Sub topic 10
Drafting specs, user stories, and acceptance criteria
This chapter assumes you can write a user story and acceptance criteria by hand and that you have used a chat assistant. It also assumes you know the structured prompt pattern (role, context, task, format, constraints) from earlier chapters. Here you apply that pattern to spec writing. You will see where AI helps, where it invents things, and how to review a draft before it reaches engineering.
What AI is good at in spec work
A spec has two kinds of content. The first is structure: a story template, numbered criteria, edge-case lists, a consistent format. The second is decisions: what the product should do, for whom, and why. A language model is good at the first and unreliable at the second.
The model does not know your product, your users, your technical limits, or your commitments. If you leave a gap, it fills the gap with something plausible. In a spec, a plausible but invented requirement is worse than a missing one, because it looks like a decision someone made.
Use the model for these jobs:
- Turning a rough feature description into a story and criteria in your team's format.
- Rewriting vague criteria ("should be fast") into testable statements, with a placeholder where you must supply the number.
- Brainstorming edge cases and error states you may have missed.
- Producing a list of open questions for engineering and design.
- Checking a draft for ambiguity, contradictions, or untestable wording.
Keep these jobs for yourself:
- Choosing what to build and what to leave out.
- Setting thresholds, limits, and permission rules.
- Confirming what is technically feasible.
- Signing off that the criteria reflect the real decision.
The drafting workflow
The loop matters because the first draft is rarely the one you ship. The most valuable output of the first pass is often the open-questions list, not the criteria.
A prompt that refuses to invent
The following prompt asks for a story, criteria in Given / When / Then form, and a separate list of open questions. The last line gives the model an explicit place to put its uncertainty.
Draft a user story and acceptance criteria for the feature described below.
Feature: Let workspace admins export the member list as a CSV file.
Use this format:
User story: As a <role>, I want <capability>, so that <benefit>.
Acceptance criteria: a numbered list of testable statements, each in Given / When / Then form.
Open questions: anything the description leaves undefined that engineering or design must decide.
Do not invent requirements. Put anything you are unsure about under Open questions.A reasonable response to this prompt covers the happy path: an admin opens the member settings, selects export, and receives a CSV with one row per member. It should then list open questions such as these:
- Which columns are included? Are email addresses and roles part of the file?
- Can non-admins export, or only admins?
- What happens for workspaces with tens of thousands of members? Is the export synchronous, or sent by email?
- Does the export include deactivated or invited members?
- Is the export logged for audit purposes?
Those questions are the real value. Each one is a decision you or your team must make before anyone builds.
Why the "Do not invent" line is not enough
Instructions reduce invention, but they do not remove it. A model told not to invent requirements will still sometimes slip a detail into the criteria, such as "the file downloads within 5 seconds" or "the file is named members-YYYY-MM-DD.csv." These read naturally, so they pass a quick review.
Treat any concrete number, name, limit, or permission rule in the draft as suspect unless you supplied it. A fast way to find them is to scan the criteria for digits, quoted strings, and words like "only," "always," "never," and "within."
Writing testable criteria
Given / When / Then is a useful format because it forces three parts: the starting state, the action, and the observable result. Models follow the format well. They are less reliable at making each statement testable, so check each one.
| Weak criterion | Problem | Testable version |
|---|---|---|
| The export should be fast. | No measurable result. | Given a workspace with 1,000 members, when an admin requests the export, then the file is available within [N] seconds. |
| Admins can export members. | Does not say who is excluded. | Given a user with the Member role, when they open member settings, then the export option is not shown. |
| The CSV has the right data. | "Right" is undefined. | Given an admin exports the list, when they open the file, then it has one row per active member and the columns listed in the spec. |
| Errors are handled well. | No defined behavior. | Given the export service is unavailable, when an admin requests the export, then a message states that the export failed and offers a retry. |
In the first row, [N] is deliberate. Ask the model to leave a bracketed placeholder wherever a number must come from you. That makes missing decisions visible instead of hiding them behind an invented value.
You can add this constraint to the prompt:
Where a criterion needs a number, limit, or name that I have not given you, write a placeholder in square brackets, such as [N seconds], and list it under Open questions.Asking for edge cases
Models are useful for widening your view of what can go wrong. After the first draft, run a separate prompt that targets edge cases only. Keep it separate so the model does not mix brainstorming with committed requirements.
Here is the draft story and criteria for the member export feature.
List edge cases and failure states that the criteria do not cover. Group them under: permissions, data volume, data content, network and timing, and audit or compliance. For each, write one line saying why it could matter. Do not add them to the criteria. I will decide which ones are in scope.The final sentence matters. It keeps the output as a list of candidates and leaves the scope decision with you. Expect some items to be irrelevant to your product. Discard them without guilt.
Grounding the draft in your own material
The output improves when you paste real context: your team's story template, one or two past specs that engineering found clear, and the relevant constraints (for example, "exports must not include personal data fields for workspaces in the EU plan"). Fence the pasted text so the model can tell your material from your instructions. Remove names, customer details, and anything confidential first, following your organization's data rules.
Give the model your definition of done as well. If your team requires every story to name an analytics event or an accessibility check, say so in the format section. Otherwise the model will follow a generic template.
Reviewing the draft
Before sharing, read the draft against this checklist:
- Does every requirement trace to a decision you or the team made?
- Is every number, name, and limit either supplied by you or marked as a placeholder?
- Can a tester write a pass or fail check for each criterion without asking you what it means?
- Do any two criteria contradict each other, for example one allowing all members to export while another restricts export to admins?
- Are the open questions assigned to a person, such as engineering, design, legal, or you?
- Is anything out of scope stated explicitly, so it is not assumed to be included?
You can also ask the model to review its own draft for ambiguity and contradictions. This catches some problems, but it shares the blind spots of the draft it wrote. Your review and your engineers' review remain the check that counts.
Common errors
- Accepting the first draft. The first pass is a starting point. Answer the open questions and run a second pass.
- Pasting a vague one-line feature and expecting a precise spec. The model cannot supply context you did not give. The output will be generic or invented.
- Mixing brainstormed ideas into committed criteria. Keep exploration and requirements in separate prompts and separate sections.
- Letting the model choose the format. Without a stated format, each draft looks different, which makes review and comparison harder.
- Sharing before engineering has seen the open questions. An unanswered question that engineering discovers later costs more than one raised early.
- Treating polished wording as evidence of correctness. Fluent text is the model's default. It says nothing about whether the content is right.
Exercise
You ask an assistant to draft acceptance criteria for a "bulk invite" feature. The draft includes the criterion "Given an admin uploads a file with more than 500 addresses, when they submit, then the system rejects the file with an error." You never mentioned 500. What should you do, and how could you change the prompt to prevent this?
Show answer
Treat the 500 limit as an invented requirement. Check with engineering whether a limit exists and what it should be. If none is decided, replace the number with a placeholder such as [N addresses] and add the limit to Open questions. To prevent it, add a constraint to the prompt: "Where a criterion needs a number or limit I have not given you, write a bracketed placeholder and list it under Open questions." Also scan future drafts for digits and words like "only," "within," and "more than."
Exercise
Why is it better to run edge-case brainstorming as a separate prompt from the first draft of the criteria?
Show answer
In a combined prompt, the model tends to add speculative cases directly to the criteria, so ideas you have not approved look like committed requirements. A separate prompt keeps the output as a list of candidates, and you decide which ones are in scope and then add only those to the spec.