| name | s-auto |
| description | Autonomous workflow loop - runs the full skill chain automatically with circuit breaker and stuck detection |
/s:auto - Autonomous Workflow Loop
Run the full skill chain automatically. Monitors progress, detects failures, and stops when the job is done.
Prerequisites
- Project must be initialized (
/s:new already run)
.planning/STATE.md must exist
Step 1: Load Current State
Read .planning/STATE.md to determine the current position in the workflow chain.
Identify which phase and task is active. Determine the next skill in the chain:
CHAIN ORDER:
/s:discuss → /s:brainstorm → /s:plan → /s:build → /s:review → /s:verify → /s:ship → /s:compound
Map the current state to the next skill:
- Status "initialized" or no requirements → next is
/s:discuss
- Requirements exist but no brainstorm → next is
/s:brainstorm
- Brainstorm exists but no roadmap → next is
/s:plan
- Roadmap exists, phase active, tasks pending → next is
/s:build
- Phase tasks complete, not reviewed → next is
/s:review
- Reviewed but not verified → next is
/s:verify
- Verified and passing → next is
/s:ship
- Shipped → next is
/s:compound
Step 2: Circuit Breaker
Maintain a circuit breaker with 3 states:
CLOSED (Normal Operation)
- Skills run automatically one after another
- Errors are counted but execution continues
- Transition to OPEN: same error appears 3 consecutive times
OPEN (Stopped)
- All automatic execution STOPS immediately
- Display the repeated error clearly to the user
- Ask user for guidance: fix the issue, skip the step, or abort
- Transition to HALF-OPEN: when user provides a fix or says "retry"
HALF-OPEN (Testing)
- Run exactly ONE more skill step
- If it succeeds → transition back to CLOSED
- If it fails with same error → transition back to OPEN
Display circuit breaker state at each step:
[AUTO] Circuit: CLOSED | Step 3/8: running /s:plan...
[AUTO] Circuit: OPEN | STOPPED - same error 3x: "test suite failed"
[AUTO] Circuit: HALF-OPEN | Testing: running /s:build after user fix...
Step 3: Stuck Detection
Track errors across steps. An error is "stuck" when:
- The same error message appears 3 consecutive times
- A skill produces no state change after running (STATE.md unchanged)
- A skill fails and the retry also fails with identical output
When stuck is detected:
[AUTO] STUCK DETECTED after 3 identical failures.
Error: {error_message}
Skill: /s:{skill_name}
Options:
1. Fix the issue and type "retry"
2. Skip this step: "skip"
3. Abort autonomous mode: "abort"
Step 4: Execute the Chain
For each skill in the chain:
- Announce:
[AUTO] Step {N}/8: running /s:{skill}...
- Run the skill with full instructions
- Verify the skill completed (check STATE.md was updated)
- Pause briefly - display output summary for user review
- Check circuit breaker state before proceeding
- Log the result: success, warning, or error
Progress display format:
[AUTO] ================================
[AUTO] Step 3/8: /s:plan
[AUTO] Status: RUNNING
[AUTO] Circuit: CLOSED
[AUTO] Errors so far: 0
[AUTO] ================================
After each skill completes:
[AUTO] Step 3/8: /s:plan - COMPLETE
[AUTO] Next: /s:build (starting in 3s, type 'pause' to stop)
Step 5: Rate Limiting
Between each skill execution:
- Display the skill's output summary (what was created/modified)
- Wait for user acknowledgment OR auto-proceed after showing output
- If user types "pause" at any point, stop and wait
- If user types "skip", skip current skill and move to next
- If user types "abort", stop the entire chain
Step 6: Dual-Condition Exit Gate
The autonomous loop ONLY terminates when BOTH conditions are met:
Condition A: All phase tasks complete
- Read
.planning/ROADMAP.md and check all tasks are marked [x]
- Read
.planning/phases/N/PLAN.md and verify all tasks done
Condition B: Verification passes
/s:verify ran and produced a passing evidence table
- All requirements in
REQUIREMENTS.md have status "done" or "verified"
If only one condition is met:
- Tasks complete but verify fails → run
/s:verify again, then /s:debug if needed
- Verify passes but tasks remain → continue with
/s:build
Step 7: Completion
When both exit conditions are satisfied:
- Run
/s:compound (NEVER skip - captures learnings)
- Display final summary:
[AUTO] ================================
[AUTO] AUTONOMOUS LOOP COMPLETE
[AUTO] ================================
[AUTO] Skills executed: 8
[AUTO] Errors encountered: 1 (resolved)
[AUTO] Total tasks completed: {N}
[AUTO] Verification: PASSED
[AUTO] Learnings saved: docs/solutions/{file}
[AUTO] ================================
[AUTO] Run /s:retro for a retrospective.
Step 8: User Interrupt Handling
At ANY point during execution, the user can:
- "pause" → Stop after current skill completes, show state, wait
- "skip" → Skip current skill, move to next in chain
- "abort" → Stop immediately, save state to STATE.md
- "status" → Show current progress without stopping
- Ask a question → Pause, answer, then offer to resume
After any interrupt, update STATE.md with:
- Which step was interrupted
- What was completed so far
- Resume instructions
Error Recovery
If a skill fails:
- Log the error with full context
- Increment error counter for that specific error
- Check circuit breaker thresholds
- If under threshold: retry once, then skip if still failing
- If at threshold: trigger OPEN state, ask user
- Always preserve state - never lose progress on failure
Notes
- This skill orchestrates other skills - it does NOT replace their logic
- Each sub-skill runs with its full instructions and protocols
- TDD is still enforced during
/s:build even in auto mode
- Verification is still evidence-based even in auto mode
- Context persistence rules still apply - STATE.md is always updated