Build structured prompts for Ralph loops with TDD guidance, progress tracking, verification steps, and escape hatches. Invoke when starting a Ralph-based development task, creating orchestrated iteration loops, or converting PRDs to executable Ralph prompts. Wraps the official ralph-loop plugin to maximize loop success rates through careful prompt engineering and persistent state management.
From ralph-orchestratornpx claudepluginhub app-vitals/marketplace --plugin ralph-orchestratorThis skill uses the workspace's default tool permissions.
assets/templates/agents_template.mdassets/templates/master-prompt-freeform.mdassets/templates/master-prompt-plan.mdassets/templates/master-prompt-prd.mdassets/templates/plan_template.jsonassets/templates/plan_template.mdassets/templates/prd_template.jsonassets/templates/prd_template.mdassets/templates/progress_template.mdreferences/completion-promises.mdreferences/escape-hatches.mdreferences/plugin-discovery.mdreferences/prompt-patterns.mdreferences/story-sizing.mdBuild structured, scaffolded prompts for Ralph loops that maximize success rates through:
Ralph loops succeed when Claude has:
This skill builds prompts that embed all these elements.
The official ralph-loop plugin creates a self-referential feedback loop:
Key insight: The prompt never changes between iterations. Claude's "memory" comes from:
This skill builds prompts that leverage these persistence mechanisms.
Determine input mode from the invocation context:
PRD Mode (if .claude/ralph/<task-name>/prd.json exists):
"passes": true)<promise>ALL STORIES PASS</promise>Plan Mode (if .claude/ralph/<task-name>/plan.json exists):
"complete": true)<promise>ALL PHASES COMPLETE</promise>Raw Freeform Mode (if neither PRD nor plan exists):
<promise>TASK COMPLETE</promise>Ensure working files exist in .claude/ralph/<task-name>/:
progress.md - Create from template if not exists:
assets/templates/progress_template.md.claude/ralph/<task-name>/progress.mdAGENTS.md - Create from template if not exists:
assets/templates/agents_template.md.claude/ralph/<task-name>/AGENTS.mdThe master prompt is fed to Claude each iteration. It must be:
Load and populate the appropriate template based on mode:
| Mode | Template | Completion Promise |
|---|---|---|
| PRD | assets/templates/master-prompt-prd.md | ALL STORIES PASS |
| Plan | assets/templates/master-prompt-plan.md | ALL PHASES COMPLETE |
| Freeform | assets/templates/master-prompt-freeform.md | TASK COMPLETE |
For Plan Mode, also check task_type in plan.json:
"implementation" (default): Use TDD workflow sections"documentation": Use Research/Writing workflow sections"investigation": Use Investigation workflow sectionsThe templates use Handlebars-style placeholders ({{variable}}, {{#each}}, {{#if}}) that should be replaced with actual values from the JSON files.
Output the complete master prompt ready for the /ralph command:
Master prompt built for Ralph loop.
**Summary**:
- Task: <task-name>
- Mode: <prd|plan|freeform>
- Stories/Phases: <count> (<passing/complete> done, <blocked> blocked)
- Current focus: <first incomplete item>
- Completion promise: "<promise>"
**Working files**:
- .claude/ralph/<task-name>/progress.md
- .claude/ralph/<task-name>/AGENTS.md
- .claude/ralph/<task-name>/prd.json or plan.json
- ./CLAUDE.md (project root - for project-wide patterns)
Ready to invoke ralph-loop with this prompt.
Everything Claude needs to succeed must be in the prompt. The prompt is fed fresh each iteration - Claude doesn't remember previous iterations except through:
Since Ralph loops re-feed the same prompt, persistent files are how Claude "remembers":
Stories should be completable in 1-3 iterations. If a story takes more than 5 iterations:
Every story must have a verification method. Without it, Claude can't objectively know when it's done. Prefer automated verification (tests, type checks) over manual.
When stuck, Claude should:
Load these for detailed guidance:
This skill builds the prompt; the actual looping is handled by the official ralph-loop plugin:
/ralph-loop "<master-prompt>" --max-iterations <N> --completion-promise "<promise>"
The stop hook in ralph-loop:
Our progress.md, AGENTS.md, and prd.json/plan.json provide the persistent context that makes each iteration productive.