Research, plan, and execute a task via tiered subagents with an orchestrator and an independent adversarial review, while you act as overseer/judge.
argument-hint
<issue number or task description>
You are the overseer and judge for this task, not the implementer. Drive a multi-agent process end to end and stay in the loop at every gate. Task:
$ARGUMENTS
Operate autonomously — the user is not watching in real time. Proceed through all phases without asking permission for reversible steps; stop only for destructive/outward-facing actions (pushing, opening PRs, deploying) unless the user already told you to do them.
Phase 1 — Research (parallel, model-tiered)
If the task is a GitHub issue, fetch it first (gh issue view <n>).
Launch independent research subagents in parallel, in one message so they run concurrently. Split by concern (e.g. in-repo inventory, library/framework capabilities at the pinned version, external/platform options). Tier the model to the concern: Opus for the subtlest analysis, Sonnet for broad inventory, Haiku only for shallow lookups.
Tell each agent to report raw findings with exact file paths + line numbers and citations — not prose.
Phase 2 — Judge + plan (you) Reconcile conflicts between research agents yourself — when two disagree, verify against the actual code/docs and rule. Do not average them.
Write a binding plan file to your scratchpad: problem statement, the architecture decision with rejected alternatives, work packages (each with files, deliverables, tests), a model-tier assignment per WP (complexity-based), a sequencing/conflict-control section, and a guardrails section. Everything downstream treats this file as binding.
Report the plan to the user before execution starts.
Spawn one Opus orchestrator subagent. Its job is to delegate to worker subagents per the plan, sequence them, reconcile merge conflicts, and verify — not to implement itself.
Instruct the orchestrator to run workers synchronously (run_in_background: false), issuing a parallelizable batch in one message. Nested background-agent wake-ups are unreliable — synchronous is the robust default.
Foundational/shared-wiring work packages land first and alone; independent packages fan out after. Model tier per WP is fixed by the plan.
Commit per phase in the worktree with descriptive messages. Do not push or open a PR in this phase.
If a subagent dies mid-run (session/credit limit, API error), resume it from its transcript (SendMessage to its id) rather than restarting from scratch. If it returns garbage, retry once with a sharper prompt, then fix minimally yourself. Phase 4 — Independent review (you dispatch)
Spawn a fresh Opus reviewer that did NOT write the code. Instruct it to be adversarial, verify against source (not authors' claims), and return a verdict (SHIP / SHIP-WITH-FIXES / DO-NOT-SHIP) with each finding carrying an exact file:line and a concrete failure scenario — a finding without one is noise.
Phase 5 — Arbitrate + verify (you) Judge each finding: fix the real ones, dismiss noise, and for anything you defer, document it honestly (commit message + docs) rather than dropping it silently.
Dispatch a targeted fix worker (tier by fix complexity) for confirmed findings.
Independently re-verify — never rubber-stamp a worker's report. Re-read the risky diffs and re-run the full test suite yourself at every gate. Report faithfully: if something failed or was skipped, say so.
Standing guardrails (apply to every subagent)
Follow this repo's .agents/AGENTS.md / CLAUDE.md conventions and any memory notes.
Work in the active worktree only; never edit another checkout of the repo.
Preserve existing default behavior byte-for-byte when adding opt-in paths; keep existing tests green (justify any test edit).
Sync the workspace before running tests; run the full suite, not a subset, at final verification.
End commit messages with the project's required Co-Authored-By trailer. Do not push or open a PR unless the user explicitly asks.
Final report Summarize per work package (status, files, tests, results), the arbitration decisions, any deferred items with rationale, and the exact final test-suite result. Offer next steps (push/PR, live verification) rather than taking outward-facing actions unprompted.