Skip to main content

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.

Claude Code Plugin

The repo is also a Claude Code plugin marketplace — no pip install needed:

/plugin marketplace add CodeBlackwell/army-of-ralph
/plugin install army-of-ralph@army-of-ralph

You get two skills:

  • /prd — the same PRD generator that ralph install-skill copies to ~/.claude/skills (if you installed that copy, run ralph uninstall-skill to avoid shadowing).
  • /army <PRD dir> — runs an Army PRD inside your Claude Code session via the Workflow tool: parallel agents per wave, per-agent verification, gated retries. Watch live with /workflows. Flags: --dry-run, --only a,b, --resume <runId>, --model <name>, --prototype.

Plugin /army vs the ralph CLI: same PRD format, either runs it. Use /army for in-session/interactive runs; use the CLI for terminal/CI runs, solo mode, and multi-PRD campaigns.

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-auth runs 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

Per-Agent Models (army mode)

An agent spec may declare its own model in the Identity block:

## Identity
- **Name**: ui-agent
- **Model**: opus

That agent (and its verifier) runs with claude --model opus; agents without the field use the claude default. Tier by lane difficulty: cheap models for mechanical scaffolding, strong models for judgment-heavy or streaming/async lanes. A CLI -m/--model overrides the field for every agent — one flag to force a uniform run.

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`. Overrides per-agent
                      '- **Model**:' fields in agent specs
  --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

Contributing

The canonical /prd skill is ralph/skills/prd-SKILL.md (shipped in the wheel). After editing it, copy to the plugin location: cp ralph/skills/prd-SKILL.md skills/prd/SKILL.md. Keep version in pyproject.toml and .claude-plugin/plugin.json in sync. The release workflow's sanity job enforces both.

License

MIT

Metadata

Release files for army-of-ralph 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for army-of-ralph 0.6.0
File Size Uploaded Provenance
army_of_ralph-0.6.0.tar.gz 39.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for army-of-ralph 0.6.0
File Interpreter ABI Platform
army_of_ralph-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.2 kB

Release files / army_of_ralph-0.6.0.tar.gz

Download URL army_of_ralph-0.6.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9aaa35f451ebfafd841de59b177e6a17cba913b81e5fd9d72e7b2a038b58b1cd
BLAKE2b-256 checksum
How to use checksums
2d3d7872f707a50954915eae0a21cb322a61865540f398ca6b676bea25f6ede2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / army_of_ralph-0.6.0-py3-none-any.whl

Download URL army_of_ralph-0.6.0-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5764653bc70ac3014eff4c9eaafcec18dbf9c122a871ac6ca6a6aa0f8dcf6c5
BLAKE2b-256 checksum
How to use checksums
a690a780f6df13a9c13410a6d571591256698fb51ee77502474b5cd84af3389a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Security for army-of-ralph 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for army_of_ralph-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page