Engineering

Acceptance Scenario Lockstep

Pin the target with executable scenarios before the agent starts changing code.

Use when

A coding agent is about to implement a feature where success could be interpreted three different ways.

difficultyIntermediate
categoryEngineering
sourceMia daily expansion

Cadence

Before and during ambiguous feature work

Verification

The same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved.

Structured loop spec

FieldValue
NameAcceptance Scenario Lockstep
CategoryEngineering
TriggerBefore and during ambiguous feature work
ObjectivePin the target with executable scenarios before the agent starts changing code.
Allowed inputsRelevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop
Allowed actionsTranslate the request into 3-7 user-visible scenarios, including at least one failure or edge case.; Mark which scenarios are in scope, out of scope, or require approval before work starts.; Turn the in-scope scenarios into tests, fixtures, or a checklist that can be rerun unchanged.; Implement only the smallest change needed for those scenarios.; Run the scenarios and stop if new behavior would broaden scope, affect billing/data/security, or require product judgment.
VerificationThe same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved.
Stop conditionStop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required.
BudgetSet a time, turn, token, retry, file, or dollar cap before running the loop.
Approval boundaryHuman approval required before publishing, sending, deleting, spending, changing accounts, touching production, or making reputational/legal/financial commitments.
Safe outputPull request, patch, report, or evidence log
Works withClaude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent

Steps

  1. Translate the request into 3-7 user-visible scenarios, including at least one failure or edge case.
  2. Mark which scenarios are in scope, out of scope, or require approval before work starts.
  3. Turn the in-scope scenarios into tests, fixtures, or a checklist that can be rerun unchanged.
  4. Implement only the smallest change needed for those scenarios.
  5. Run the scenarios and stop if new behavior would broaden scope, affect billing/data/security, or require product judgment.

Prompt

Run the Acceptance Scenario Lockstep loop. Use it before ambiguous feature work. First convert the request into 3-7 user-visible scenarios with clear in-scope, out-of-scope, and approval-required labels. Make the in-scope scenarios executable as tests, fixtures, or a repeatable checklist before implementation. Implement only against those scenarios, rerun them unchanged, and stop for approval if the work broadens scope or touches billing, data, security, or product judgment.

Run in Claude Code

Paste this into Claude Code (or any tool-using agent) to run the loop bounded: one change per round, the same verification every round, durable state files, and explicit stop conditions.

Run the "Acceptance Scenario Lockstep" loop from AI Loop Library (https://ailooplibrary.com/loops/acceptance-scenario-lockstep/) as a bounded loop.
Goal: Pin the target with executable scenarios before the agent starts changing code.
Rules: one change per round; run the same verification every round (The same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved.); append each round to docs/loops/acceptance-scenario-lockstep/progress.md and update docs/loops/acceptance-scenario-lockstep/state.json; stop on verifier pass, 8 rounds, 3 consecutive failed verifications, no progress, a blocker, or anything needing human approval (money, production, outbound, deletion). Finish with a proof report: rounds used, changes made, verification output, remaining risk, and the next human decision.

Get the MCP server + agent pack

Tags

acceptance criteriatestingagent coding

Related loops

Browse all 68 loops