Write Acceptance Criteria
ASecurityWrite new acceptance criteria for a story or work item, in the team's house format. Use whenever someone wants to draft, write or create acceptance criteria from a story, brief or item, phrased as "draft ACs for this", "write acceptance criteria for", "write the Gherkin for this story", "turn this item into ACs", "give me Given/When/Then for" or "help me spec the criteria on this item". It writes at two depths, a LEAN card by default (also for "high level", "keep it lean", "just the card" or ...
- 5 stars
- 0 votes
- 0 copies
- 1 view
- Added November 28, 2026
Works with
Security analysis
100/100Pro scans all 5 files and shows the line behind each finding
npx -y skills add trampo-framework/trampo --skill write-acceptance-criteria --agent claude-codeAre you the author of Write Acceptance Criteria?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/trampo-framework-write-acceptance-criteria)---
name: write-acceptance-criteria
description: Write new acceptance criteria for a story or work item, in the team's house format. Use whenever someone wants to draft, write or create acceptance criteria from a story, brief or item, phrased as "draft ACs for this", "write acceptance criteria for", "write the Gherkin for this story", "turn this item into ACs", "give me Given/When/Then for" or "help me spec the criteria on this item". It writes at two depths, a LEAN card by default (also for "high level", "keep it lean", "just the card" or "lean") and a FULL contract for money, decisions about people, regulated output, personal data or cross-system work. It produces the contract; it does not check whether existing code meets criteria someone already has.
---
# Write acceptance criteria
Write acceptance criteria (AC) for a story or work item so it has a clear, testable contract. The AC is the contract:
**once the AC is met the item is done**, and any undocumented work is out of scope. Write it so a tester could test it
without asking a question.
Read the house style first: the file the project's CLAUDE.md or AGENTS.md names, or
`${CLAUDE_PLUGIN_ROOT}/house-style.md`. It sets the default depth, the story frame, the markup and the rules the team
added from its own items' mistakes, which every draft keeps, LEAN or FULL.
> Writing, not checking. If the person already has criteria and wants to know whether the code satisfies them, this
> skill is the wrong tool: read the code against the criteria instead.
## Choose the depth first: LEAN (default) or FULL
**LEAN is the default** for ordinary product stories: a one-line story, **one to three scenarios**, exact copy quoted
in `Then`, a design link, and nothing else. No Requirements, Notes, Definition of Done or Open Decisions sections, no
implementation detail, no edge-case sweep. The developer is trusted to discover the implementation; open questions and
slicing go to people (a comment or a message), not into the description. Follow the six lean rules and the template in
`reference/lean.md` and stop there.
Use LEAN unless a FULL trigger fires. Explicit LEAN cues: `lean`, "high level", "keep it lean", "just the card".
**Escalate to FULL** (the workflow below) only when the item involves any of:
- money movement, or a decision about a person (approve, decline, refer),
- regulated or compliance output,
- personal data newly exposed or moved,
- a field contract with another system,
- persistence or idempotency the team relies on,
- or the person explicitly asks for rigour ("thorough", "cover the edge cases", "adversarial").
FULL adds the decision rule, the edge and failure checklist, and assertions on system side effects. Even in FULL, only
what is a testable `Then` belongs in the description: push context and open decisions to comments. A common and
correct move is to draft FULL for your own analysis, then hand over the LEAN card and keep the rest as comments. When
in doubt, start LEAN; adding rigour is cheaper than stripping noise.
## Workflow (FULL)
For LEAN, use `reference/lean.md` instead of steps 1 to 9, then do step 10.
1. **Gather the story.** Capture or write it as `As a <user>` / `I want <capability>` / `So that <reason>`. Apply
INVEST: Independent, Negotiable, Valuable, Estimable, Small, Testable. For internal or non-functional work the actor
is the system: `As the payments service we need`, `As the billing job I want`.
2. **Apply the decision rule.** Walk the tree top to bottom and stop at the first matching leaf; the leaf sets the
shape of the AC. Never invent Given/When/Then where there is no observable behaviour.
```
Does the change produce an observable system behaviour
(the system responds differently depending on state or user action)?
|
+- YES -> Does it surface to a user or an API consumer?
| +- YES -> Write Given / When / Then scenarios.
| +- NO -> Testable via logs, stored state or events?
| +- YES -> Write scenarios with system-level Then assertions.
| +- NO -> Write text plus an architecture or sequence diagram.
|
+- NO -> Purely copy, layout, a config value or a static asset?
+- YES -> Write text plus a diagram or an annotated screenshot.
+- NO -> (Hybrid) Split: scenarios for the behavioural parts,
text plus a diagram for the rest.
```
**If the brief is bigger than one item (an epic with children), deciding which items the epic holds is
`write-epic`'s job.** Run it first, then write AC here for each Story on its approved slice list. Its slices are
vertical, not horizontal: no feature is split into an infrastructure item, then the feature, then polish. Later
children add autonomy, precision and measurement to a feature an earlier child already delivered end to end. If the
first honest slice would be unsafe to ship autonomously (an agent that posts to real change requests or sends real
messages), make the first item the human-gated or on-demand version of the same feature, so the person is the
safety gate, and defer autonomy and measurement to the next slice. Write each child's AC against its own shippable
behaviour, and name in Notes what the next slice adds.
3. **Write the scenarios (for behaviour).** One `Scenario N: <descriptive name>` per behaviour. Each Given / When /
Then block is **one atomic rule**; several rules become several blank-line-separated blocks under the scenario.
Keep each scenario to about 3 to 5 steps. Use `And` and `But` only to chain steps of the same type. Write
declaratively (what, not which button) unless the UI mechanic is the point.
4. **Cover the happy path and the edge and failure cases.** A happy-path scenario alone is incomplete. Run the
checklist below and add a scenario for each category that applies.
5. **Quote exact user-facing copy in `Then`,** so a tester can match the string:
`Then the message "Your payment link has expired" is shown`.
6. **Assert system side effects, and put persistence in a `Then`.** Assert backend effects too: an id stored against
the record, an outcome code recorded, an event logged against the record, a status updated. **If the brief says
data is stored, recorded or persisted, that must appear as a `Then` that names the record and the field**, never
only in Requirements or Notes. A persistence requirement with no `Then` is invisible to the tester and to the
implementer, who will invent a fragile mechanism for it or skip it.
7. **State negatives explicitly:** `Then no back button is shown`, `Then no eligibility check is made`. A negative the
team relies on must be written down.
8. **Pin down every state a scenario depends on.** If a `Given` or `Then` gates on an entity's status, name the
**exact** state values, never a vague class like "the error state", "an active record" or "no longer pending".
Enumerate which states the action applies to and which it is rejected or abandoned for, and add a scenario for
**each existing state the feature touches**, especially a part-way record or one already resolved (the concurrent
or idempotency case). Bad: `Given the record is no longer processing`. Good: `Given the record's status is approved,
declined or referred`.
9. **Add Notes:** dependencies, open decisions, linked items, and anything intentionally out of scope.
10. **Estimate** (not for Bugs unless the house style says otherwise). Run `estimate-story-points` on the draft and
append its proposal below it.
## Edge and failure checklist
Before finishing, go through each category and add a scenario where it applies. If one does not apply, say why in
Notes. Add any other category the item implies.
- [ ] **Expired:** a token, link, session or prefill past its lifetime. What does the user see? Is a recovery path
offered (resend the link)?
- [ ] **Limit exceeded:** a rate limit, quota or count boundary (most retries, a daily cap, a per-request ceiling).
What error is shown and what is blocked?
- [ ] **Failed retry:** a retried operation fails on its last attempt. Is the user told? Is a support path offered? Is
the failure recorded?
- [ ] **Empty state:** nothing to show. Is there meaningful empty-state copy rather than a blank screen or a silent
failure?
- [ ] **Unauthorised:** the actor lacks permission (wrong role, unverified identity, revoked token, another account's
data). Is access denied with the right message and without leaking data?
- [ ] **Invalid input:** the input fails validation. Is it rejected with a specific message, and is nothing stored?
- [ ] **Concurrent or conflicting change:** the entity changes between load and action (archived before the save
completes, or an earlier asynchronous attempt already resolved it). Name the exact states that abort and those that
proceed. Does the user see a specific message, and is there no partial write?
- [ ] **Personal or sensitive data:** does the change introduce, move or newly expose personal data (identity,
financial, health, contact, or any regulated identifier)? If so, state where the value must **not** appear (logs,
analytics, error payloads, third parties), what masking applies, and add a `Then` asserting the value is **absent**
from what is logged or sent: `Then the request log records the record id but not the raw value`. A new personal field
without an explicit logging rule is an incomplete AC: the redaction ships before the field is emitted.
- [ ] **Cross-system field contract and precondition:** when the behaviour writes to or reads from another system (a
partner API, a CRM, another internal service), pin the **exact** destination object, field, type and wire format (a
date passed as `YYYY-MM-DD`), name what is out of scope (which system owns the adjacent data), and add a precondition
that the destination field and the write permission **exist in every target environment before release**. State the
blast radius if the field is missing (does only the new field fail, or the whole write?) and the order in which
producer and consumer deploy. Decide the idempotency rule: on a re-send without the field, is the existing value kept
or blanked? Make that a `Then`.
## Output template
```
**Purpose**
As a <user>
I want <capability>
So that <reason>
**Design:** <link>
**Requirements:** (optional, hard limits only)
- <200 per request, 5 per day>
**Scenario 1: <descriptive test-case name>**
Given <past context or state, no UI interaction>
When <a single event or action>
Then <observable outcome, exact copy quoted>
And <system side effect that is recorded>
Given <another state>
When <another action>
Then <another outcome>
**Scenario 2: <edge or failure case name>**
Given ...
When ...
Then ...
**Notes:** (optional)
- Depends on <item or decision>
- Out of scope: <...>
```
- `Given` is past or established context (no UI clicks). `When` is a single event. `Then` is an asserted, observable
outcome.
- Scenario names are descriptive test-case labels ("Expired link shows an error and offers a resend"), never generic
("Scenario 2", "Negative case").
- **The scenarios are the main body of the item: keep them readable.** File paths, line numbers, query output and
root-cause tracing go below them, last, under **Technical detail**, as the house style says.
- **Do not restate scenarios the codebase already tests.** Before writing, read the existing feature file or tests for
the area and drop any scenario they already cover; cite them instead ("already covered at `<file>` lines N to M").
Read the shared setup too (a feature file's `Background`, a test suite's fixtures): when every existing scenario
assumes one state, that state is exactly where the untested case hides.
A fully worked FULL example is in `reference/golden-example.md`.
## Do not
- **Fabricate Gherkin** for work with no observable behaviour (copy, styling, config). Bad: `Given I am on any page /
When I look at the footer / Then the label reads "Help Centre"` for a label rename: that is a content change, so state
it as a requirement with a screenshot.
- **Write an item raised from a finding as the finding.** When the work comes from a defect report, investigation,
alert, scan, load test or known-issue entry, the title and scenarios describe the feature as if it were new: its
normal case, edge cases and what the user or operator sees. No tracker ids or symptoms in the title, no scenario
asserting the bug is gone or quoting the numbers that exposed it; a number appears only as a limit the feature must
keep. The evidence goes in Technical detail.
- **Write a scenario for a verification activity.** A load test, a soak or a rollout check is how the team proves the
work, not behaviour the feature has: put it in Notes or Technical detail.
- **Be vague.** Every `Then` must be testable: no "works correctly", "as expected", "looks good".
- **Put UI actions in `Given`.** Bad: `Given the user clicks the dashboard link`. Good: `Given the user is on the
dashboard`.
- **Write compound `When` steps.** Bad: `When the user fills in the form and clicks Submit`. Good: `When the user
submits the payment form`.
- **Overload a `Then`.** One assertion per `Then`; chain with `And`, or split into another block. One behaviour per
scenario; a scenario over about 5 steps usually hides several behaviours.
- **Scope to implementation details.** Bad: `Then the payment service calls the payment provider with an idempotency
key`. Good: `Then the payment is recorded as pending against the invoice`. Mechanism notes go in a technical note.
- **Bury persistence, limits or state rules in Notes or Requirements only.** Anything the system must do (store a
field, cap a count, reject or abandon on a given state) needs a `Then`.
- **Gate a scenario on a vague state class.** Enumerate the exact states.
- **Skip failure and edge scenarios** or unstated negatives.
- **Paraphrase user-facing copy:** quote it exactly.
- **Leave the So that blank or generic.** It is the business value; if you cannot state it, ask the owner before
writing scenarios.
## Self-check before handing over
FULL mode. In LEAN mode, check only the six rules in `reference/lean.md`.
- [ ] The story is in As / I want / So that form and passes INVEST.
- [ ] The decision rule was applied (behaviour gets scenarios; content, UI or config gets text and a diagram).
- [ ] The happy path and at least one edge or failure scenario are present.
- [ ] Each scenario is atomic (about 3 to 5 steps, one behaviour); each `Then` asserts one thing.
- [ ] Exact user-facing copy is quoted; relevant side effects and negatives are asserted.
- [ ] Every store, record or persist requirement is a `Then` naming the record and the field.
- [ ] Scenarios gated on a status name exact values; a scenario exists for each existing or concurrent state the
feature touches.
- [ ] Notes capture dependencies, open decisions and out of scope.
- [ ] The edge and failure checklist was completed.
- [ ] If the change touches personal data, a `Then` asserts the value is absent from logs and a redaction rule is
stated.
- [ ] If the change crosses into another system, the destination field, type and format, the field-exists-everywhere
precondition, the blast radius, the deploy order and the missing-value idempotency rule are captured.
To grade a draft, use `reference/rubric.md`. `reference/testability-pitfalls.md` has worked before and after pairs for
the two gaps that most often survive review: persistence with no `Then`, and vague state gating. Read it when an item
involves stored fields, retry counts or status-driven behaviour.
Files in this skill
- SKILL.md
- reference/golden-example.md
- reference/lean.md
- reference/rubric.md
- reference/testability-pitfalls.md
Attribution
Related skills
View all in business →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.