Your AI Agents Ship Code Faster Than You Can Review It. Here's the Workflow That Fixes That
DEV Community

Your AI Agents Ship Code Faster Than You Can Review It. Here's the Workflow That Fixes That

Most teams didn't decide to become AI agent teams. One developer adopted a coding agent, another wired one into CI, and within a quarter half the pull requests were machine-written. Then the pain starts, and it's a specific kind of pain:

  • PRs pile up faster than anyone can read them
  • Two agents solve overlapping problems in incompatible ways
  • A prompt that lived in one developer's chat session produced a product decision nobody approved

The failure isn't the agents. It's that the team's intent exists nowhere an agent - or a reviewer - can check. Chat transcripts aren't reviewable, aren't reusable, and can't be compared against the final diff.

Before agents, the slowest step in delivery was implementation, so every process optimized for developer throughput. With agents, implementation is nearly free, and two other steps become the constraint: deciding exactly what to build, and confirming the result matches that decision.

Here's the five-stage workflow that moves human effort to those two places. It's tool-agnostic - Claude Code, Cursor, Copilot agents, or a mix - because the contract lives in files, not in any tool's memory.

The workflow at a glance

Stage Owner Artifact Gate to pass
1. Intake Feature owner spec.md packet Goal, non-goals, acceptance criteria approved by a human
2. Task split Tech lead tasks.md Every task has a write scope and a verifiable outcome
3. Implementation One agent per task Branch diff Diff stays inside the task's write scope
4. Evidence Same agent evidence.md Named tests exist and pass
5. Review Human reviewer PR with linked artifacts Checklist review against criteria, not vibes

Stage 1: Turn the ticket into a spec packet

Everything downstream inherits the quality of this step - and it's the step teams most want to skip.

Input: a ticket like "let support admins retry failed exports." Output: a one-page packet that fixes four things:

  • The goal, in observable terms
  • The non-goals that bound the change
  • Acceptance criteria a test can check
  • The evidence a reviewer will demand

The discipline that matters most is non-goals. A line like "no schema changes, no email template edits, no new dependencies" removes the three most common ways agents helpfully expand scope.

Write the packet before choosing which agent implements it. This is where product ambiguity gets resolved by a person instead of leaking into an agent's assumptions.

Stage 2: Split the spec into bounded tasks

A spec packet is still too big to hand to one agent as one prompt. The reliable unit of agent work is a task that a single agent can complete - and a single human can review - in one sitting.

Each task needs three fields beyond its description:

Task 2 of 3: add retry endpoint
Write scope:
  - src/exports/retry.ts
  - src/exports/retry.test.ts
Depends on: task 1 (retry state column) merged.
Acceptance:
  - POST /api/exports/:id/retry on a failed export returns 202 and the same retry_id on duplicate calls
  - retrying a non-failed export returns 409
Evidence:
  - test: export_retry_idempotent
  - test: export_retry_wrong_state_conflict

One rule saves you from most multi-agent chaos: tasks that share files must not run in parallel. If two tasks both touch billing/index.ts, merge them or serialize them explicitly. Merge conflicts between agents are not a tooling problem; they're a task-splitting problem.

Stage 3: Run agents in parallel inside write scopes

With bounded tasks, parallelism becomes safe and boring - which is the goal.

Give each agent one task, its packet, and an isolated branch or git worktree. The write scope is the enforcement line: an agent that edits a file outside its scope has its diff rejected before review, no discussion needed.

Most modern agents respect an instruction like: "Modify only the files listed under write scope. If the task requires touching anything else, stop and report instead of editing."

That stop-and-report clause matters more than it looks. The most expensive agent failure is not a wrong implementation; it's a quiet decision - an extra column, a renamed function, a new dependency - buried in an otherwise plausible diff. Scope enforcement converts quiet decisions into loud questions a human answers in seconds.

Stage 4: Collect evidence before requesting review

An agent's claim that work is complete is worth nothing. Before a task's PR opens, the same agent fills in evidence.md: which named tests were added, their pass output, and which acceptance criterion each test covers.

Evidence is where hallucinated completeness dies. An agent that says "all tests pass" but can't paste the run output for export_retry_idempotent has not finished. The gate is mechanical: the named test either exists and passes, or it doesn't.

Stage 5: Review the PR against the checklist

Human review is the scarcest resource in the whole system, so spend it only on what earlier gates can't check: does the diff match the intent, and did anything unstated slip in?

The reviewer confirms the diff stays in scope, maps each change to a task, spot-checks the evidence, and asks the one question no automation can: what did nobody ask for?

A real run: one feature, three agents

Feature: "support admins can retry a failed data export."

  • spec: exports/retry-failed-export/spec.md
  • tasks:
    1. retry state column + migration - agent A (db/migrations, models)
    2. retry endpoint + idempotency - agent B (src/exports/retry.ts + test)
    3. admin console retry button - agent C (console/exports/*.tsx + test)
  • serialization: task 1 merges first; tasks 2 and 3 run in parallel
  • review: one human, three PRs, ~40 minutes total

The instructive failure: agent B added a helpful retry_count column - outside its write scope. The scope check flagged it before review. The team decided the count was genuinely useful, wrote it into the packet as a follow-up task, and rejected the out-of-scope edit. That's the workflow doing its job: the good idea survived, the unreviewed decision did not.

What to measure in the first 30 days

Adopt this on one feature stream, not the whole team, and track three numbers:

  • Review time per agent PR - should fall week over week as artifacts standardize
  • Out-of-scope edits caught before review - should be non-zero early (the gate works), declining later (the prompts learn)
  • Rework rate (PRs needing a second implementation pass) - this is the number that convinces skeptics

The steady state is unglamorous: specs are short, tasks are boring, agents are interchangeable, and review is fast. That's what it looks like when humans spend their time on intent and evidence, and machines spend theirs on everything in between.

The full version of this article - with the failure-mode table and links to copy-ready templates for spec packets, task plans, and evidence logs - is on spec-coding.dev. The spec packet generator is free and runs entirely in your browser.

Comments

No comments yet. Start the discussion.