A CLI tool for PRD-driven AI development workflows. Uses Claude Code to execute tasks from a PRD file or generate new PRDs through interactive conversation.
Based on Anthropic's harness pattern for long-running agents.
- Claude Code CLI installed and available as
claudein PATH - Rust toolchain (for building from source)
- Git (for automatic commits during build loops)
cargo build --release
# Binary will be at target/release/ralphOr install directly:
cargo install --path .Runs an iterative loop where Claude Code works through tasks in a PRD file.
ralph build [OPTIONS]
Options:
-p, --prd-path <PATH> Path to PRD JSON file [default: plans/prd.json]
-l, --max-loops <N> Maximum iterations to run [default: unlimited]Example:
ralph build --prd-path plans/prd.json --max-loops 10What happens:
- Loads PRD and any previously completed tasks
- Invokes Claude Code with a prompt referencing the PRD
- Claude works on the highest priority incomplete task
- Claude runs quality gates, updates progress, commits changes
- Repeats until all tasks complete or max loops reached
TUI Controls:
q/Q— Queue stop after current loop finishesr/R— Resume (cancel queued stop)Ctrl+C— Kill Claude immediately←/→— Navigate between iteration logs↑/↓/PgUp/PgDn— Scroll current log
Interactive multi-turn conversation to generate a new PRD file.
ralph plan [OPTIONS]
Options:
-o, --output <PATH> Output path for PRD [default: plans/prd.json]
-r, --resume Resume an interrupted session
-f, --force Force overwrite existing files
-d, --description <TEXT> Initial description of what to buildExample:
ralph plan --output plans/prd.json --description "A CLI tool for managing bookmarks"{
"name": "Project Name",
"quality_gates": [
"cargo check",
"cargo test",
"cargo clippy -- -D warnings"
],
"tasks": [
{
"category": "functional",
"description": "Brief description of the feature",
"steps": [
"Step 1",
"Step 2",
"Step 3"
],
"passes": false
}
]
}Fields:
name— Project identifierquality_gates— Commands Claude runs to verify changes (tests, lints, etc.)tasks[]— Array of tasks to completecategory— Task type (e.g., "functional", "refactor", "bugfix")description— What needs to be donesteps— Verification steps or acceptance criteriapasses— Whether the task is complete (true/false)
When running ralph build:
| File | Purpose |
|---|---|
plans/prd.json |
PRD with tasks (default path) |
plans/completed.json |
Auto-generated log of completed tasks |
progress.txt |
Running progress notes (same dir as PRD) |
cargo check # Type check
cargo test # Run tests
cargo clippy # Lint
cargo fmt # Format