Autonomous Claude CLI orchestrator — solo iteration or parallel agents in waves, driven by PRDs
Project description
Army of Ralph
Autonomous Claude CLI orchestrator. Runs Claude agents in two modes — solo (one task per iteration) and army (parallel agents in sequential waves with verification) — driven by PRD files. Point it at one PRD or a whole directory of them.
Install
pip install army-of-ralph # PyPI
brew install codeblackwell/tap/ralph # Homebrew
Both install the ralph command. Requires Python 3.10+ and the claude CLI on your PATH.
Quick Start
ralph init my-feature # scaffold a PRD dir from templates
ralph install-skill # add the /prd skill to ~/.claude/skills (optional)
ralph my-feature # run one PRD — mode auto-detected
ralph my-feature 20 # solo, max 20 iterations
ralph my-feature --army # force army mode
ralph PRDs # a parent of PRD dirs — run each in name order
ralph <path> is shorthand for ralph run <path>, and run figures out what the path is: a single PRD (it has a PRD.md) or a parent of PRD dirs (it holds subdirs that do). Mode is auto-detected per PRD too: a directory with an agents/ subdir runs in army mode, otherwise solo. --army forces it on.
Commands
| Command | What it does |
|---|---|
ralph run <path> |
Run a PRD, or a parent of PRD dirs (auto-detected). run is optional |
ralph watch <path> |
Live read-only dashboard for a run (auto-started by run) |
ralph init <name> |
Scaffold a new PRD directory (--army adds agents/ + progress/) |
ralph install-skill |
Install the /prd generator skill into ~/.claude/skills |
ralph uninstall-skill |
Remove the /prd skill from ~/.claude/skills |
Targeting One PRD or All of Them
A PRD lives in its own directory (PRD.md plus, for army mode, agents/ and progress/). You organize features as sibling subdirs:
PRDs/
├── 01-schema/ PRD.md → solo
├── 02-auth/ PRD.md + agents/ → army
└── 03-dashboard/ PRD.md + agents/ → army
- One PRD:
ralph PRDs/02-authruns just that directory. - All PRDs:
ralph PRDs(pointing at the parent) discovers every*/PRD.md, runs them in name order (so number your dirs), and stops if one fails. Each subdir's mode is auto-detected, and the dashboard follows the active PRD.
Multi-PRD flags: --continue-on-fail keeps going past a failure, --resume skips PRDs that are already fully complete, and --only 02,04 runs just the dirs whose names contain those tokens.
Modes
Solo
Finds the first unchecked [ ] task in PRD.md, implements it, marks it [x], commits, repeats — one task per iteration until the PRD is done or max_iterations is hit.
Army
Reads wave assignments from the PRD, launches agents in parallel per wave, gates between waves, and verifies completion.
┌─────────┐ gate ┌─────────┐ gate ┌─────────┐
│ Wave 0 │ ──────► │ Wave 1 │ ──────► │ Wave 2 │
│Foundation│ │ Parallel │ │ Parallel │
└─────────┘ └─────────┘ └─────────┘
Domain isolation — each agent owns specific file paths, so parallel agents never conflict.
Wave gating — gate commands (typecheck, tests) run between waves; a failed gate re-launches the wave's agents with error context (up to 3 retries). Define waves in the PRD:
WAVE_0_AGENTS=("foundation")
WAVE_0_GATE="cd my-project && npm run typecheck"
WAVE_1_AGENTS=("auth" "profile" "dashboard")
WAVE_1_GATE="cd my-project && npm run typecheck && npm test"
Three-layer completion — prevents an agent from falsely claiming "done":
| Layer | Tag | Who writes it |
|---|---|---|
| Promise | <promise>COMPLETE</promise> |
Templates only (never triggers completion) |
| Delivered | <delivered>COMPLETE</delivered> |
Agent self-reports |
| Verified | <verified>COMPLETE</verified> |
A separate verification Claude confirms it |
Generating PRDs
Run ralph install-skill to install the /prd Claude Code skill, then use /prd to generate PRDs in the right shape for either mode. For hand-authoring, ralph init <name> scaffolds a directory from the bundled templates (in ralph/templates/).
Live Dashboard
ralph run launches the orchestrator under a live, read-only dashboard by default. The agents' output is captured to <dir>/ralph.log while the terminal shows a redrawn-in-place status table: per agent, a progress bar ([x]/total), status (working / verifying / done), and the last line of its log so you can see what it is doing right now.
RALPH WATCH 02-auth refreshed 14:03:22
AGENT PROGRESS STATUS DOING NOW
foundation ██████████ 5/5 done done
auth ██████░░░░ 3/6 working editing app/auth/login.tsx
profile ███░░░░░░░ 1/4 working running typecheck
9/15 tasks · 2 working · 0 verifying · 1 done
read-only · Ctrl-C to exit
When the target is a parent of PRD dirs, the dashboard follows the active PRD with a PRD 2/3 · 02-auth header as each one runs. Ctrl-C stops the run and its agents cleanly. The dashboard is skipped automatically for --json or non-TTY output (CI), and you can opt out with ralph run <dir> --no-watch to stream inline as before. To watch a run happening in another pane (or review a finished one), use ralph watch <dir> directly. It is purely a file reader, so it never affects the run.
Prototype Mode
--prototype turns Ralph into a proof-of-concept builder. It prepends a YAGNI directive to every agent prompt: implement only what the story names, no error handling beyond preventing a crash, no logging/config/caching/validation/abstraction, no tests unless asked, no future-proofing. In army mode it also tells the verifier to reject any work that added features beyond the listed stories, so scope creep fails the gate instead of passing silently.
ralph my-feature --prototype
ralph PRDs --prototype --model haiku
Drop the flag and re-run to harden the prototype into production code later.
Project Structure (army mode)
PRDs/02-auth/
├── PRD.md # spec + wave config
├── agents/<name>-agent.md # one spec per agent (owned paths, stories)
├── progress/progress-<name>.txt # checkbox tracker + completion signal
└── logs/ # auto-created — agent + verify stdout, timing
CLI Reference
ralph run <target> [max_iterations] [sleep] [options] # `run` is optional
ralph watch <target> # live dashboard (read-only)
ralph init <name> [--army]
ralph install-skill [--force]
target a PRD dir/file, or a parent dir holding PRD dirs
max_iterations Max iterations for solo mode (default: 10)
sleep Seconds between iterations (default: 2)
options:
-a, --army Force army mode (otherwise auto-detected from agents/ dir)
-m, --model MODEL Claude model for every agent (e.g. sonnet, opus, haiku);
passed through to `claude --model`
--prototype Proof-of-concept mode: build the bare minimum, no extras (YAGNI)
--no-watch Stream inline instead of using the live dashboard
-q, --quiet Suppress the Claude output stream and per-iteration banners
--json Emit a JSON summary on stdout (human text goes to stderr)
--no-color Disable ANSI color (also honors NO_COLOR / non-TTY)
multi-PRD options (apply when the target is a parent of PRD dirs):
--continue-on-fail Keep going after a PRD fails instead of stopping
--only TOKENS Comma-separated name tokens; run only matching PRD dirs
--resume Skip PRD dirs that are already fully complete
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file army_of_ralph-0.3.0.tar.gz.
File metadata
- Download URL: army_of_ralph-0.3.0.tar.gz
- Upload date:
- Size: 33.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4819ef520058f957e27c56beaf77f4d84f472d3373e336c7e254b0dbb068a6d7
|
|
| MD5 |
46523910dfec9d12722ce7933b1f6a39
|
|
| BLAKE2b-256 |
d8d05e098626cfff7f25d4a01ad20164652d0b44bd12641a846d6ccc22197332
|
Provenance
The following attestation bundles were made for army_of_ralph-0.3.0.tar.gz:
Publisher:
release.yml on CodeBlackwell/army-of-ralph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
army_of_ralph-0.3.0.tar.gz -
Subject digest:
4819ef520058f957e27c56beaf77f4d84f472d3373e336c7e254b0dbb068a6d7 - Sigstore transparency entry: 1956585596
- Sigstore integration time:
-
Permalink:
CodeBlackwell/army-of-ralph@ed743ef876d16b592204969c6516e73b87adfe6d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/CodeBlackwell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ed743ef876d16b592204969c6516e73b87adfe6d -
Trigger Event:
push
-
Statement type:
File details
Details for the file army_of_ralph-0.3.0-py3-none-any.whl.
File metadata
- Download URL: army_of_ralph-0.3.0-py3-none-any.whl
- Upload date:
- Size: 37.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40ce9b8d8e016368043b4e2a3af3dbcc01e8be371392ac250f3e309afbdae369
|
|
| MD5 |
c01b3c1b189fbaf57203a416c5dd821e
|
|
| BLAKE2b-256 |
6be17e79cdc86527b017b804800c2bef4f784b9dfa0307a06584ab3a092f4053
|
Provenance
The following attestation bundles were made for army_of_ralph-0.3.0-py3-none-any.whl:
Publisher:
release.yml on CodeBlackwell/army-of-ralph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
army_of_ralph-0.3.0-py3-none-any.whl -
Subject digest:
40ce9b8d8e016368043b4e2a3af3dbcc01e8be371392ac250f3e309afbdae369 - Sigstore transparency entry: 1956585727
- Sigstore integration time:
-
Permalink:
CodeBlackwell/army-of-ralph@ed743ef876d16b592204969c6516e73b87adfe6d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/CodeBlackwell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ed743ef876d16b592204969c6516e73b87adfe6d -
Trigger Event:
push
-
Statement type: