AI Academy · Book
Engineering Managers · Module 02 · Chapter 002

Specs, Requirements and Design With AI

Generated code follows what it is told, and what it is told is whatever your team wrote down. A short specification with testable acceptance criteria, scaled to the size of the work, gives people and agents the same target. A manager who sets the template and the review questions can see misunderstandings before they become pull requests.

≈ 10 min read

After this chapter you can

  • List the five parts of a short specification and say what question each one answers.
  • Rewrite a vague wish into an acceptance criterion that a test or observer can mark pass or fail.
  • Scale spec weight to the size and reach of a change, from a three-line fix to a design note.
  • Use a model to challenge a draft for gaps while a named person approves intent.
  • Count the share of reviews raising intent questions, and read one sprint of improvement with caution.

In October 2025, Birgitta Böckeler, a software engineer who writes on martinfowler.com, published her hands-on trials of three tools that put a written specification at the center of AI-assisted coding. On a small bug fix, one tool produced four user stories with 16 acceptance criteria. In another, the agent had been told in its own research notes that certain classes already existed, and generated them again anyway, creating duplicates. Her summary of the review work was candid: she would rather review code than all those markdown files1. These are one practitioner’s trials of tools that have kept changing, not a controlled study, and they do not show that specs fail. They show two things worth holding at once. A written spec does not make an agent obey it, and a process built for a feature can bury a fix.

That is the manager’s problem in its plain form. Intent now has two audiences: the engineer who will review the code and the agent that will draft it. Level 1 made the general point that what the model receives decides what it returns. This chapter is about what your team writes down so that what is received matches what you meant, how much to write, and how to review it before code exists.

What a spec is for

Treat a specification as a contract between whoever asks for the change and whoever, or whatever, delivers it. A contract is useful when both sides can tell whether it has been met. That rules out the ticket title (“improve export”) and the long essay that no one finishes. It favors a short document in five parts.

A table of five spec parts, intent, acceptance criteria, constraints, non-goals and open questions, with the question each answers and a sign that it is done well.PartQuestion it answersA good signIntentWhat problem does this solve, and for whom?A newcomer can restate it in one sentenceAcceptancecriteriaHow will anyone know it is done and right?Each one can be checked and marked pass or failConstraintsWhat must hold: performance, privacy, compatibility?Each has a number or a named ruleNon-goalsWhat are we deliberately not doing?At least one item that someone might have assumedOpenquestionsWhat do we not know yet, and who decides?Each has an owner and a date
Figure 2.2.1 The five parts of a short specification, and what each should show.

The part that does the most work is the second. An acceptance criterion states behavior so that a test or a person can mark it passed or failed: “an export of 10,000 invoices finishes in under 30 seconds” is a criterion, and “export should be fast” is a wish. Writing criteria tends to bring disagreements up while they are cheap to settle. It also gives an agent something to be checked against, and gives a reviewer a checklist that does not depend on trusting the author’s summary.

Non-goals matter more with agents than with people. A person told to fix a date format will usually leave the rest of the file alone. An agent may tidy neighboring code, add a dependency or rename things unless the spec says that is out of scope. One written line, such as “no changes to the invoice schema”, is cheaper than finding the change in review.

The fifth part, open questions, protects against a quiet failure. A model asked to proceed will often fill a gap with a confident guess. Listing what is not known, with an owner, means the guess becomes a question someone must answer.

Scale the spec to the size of the work

Böckeler’s trials point at the opposite risk. If every change gets a full workflow, the spec becomes the work, and it can be as hard to review as the code it was meant to simplify. The manager’s rule should be proportion.

Four levels of specification weight from a three-line bug note to a design note with named approvers, rising with the size and reach of the change.Bug fixThree linesSmall changeHalf a pageFeatureOne to two pagesCross-team changeDesign note
Figure 2.2.2 Spec weight rises with the size and the blast radius of the change; these sizes are illustrative starting points.

A practical test is whether the spec takes longer to write than the change takes to build. If so, either the change is too small for that much paper or the spec is padded. There is a second test for the other direction: if a reviewer has to ask the author what the change was supposed to do, the spec was too light. The sizes in the figure are illustrative starting values, not rules; adjust them after a month of counting how often reviews raise questions about intent.

Specs are also not frozen. When building reveals that a criterion was wrong, the team should change the spec first and the code second, with the same approver. Otherwise the document and the code drift apart, and the next agent that reads the document may build the wrong thing with great confidence.

Review the spec before the code

The cheapest review is the one that happens before there is code to read. A short design review of the spec, run by the person who will approve the change, catches the misunderstandings that would otherwise appear as review comments or defects. Here are questions to ask, with what a good answer sounds like.

  1. What is the problem, in a sentence? A good answer names a user and a situation, not a technique.
  2. Which criterion would fail if the feature were wrong in the most likely way? A good answer points to a specific, checkable statement; a weak one repeats the intent.
  3. What is out of scope? A good answer lists something plausible. An empty list means no one has thought about the edges.
  4. What data does this touch, and who may see it? A good answer names the data and the rule, and says who approved it.
  5. What happens when it fails? A good answer says what the user sees and how the team will know.
  6. Who decides if the spec changes after work starts? A good answer names a person.

AI can help with this review, in a particular way. Ask a model to read the spec as a skeptic: list ambiguous phrases, propose edge cases the criteria do not cover, and point out places where two criteria conflict. The output is a list of prompts for the author, and cheap to produce. What AI should not do is approve the intent. Whether the result is the right thing to build is a business judgment that belongs to a named person. How well model critiques find real design flaws, compared with a human reviewer, is a capability not yet shown in results in the sources used here, so trial it on your own specs and count how many of its questions led to a change.

