agentleFS
lza6lza6/claw-code-tingfeng/skills/ralph/SKILL.md

ralph

Skill5 starsChanged 12 days agoMITView on GitHub

Self-referential loop until task completion with architect verification

  • Installs packages

45 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use compound-engineering, deep-dive and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JokerRunSkill

    compound-engineering

    Compound Engineering workflow for AI-assisted development. Use when planning features, executing work, reviewing code, or codifying learnings. Follows the Plan → Work → Review → Compound loop where each unit of engineering makes subsequent work easier. Triggers on: plan this feature, implement this, review this code, compound learnings, create implementation plan, systematic development.

    Also in 3 projects that use this

  • buddyhSkill

    deep-dive

    Deep dive on any topic. Decomposes into subtopics, researches each in parallel with thorough source gathering, then synthesizes into a comprehensive report (4,000-10,000+ words, 40-100+ sources). Scales depth dynamically based on topic complexity. Use when asked for a deep dive, deep research, comprehensive analysis, or thorough investigation of a topic.

    Also in 3 projects that use this

  • sahinSkill

    execute

    Also in 3 projects that use this

  • Saik0sSkill

    browser-use

    AI-driven browser automation via Model Context Protocol

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

39 rules. 0 are common, 15 are distinctive, and 24 are very specific to this project.

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 24

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use run_in_background: true for long operations (installs, builds, test suites)

    line 34
  2. Very specific:

    Always pass the model parameter explicitly when delegating to agents

    line 35
  3. Very specific:

    Read docs/shared/agent-tiers.md before first delegation to select correct agent tiers

    line 36
  4. Distinctive:

    Default to concise, evidence-dense progress and completion reporting unless the user or risk level requires more detail

    line 38
  5. Distinctive:

    Treat newer user task updates as local overrides for the active workflow branch while preserving earlier non-conflicting constraints

    line 39
  6. Distinctive:

    If correctness depends on additional inspection, retrieval, execution, or verification, keep using the relevant tools until the execution …

    line 40
  7. Distinctive:

    If an existing relevant snapshot is available, reuse it and record the path in Ralph state.

    line 54
  8. Very specific:

    If request ambiguity is high, gather brownfield facts first.

    line 55
  9. Distinctive:

    Do not begin Ralph execution work (delegation, implementation, or verification loops) until snapshot grounding exists.

    line 56
  10. Distinctive:

    Review progress: Check TODO list and any prior iteration state

    line 57
  11. Distinctive:

    When Ralph is entered as a ralplan follow-up, start from the approved available-agent-types roster and make the delegation plan explicit: …

    line 63
  12. Very specific:

    Run $visual-verdict before every next edit.

    line 66
  13. Very specific:

    Default pass threshold: score >= 90.

    line 69
  14. Very specific:

    URL-based cloning tasks: When the task description contains a target URL (e.g., "clone https://example.com"), invoke $web-clone instead of …

    line 70
  15. Very specific:

    After Step 7 passes, run oh-my-codex:ai-slop-cleaner on all files changed during the Ralph session.

    line 82
  16. Very specific:

    Run the cleaner in standard mode (not --review).

    line 84
  17. Very specific:

    If the prompt contains --no-deslop, skip Step 7.5 entirely and proceed with the most recent successful verification evidence.

    line 85
  18. Very specific:

    After the deslop pass, re-run all tests/build/lint and read the output to confirm they still pass.

    line 87
  19. Distinctive:

    If post-deslop regression fails, roll back cleaner changes or fix and retry.

    line 88
  20. Very specific:

    Do not proceed to completion until post-deslop regression is green (unless --no-deslop explicitly skipped the deslop pass).

    line 89
  21. Very specific:

    On approval: Run /cancel to cleanly exit and clean up all state files

    line 90
  22. Very specific:

    Before first MCP tool use, call ToolSearch("mcp") to discover deferred MCP tools

    line 95
  23. Very specific:

    Use ask_codex with agent_role: "architect" for verification cross-checks when changes are security-sensitive, architectural, or involve …

    line 96
  24. Distinctive:

    If ToolSearch finds no MCP tools or Codex is unavailable, proceed with architect agent verification alone -- never block on external tools

    line 98
  25. Very specific:

    Use state_write / state_read for ralph mode state persistence between iterations

    line 99
  26. Very specific:

    Use the omx_state MCP server tools (state_write, state_read, state_clear) for Ralph lifecycle state.

    line 105
  27. Distinctive:

    Stop and report when a fundamental blocker requires user input (missing credentials, unclear requirements, external service down)

    line 168
  28. Very specific:

    Stop when the user says "stop", "cancel", or "abort" -- run /cancel

    line 169
  29. Distinctive:

    If architect rejects verification, fix the issues and re-verify (do not stop)

    line 171
  30. Distinctive:

    If the same issue recurs across 3+ iterations, report it as a potential fundamental problem </Escalation_And_Stop_Conditions>

    line 172
  31. Very specific:

    When the user provides the --prd flag, initialize a Product Requirements Document before starting the ralph loop.

    line 190
  32. Very specific:

    Check if {{PROMPT}} contains --prd or --PRD.

    line 193
  33. Very specific:

    Check if {{PROMPT}} contains --no-deslop.

    line 196
  34. Very specific:

    If --no-deslop is present, skip the deslop pass entirely after Step 7 and continue using the latest successful pre-deslop verification …

    line 197
  35. Distinctive:

    Run deep-interview in quick mode before creating PRD artifacts:

    line 208
  36. Distinctive:

    Create canonical PRD/progress artifacts:

    line 212
  37. Very specific:

    If .omx/prd.json exists and canonical PRD is absent, migrate one-way into .omx/plans/prd-{slug}.md.

    line 245
  38. Very specific:

    If .omx/progress.txt exists and canonical progress ledger is absent, import one-way into .omx/state/{scope}/ralph-progress.json.

    line 246
  39. Distinctive:

    Keep legacy files unchanged for one release cycle.

    line 247

“Common” is measured: kept by at least 6 in 10 of the 41 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]

Your previous attempt did not output the completion promise. Continue working on the task.

<Purpose> 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. </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 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 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>

<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: 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
  • Default to concise, evidence-dense progress and completion reporting unless the user or risk level requires more detail
  • Treat newer user task updates as local overrides for the active workflow branch while preserving earlier non-conflicting constraints
  • If correctness depends on additional inspection, retrieval, execution, or verification, keep using the relevant tools until the execution loop is grounded
  • Continue through clear, low-risk, reversible next steps automatically; ask only when the next step is materially branching, destructive, or preference-dependent </Execution_Policy>
<Steps> 0. **Pre-context intake (required before planning/execution loop starts)**: - Assemble or load a context snapshot at `.omx/context/{task-slug}-{timestamp}.md` (UTC `YYYYMMDDTHHMMSSZ`). - Minimum snapshot fields: - task statement - desired outcome - known facts/evidence - constraints - unknowns/open questions - likely codebase touchpoints - If an existing relevant snapshot is available, reuse it and record the path in Ralph state. - If request ambiguity is high, gather brownfield facts first. When session guidance enables `USE_OMX_EXPLORE_CMD`, prefer `omx explore` for simple read-only repository lookups with narrow, concrete prompts; otherwise use the richer normal explore path. Then run `$deep-interview --quick <task>` to close critical gaps. - Do not begin Ralph execution work (delegation, implementation, or verification loops) until snapshot grounding exists. If forced to proceed quickly, note explicit risk tradeoffs. 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 -- "What does this function return?" - Standard work: STANDARD tier -- "Add error handling to this module" - Complex analysis: THOROUGH tier -- "Debug this race condition" - When Ralph is entered as a ralplan follow-up, start from the approved **available-agent-types roster** and make the delegation plan explicit: implementation lane, evidence/regression lane, and final sign-off lane using only known agent types 4. **Run long operations in background**: Builds, installs, test suites use `run_in_background: true` 5. **Visual task gate (when screenshot/reference images are present)**: - Run `$visual-verdict` **before every next edit**. - Require structured JSON output: `score`, `verdict`, `category_match`, `differences[]`, `suggestions[]`, `reasoning`. - Persist verdict to `.omx/state/{scope}/ralph-progress.json` including numeric + qualitative feedback. - Default pass threshold: `score >= 90`. - **URL-based cloning tasks**: When the task description contains a target URL (e.g., "clone https://example.com"), invoke `$web-clone` instead of `$visual-verdict`. The web-clone skill handles the full extraction → generation → verification pipeline and uses `$visual-verdict` internally for visual scoring. 6. **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 7. **Architect verification** (tiered): - <5 files, <100 lines with full tests: STANDARD tier minimum (architect role) - Standard changes: STANDARD tier (architect role) - >20 files or security/architectural changes: THOROUGH tier (architect role) - Ralph floor: always at least STANDARD, even for small changes 7.5 **Mandatory Deslop Pass**: - After Step 7 passes, run `oh-my-codex:ai-slop-cleaner` on **all files changed during the Ralph session**. - Scope the cleaner to **changed files only**; do not widen the pass beyond Ralph-owned edits. - Run the cleaner in **standard mode** (not `--review`). - If the prompt contains `--no-deslop`, skip Step 7.5 entirely and proceed with the most recent successful verification evidence. 7.6 **Regression Re-verification**: - After the deslop pass, re-run all tests/build/lint and read the output to confirm they still pass. - If post-deslop regression fails, roll back cleaner changes or fix and retry. Then rerun Step 7.5 and Step 7.6 until the regression is green. - Do not proceed to completion until post-deslop regression is green (unless `--no-deslop` explicitly skipped the deslop pass). 8. **On approval**: Run `/cancel` to cleanly exit and clean up all state files 9. **On rejection**: Fix the issues raised, then re-verify at the same tier </Steps>

