Holding quality when AI writes the code
Torn Studio is an AI agency that builds websites, digital products and content. Unconventional.
Short answer
When AI writes most of the code, responsibility for quality moves from review to automated gates. Strict type checking, tests, lint rules that encode architectural decisions, and a single verify command that must be green before every commit together catch what a human stops noticing after the third file.
The common objection to AI-written code is about drift: style, structure and decisions pulling apart over months until nobody can say why anything looks the way it does.
Review does not scale
A human reviewing their third AI-generated file within an hour reads with less sharpness. It is a predictable effect of how attention works. The fix is to move as much judgment as possible onto something that holds a steady edge.
The gates that do the work
- Strict type checking, including noUncheckedIndexedAccess
- Lint rules that encode architectural decisions
- Tests for the things that cost money when they break
- One command that runs everything, required green before commit
The point of that last item is that a gate counts only once it actually runs. If it takes four commands and a good memory, it gets skipped on a Friday.
Evidence
What this article rests on — a measurement we took, a dated source, or a decision we made and what it cost.
- Decision
Quality is held by automated gates that run on every change: type checking, tests, lint rules that encode architectural decisions, and one command that must be green before every commit.
What it cost: It costs build time on every change, and an urgent two-minute fix can be stopped by a contrast test or a type check that does not care that it is Friday.
Common questions
- Does code get worse if AI writes it?
- Quality follows the gates. With type checking, tests and lint rules in place, the code holds the same level regardless of who or what wrote it.
- Which tests are worth writing?
- The ones covering what costs money when it breaks: payment flows, permissions, data integrity, and the rules hardest to hold in your head. Full coverage of trivial code returns less per hour spent.
- How strict should type checking be?
- Strict mode on, including checked index access. Every gap you leave open is a class of error a human has to catch in review, and review is exactly the part that scales worst.
- Can lint rules replace code review?
- They replace the tedious half. A lint rule catches architectural drift mechanically, which frees review for what it is good at: whether the solution solves the right problem.
- What do you do when a gate gets too slow?
- Split it. Fast checks run on save, heavier ones at commit, the heaviest in the build. A gate that takes ten minutes gets worked around, and then it catches nothing.
- How do you get a team to actually run the gates?
- Make it one command. If it takes four commands and a good memory, it gets skipped. A single verify that has to be green is the only version that survives contact with a deadline.
Next steps
Read next
- How long does an AI-built website take?Week by week through a 3–6 week build: what happens when, what you supply, and what decides whether it lands at three weeks or six.
- Why agency prices have not moved since 2022Production got faster and agency rates held. What Forrester, the 4A’s and a UK agency survey say about who kept the saving, and what to ask a supplier.
- Does the EU accessibility law apply to our website?The Swedish accessibility law names the consumer services it covers. How to tell whether your website is one of them, and what applies if it is.
Go deeper