A coding-agent workflow built around acceptance criteria, not bigger prompts
Turn a vague coding request into a reviewable change using a worked task contract, an evidence matrix, explicit permissions, and risk-based review.
Sources are linked in the guide. Read our editorial policy.
On this page 6 sections
Define the observable result and how it will be checked before delegating a coding task. Then give the agent enough repository context to investigate, keep its permissions bounded, and review the final change against the original criteria. A confident completion message is not evidence that the behavior works.
Factory’s task-specification guide, published September 24, 2026, recommends a bounded outcome, repository context, acceptance criteria, and verification steps. Claude Code’s best practices similarly emphasize giving the agent a concrete check and distinguishing model-followed instructions from harness-enforced controls.
The useful addition is an evidence matrix: map each requirement to a check, an owner, and a result. This prevents “the tests passed” from hiding an untested requirement.
Start with behavior, not implementation theater
A task such as “fix authentication properly” leaves too many decisions implicit. Explain what someone observes, what should happen instead, and what must remain unchanged.
For an illustrative expired-session bug, a compact task contract could be:
Outcome:
After a session expires, opening /account sends the user to login.
After successful login, return to the original internal account URL.
Acceptance:
1. A valid session still opens /account normally.
2. An expired session cannot read protected account data.
3. The login flow preserves the intended internal return path.
4. External return URLs are rejected using the existing redirect policy.
Scope:
Investigate the session guard, login callback, and related tests.
Do not replace the identity provider or change session duration.
Do not deploy, push, or access production credentials.
Evidence:
Use the repository's documented auth checks and redirect cases.
Report actual commands/results and anything not exercised.
This is a hypothetical specification, not an implementation or a test result. Your application’s route names and policy may differ. The important feature is that success includes permitted behavior, denied behavior, and a compatibility constraint.
Avoid prescribing a new abstraction when the existing guard may need a small correction. Give the agent room to diagnose the cause without giving it permission to redesign unrelated systems.
Build the evidence matrix before editing
For the example above, use this review plan:
| Requirement | Evidence to request | What that evidence does not prove |
|---|---|---|
| Valid session still works | Existing guard test plus an authenticated navigation check | All identity-provider combinations work |
| Expired session is denied | Protected endpoint or server-side guard regression test | A client-side redirect alone protects data |
| Return path survives login | Integration check through the callback | Unit-testing URL construction covers the real flow |
| External destination is rejected | Existing redirect-policy cases exercised at the entry point | Every URL parsing edge case is covered |
| Change stays in scope | Final diff reviewed against the task | A passing suite implies no unrelated edits |
The check types are recommendations, not commands to copy blindly. Discover the repository’s actual test runner, fixtures, and setup instructions. If a needed environment is unavailable, record the missing prerequisite and leave that row unverified; do not replace an integration requirement with a narrower unit test and call it complete.
Investigate, implement, then verify the integrated result
Ask for a short investigation that names the likely path, existing conventions, and uncertainties. For a small, obvious change, this can be a few sentences; a separate planning document is unnecessary.
Next, implement the smallest coherent change and its relevant regression coverage. Keep failed hypotheses separate from established facts. Do not let a nearby style issue expand the assignment.
Agree who runs checks. In a single-agent task, the implementer can normally run the authorized focused checks. With concurrent workers, assign one integration owner to run shared checks after their changes land; otherwise overlapping builds can waste resources and exercise half-integrated code.
Record the revision or exact change state the check exercised. New edits invalidate relevant earlier results. A completion report should distinguish passed checks, failed checks, and checks not run, including environmental limitations.
Review in a fresh context, against the contract
A reviewer needs the task contract, final diff, and evidence—not the implementer’s entire persuasive conversation. Ask whether every criterion is satisfied, whether the approach fits existing patterns, and whether the tests could pass while the bug remains.
For authentication, inspect server-side enforcement separately from the visual redirect. For migrations, inspect existing consumers and rollback implications. For UI changes, include keyboard interaction and error states when they are part of the requested behavior.
An AI review can help find defects, but agreement between two agents is not an independent runtime observation. Humans should retain approval over consequential changes. Branch protection, CI, sandbox restrictions, and credential scopes provide stronger boundaries than a sentence asking the model to be careful.
Escalate by risk, not by line count
A ten-line authorization change may deserve more review than a hundred-line styling update. Use the consequences of failure to decide the approval boundary:
- Local presentation changes: focused interaction checks and ordinary diff review.
- Public API or persisted-data changes: compatibility checks and review by the relevant owner.
- Credentials, authorization, payments, or production actions: explicit permission boundaries, negative cases, and designated human approval.
These are workflow choices, not a universal compliance policy. Adapt them to your application’s actual threat model and release process.
Make the handoff usable
A good final report says what behavior changed, which criteria have evidence, what remains uncertain, and whether any action awaits approval. It does not hide missing checks behind “done.”
Use the context engineering diagnostic flow when sessions drift, and the MCP admission checklist before granting external tool access. If the workflow will run locally, the VRAM and context guide explains resource tradeoffs. Compare tools in the coding directory using the same representative task and evidence requirements.
Research note: indexed X discussions helped identify the review problem, but direct thread access was blocked. No unverified adoption figures, productivity gains, or thread quotations underpin this workflow.