ralph
Self-referential loop until task completion with architect verification
Install
mkdir -p .claude/skills/ralph && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2208" && unzip -o skill.zip -d .claude/skills/ralph && rm skill.zipInstalls to .claude/skills/ralph
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 </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.
Opt-out: If {{PROMPT}} contains --no-prd, skip PRD generation and work in legacy mode (no story tracking, generic verification). Use this for trivial quick fixes.
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 </Execution_Policy>
-
Pick next story: Read
prd.jsonand select the highest-priority story withpasses: 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
prd.json - 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 inprd.jsonb. 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
prd.json-- are ALL stories markedpasses: 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 - 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?"
7.5 Mandatory Deslop Pass:
- Unless
{{PROMPT}}contains--no-deslop, runoh-my-claudecode:ai-slop-cleanerin standard mode (not--review) on the files changed during the current Ralph session only. - 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 run passes (or
--no-deslopwas explicitly specified).
-
On approval: After Step 7.6 passes (with Step 7.5 completed, or skipped via
--no-deslop), run/oh-my-claudecode:cancelto cleanly exit and clean up all state files -
On rejection: Fix the issues raised, re-verify with the same reviewer, then loop back to check if the story needs to be marked incomplete
</Steps>
<Tool_Usage>
- Use
Task(subagent_type="oh-my-claudecode:architect", ...)for architect verification cross-checks when changes are security-sensitive, architectural, or involve complex multi-system integration - Use
Task(subagent_type="oh-my-claudecode:critic", ...)when--critic=critic - Use
omc ask codex --agent-prompt critic "..."when--critic=codex - Skip architect consultation for simple feature additions, well-tested changes, or time-critical verification
- Proceed with architect agent verification alone -- never block on unavailable tools
- Use
state_write/state_readfor ralph mode state persistence between iterations </Tool_Usage>
After refinement: acceptanceCriteria: [ "detectNoPrdFlag('ralph --no-prd fix') returns true", "detectNoPrdFlag('ralph fix this') returns false", "stripNoPrdFlag removes --no-prd and trims whitespace", "TypeScript compiles with no errors (npm run build)" ]
Why good: Generic criteria replaced with specific, testable criteria.
</Good>
<Good>
Correct parallel delegation:
Task(subagent_type="oh-my-claudecode:executor", model="haiku", prompt="Add type export for UserConfig") Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="Implement the caching layer for API responses") Task(subagent_type="oh-my-claudecode:executor", model="opus", prompt="Refactor auth module to support OAuth2 flow")
Why good: Three independent tasks fired simultaneously at appropriate tiers.
</Good>
<Good>
Story-by-story verification:
- Story US-001: "Add flag detection helpers"
- Criterion: "detectNoPrdFlag returns true for --no-prd" → Run test → PASS
- Criterion: "TypeScript compiles" → Run build → PASS
- Mark US-001 passes: true
- Story US-002: "Wire PRD into bridge.ts"
- Continue to next story...
Why good: Each story verified against its own acceptance criteria before marking complete.
</Good>
<Bad>
Claiming completion without PRD verification:
"All the changes look good, the implementation should work correctly. Task complete."
Why bad: Uses "should" and "look good" -- no fresh evidence, no story-by-story verification, no architect review.
</Bad>
<Bad>
Sequential execution of independent tasks:
Task(executor, "Add type export") → wait → Task(executor, "Implement caching") → wait → Task(executor, "Refactor auth")
Why bad: These are independent tasks that should run in parallel, not sequentially.
</Bad>
<Bad>
Keeping generic acceptance criteria:
---
*Content truncated.*
More by Yeachan-Heo
View all skills by Yeachan-Heo →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
pdf-to-markdown
aliceisjustplaying
Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.
Related MCP Servers
Browse all serversDeepSeek offers an AI-powered chatbot and writing assistant for chat completions, writing help, and code generation with
TaskManager streamlines project tracking and time management with efficient task queues, ideal for managing projects sof
Ask Human adds human-in-the-loop responses to AI, preventing errors on sensitive tasks like passwords and API endpoints.
Manage project task dependencies easily. Organize tasks, set priorities, and track progress with a structured API for pr
Boost productivity with Todoist Extended: automate IT tasks, manage projects, and streamline task automation through pow
Webvizio offers project management and project tracking software for seamless task tracking, project selection, and auto
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.