ralph
npx skills add https://github.com/yeachan-heo/oh-my-claudecode --skill ralph
Agent 安装分布
Skill 文档
[RALPH + ULTRAWORK – ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
<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 parallel execution with architect sign-off at the end </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 looping until work is genuinely complete, requiring fresh verification evidence before allowing completion, and using tiered architect review to confirm quality. </Why_This_Exists>
<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>
<Tool_Usage>
- Before first MCP tool use, call
ToolSearch("mcp")to discover deferred MCP tools - Use
ask_codexwithagent_role: "architect"for verification cross-checks when changes are security-sensitive, architectural, or involve complex multi-system integration - Skip Codex consultation for simple feature additions, well-tested changes, or time-critical verification
- If ToolSearch finds no MCP tools or Codex is unavailable, proceed with architect agent verification alone — never block on external tools
- Use
state_write/state_readfor ralph mode state persistence between iterations </Tool_Usage>
<Escalation_And_Stop_Conditions>
- Stop and report when a fundamental blocker requires user input (missing credentials, unclear requirements, external service down)
- Stop when the user says “stop”, “cancel”, or “abort” — run
/oh-my-claudecode:cancel - Continue working when the hook system sends “The boulder never stops” — this means the iteration continues
- If architect rejects verification, fix the issues and re-verify (do not stop)
- If the same issue recurs across 3+ iterations, report it as a potential fundamental problem </Escalation_And_Stop_Conditions>
<Final_Checklist>
- All requirements from the original task are met (no scope reduction)
- Zero pending or in_progress TODO items
- Fresh test run output shows all tests pass
- Fresh build output shows success
- lsp_diagnostics shows 0 errors on affected files
- Architect verification passed (STANDARD tier minimum)
-
/oh-my-claudecode:cancelrun for clean state cleanup </Final_Checklist>
When the user provides the --prd flag, initialize a Product Requirements Document before starting the ralph loop.
Detecting PRD Mode
Check if {{PROMPT}} contains --prd or --PRD.
PRD Workflow
- Create
.omc/prd.jsonand.omc/progress.txt - Parse the task (everything after
--prdflag) - Break down into user stories:
{
"project": "[Project Name]",
"branchName": "ralph/[feature-name]",
"description": "[Feature description]",
"userStories": [
{
"id": "US-001",
"title": "[Short title]",
"description": "As a [user], I want to [action] so that [benefit].",
"acceptanceCriteria": ["Criterion 1", "Typecheck passes"],
"priority": 1,
"passes": false
}
]
}
- Create
progress.txtwith timestamp and empty patterns section - Guidelines: right-sized stories (one session each), verifiable criteria, independent stories, priority order (foundational work first)
- Proceed to normal ralph loop using user stories as the task list
Example
User input: --prd build a todo app with React and TypeScript
Workflow: Detect flag, extract task, create .omc/prd.json, create .omc/progress.txt, begin ralph loop.
Background Execution Rules
Run in background (run_in_background: true):
- Package installation (npm install, pip install, cargo build)
- Build processes (make, project build commands)
- Test suites
- Docker operations (docker build, docker pull)
Run blocking (foreground):
- Quick status checks (git status, ls, pwd)
- File reads and edits
- Simple commands
Original task: {{PROMPT}}