<Tool_Usage>

  • 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
  • Persist context snapshot path in Ralph mode state so later phases and agents share the same grounding context </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>", state: {context_snapshot_path: "<snapshot-path>"}})
  • On each iteration: state_write({mode: "ralph", iteration: <current>, current_phase: "executing"})
  • On verification/fix transition: state_write({mode: "ralph", current_phase: "verifying"}) or state_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 call state_clear(mode="ralph"))

Scenario Examples

Good: The user says continue after the workflow already has a clear next step. Continue the current branch of work instead of restarting or re-asking the same question.

Good: The user changes only the output shape or downstream delivery step (for example make a PR). Preserve earlier non-conflicting workflow constraints and apply the update locally.

Bad: The user says continue, and the workflow restarts discovery or stops before the missing verification/evidence is gathered.

<Examples> <Good> Correct parallel delegation: ``` delegate(role="executor", tier="LOW", task="Add type export for UserConfig") delegate(role="executor", tier="STANDARD", task="Implement the caching layer for API responses") delegate(role="executor", tier="THOROUGH", task="Refactor auth module to support OAuth2 flow") ``` Why good: Three independent tasks fired simultaneously at appropriate tiers. </Good><Good> Correct verification before completion: ``` 1. Run: npm test → Output: "42 passed, 0 failed" 2. Run: npm run build → Output: "Build succeeded" 3. Run: lsp_diagnostics → Output: 0 errors 4. Delegate to architect at STANDARD tier → Verdict: "APPROVED" 5. Run /cancel ``` Why good: Fresh evidence at each step, architect verification, then clean exit. </Good><Bad> Claiming completion without verification: "All the changes look good, the implementation should work correctly. Task complete." Why bad: Uses "should" and "look good" -- no fresh test/build output, no architect verification. </Bad><Bad> Sequential execution of independent tasks: ``` delegate(executor, LOW, "Add type export") → wait → delegate(executor, STANDARD, "Implement caching") → wait → delegate(executor, THOROUGH, "Refactor auth") ``` Why bad: These are independent tasks that should run in parallel, not sequentially. </Bad> </Examples>

<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 /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)
  • ai-slop-cleaner pass completed on changed files (or --no-deslop specified)
  • Post-deslop regression tests pass
  • /cancel run for clean state cleanup </Final_Checklist>
<Advanced> ## PRD Mode (Optional)

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.

Detecting --no-deslop

Check if {{PROMPT}} contains --no-deslop. If --no-deslop is present, skip the deslop pass entirely after Step 7 and continue using the latest successful pre-deslop verification evidence.

Visual Reference Flags (Optional)

Ralph execution supports visual reference flags for screenshot tasks:

  • Repeatable image inputs: -i <image-path> (can be used multiple times)
  • Image directory input: --images-dir <directory>

Example: ralph -i refs/hn.png -i refs/hn-item.png --images-dir ./screenshots "match HackerNews layout"

PRD Workflow

  1. Run deep-interview in quick mode before creating PRD artifacts:
    • Execute: $deep-interview --quick <task>
    • Complete a compact requirements pass (context, goals, scope, constraints, validation)
    • Persist interview output to .omx/interviews/{slug}-{timestamp}.md
  2. 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)
  3. Parse the task (everything after --prd flag)
  4. 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
    }
  ]
}
  1. Initialize canonical progress ledger at .omx/state/{scope}/ralph-progress.json
  2. Guidelines: right-sized stories (one session each), verifiable criteria, independent stories, priority order (foundational work first)
  3. 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.json exists and canonical PRD is absent, migrate one-way into .omx/plans/prd-{slug}.md.
  • If .omx/progress.txt exists 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</Advanced>

Original task: {{PROMPT}}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.