T08-L03 · Write code · Level 3 Builder · 24-minute read, plus 2½ hours of doing

One sentence, three groups

The plate-reader script from T08-L02 · Get a Script Your Colleague Can Rerun, Without Being a Developer did its job. Jonas reran it without Mia, and within two months three groups on the floor used it for their weekly summaries. Then Lena, a student in one of them, asks for one more column: each sample as a percentage of the plate's control. Typed as one sentence, "add a percent-of-control column", that request leaves a dozen decisions open. What if a plate has no control? Round before dividing, or after? What happens to the two groups that never asked for the column? An AI assistant fills every open decision with a guess, and the guesses look reasonable, which is why they get through.

In a company it's the quality team's returns report. The head of quality asks for returns per quarter. The assistant builds calendar quarters; the financial year starts in April. The first quarterly report puts March's recall in the wrong quarter.

You are at Level 3 Builder: colleagues depend on this code, so a change that breaks it breaks their results. This book shows you how to write the decisions down before any code, lock the answers so the assistant can't change them, have OpenCode write tests against them, and review its change rule by rule.

After this you can

  • Write a one-page spec, SPEC.md: numbered rules, what must not change, and a check for each rule, and have OpenCode find its gaps before any code exists.
  • Work out the expected answers yourself and lock them in opencode.json, so OpenCode can't edit them.
  • Have OpenCode write tests first, and see them fail for the right reason.
  • Make your own slash commands, /check and /spec-review, that the whole group gets with the repository.
  • Plan against the rules, build, review the change block by block, and release it as a version your colleague can check.

Before you start