Autonomous iteration execution guide for PRP Ralph loops. Use when .claude/prp-ralph.state.md exists, when continuing Ralph iterations, or when executing plans autonomously until all validations pass. Provides iteration behavior, completion protocol, validation requirements, and progress logging.
View on GitHubWirasm/PRPs-agentic-eng
prp-core
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/Wirasm/PRPs-agentic-eng/blob/main/plugins/prp-core/skills/prp-ralph-loop/SKILL.md -a claude-code --skill prp-ralph-loopInstallation paths:
.claude/skills/prp-ralph-loop/# PRP Ralph Loop Execution Guide This skill provides the knowledge needed to correctly execute Ralph loop iterations. Ralph is an autonomous loop system that executes PRP plans iteratively until all tasks are complete and all validations pass. --- ## 1. Context Detection ### How to Know You're in a Ralph Loop Check for the state file: `.claude/prp-ralph.state.md` If this file exists, you are in an active Ralph loop. Read it first to understand: - Current iteration number - Maximum iterations allowed - Path to the plan being executed - Progress from previous iterations ### State File Location ``` .claude/prp-ralph.state.md ``` --- ## 2. State File Format The state file uses YAML frontmatter followed by a progress log: ```markdown --- iteration: 3 max_iterations: 10 plan_path: ".claude/PRPs/plans/add-feature.md" started_at: "2024-01-12T10:00:00Z" --- # Ralph Progress Log ## Codebase Patterns [Consolidated learnings that apply across iterations] ## Iteration 1 - 2024-01-12T10:05:00Z - Implemented X - Files changed: a.ts, b.ts - Learnings: Found that Y pattern is used for Z - Still failing: type-check (3 errors) ## Iteration 2 - 2024-01-12T10:15:00Z - Fixed type errors - Added missing imports - Learnings: Always import types from @/types - Still failing: tests (1 failure in auth.test.ts) --- ``` ### Frontmatter Fields | Field | Type | Description | |-------|------|-------------| | `iteration` | number | Current iteration (1-indexed) | | `max_iterations` | number | Maximum allowed iterations (0 = unlimited) | | `plan_path` | string | Path to the plan file being executed | | `started_at` | string | ISO timestamp when loop started | --- ## 3. Iteration Behavior Protocol ### Each Iteration Must Follow This Sequence #### Step 1: Read Context 1. Read the state file to understand current iteration and history 2. Read the plan file (from `plan_path`) to understand all tasks 3. Check the "Codebase Patterns" section for learnings from previous iterations 4.