Your agent writes code that runs, and a passing demo tells you nothing about what happens next. Working code and good code are different things. Good code is code you can still change six months from now without dreading it. This chapter gives you the small bar that separates the two, and the way to make your agent hold to it on every feature, not just when you remember to ask.
4.7.1Good code is code you can change
The one quality that matters most is that code stays maintainable: easy to read, easy to change, hard to break by accident. Everything else is downstream of that.
Clever code that only its author understands is not a prize, it is a liability. At AI speed you will change this code constantly, so the code that bends without breaking wins over the code that shows off.
4.7.2The few rules that carry most of it
Most of quality comes from five plain rules you can check by eye:
- Single responsibility: each piece does one job, so you always know where a change goes.
- Small functions: short enough to read at a glance, not a scroll.
- Clear names: a name says what the thing is, so
daysUntilRenewalbeatsd. - No duplication (DRY): the same logic lives in one place, so a fix lands once, not five times. DRY is short for "don't repeat yourself."
- Explicit errors: failures are handled out loud, never silently swallowed.
These are the readable slice of a larger set called SOLID, five design principles your agent already knows by name. You do not need to study them. Naming SOLID in an instruction is enough to pull the whole set in.
Rule of thumb: if you cannot tell what a function does from its name and a few lines, that is the code to question, no matter how well it runs.
4.7.3Big file is a smell, not a verdict
A code smell is a surface sign that something might be off, a hint worth a look, not proof of a problem. A file that has grown huge is the most common one.
Size alone does not condemn a file. It is a flag that says look here, then you judge: is this one thing that is genuinely large, or five things that drifted into one file and should split?
4.7.4Make it the agent's standing bar
Asking for quality once is weak. The fix is to make this bar standing, written into the rules file your agent reads on every task, so it applies without you repeating it.
Do this now: paste the prompt to fold this bar into your agent rules file, then have it review one existing feature against the bar and hand you the worst offender first.