| name | auto-dev |
|---|---|
| description | Autonomous development loop. Continuously develops, tests, reviews, and commits code toward PRD goals. Enforces minimum work duration per invocation. Prioritizes fixing existing defects over new features. Use when the user says auto-dev, /auto-dev, autonomous dev, or continuous development. |
Continuously develop a codebase toward its PRD goals. Each invocation works for a specified duration: assessing state, fixing defects, building features, testing, reviewing, and committing. Fully autonomous — no user interaction required.
Accept /auto-dev [duration] or via loop: /loop 2h /auto-dev 1.5h
Parse duration:
1.5hor1.5H→ 90 minutes2h→ 120 minutes90mor90M→ 90 minutes45m→ 45 minutes- No argument → default 60 minutes
Store as MIN_DURATION_MIN (integer minutes).
On every invocation, discover the project context. Do NOT hardcode paths or tech stacks — detect them.
Check these in order for the project root:
$AUTODEV_PROJECTenvironment variable- Current working directory if it contains a known project marker
- The workspace root
Project markers (any one is sufficient):
package.json, Cargo.toml, pyproject.toml, go.mod, Makefile,
CMakeLists.txt, pom.xml, build.gradle, .git
Search the project root for a requirements document:
PRD.md, prd.md, SPEC.md, spec.md, DESIGN.md, design.md,
REQUIREMENTS.md, requirements.md, ARCHITECTURE.md
If none found, check docs/ subdirectory. If still none, the session operates
in defect-fix-only mode (skip Phase 4 feature work).
Detect from project files:
package.json→ Node.js/TypeScript (check fornext,react,vue, etc.)Cargo.toml→ Rustpyproject.toml/requirements.txt→ Pythongo.mod→ GoCMakeLists.txt/Makefile→ C/C++- Other → infer from file extensions
Check package.json scripts, Makefile targets, Cargo.toml, etc. for:
- Build:
npm run build,cargo build,make,go build, etc. - Test:
npm test,cargo test,pytest,go test, etc. - Lint:
npm run lint,cargo clippy,ruff,golangci-lint, etc. - Type-check:
tsc --noEmit,mypy, etc. - Dev server:
npm run dev,cargo run, etc.
Check for auto-dev-session.md in the project root. If it exists, read it to
understand what was done in previous invocations. This provides continuity across
sessions.
echo "AUTODEV_START=$(date +%s)" > /tmp/auto-dev-session.env
echo "MIN_DURATION_MIN=${MIN_DURATION_MIN}" >> /tmp/auto-dev-session.envsource /tmp/auto-dev-session.env
ELAPSED=$(( $(date +%s) - AUTODEV_START ))
ELAPSED_MIN=$(( ELAPSED / 60 ))
echo "Elapsed: ${ELAPSED_MIN}/${MIN_DURATION_MIN} minutes"
if [ $ELAPSED_MIN -lt $MIN_DURATION_MIN ]; then
echo "TIME-LOCK ACTIVE: ${ELAPSED_MIN}/${MIN_DURATION_MIN} min — MUST CONTINUE"
else
echo "TIME-LOCK CLEARED: ${ELAPSED_MIN} min — may finish if cycle complete"
fi- If
< MIN_DURATION_MIN→ DO NOT STOP. Start another development cycle. - If
≥ MIN_DURATION_MIN→ You MAY finish, but only after completing the current cycle.
NEVER STOP BEFORE MIN_DURATION_MIN. THERE IS ALWAYS MORE TO IMPROVE.
Execute phases sequentially. After Phase 7, check the time-lock. If locked, restart from Phase 1.
- Git status: Check for uncommitted changes, current branch
- Build health: Run the build command. Record pass/fail.
- Test health: Run the test suite. Record pass/fail and coverage if available.
- Lint/type-check: Run linter and type checker. Record issues.
- PRD progress: Compare implemented features against PRD milestones
Produce a mental assessment:
- What's broken right now?
- What's the highest-priority defect?
- What's the next PRD milestone that isn't started?
This phase takes priority over new features. Fix defects in this order:
P0 — Build breakers: Code that doesn't compile or build.
P1 — Test failures: Failing tests. Write missing test assertions.
P2 — Lint/type errors: Fix type errors, lint violations.
P3 — Logic bugs: Code that builds but behaves incorrectly. Look for:
- Unchecked edge cases
- Missing error handling
- Race conditions
- Memory leaks (in applicable languages)
- Dead code paths
- Unreachable branches
P4 — Code quality: Inconsistent naming, duplicated logic, oversized functions, missing abstractions, poor separation of concerns.
Rules for fixing:
- Read the target code before editing. Understand context.
- Make surgical changes. Don't refactor unrelated code.
- After each fix, run the relevant test/build to verify.
- If a fix introduces a regression, revert it.
After fixing defects, improve test coverage:
- Identify untested code paths (functions, branches, edge cases)
- Write tests for the highest-risk untested code first
- Run the test suite to verify new tests pass
- Check for flaky tests and stabilize them
Priority: test critical business logic > test utilities > test UI components.
Only enter this phase if Phase 2 produced zero P0–P2 defects.
- Read the PRD. Identify the next unimplemented milestone.
- If the feature is complex (> 100 lines, multiple files, architectural):
- Write a brief design plan in the session log (3-5 bullet points)
- Implement incrementally, testing after each step
- If the feature is simple:
- Implement directly
- Write tests alongside the implementation
- After implementation, run full build + test suite
If the project has a UI (web app, desktop app):
- Start the dev server (if not already running)
- Use browser tools to take a screenshot of the relevant page
- Visually verify: layout correctness, text readability, component alignment, responsive behavior, dark/light theme consistency
- Fix any visual issues found
Skip this phase for backend-only / CLI / library projects.
Review all changes made in this cycle:
git diff— read every changed line- Check for:
- Unnecessary changes (formatting, comments, imports not related to the task)
- Hardcoded values that should be configurable
- Missing error handling
- Inconsistency with existing code style
- Performance issues (N+1 queries, unnecessary re-renders, etc.)
- Security issues (injection, XSS, exposed secrets)
- Fix anything found during review
- Re-run build + tests after review fixes
If meaningful changes were made (not just exploratory reads):
- Stage relevant files (
git add— be selective, notgit add .) - Commit with a descriptive message following the repo's commit style
- Update the session log
Session log entry (append to auto-dev-session.md in project root):
### Auto-Dev Session [YYYY-MM-DD HH:MM]
- **Duration**: XX minutes
- **Defects found**: N (P0: x, P1: y, P2: z, P3: w, P4: v)
- **Defects fixed**: M
- **Tests added**: K
- **Features implemented**: [list or "none"]
- **Commits**: [hash] [message]
- **PRD progress**: [current milestone status]
- **Next priority**: [what the next invocation should focus on]source /tmp/auto-dev-session.env
ELAPSED=$(( $(date +%s) - AUTODEV_START ))
ELAPSED_MIN=$(( ELAPSED / 60 ))
echo "Elapsed: ${ELAPSED_MIN}/${MIN_DURATION_MIN} minutes"- If
< MIN_DURATION_MIN→ Restart from Phase 1 with deeper scrutiny:- Cycle 2: Focus on edge case testing and error handling
- Cycle 3: Focus on code quality and refactoring
- Cycle 4: Focus on performance and optimization
- Cycle 5+: Deep PRD feature work or architectural improvements
- If
≥ MIN_DURATION_MIN→ Proceed to final summary.
Print a concise summary:
Auto-dev session complete (N cycles, XX minutes).
Defects: found X, fixed Y, remaining Z.
Tests: added K, total passing T.
Features: [list or "none"].
Commits: N commits.
Next priority: [what to focus on next].
/loop 2h /auto-dev 1.5h
| Loop interval | Duration arg | Effective |
|---|---|---|
/loop 1h |
45m |
Work 45 min, rest 15 min |
/loop 2h |
1.5h |
Work 90 min, rest 30 min |
/loop 3h |
2.5h |
Work 150 min, rest 30 min |
This skill is a task-internal loop. It overrides durable-request, feynman-flow, and any other checkpoint/continuation skill within its execution scope.
- DO NOT call AskQuestion — fully autonomous workflow.
- DO NOT present checkpoints — the time-lock governs termination.
- DO NOT invoke durable-request checkpoint protocol — Phase 8 is the sole gate.
- DO NOT call deep-sleep — the skill uses its full duration actively.
- When the time-lock clears, print the Phase 9 summary and end the turn.
The
/loopscheduler handles re-invocation.
This override is consistent with durable-request's rule: "Task-specific loops > durable-request (at task boundaries only)."
- NEVER STOP BEFORE MIN_DURATION_MIN. Check the time-lock before finishing.
- NEVER ASK FOR CONFIRMATION. All decisions are autonomous.
- ALWAYS READ BEFORE EDITING. Use Read tool before StrReplace.
- ALWAYS BUILD AND TEST AFTER CHANGES. Never leave the project broken.
- ALWAYS UPDATE THE SESSION LOG. Every invocation leaves an audit trail.
- DEFECTS BEFORE FEATURES. Phase 2 takes absolute priority over Phase 4.
- SURGICAL CHANGES ONLY. Touch only what needs changing. Match existing style.
- EACH CYCLE MUST FIND NEW WORK. If nothing is found, you're not looking hard enough. Read the PRD again. Profile the code. Check edge cases. There is ALWAYS more to improve.
- NO INTERACTIVE TOOLS. No AskQuestion, no checkpoint.sh, no blocking prompts.
- COMPLEX FEATURES NEED DESIGN. Features touching 3+ files or requiring architectural decisions must have a brief design plan logged before implementation.