You are given a spec. The spec should have associated tickets describing how to implement the spec.
The goal is to deliver a PR on a single branch that implements the entire spec.
Tickets are not a checklist of steps, but a task graph with blocking relationshipstask graph. So there are always several ready tickets forming thefrontierthat can be claimed at any time.
Keep correspondence with subagents restrained. Communicate mainly via **context pointers**: pointing to the spec, tickets, research notes, and previous commits. Do not restate information already provided by the pointer.
implementer subagentrun in the background as much as possible, aiming formaximum concurrency。
Steps
-
Read the spec and tickets until you understand the task graph.
-
(Optional) Use anexplorer subagentto complete the exploration required by the tickets: relevant codebase files or external documentation. Make sure the explorer subagent can save files: it should store markdown notes in a directory outside the repository that all subsequent subagents can access. This lets theimplementer subagentfocus on implementation without being distracted by exploration.
-
Create a branch and open a draft PR. Start the title with
[AI Generated][<类型>]and mark the body as 'closing' the spec issue and each ticket. -
Useimplementer subagentsto implement the tickets one by one. Each implementer subagent works in its own worktree and its own branch.
-
Once animplementer subagentfinishes, use a **merger subagent** to merge its results into the PR branch.
-
If this changes thefrontierof claimable tickets, then dispatch moreimplementer subagentsto handle the new tickets, maintaining maximum concurrency.
-
After all tickets are complete, call the Skill tool on the PR branch, passing "code-review". Hand the issues it raises to a singleimplementer subagentto fix all at once.
-
Mark the PR as ready for review.
-
Clean up the worktrees of allimplementer subagents.