From prd2impl
Full-autopilot orchestrator — AI picks task order and parallelism, auto-approves default decisions, and drives all remaining tasks to completion without STOP checkpoints. Use when the user says 'autorun', 'full autopilot', 'run everything', '全托管', or runs /autorun.
How this skill is triggered — by the user, by Claude, or both
Slash command
/prd2impl:skill-13-autorunThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<SUBAGENT-STOP>
Orchestrate the entire task queue autonomously. Pick order, pick parallelism, auto-approve default decisions at every dev-loop STOP point, and drive to completion.
/autorun — autopilot all Green tasks (safe default)/autorun green — same as above/autorun yellow — autopilot Green + Yellow (AI self-reviews Yellow drafts)/autorun all — autopilot Green + Yellow + Red (AI picks default on every design decision; risky)/autorun until {milestone} — stop when the given milestone passes smoke-test/autorun {task-ids} — autopilot a specific subsetBefore building the work queue, detect work that landed on the branch since the last autorun. This catches the scenario where another orchestrator (human or another agent) shipped commits in parallel to the autorun's plan — common when you've been away from the repo for a while or when a human co-developer is co-writing the same milestone.
Run:
LAST_AUTORUN_SHA=$(git log --grep='chore.*autorun' -1 --format=%H 2>/dev/null || git log --grep='/autorun' -1 --format=%H 2>/dev/null)
if [ -n "$LAST_AUTORUN_SHA" ]; then
git log --oneline "$LAST_AUTORUN_SHA"..HEAD
else
# First autorun on this branch — scope to recent activity instead
git log --oneline -20
fi
Expected output classes:
task-status.md session log) → proceed.task-status.md → STOP. List those commits and ask: "Detected N parallel-line commits since last autorun: . These may have changed contracts or schemas the queued tasks depend on. Reconcile (re-read tasks against new HEAD) or proceed anyway?" Wait for explicit user choice; do NOT default to proceed.Why mandatory: parallel-line drift caught at autorun start costs 1 minute (a git log and a confirmation). Caught mid-batch it costs 30+ minutes (rework + reconcile + possibly re-running already-shipped tasks). M3 retro evidence: a parallel line added ParticipantRole.TRIAGE and list_conversations_in_takeover_by() while autorun was closing the M3 gate; cost ~30 min to detect + ~30 min to reconcile (re-export shim + 3 contract-drift test fixes).
Then confirm scope with a one-shot summary (not a question):
Autorun starting — level: {green|yellow|all}
Scope: {N} tasks in queue ({G} Green, {Y} Yellow, {R} Red)
Will skip: {what's excluded based on level}
Stop conditions: test failure after 3 retries, dependency cycle, explicit STOP commit marker
Estimated parallelism: up to {K} concurrent worktrees
Parallel-line: {clean | reconciled with N commits | proceeding anyway despite N undocumented commits}
Starting in 10s. Type 'cancel' to abort.
If --dangerously-skip-permissions is NOT in effect, warn once:
⚠️ Claude Code is in interactive-permission mode. Autorun will still prompt
for Bash/Edit. For true hands-off mode, restart with:
claude --dangerously-skip-permissions
or set .claude/settings.json → permissions.defaultMode = "bypassPermissions".
Continue in interactive mode anyway? (yes/cancel)
Path resolution: Before constructing any read/write path, resolve
{plans_dir}perlib/plans-dir-resolver.md. Alldocs/plans/references (exceptdocs/plans/project.yaml, which stays at repo root) are relative to that resolved directory. Bare references totasks.yaml,task-status.md, etc. are also{plans_dir}-scoped.
tasks.yaml and execution-plan.yaml (if present)green → only type == Greenyellow → type in [Green, Yellow]all → all non-completed taskscompleted, tasks marked blocked with no resolution, tasks with unmet external blocked_bydepends_on; tasks at the same depth are parallelizable candidatesFor each dependency level (batch):
project.yaml → autorun.max_parallel (default: 3; cap: 5)max_paralleltask.files_touched if declared in tasks.yamlmodule only if explicitly marked parallel_safe: true; otherwise serialize--dry-run was passedFor each planned group:
skill-8-batch-dispatch with --autopilot={level}skill-5-start-task {ID} --autopilot={level}skill-6-continue-task {ID} --autopilot={level} if not already auto-closedtask-status.md after each task state transitionAutorun does not ask for permission to retry or fix. It follows this decision tree:
| Failure mode | Action |
|---|---|
| Test failure (attempt 1-3) | Re-enter skill-6-continue-task with diagnostic context; invoke superpowers:systematic-debugging if available |
| Test failure after 3 retries | Mark task failed, record diagnostic report, continue with rest of queue, surface at end |
| Dependency cycle detected | Halt queue, report cycle, exit with NO-GO |
| Contract drift | Invoke /contract-check; if impact is bounded to Green tasks, auto-replan; else halt |
| Worktree conflict / dirty tree | Clean worktree via ExitWorktree, retry once, then mark failed |
Missing Red decision (in yellow mode) | Mark task blocked: needs Red decision, skip, continue |
In --autopilot=yellow or all, Yellow tasks still need a "review".
Autorun performs a two-stage review instead of human STOP, per
superpowers:subagent-driven-development. The 0.3.x single-stage
review missed the "added unrequested feature" class — exactly what
produced the AutoService PV2 dead-code phenomenon (entire
pipeline_v2/kb_mcp/ directory shipped per spec, deleted as dead
code one day post-gate in commit f82c22e).
Goal: catch over-building (work beyond spec) and under-building (missing spec items).
superpowers:requesting-code-review with prompt focused on:
skill-12-contract-check --preflight for the upstream gate)REQUESTED_DELIVERED [Y / N / PARTIAL]
plus EXTRAS [list].If verdict is N or extras non-empty → revise the diff to either match spec or update spec (with user confirmation) before Stage B.
Only after Stage A clears (no missing items, no extras).
superpowers:requesting-code-review again with prompt
focused on:
task: {ID} → completed (autopilot-yellow, stage-A: {summary}, stage-B: {summary})Stage A is a focused 200-token check. Total reviewer cost increase ~30% over 0.3.x single-stage, not 100%. Justified by retro evidence that Stage A catches a class of bugs single-stage review misses (over-building per spec but under-wiring in production).
If superpowers:requesting-code-review is unavailable, Yellow tasks
are always deferred (not auto-completed) regardless of level —
matches 0.3.x behavior. If superpowers:subagent-driven-development
is unavailable but requesting-code-review exists, fall back to
single-stage review with a logged warning.
all mode only)For Red tasks in --autopilot=all:
task: {ID} → completed (autopilot-all, DEFAULT-PICKED)If the queue crosses a milestone boundary:
skill-10-smoke-test {milestone}/autorun until {milestone} → exit after that milestone's smoke-test (pass or fail)When the queue drains (or halts), emit:
Autorun complete — level: {green|yellow|all}
Duration: {HH:MM:SS}
Completed: {N} tasks ({G} Green, {Y} Yellow, {R} Red)
Failed: {M} tasks — see details below
Auto-picked Red decisions: {K} — listed below for audit
Milestones passed: {list}
--- Failures ---
{per-task diagnostic summary}
--- Red Decisions Log ---
{per-decision: task, question, chosen option, rationale}
Next: {/smoke-test {next-milestone} | /retro | /task-status}
These apply even in --autopilot=all:
git push --force to shared branches (dev, main)files_touched breach)git log + revert a single groupqueue_building → planning → dispatching → awaiting_group → processing_group →
(success) → next_group or done
(failure) → diagnose → (recoverable → retry) or (terminal → mark_failed → next_group)
(cancel) → halt → final_report
If autorun is interrupted (user cancel, context loss, crash):
/autorun resume: read task-status.md, find last in_progress set, re-plan the remaining queue at the same levelfailed tasks automatically — user must /start-task them manually (autorun already tried 3x)project.yaml → autorun.max_parallel: fall back to 3execution-plan.yaml: build batches ad-hoc from tasks.yaml dependency graphsuperpowers:dispatching-parallel-agents unavailable: serialize the queue (log a warning once)cancel during preflight countdown: abort cleanly, no state changes| Mode | Required | Degrades gracefully if missing |
|---|---|---|
green | skill-5, skill-6 | skill-8 (sequential fallback), dev-loop-skills, superpowers:systematic-debugging |
yellow | green reqs + superpowers:requesting-code-review | (Yellow tasks deferred if review unavailable) |
all | yellow reqs | superpowers:brainstorming (Red tasks still run with default-picking) |
───────────────────────────────────────────────────── ⬆ /autorun complete ─────────────────────────────────────────────────────
📋 Next: /task-status — review autorun results /retro — run retrospective if milestone completed ─────────────────────────────────────────────────────
npx claudepluginhub ezagent42/prd2impl --plugin prd2implCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.