STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes tokens. Begin executing Step 0 immediately.
/pbr:autonomous — Hands-Free Multi-Phase Execution
References: @references/questioning.md, @references/ui-brand.md
Step 0 — Immediate Output
Before ANY tool calls, display this banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► AUTONOMOUS MODE ║
╚══════════════════════════════════════════════════════════════╝
Then proceed to Step 1.
Step 1: Config Gate and Parse Arguments
- Read
.planning/config.json. Checkworkflow.autonomous— iffalseor missing, display:
Autonomous mode is disabled.
Enable with: /pbr:config set workflow.autonomous true
Stop immediately. Do NOT proceed.
- Parse
$ARGUMENTS:
| Argument | Meaning | Default |
|---|---|---|
--from N | Start from phase N | Current phase from STATE.md |
--through N | Stop after phase N | Last phase in current milestone |
--speculative-depth N | How many phases ahead to plan speculatively | From config workflow.speculative_depth (default 2) |
--dry-run | Show which phases would execute without doing anything | Off |
-
Determine speculative planning settings:
- Read
workflow.speculative_planningfrom config — if false, speculative depth = 0 - Read
workflow.speculative_depthfrom config (default: 2) - If
--speculative-depth Nprovided, override config value - Store as
speculativeDepthfor use in Step 3
- Read
-
Read
gates.checkpoint_auto_resolvefrom config (default:"none"). Values:"none": STOP on all checkpoints (user must resolve)"verify-only": Auto-resolvecheckpoint:human-verify(proceed after confidence-gate passes), STOP oncheckpoint:human-action"verify-and-decision": Auto-resolve verify + decision checkpoints, STOP oncheckpoint:human-action"all": Auto-resolve all checkpoints (dangerous — only for fully automated pipelines) Store ascheckpointResolveLevelfor use in Step 3c.
-
Read
.planning/STATE.mdto determine current phase (used as default for--from). -
Read
.planning/ROADMAP.mdto build phase list for current milestone. -
CRITICAL (hook-enforced): Write .active-skill NOW. Write
.planning/.active-skillwith the contentautonomoususing the Write tool. This registers the autonomous session with the workflow enforcement hooks. Child Skill() calls (plan, build, review) will overwrite this with their own skill name during execution and should restore or re-write it — but the orchestrator owns the initial write and final cleanup. -
Filter to phases from
--fromthrough--throughthat are not yet complete. -
If no phases to execute, display: "All phases in range are complete." and stop.
If --dry-run: Display the phase list with planned actions per phase, then stop without executing.
DRY RUN — Would execute:
Phase 3 (data-layer): discuss -> plan -> build -> verify
Phase 4 (api-endpoints): plan -> build -> verify (CONTEXT.md exists, skip discuss)
[speculative: plan Phase 5 during Phase 4 build]
Phase 5 (frontend): discuss -> plan -> build -> verify
Speculative depth: 2
When speculativeDepth > 0, append the speculative depth value and annotate phases where speculative planning would occur. When speculativeDepth == 0 (speculative_planning is false), omit the speculation lines.
Step 2: Dynamic Phase Detection
Before each phase iteration:
- Re-read
.planning/ROADMAP.md(catches inserted/removed phases between iterations) - Rebuild the phase list for the current milestone
- Compare with previous iteration's list — if changed, log:
Phase list changed: {diff}. Adjusting execution order. - Skip phases already marked as verified/complete in ROADMAP.md
Verification tracking: Initialize two counters at the start of the autonomous run:
phases_verified_full = 0— count of phases that received full/pbr:reviewverificationphases_verified_total = 0— count of phases that completed verification (any type)- Read
verification.min_full_percentfrom config (default: 30) - Calculate
full_verify_interval: if min_full_percent > 0, computeMath.floor(100 / min_full_percent)(e.g., 30% → every 3rd phase). If 0, set to Infinity (never force full).
Step 3: Phase Loop
For each remaining phase N:
3a. Discuss Phase (conditional)
- Check if
.planning/phases/{NN}-{slug}/CONTEXT.mdexists -- if so, skip (decisions already captured) - Count requirements for this phase: parse the
### Phase {N}:section in ROADMAP.md, count bullet lines under**Requirements:** - Auto-skip discuss (no Skill() call) when ANY of these are true:
- CONTEXT.md already exists
- Requirement count is 0 or 1 (well-specified, no gray areas worth discussing)
--automode is active AND all requirements are simple factual statements (no[NEEDS DECISION]markers)- Log:
Phase {N}: auto-skipping discuss ({count} requirement(s), well-specified)
- Run discuss only when: CONTEXT.md missing AND requirement count >= 2 AND at least one requirement contains ambiguous language or
[NEEDS DECISION]- Invoke:
Skill({ skill: "pbr:discuss", args: "{N} --auto" }) - The
--autoflag triggers smart discuss batching: collect ALL gray areas across the phase requirements and present them in a single batch for resolution, rather than asking one at a time.
- Invoke:
3b. Plan Phase
- Check if
.planning/phases/{NN}-{slug}/PLAN-*.mdfiles exist - If NOT exists:
- Invoke:
Skill({ skill: "pbr:plan", args: "{N} --auto" })
- Invoke:
- If plans exist (from speculative planning or prior run): skip planning.
- Log:
Phase {N}: plans already exist (speculative or prior) -- skipping plan step. - Note: even if planning is skipped, the 3b-validate gate below will verify plans are validated.
- Log:
- If Skill returns failure: stop autonomous loop, display error, suggest:
/pbr:plan {N}
3b-validate. Plan Validation Gate (always runs)
CRITICAL -- DO NOT SKIP. No phase may enter build without passing plan validation.
- Check if
.planning/phases/{NN}-{slug}/.plan-check.jsonexists. - If it exists: read it and verify
status === "passed".- If passed: log
Phase {N}: plan validation passedand proceed to 3c. - If not passed: log
Phase {N}: plan validation failed -- re-running plan checker- Invoke:
Skill({ skill: "pbr:plan", args: "{N} --audit --auto" }) - Re-check
.plan-check.json. If still not passed: stop autonomous loop. Display:BLOCKED: Phase {N} plans failed validation. Fix issues with /pbr:plan {N} --audit
- Invoke:
- If passed: log
- If
.plan-check.jsondoes NOT exist (plans came from speculative planner which bypassed plan-checker):- Log:
Phase {N}: no .plan-check.json -- running plan checker on existing plans - Invoke:
Skill({ skill: "pbr:plan", args: "{N} --audit --auto" }) - After completion, re-check
.plan-check.json. If missing or failed: stop autonomous loop with same BLOCKED message.
- Log:
3c. Build Phase
- Check if all PLAN files have corresponding SUMMARY files
- If incomplete:
- Invoke:
Skill({ skill: "pbr:build", args: "{N} --auto" })
- Invoke:
- If all SUMMARYs exist: skip build
- Checkpoint handling (uses
checkpointResolveLevelfrom Step 1):checkpoint:human-action: ALWAYS stop (regardless of config). Display: "Human action required in Phase {N}. Complete the action, then resume with:/pbr:autonomous --from {N}"checkpoint:human-verify: IfcheckpointResolveLevelis"verify-only","verify-and-decision", or"all": auto-resolve by running confidence gate. Otherwise STOP.checkpoint:human-decision: IfcheckpointResolveLevelis"verify-and-decision"or"all": auto-resolve with default option. Otherwise STOP.- Any o