A portable workflow for using agents on engineering work without stuffing the whole job into one long context window.
Core idea:
Break a job into roles, give each role its own context, and pass only structured handoffs between them.
Loop:
Issue or ticket -> Planner -> Clarifier -> Human Gate -> Builder -> Reviewers -> Reviewer Boss
Agents get worse when one context window accumulates the ticket, repo scans, logs, failed attempts, review comments, stale assumptions, and half a plan. The role loop keeps each stage focused:
- The Planner turns messy input into an executable build packet.
- The Clarifier tries to kill ambiguity before code is written.
- The Human Gate prevents confident automation from charging past judgment calls.
- The Builder executes the approved packet and produces evidence.
- The Reviewers inspect the change from separate perspectives.
- The Reviewer Boss merges review findings into one verdict.
Run each role in a fresh agent, subagent, chat, or context window when possible.
Do not paste every intermediate transcript into the main orchestration thread. Keep the orchestrator small: current stage, current artifact, decision, and next action.
Each stage should return a compact artifact:
- Planner -> Build Packet
- Clarifier -> PASS or FAIL with requested edits and blocking questions
- Human Gate -> Proceed, revise, or stop
- Builder -> Review Handoff with diff summary, files, acceptance criteria, contracts, tests, and evidence
- Reviewers -> Independent verdicts and findings
- Reviewer Boss -> Final decision:
BLOCK,SHIP, orSHIP WITH NITS