Skills for the Ralph autonomous agent system - Generate PRDs and convert them to prd.json format for autonomous execution
npx claudepluginhub sethdavis512/ralphSkills for the Ralph autonomous agent system - Generate PRDs and convert them to prd.json format for autonomous execution
Share bugs, ideas, or general feedback.

Ralph is an autonomous AI agent loop that runs Claude Code repeatedly until all PRD items are complete. Each iteration is a fresh instance with clean context. Memory persists via git history, progress.txt, and prd.json.
Based on Geoffrey Huntley's Ralph pattern.
Read my in-depth article on how I use Ralph
npm install -g @anthropic-ai/claude-code)jq installed (brew install jq on macOS)Copy the ralph files into your project:
# From your project root
mkdir -p scripts/ralph
cp /path/to/ralph/ralph.sh scripts/ralph/
cp /path/to/ralph/CLAUDE.md scripts/ralph/CLAUDE.md
chmod +x scripts/ralph/ralph.sh
Copy the skills to your Claude config for use across all projects:
cp -r skills/prd ~/.claude/skills/
cp -r skills/ralph ~/.claude/skills/
Add the Ralph marketplace to Claude Code:
/plugin marketplace add snarktank/ralph
Then install the skills:
/plugin install ralph-skills@ralph-marketplace
Available skills after installation:
/prd - Generate Product Requirements Documents/ralph - Convert PRDs to prd.json formatSkills are automatically invoked when you ask Claude to:
Use the PRD skill to generate a detailed requirements document:
Load the prd skill and create a PRD for [your feature description]
Answer the clarifying questions. The skill saves output to tasks/prd-[feature-name].md.
Use the Ralph skill to convert the markdown PRD to JSON:
Load the ralph skill and convert tasks/prd-[feature-name].md to prd.json
This creates prd.json with user stories structured for autonomous execution.
./scripts/ralph/ralph.sh [max_iterations]
Default is 10 iterations.
Ralph will:
branchName)passes: falseprd.json to mark story as passes: trueprogress.txt| File | Purpose |
|---|---|
ralph.sh | The bash loop that spawns fresh Claude Code instances |
CLAUDE.md | Prompt template given to each Claude Code instance |
prd.json | User stories with passes status (the task list) |
prd.json.example | Example PRD format for reference |
progress.txt | Append-only learnings for future iterations |
skills/prd/ | Skill for generating PRDs |
skills/ralph/ | Skill for converting PRDs to JSON |
.claude-plugin/ | Plugin manifest for Claude Code marketplace discovery |
flowchart/ | Interactive visualization of how Ralph works |
View Interactive Flowchart - Click through to see each step with animations.
The flowchart/ directory contains the source code. To run locally:
cd flowchart
npm install
npm run dev
Each iteration spawns a new Claude Code instance with clean context. The only memory between iterations is:
progress.txt (learnings and context)prd.json (which stories are done)Each PRD item should be small enough to complete in one context window. If a task is too big, the LLM runs out of context before finishing and produces poor code.
Right-sized stories:
Too big (split these):
After each iteration, Ralph updates the relevant AGENTS.md files with learnings. This is key because AI coding tools automatically read these files, so future iterations (and future human developers) benefit from discovered patterns, gotchas, and conventions.
Examples of what to add to AGENTS.md: