Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Autonomous AI coding loop (Ralph Wiggum methodology). Use when running AI agents in unattended/autonomous mode to independently select and complete tasks from a structured task list (prd.json). Enables AFK development across multiple context windows.
.claude/skills/majiayu000-auto/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 135% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 273% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 220% | 0% |
Fully autonomous development. Works through all tasks without stopping until complete.
!git status --short !node -e "try{const p=require('./prd.json');const sp=p.sprints?p.sprints[p.sprints.length-1]:p;const s=Object.values(sp.stories||p.stories||{});const name=sp.id||sp.name||p.sprint||'unknown';const done=s.filter(x=>x.passes===true).length;const pend=s.filter(x=>x.passes===null||x.passes===false).length;console.log('Sprint:',name,'| Done:',done,'| Pending:',pend,'| Total:',s.length)}catch(e){console.log('No prd.json')}"
auto
|-- Activate: write .claude/auto-active
|-- Check prd.json exists?
| |-- No -> Bootstrap from context
| +-- Yes -> Check pending tasks
| |-- None pending -> IDLE Detection
| +-- Has pending -> Execute tasks
|
+-- Execute until done or interrupted
+-- Deactivate: delete .claude/auto-activeOn start, create the flag file:
bashecho '{"started":"'$(date -Iseconds)'","sprint":"current"}' > .claude/auto-active
PowerShell: @{started=(Get-Date -Format o)} | ConvertTo-Json > .claude/auto-active
This flag tells the Stop hook to block Claude from stopping. Claude keeps working as long as this flag exists.
On exit (user says "done", or nothing left), delete the flag:
bashrm -f .claude/auto-active
Delete the flag when auto mode ends. If asking the user what's next (IDLE Detection), keep the flag active.
Do not ask "Should I continue?" or show summaries and wait.
Instead:
.claude/decisions.mdWhen findings, scan results, or ad-hoc issues are identified during execution, write them to prd.json as stories before fixing them. prd.json is the source of truth that survives session restarts and /compact.
If the user gives a direct instruction (e.g., "fix this button", "update that copy") rather than saying "auto":
When prd.json does not exist:
Before first task:
bashgit status --short npm run build 2>&1 | tail -5
Skip if takes >10 seconds.
javascript// prd.json has two shapes: // Flat: { stories: { "S1-001": {...} }, sprint: "sprint-1" } // Nested: { sprints: [{ id: "sprint-1", stories: { "S1-001": {...} } }] } const sp = prd.sprints ? prd.sprints[prd.sprints.length - 1] : prd; const stories = sp.stories || prd.stories || {}; const storyEntries = Object.entries(stories); const executable = storyEntries.filter(([id, s]) => s.passes !== true && (s.blockedBy || []).every(dep => stories[dep]?.passes === true) );
npm run typecheck — fix if failsnpm run build — fix if failspasses: true| Task Type | Verification | |-----------|--------------| | UX/UI | agent-browser visual + console + network | | Feature | Build passes + browser devtools check | | API | Endpoint returns expected data + network check | | Bug fix | Reproduce, verify fixed, no new errors |
For UI/API tasks with a running dev server:
bashagent-browser open http://localhost:3000/path agent-browser snapshot -i agent-browser errors agent-browser network requests
Fix console errors or failed network requests before moving on.
Before marking any task as complete:
1. Type Safety
bashnpm run typecheck 2>/dev/null || npx tsc --noEmit 2>/dev/null
2. Tests
bashnpm test -- --passWithNoTests --watchAll=false 2>/dev/null
3. Self-Review Run git diff and check:
console.log or debugger left inany types introduced4. UI/API Change? Browser Verification If agent-browser is available and a dev server is running:
bashagent-browser open http://localhost:3000/[page] agent-browser screenshot .claude/screenshots/verify-$(date +%s).png agent-browser snapshot -i agent-browser errors agent-browser network requests --filter api
5. Mark Complete Only after all checks pass. If any check fails, fix it first.
For independent tasks, launch multiple agents:
Task({ subagent_type: "general-purpose", prompt: "...", run_in_background: true })On failure (maximum 2 retries, then move on):
.claude/mistakes.mdpasses: false, continue to next taskDo not retry a third time. Do not spend more than 10 minutes on retries for a single task.
feat|fix|refactorAfter every 3 completed tasks, recommend /compact:
Checkpoint: 3 tasks complete. Run /compact to reclaim ~40% tokens.Be concise. Short responses = more runway.
When all stories have passes === true:
All [N] tasks complete.
Summary:
- [X] features implemented
- [X] bugs fixed
- [X] improvements made
Run `progress` to see full results.If no tasks to work on:
passes: true?| Signal | Action | |--------|--------| | TODOs/FIXMEs in code | Brainstorm (auto mode creates stories) | | Console.logs left in | Quick cleanup sprint | | No tests exist | Suggest test sprint | | Build warnings | Fix warnings sprint | | Clean codebase | Ask user (see below) |
If brainstorm scan finds 3+ actionable improvements, auto-create next sprint and continue:
Sprint [N] complete (8/8 tasks).
Scanning codebase... found 5 improvements.
Creating Sprint [N+1] and continuing.Limit: 1 auto-generated sprint per session. After that, ask the user.
Sprint [N] complete (8/8 tasks).
What's next? (Recommended: ship)
1. ship - Deploy current work
2. audit - Deep quality check
3. brainstorm - Find more improvements
4. Done for nowUse AskUserQuestion with these options. Pick recommendation based on context.
Keep .claude/auto-active flag while asking. Only delete it if user picks "Done for now".
| Situation | Action | |-----------|--------| | No prd.json | Bootstrap from context | | All done + issues found | Brainstorm (auto-creates stories) | | All done + clean code | Ask user for next action | | All done + already auto-sprinted | Ask user (limit reached) | | Build broken | Fix first | | Task fails | Retry 2x, then skip | | UX task | Browser verify | | Blocked task | Skip, work on unblocked | | < 5 tasks, no sprint | Work directly |
Other measured skills in the registry, with their headline benchmark lift.