Ralph is an iterative AI agent system for implementing features and requirements with automated progress tracking.
Ralph is designed to be used as a git submodule, keeping the tool separate from your project-specific requirements.
project-root/
├── ralph/ # Git submodule (Ralph tool)
│ ├── ralph.sh # Main execution script
│ ├── PROMPT.md # Shared prompt template
│ ├── CLAUDE.md # Developer guidance
│ ├── README.md # This file
│ └── templates/ # Template files
│ ├── 000-sample.md # Example PRD structure
│ └── PRD_PROMPT.md # Template for PRD generation instructions
└── ralph-reference/ # Project-specific requirements (NOT in submodule)
├── 20260114-kickoff/
│ ├── idea.md # Initial rough idea/concept
│ ├── PRD.md # Product Requirements Document
│ ├── progress.md # Progress log with learnings (auto-generated)
│ ├── .run-id # Current run identifier (auto-generated)
│ └── archive/ # Completed/incomplete run archives
└── 20260116-feat-palette-selector-to-footer/
└── PRD.md
# From your project root
git submodule add <ralph-repo-url> ralph
git submodule update --init
# Run the wizard to create your first requirement
./ralph/ralph.shThe ralph-reference/ directory will be automatically created in your project root when you create your first requirement.
Run Ralph without arguments to enter interactive wizard mode:
./ralph/ralph.shThe wizard will guide you through:
- Creating a new requirement or running an existing one
- Visual status indicators show which requirements are completed:
- ✓ Green checkmark = Completed (has completed archive)
- • Cyan dot = In progress or not started
- Summary count shows "X of Y completed" at the top
- For new requirements:
- Enter requirement name (automatically prefixed with date and time)
- Provide idea/description (multi-line, end with Ctrl+D)
- Automatically generate PRD.md using Claude
- Option to run immediately or later
- Choose interactive or auto-continue mode
- For existing requirements:
- Select from available requirements (with completion status)
- Choose interactive or auto-continue mode
You can also run Ralph directly with command-line arguments:
# Run existing requirement (interactive mode)
./ralph/ralph.sh <requirement-folder>
# Run with auto-continue (skip confirmation prompts)
./ralph/ralph.sh <requirement-folder> --yes
# Examples
./ralph/ralph.sh 20260114-kickoff
./ralph/ralph.sh 20260116-feat-palette-selector-to-footer -yInteractive Mode (default):
- Ralph pauses after each iteration
- Prompts to continue, quit, or enable auto-continue
- Press Enter to continue, 'q' to quit, 's' to skip future prompts
- Gives you control over the execution flow
Auto-continue Mode:
- Ralph runs continuously until all tasks are complete
- No confirmation prompts between iterations
- Enable with
--yesor-yflag, or press 's' during interactive mode - Ideal for unattended execution
If you prefer manual setup instead of the wizard:
-
Create a new folder in
ralph-reference/with a descriptive name:mkdir -p ralph-reference/YYYYMMDD-HHMM-feature-name
-
Create an
idea.mdwith your initial concept:echo "# Feature Name\n\nBrief description of what you want to build..." > ralph-reference/YYYYMMDD-HHMM-feature-name/idea.md
-
Generate the
PRD.mdusing Claude or write it manually (Claude will useralph/templates/PRD_PROMPT.mdas instructions) -
Run Ralph for this requirement:
./ralph/ralph.sh YYYYMMDD-HHMM-feature-name
Ralph will automatically:
- Create
progress.mdif it doesn't exist - Track the run with a
.run-idfile - Archive completed/incomplete runs in
archive/
Main script that:
- Provides interactive wizard mode for creating new requirements
- Guides user through requirement name and idea input
- Auto-generates folder structure, idea.md, and PRD.md (using ralph/templates/PRD_PROMPT.md)
- Validates requirement folder exists
- Prepares the prompt with requirement-specific paths
- Runs Claude iteratively until completion (with optional confirmation prompts)
- Shows Claude's output in real-time during each iteration
- Supports interactive mode (with confirmations) or auto-continue mode (--yes flag)
- Archives results on completion or user stop
Shared prompt template used for all requirements. Contains:
- Task instructions for the AI agent (ONE task per iteration)
- Critical rules emphasizing single-task execution
- Progress format guidelines
- Stop condition for completion (only when ALL tasks done)
- Workflow summary for clarity
- Uses
{{PRD_PATH}}and{{PROGRESS_PATH}}placeholders
Initial rough concept or feature description. Used as input for generating PRD.md.
Template containing standard instructions for generating PRD.md files. Documents:
- Instructions for creating PRD from idea.md
- References to sample structure (000-sample.md)
- What to include in the PRD
- Shared across all requirements for consistency
Product Requirements Document generated using ralph/templates/PRD_PROMPT.md. Contains:
- Progress summary with checkboxes
- Overview and goals
- Implementation steps
- Acceptance criteria
- Technical specifications
Progress log created and updated by Ralph with:
- Run ID and timestamp
- Codebase patterns (at the top)
- Dated entries for each implementation step
- Learnings and gotchas discovered
Tracks the current run identifier for the requirement. Deleted on completion.
Contains timestamped snapshots of completed or incomplete runs.
Using the wizard (recommended):
- Launch: Run
./ralph/ralph.shwithout arguments - Select: Choose "Create new requirement"
- Name: Enter descriptive requirement name (auto-prefixed with date and time)
- Ideation: Enter your idea/description (multi-line, Ctrl+D to finish)
- Auto-Generate: Wizard creates folder structure, idea.md, and generates PRD.md with Claude (using ralph/templates/PRD_PROMPT.md)
- Review: Review the generated PRD.md (optional: edit before running)
- Run: Choose to run immediately or later
Or manually:
- Ideation: Create
idea.mdwith rough concept - PRD Generation: Use Claude to generate
PRD.mdfromralph/templates/PRD_PROMPT.mdandidea.md - Review: Review and refine the PRD before implementation
Ralph works in one-task-per-iteration cycles:
- Initialize: Ralph reads the PRD and existing progress
- Select: Picks the first unchecked [ ] task in the PRD
- Implement: Completes ONLY that ONE task (no batching)
- Test: Runs tests and type checks if applicable
- Commit: Creates focused git commit with task ID
- Update: Marks ONLY that task as [x] in PRD
- Document: Appends learnings to progress.md
- Display: Shows Claude's output in real-time for transparency
- Confirm: (Interactive mode) Prompts user before next iteration
- Iterate: Repeats until ALL tasks are complete
- Archive: Saves PRD and progress to timestamped archive folder
Why one task per iteration?
- Enables granular progress tracking
- Allows user review between tasks in interactive mode
- Creates focused, meaningful git commits
- Makes it easy to stop and resume work
- Provides clear visibility into what's being done
Ralph completes when the AI agent outputs:
<promise>COMPLETE</promise>
This should only happen when ALL tasks in the PRD are completed.
Requirement folders should follow the pattern:
YYYYMMDD-HHMM-brief-descriptive-name
Examples:
20260114-0930-kickoff- Initial project setup20260116-1104-feat-palette-selector-to-footer- Add palette selector feature20260120-1530-fix-responsive-mobile- Fix mobile responsiveness
The date and time prefix ensures unique folder names even when multiple features are created on the same day.
- Keep PRDs focused on a single feature or requirement
- Break tasks into small, atomic steps (5-10 minimum)
- Each task should have a clear, testable outcome
- Use
idea.mdfor initial brainstorming before creating the PRD
- Ralph processes ONE task per iteration (by design)
- This creates focused commits and enables granular progress tracking
- Use interactive mode when you want to review each iteration's output
- Use auto-continue mode (
--yes) for unattended execution - Press 's' during interactive mode to dynamically switch to auto-continue
- Watch Claude's real-time output to understand what changes are being made
- Press 'q' to gracefully stop execution and archive progress
- Update progress.md with learnings as you discover patterns
- Archive folders preserve the state at completion/stop
- Check the wizard menu for a quick overview of which requirements are complete
- Green checkmarks indicate requirements with completed archives
- The summary count helps track overall progress across all requirements
- The script runs Claude from the project root for full codebase access
- Each iteration marks exactly ONE checkbox in the PRD
- Completion only triggers when ALL tasks are checked