Install
npx skillscat add yeachan-heo/oh-my-codex/ralph Install via the SkillsCat registry.
SKILL.md
[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
Ralph is a persistence loop that keeps working on a task until it is fully complete and architect-verified. It wraps ultrawork's parallel execution with session persistence, automatic retry on failure, and mandatory verification before completion. - 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> - User wants a full autonomous pipeline from idea to code -- use `autopilot` instead - User wants to explore or plan before committing -- use `plan` skill instead - User wants a quick one-shot fix -- delegate directly to an executor agent - User wants manual control over completion -- use `ultrawork` directly </Do_Not_Use_When> 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> - Fire independent agent calls simultaneously -- never wait sequentially for independent work - Use `run_in_background: true` for long operations (installs, builds, test suites) - Always pass the `model` parameter explicitly when delegating to agents - Read `docs/shared/agent-tiers.md` before 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> 1. **Review progress**: Check TODO list and any prior iteration state 2. **Continue from where you left off**: Pick up incomplete tasks 3. **Delegate in parallel**: Route tasks 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" 4. **Run long operations in background**: Builds, installs, test suites use `run_in_background: true` 5. **Verify completion with fresh evidence**: a. Identify what command proves the task is complete b. Run verification (test, build, lint) c. Read the output -- confirm it actually passed d. Check: zero pending/in_progress TODO items 6. **Architect verification** (tiered): - <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) - Ralph floor: always at least STANDARD, even for small changes 7. **On approval**: Run `/cancel` to cleanly exit and clean up all state files 8. **On rejection**: Fix the issues raised, then re-verify at the same tier - Before first MCP tool use, call `ToolSearch("mcp")` to discover deferred MCP tools - Use `ask_codex` with `agent_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_read` for ralph mode state persistence between iterations </Tool_Usage>State Management
Use the omx_state MCP server tools (state_write, state_read, state_clear) for Ralph lifecycle state.
- On start:
state_write({mode: "ralph", active: true, iteration: 1, max_iterations: 10, current_phase: "executing", started_at: "<now>"}) - On each iteration:
state_write({mode: "ralph", iteration: <current>, current_phase: "executing"}) - On verification/fix transition:
state_write({mode: "ralph", current_phase: "verifying"})orstate_write({mode: "ralph", current_phase: "fixing"}) - On completion:
state_write({mode: "ralph", active: false, current_phase: "complete", completed_at: "<now>"}) - On cancellation/cleanup:
run$cancel(which should callstate_clear(mode="ralph"))
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 canonical PRD/progress artifacts:
- PRD:
.omx/plans/prd-{slug}.md - Progress ledger:
.omx/state/{scope}/ralph-progress.json(session scope when available, else root scope)
- PRD:
- 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
}
]
}- Initialize canonical progress ledger at
.omx/state/{scope}/ralph-progress.json - 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 .omx/plans/prd-{slug}.md, create .omx/state/{scope}/ralph-progress.json, begin ralph loop.
Legacy compatibility
- If
.omx/prd.jsonexists and canonical PRD is absent, migrate one-way into.omx/plans/prd-{slug}.md. - If
.omx/progress.txtexists and canonical progress ledger is absent, import one-way into.omx/state/{scope}/ralph-progress.json. - Keep legacy files unchanged for one release cycle.
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}}