AI code quality
Keeping code quality when your agent writes most of it
AI agents write working code fast. Quality slips in the decisions nobody made on purpose. How to keep judgement over a codebase an agent mostly writes.
Code written by agents is usually fine line by line. Where quality slips is between the lines: three caches that each made sense alone, a retry added twice, an error swallowed because the test only checked the happy path.
Quality is a series of decisions
A codebase stays good when the decisions in it were made on purpose by someone who understood the trade-off. With an agent writing most of the code, those decisions still get made. They just get made quickly, inside a task, and approved in bulk.
Keep judgement where it matters
You do not need to review everything equally. Watch the decisions that compound:
- New state. Caches, queues, tables, flags. Each one is forever.
- Failure handling. Retries, timeouts, fallbacks, swallowed errors.
- Boundaries. What calls what, and who is allowed to.
- Tests. Whether they pin behaviour or just the implementation the agent wrote.
Make the agent argue for its choices
Agents are good at explaining, if you ask for the right shape. The useful shape is a claim, the lines that support it, and the alternative it rejected.
deck gives your agent that shape. It writes the explanation as a short deck you click through: each sentence lights the code it is about, and when it matters the agent draws the behaviour, like latency before and after or a queue on its busiest day. You push back on the line, and the same agent answers.
The result is a codebase where each decision was shown to someone and chosen. That is most of what quality is.
A small habit
At the end of any change that adds state or changes failure handling, ask your agent to show you that part before you approve. It takes a minute, and you will catch the second cache before there is a third.
Questions
Is AI-generated code lower quality?
Not line by line. The risk is decisions made quickly and approved without being understood. Review the decisions and quality holds.
How do I keep an AI-written codebase maintainable?
Make sure every decision that adds state or changes failure handling is shown to someone and chosen on purpose.
Where does deck help with quality?
It makes your agent show its decisions on the actual lines, so you can agree or push back before they ship.