Ralph loop engine with planner, coder, and reviewer for autonomous feature implementation.
/ralph.planner (interactive)
|
Phase 1: product vision
Phase 2: design
Phase 3: tech stack
Phase 4: risks & testing
Phase 5: synthesis
|
draft brainstorm.md + spec.md
review with user
generate stories + tasks
commit artifacts
|
done
%> pnpm loop (autonomous)
|
read state (spec, brainstorm, progress.json)
find next story + task
dispatch coder or reviewer
update progress.json
commit & end iteration
|
↻ until all stories COMPLETE
/ralph.planner— Brainstorm with user, generate spec, stories, tasks, and progress.jsonpnpm loop— Bash loop that pipes a prompt toclaudeper iteration (up to 100 iterations)ralph.coder— TDD implementation, one task per iterationralph.reviewer— QA (live server), code quality, security, design review
# Step 1: Plan the feature interactively
/ralph.planner
# Step 2: Run autonomous implementation
pnpm loop
# Or run a single iteration (full output visible)
pnpm loop:onceralph-engine/
ralph-loop.sh # headless bash loop (up to 100 iterations)
ralph-once.sh # interactive single iteration
ralph-prompt.md # self-dispatching prompt with decision logic
ralph-format.sh # formats streaming JSON output
ralph-workspace/ # generated by planner, consumed by loop
spec.md # feature spec (goals, non-goals, tech stack)
brainstorm.md # design rationale and architecture decisions
progress.json # global state (stories, tasks, statuses)
known-issues.md # tasks that exceeded retry caps
logs/ # iteration output logs
001-{userstory}/
story.md # user story description, acceptance criteria
tasks.md # task breakdown
log.md # coder/reviewer/QA detailed log (append-only)
.claude/skills/
ralph.planner/ # interactive brainstorming PM (5 phases)
ralph.coder/ # TDD implementation teammate
ralph.reviewer/ # QA/review teammate (7 verification steps)
- superpowers — brainstorming, planning, execution workflows
- gstack — headless browser QA, CEO/eng plan reviews
- context7 — library documentation lookup
- frontend-design — production-grade UI generation
Phase 1: Product Vision
- Problem definition, affected surfaces (webapp, Slack, CLI, etc.)
- User stories per surface, concrete demo scenario, non-goals
Phase 2: Design
- Visual direction and interaction patterns per surface
- Interaction state matrix (loading, empty, error, success, partial)
- AI slop check — challenge generic patterns, push for specificity
- Edge cases per screen/interaction
Phase 3: Technical Foundation
- Tech stack per surface (verified via Context7 docs)
- Architecture and data model (cross-surface integration)
- Environment setup (API keys, OAuth, env vars, external services)
Phase 4: Risk & Test Strategy
- Risks with likelihood, impact, and mitigation
- Test strategy per surface (TDD, browser QA, integration)
- Acceptance criteria sharpening — every criterion must be objectively verifiable
Phase 5: Synthesis & Context
- Draft brainstorm.md (design rationale from all phases)
- Draft spec.md (goals, design, non-goals, tech, risks)
- Section-by-section review with user
- Write spec.md + brainstorm.md to disk
- Generate story.md per user story
- Generate tasks.md per user story (each task = one coder iteration)
- Generate progress.json (all statuses start as
pending) - Subagent spec review (TODOs, contradictions, vague criteria)
- Update CLAUDE.md if new conventions emerged
- Commit all artifacts to git
- Read
progress.jsonto find current work - Dispatch coder or reviewer based on task status
- Coder: pre-flight checks, TDD (fail → implement → pass → commit), self-validate, write to log.md
- Reviewer: 7 sequential steps — tests, lint/typecheck/build, live server QA, code quality, security, design, spec alignment
- If issues: coder fixes, reviewer reviews again (max 5 rounds per task)
- After all tasks pass: QA validates full story
- Stuck tasks (5+ rounds) recorded in known-issues.md
- Repeat until all stories complete
MIT