Make the test fail: the system design file my coding agents were missing
Avid (@Av1dlive) posted a full X Article on Nov 5: How to Master System Design for Building with AI. I read the body. The pitch is not "prompt better." It is: turn each system design decision into a rule the agent reads, and a test the agent must fail once on purpose.
That hit, because I already send coding work to Claude Code and I already require a second model to verify it. I did not have the design half written down the way he describes.
What he actually says
Per the Article (illustrative numbers unless he links a source; he says so up front):
- An agent types fast. What it lacks is decisions about where data lives, what happens under load, and what happens when a part fails.
- If those decisions live only in your head, the agent guesses. If they live in a file and in tests, it can check its own work.
- Three things persist between sessions:
SYSTEM.md(decisions and labeled numbers),MODULES.md(one contract per module), and red tests in CI. - A red test is one you make fail on purpose once. Inject the fault, watch it go red, then fix until green. "Before you trust a new test, make it fail for the fault it is meant to catch."
- Label every intake number MEASURED, TARGET, or GUESS. A GUESS is honest. A number with no label is a hidden guess.
- His session loop: read the files, name the rules you touch, write or update the red test, prove it red, then write code, then paste red and green output.
He also cites mixed research on context files alone (runtime/tokens studies, and cases where files hurt success or added cost). His point: the file guides; the tests check.
Why I care
My Claude jobs already have rules in ~/.claude/CLAUDE.md, and coding work gets an independent Sonnet check. That is the auditor half. What Av1dlive adds is the design half: write the decisions before the agent writes handlers, and force every new check to prove it can see its fault.
The line I am stealing is the law at the end of his Article: the agent does not know your design until it can make a test fail for it.
I have not rebuilt a whole feed app with his starter SYSTEM.md yet. I am putting the intake prompt and the red-test-first loop next to my Claude job brief for the next feature that touches money, auth, or an external call.
Credit: Avid, "How to Master System Design for Building with AI (Full Course)".