Ralph maintains a persistent loop to execute tasks from a prd.json file, monitoring progress, retrying failures, and requiring reviewer sign-off.
Install
mkdir -p .claude/skills/ralph && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2208" && unzip -o skill.zip -d .claude/skills/ralph && rm skill.zipInstalls to .claude/skills/ralph
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Self-referential loop until task completion with configurable verification reviewerKey capabilities
- →Tracks user stories in prd.json
- →Enforces mandatory reviewer sign-off
- →Automates retries for failed implementation steps
- →Persists state across multiple work iterations
- →Updates progress tracking in progress.txt
How it works
It runs a recursive feedback loop that compares current code state against a PRD checklist, forcing continuous iteration until all tests pass.
Inputs & outputs
When to use ralph
- →Executing long-running coding tasks with complex dependencies
- →Ensuring all user stories in a PRD are fully implemented and tested
- →Automating multi-iteration development work with mandatory verification
- →Recovering from partial implementations by forcing persistence until completion
About this skill
[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
<Purpose> Ralph is a PRD-driven persistence loop that keeps working on a task until ALL user stories in prd.json have passes: true and are reviewer-verified. It wraps ultrawork's parallel execution with session persistence, automatic retry on failure, structured story tracking, and mandatory verification before completion. </Purpose><Use_When>
- Task requires guaranteed completion with verification (not just "do your best")
- User says "ralph", "don't stop", "must complete", "finish this", or "keep going until done"
- Work may span multiple iterations and needs persistence across retries
- Task benefits from structured PRD-driven execution with reviewer sign-off </Use_When>
<Do_Not_Use_When>
- User wants a full autonomous pipeline from idea to code -- use
autopilotinstead - User wants to explore or plan before committing -- use
planskill instead - User wants a quick one-shot fix -- delegate directly to an executor agent
- User wants manual control over completion -- use
ultraworkdirectly - User already has an active Claude Code
/goaland only wants that native goal loop monitored -- adopt the existing/goalexplicitly or use artifact-only Ultragoal notes instead of starting Ralph as a competing persistence loop </Do_Not_Use_When>
<Why_This_Exists> Complex tasks often fail silently: partial implementations get declared "done", tests get skipped, edge cases get forgotten. Ralph prevents this by:
- Structuring work into discrete user stories with testable acceptance criteria (prd.json)
- Iterating story-by-story until each one passes
- Tracking progress and learnings across iterations (progress.txt)
- Requiring fresh reviewer verification against specific acceptance criteria before completion </Why_This_Exists>
<PRD_Mode>
By default, ralph operates in PRD mode. A scaffold prd.json is auto-generated when ralph starts if none exists. Active transient PRD state is session-scoped at .omc/state/sessions/{sessionId}/prd.json when a session ID is available; legacy project-level prd.json / .omc/prd.json files are read as startup migration inputs.
Startup gate: Ralph always initializes and validates prd.json at startup. Legacy --no-prd text is sanitized from the prompt for backward compatibility, but it no longer bypasses PRD creation or validation.
Deslop opt-out: If {{PROMPT}} contains --no-deslop, skip the mandatory post-review deslop pass entirely. Use this only when the cleanup pass is intentionally out of scope for the run.
Reviewer selection: Pass --critic=architect, --critic=critic, or --critic=codex in the Ralph prompt to choose the completion reviewer for that run. architect remains the default.
</PRD_Mode>
<Execution_Policy>
- Fire independent agent calls simultaneously -- never wait sequentially for independent work
- Use
run_in_background: truefor long operations (installs, builds, test suites) - Always pass the
modelparameter explicitly when delegating to agents - Read
docs/shared/agent-tiers.mdbefore first delegation to select correct agent tiers - Deliver the full implementation: no scope reduction, no partial completion, no deleting tests to make them pass
- If a Claude Code
/goalis mentioned, treat it as a native session-loop handoff/evidence source only and use the deterministic conflict policiesrefuse,adopt_existing, andartifact_onlyrather than non-deterministic warning handling. Ralph remains the OMC loop authority for this run; do not claim/goalindependently ran tests or read files, and do not treat evaluator success as a substitute for Ralph reviewer verification. </Execution_Policy>
-
Pick next story: Read the active PRD file and select the highest-priority story with
passes: false. This is your current focus. -
Implement the current story:
- Delegate to specialist agents at appropriate tiers:
- Simple lookups: LOW tier (Haiku) -- "What does this function return?"
- Standard work: MEDIUM tier (Sonnet) -- "Add error handling to this module"
- Complex analysis: HIGH tier (Opus) -- "Debug this race condition"
- If during implementation you discover sub-tasks, add them as new stories to the active PRD file
- Run long operations in background: Builds, installs, test suites use
run_in_background: true
- Delegate to specialist agents at appropriate tiers:
-
Verify the current story's acceptance criteria: a. For EACH acceptance criterion in the story, verify it is met with fresh evidence b. Run relevant checks (test, build, lint, typecheck) and read the output c. If any criterion is NOT met, continue working -- do NOT mark the story as complete
-
Mark story complete: a. When ALL acceptance criteria are verified, set
passes: truefor this story in the active PRD file b. Record progress inprogress.txt: what was implemented, files changed, learnings for future iterations c. Add any discovered codebase patterns toprogress.txt -
Check PRD completion: a. Read the active PRD file -- are ALL stories marked
passes: true? b. If NOT all complete, loop back to Step 2 (pick next story) c. If ALL complete, proceed to Step 7 (architect verification) -
Reviewer verification (tiered, against acceptance criteria):
- <5 files, <100 lines with full tests: STANDARD tier minimum (architect-medium / Sonnet)
- Standard changes: STANDARD tier (architect-medium / Sonnet)
-
20 files or security/architectural changes: THOROUGH tier (architect / Opus)
- If
--critic=critic, use the Claudecriticagent for the approval pass - If
--critic=codex, runomc ask codex --agent-prompt critic "..."for the approval pass. The Codex critic prompt MUST include:- The full list of acceptance criteria from prd.json for verification
- A directive to evaluate whether the implementation is OPTIMAL — not just correct, but whether there exists a meaningfully better approach (simpler, faster, more maintainable) that the implementation missed
- A directive to review all code related to the changes (callers, callees, shared types, adjacent modules), not only the files directly modified
- The list of files changed during the ralph session for context
- Ralph floor: always at least STANDARD, even for small changes
- The selected reviewer verifies against the SPECIFIC acceptance criteria from prd.json, not vague "is it done?"
- On APPROVAL: immediately proceed to Step 7.5 in the same turn. Do NOT pause to report the verdict to the user — reporting happens only at Step 8 (
/oh-my-claudecode:cancel) or on rejection (Step 9). Treating an approved verdict as a reporting checkpoint is a polite-stop anti-pattern.
7.5 Mandatory Deslop Pass (runs unconditionally after Step 7 approval, unless {{PROMPT}} contains --no-deslop):
-
Invoke the
ai-slop-cleanerskill via the Skill tool:Skill("ai-slop-cleaner"). Run in standard mode (not--review) on the files changed during the current Ralph session only. -
ai-slop-cleaner is a SKILL, not an agent. Do NOT call it via
Task(subagent_type="oh-my-claudecode:ai-slop-cleaner")— that subagent type does not exist and the call will fail with "Agent type not found". If you see that error, retry with the Skill tool — do NOT substitute a similarly-named agent likecode-simplifieras a "closest match". -
Keep the scope bounded to the Ralph changed-file set; do not broaden the cleanup pass to unrelated files.
-
If the reviewer approved the implementation but the deslop pass introduces follow-up edits, keep those edits inside the same changed-file scope before proceeding.
7.6 Regression Re-verification:
-
After the deslop pass, re-run all relevant tests, build, and lint checks for the Ralph session.
-
Read the output and confirm the post-deslop regression run actually passes.
-
If regression fails, roll back the cleaner changes or fix the regression, then rerun the verification loop until it passes.
-
Only proceed to completion after the post-deslop regression r
Content truncated.
When not to use it
- →Single-shot tasks requiring no follow-up
- →Exploratory research or planning phases
- →When full autonomous agent control is preferred
Limitations
- →Requires a defined prd.json for optimal performance
- →Can get stuck in loops if verification criteria are vague
How it compares
It prevents 'false completion' by enforcing a mandatory verification step that the agent cannot override.
Compared to similar skills
ralph side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| ralph (this skill) | 17 | 2mo | No flags | Intermediate |
| develop-ai-functions-example | 5 | 6mo | Review | Intermediate |
| adk-engineer | 3 | 27d | Review | Advanced |
| async-repl-protocol | 1 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Yeachan-Heo
View all by Yeachan-Heo →You might also like
develop-ai-functions-example
vercel
Develop examples for AI SDK functions. Use when creating, running, or modifying examples under examples/ai-functions/src to validate provider support, demonstrate features, or create test fixtures.
adk-engineer
jeremylongshore
Execute software engineer specializing in creating production-ready ADK agents with best practices, code structure, testing, and deployment automation. Use when asked to "build ADK agent", "create agent code", or "engineer ADK application". Trigger with relevant phrases based on skill purpose.
async-repl-protocol
parcadei
Async REPL Protocol
apex
zuzu59
Systematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with parallel agents, self-validation, and optional adversarial review. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
skill-creator
anthropics
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
vitest
antfu
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.