A chain of five steps, draft, challenge, approve, build and check, in which a model challenges the spec but a named person approves intent.DraftAuthorwrites thefive partsChallengeModel listsgaps andedge casesApproveA namedpersonsigns intentBuildAgent orpersondrafts codeCheckCriteriaapplied tothe resultChanges to the spec go back through Approve
Figure 2.2.3 A spec loop in which a model challenges the draft but a person approves it, and the criteria are applied to the finished change.

A worked example: six engineers and an invoice export

What follows is an invented example, with invented figures; it is not data from a real team. A team of six builds a billing service. Over the last sprint it merged 20 changes, and the lead went through the review comments on each. For 8 of the 20, a reviewer had asked what the change was supposed to do, or asked for behavior the author had not known about. Call this the intent escape rate: 8 of 20 is 40 percent. The lead sets an illustrative target of 20 percent or lower (at most 4 of 20), to be reset after one more sprint.

The lead introduces a one-page template with the five parts, scaled by the ladder above: bug fixes get three lines. For the first feature, an invoice export to CSV, the author drafts 12 acceptance criteria. When the model is asked to challenge the draft, it flags 5 phrases as ambiguous. The author judges 3 of those 5 to be real gaps and 2 to be already clear in context. Separately, in the design review, the lead finds that 3 of the 12 criteria are not checkable as written (“should be reasonably fast”), so 9 of 12 were testable at the start, and the 3 are rewritten with numbers. All 12 end up checkable (9 + 3 = 12). A non-goal is added: no change to the invoice schema. An open question about rounding is assigned to the finance owner, with a date.

In an invented six-person team the share of changes that raised an intent question fell from 40 to 15 percent, and all 12 invoice export criteria became checkable.40%Before the template8 of 20 changes raised anintent question15%After one sprint3 of 20 changes raised one12 of 12Criteria checkable9 at first, 3 rewrittenILLUSTRATIVE NUMBERS
Figure 2.2.4 Illustrative example: the intent escape rate falls from 8 of 20 to 3 of 20 against a target of 20 percent or lower.

In the next sprint, 3 of 20 changes (15 percent) draw an intent question, under the 20 percent target. The lead notes what the figure does not show. The sprints differed in content, the sample is small, and one sprint is not a trend. So the decision is modest: keep the template, trim it for fixes, and read the figure again after another sprint before telling anyone it works. The cost is also counted. The lead records about 40 minutes of extra author and reviewer time for each feature spec, as an illustrative figure, and decides it is worth paying while reviews of intent stay at or under the target.

Where specs go wrong

Four patterns recur. The first is the spec as ceremony: long documents filled in to satisfy a process, which nobody reads. The second is the spec that is a prompt: written to steer the agent, and not understandable to a human reviewer. Keep one document that a person can read, and let the agent use it. The third is criteria that restate the code: if the criteria were derived from the generated implementation, they will confirm it, which is why the next chapters put tests and the definition of correct in human hands. The fourth is drift, a spec that no longer matches what was built.

DORA’s 2025 report, summarizing survey data from nearly 5,000 professionals, argues that the greatest return from AI comes not from the tools themselves but from the quality of internal platforms, the clarity of workflows and the alignment of teams2. A spec is a small instrument for clarity and alignment. The report’s claim is an organization-level finding, and it does not test spec templates in particular.

What this means for engineering managers

Change:            <name>
Intent:            <one sentence: who, what situation>
Acceptance:        1. Given ... when ... then ... (checkable)
Constraints:       <numbers or named rules>
Non-goals:         <at least one>
Data touched:      <personal data? purpose? approver?>
Open questions:    <question - owner - date>
Approver of intent: <name>

The Monday action, with you as owner and the engineer who raised the ticket as author, is to take the next ticket your team plans to hand to an agent and rewrite its acceptance criteria until each can be marked pass or fail.

Check yourself

  1. If the spec is detailed enough, an agent will follow it.
  2. A bug fix should get the same spec process as a new feature.
  3. An acceptance criterion should be something a test or an observer can mark pass or fail.
  4. A model that reviews a spec can also be trusted to approve its intent.
  5. Listing non-goals helps with agents because they may extend a change beyond what was asked.
  6. One sprint of improved numbers proves the template works.

Reflection

What comes next

A good spec makes the right code easier to ask for, but a person must still read what comes back. The next chapter, Code Review at AI Volume, covers review budgets, checklists for generated code and the rules for what needs a second human.

Laws referenced

General Data Protection Regulation · EU

Regulation (EU) 2016/679

Personal data is any information relating to an identified or identifiable person, directly or indirectly, including by an identifier such as an online ID (Art. 4(1)). Lawful basis and purpose limitation (Arts. 5-6); processing special-category data, including biometric data used to identify a person, health data and data revealing ethnicity, is prohibited unless a specific exception applies (Art. 9); data protection by design and by default (Art. 25); processors such as AI vendors may act only under a written contract with required terms and sufficient guarantees (Art. 28); transparency to data subjects (Arts. 13-14); right not to be subject to a decision based solely on automated processing with legal or similarly significant effects (Art. 22); breach notification to the supervisory authority within 72 hours (Art. 33) and to individuals without undue delay when the risk is high (Art. 34); data protection impact assessment for high-risk processing (Art. 35). Fines up to EUR 20 million or 4% of global turnover.

  • 2018-05-25 — Applies

Last verified 2026-10-08 · official text

References

  1. Birgitta Boeckeler. Understanding Spec-Driven-Development: Kiro, spec-kit, and Tessl. martinfowler.com (Exploring Generative AI series). 2025.
  2. DORA (Google Cloud). State of AI-assisted Software Development 2025. Google Cloud. 2025.

Further reading

Sources last verified 2026-10-12.