A CLI that runs Claude in a loop to plan, build, test, and commit — autonomously.
git clone https://github.com/youruser/afk.git
cd afk
just installThis symlinks the afk binary to ~/.local/bin/ and the /prd skill to ~/.claude/skills/. Make sure ~/.local/bin is on your PATH.
To remove: just uninstall
# In a new project, generate specs interactively:
/prd
# Generate the implementation plan:
afk plan
# Start building:
afk
# Scoped work on a feature branch:
git checkout -b afk/feature-name
afk plan-work "add user authentication"
afk| Command | Description |
|---|---|
afk |
Build mode, unlimited iterations |
afk build [N] |
Build mode, optional max iterations |
afk plan [N] |
Planning mode, optional max iterations |
afk plan-work "desc" [N] |
Scoped work on feature branch (default: 5 iterations) |
afk help |
Show usage |
afk version |
Print version |
Options:
--dry-run— Print the resolved prompt without running Claude--mode <mode>— Use "default" or "slc" mode (default: "default")
Each iteration:
- Validates project structure (specs/, IMPLEMENTATION_PLAN.md)
- Resolves the appropriate prompt template
- Pipes the prompt to
claude -p --dangerously-skip-permissions --model opus --verbose - Pushes changes after each iteration
The /prd Claude Code skill walks you through an interactive session to define project requirements. It produces:
specs/*.md— requirement specs with acceptance criteriaAGENTS.md— build/test/lint commands for the loopAUDIENCE_JTBD.md— audience and jobs to be done (SLC mode only)
Two modes:
- Default — Problem -> topics of concern -> specs
- SLC — Audience/JTBD -> activities -> story map -> specs
- Backpressure — Tests/lints/typechecks gate commits. If they fail, AFK fixes before proceeding.
- Acceptance-driven — Specs include acceptance criteria -> planning derives test requirements -> building enforces them.
- Context efficiency — Each loop iteration gets a fresh context window. Specs stay concise to maximize the "smart zone" (40-60% context utilization).
- Plan is disposable — If AFK goes off track, regenerate:
afk plan