Writing user stories an AI coding agent can deliver
AI coding agents act literally on what you write. How to turn user stories into small, testable units of work with acceptance criteria anyone can check.
Westerwick5 min read

On this page
A human developer who gets a vague request will usually come back with questions. An AI coding agent will often just build something, quickly and literally. That makes the way you describe work more important than ever. User stories for AI delivery need to be small, clear about what counts as done, and checkable by someone who didn't write the code.
None of the techniques here are new. They're standard agile practice. What's changed is the cost of skipping them.
What a user story is for
In agile software delivery, work is divided into "functional increments called 'user stories'", each expected to deliver "a contribution to the value of the overall product"1. A story is usually written as: As a [type of user], I want [something], so that [benefit].
The point is a split of responsibilities. The business defines "the 'what'", and the technical team (now often an AI agent with a person supervising) handles "the 'how'"1. That split suits business owners: you don't need to know how the software works to write a good story. You need to know exactly what should happen.
The INVEST check, applied to AI
The Agile Alliance's long-standing INVEST checklist says a good story is Independent, Negotiable, Valuable, Estimable, Small and Testable2. Two of those letters matter most when an AI is doing the building.
Small. The original guidance is "so as to fit within an iteration"2. With AI, we'd go smaller: small enough that a person can review the result in one sitting. Big stories produce big changes, and big changes get skimmed.
Testable. A story should be testable "in principle, even if there isn't a test for it yet"2. If you can't say how you'd check it, neither can the AI, and it will decide for itself.
Acceptance criteria you could hand to a stranger
Acceptance criteria are the conditions that must be true for a story to count as done. The Agile Alliance lists "clear and precise acceptance criteria" as a core benefit of user stories for developers1, and the same holds for AI agents.
The most widely used format is Given, When, Then: "(Given) some context (When) some action is carried out (Then) a particular set of observable consequences should obtain"3. The Agile Alliance's own example is a bank withdrawal: given the account is in credit, when the customer withdraws less than their card limit, then the withdrawal completes "without errors or warnings"3.
Here's the difference in practice, using a supplier-invoice example.
Vague: As a finance clerk, I want invoices to be approved properly.
AI-ready:
- As a finance clerk, I want invoices over R50,000 to need a second approver, so that large payments get a second look.
- Given an invoice of R50,001, when the first approver approves it, then its status is "Awaiting second approval" and it can't be paid.
- Given an invoice of R50,000 or less, when the first approver approves it, then its status is "Approved".
- Given an invoice awaiting second approval, when the same person tries to approve it again, then the system refuses and says why.
Each line can be checked by someone who didn't build it, and each one becomes a test. The third criterion covers the case a quick AI build would most likely miss.
Kiro, AWS's AI development tool, uses a similar pattern for requirements: "WHEN [condition/event] THE SYSTEM SHALL [expected behavior]", written so that each requirement "can be directly translated into test cases"6. The format matters less than the discipline: observable behaviour, stated precisely.
From stories to units of work
AWS's AI-Driven Development Life Cycle (AI-DLC), the method we use, renames the familiar agile containers. In AI-DLC, "Epics are replaced by Units of Work", and its short delivery cycles are called bolts instead of sprints4. In its opening phase, the AI "transforms business intent into detailed requirements, stories and units" through Mob Elaboration, a session where the whole team reviews the AI's questions and proposals4.
AI-DLC defines a unit of work as "an independently implementable piece of the solution"5. A bolt, the delivery slice built from one or more units, records its "Definition of Done" upfront, along with who owns it5.
The labels differ between tools, but the idea is the same: before the AI builds anything, the work is cut into independent pieces with agreed conditions for done, and a person has signed off on the cut. We describe the rest of the plan in What a useful AI execution plan should contain.
Tests make the stories stick
Clear criteria are only half the job. The Agile Alliance notes that user stories "all but mandate significant test automation"1. Each new feature adds to what could break, so re-checking everything by hand soon stops being practical.
That matters more with AI, because AI produces changes faster than people can re-check them by hand. A skilled team member, in the Agile Alliance's words, can express acceptance criteria "in terms that will be directly usable as an automated acceptance test"1. When your criteria are written as Given, When, Then, that step is short.
Mistakes we see most often
In our experience, these are the patterns that cause the most rework:
- Solutions disguised as stories. "Add a dropdown with five options" describes a screen, not a need. State the outcome and let the design follow.
- Missing unhappy paths. Stories describe what happens when everything goes right. Add at least one criterion for a refusal, an error or missing data.
- Undefined words. "Large invoice", "active customer" and "recent order" need numbers or rules.
- Stories that depend on each other. If story B can't be tested until story C exists, the AI will build both at once, and the change gets too big to review.
- Nobody owns sign-off. Each story needs a named person who confirms it's done against its criteria.
What to do next
- Pick one upcoming change and write it as a story with three to five Given, When, Then criteria before any AI tool touches it.
- Add an unhappy path to every story: what should happen when the input is wrong, missing or not allowed.
- Define your business terms with numbers, such as thresholds, dates and statuses, rather than adjectives.
- Split anything a person couldn't review in one sitting into smaller, independent stories.
- Name who signs off each story, and have them check the result against the criteria, not against a demo.
Sources
- 1.User StoriesAgile Alliance
- 2.INVESTAgile Alliance
- 3.Given – When – ThenAgile Alliance
- 4.AI-Driven Development Life Cycle: Reimagining Software EngineeringAWS DevOps & Developer Productivity Blog · 31 July 2025
- 5.AI-DLC glossaryAWS Labs on GitHub
- 6.Feature SpecsKiro


