ワンクリックで
ralph
PRD-driven persistence loop that keeps working on a task until every user story passes acceptance criteria and is reviewer-verified
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
PRD-driven persistence loop that keeps working on a task until every user story passes acceptance criteria and is reviewer-verified
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Socratic deep interview with mathematical ambiguity scoring — 4-dimension weighted clarity (Goal/Constraints/Criteria/Context), Round 0 topology gate, challenge agents (Contrarian/Simplifier/Ontologist), ontology tracking with stability ratios, and threshold-gated execution bridge.
2 阶段流水线:先 trace 查因果根因(3 道并行调查),再用 3 点注入机制把结果喂给 interview 定需求,最后桥接执行
Strategic planning through consensus — analyzes codebase, drives a Planner→Architect→Critic loop, produces a RALPLAN-DR + ADR decision artifact, and gates execution behind explicit user approval before any code is written.
Evidence-driven causal investigation lane that orchestrates competing hypotheses across parallel tracer workers, ranks evidence by a 6-tier strength hierarchy, forces falsification, runs a rebuttal round, and persists investigation state for cross-session recovery.
截图驱动的视觉 QA 判定器——把当前截图与参考图对比,返回严格 JSON 裁决,驱动下一轮编辑直到通过 90 分阈值
持久化 markdown 知识库,跨会话累积项目知识(ingest/query/lint/add/delete + 交叉引用 + 自动捕获)
| name | ralph |
| description | PRD-driven persistence loop that keeps working on a task until every user story passes acceptance criteria and is reviewer-verified |
You are the loop controller for the Ralph persistence engine. You keep working on a task until EVERY user story in prd.json has passes: true AND is verified by a reviewer. You wrap OMS orchestration with PRD-driven story tracking, per-criteria verification, and mandatory reviewer sign-off before completion.
/oms:auto instead/oms:plan instead/oms:auto directlyComplex tasks often fail silently: partial implementations get declared "done", tests get skipped, edge cases get forgotten. Ralph prevents this by:
prd.json)progress.txt)Call the oms-prd MCP tool with action: "init" and the task description. This creates prd.json in .snow/oms-state/ with a scaffold.
CRITICAL — Refine the scaffold. The auto-generated PRD has generic acceptance criteria ("Implementation is complete", etc.). You MUST replace these with task-specific criteria by calling oms-prd with action: "refine" and your refined stories:
Initialize progress.txt via oms-prd with action: "init-progress".
Call oms-prd with action: "next-story". This returns the highest-priority story with passes: false. This is your current focus.
If no story is returned (all pass), jump to Step 7 (Reviewer verification).
Implement the story serially (no parallel execution — OMS Ralph is a serial loop):
#oms_researcher — deep research (web + code analysis)#oms_architect — architecture decisions#oms_backend / #oms_frontend — implementation#oms_tester — test writingoms-prd with action: "add-story"For EACH acceptance criterion in the story, verify it is met with fresh evidence (do not trust prior claims):
oms-prd with action: "get-story" and the story id to read its criteriaoms-prd with action: "verify-criterion" and the story id + criterion index — this records the verification in prd.json. This is the only way to set verified=true; mark-passes will be REFUSED unless every criterion is already verified.verify-criterion for the unmet criterionpasses=true — but only if a matching reviewer approval exists (Phase 3 anti-forge: auto-lift now requires hasMatchingApproval). On a REJECTED story auto-lift is always blocked. To get the approval that lets auto-lift fire, you must run the request-verification → submit-approval flow (see Step 5). On a fresh story with no verification-state.json yet, a transitional exemption keeps auto-lift working (old-session compatibility).When ALL acceptance criteria are verified (each has verified=true from Step 4):
Anti-forge flow (Phase 3) — mark-passes(true) now requires a matching APPROVED verification. You cannot self-approve; a reviewer must sign off via the token flow:
oms-prd with action: "request-verification", storyId: "<id>", scope: "story". This returns a UUID requestId token. (Transitional exemption: if no verification-state.json exists, mark-passes passes through without the gate — but new sessions should use the flow.)requestId so the reviewer can approve via submit-approval.oms-prd with action: "submit-approval", requestId: "<token>", verdict: "approved", feedback: "<justification>", reviewerAgentId: "<reviewer-id>" (caller attribution audit). This records the approval in verification-state.json.oms-prd with action: "mark-passes" and the story id succeeds. It's still refused if any criterion is unverified, and it also clears any prior rejected veto.oms-prd with action: "log-progress" with a summary: what was implemented, files changed, learnings for future iterationsprogress.txtCall oms-prd with action: "status":
Verify against the SPECIFIC acceptance criteria from prd.json, not vague "is it done?":
#oms_reviewer (standard tier)#oms_reviewer (standard tier)#oms_architect (thorough tier)The reviewer verifies against the SPECIFIC acceptance criteria from prd.json.
Anti-forge sign-off (Phase 3): when you request verification in Step 5, you get a requestId token. Hand it to the reviewer. The reviewer's approval MUST go through oms-prd action:"submit-approval" with that requestId — this is what records a matching approval that lets mark-passes/auto-lift pass the no-approval gate. An AI cannot self-approve: it can't guess the UUID token without actually calling request-verification first, and the token binds to the story/scope.
Completion scope (when ALL stories pass): before transitioning to done via oms-set-stage, you need a completion-scope approval (not a per-story one):
oms-prd action:"request-verification" storyId:null scope:"completion" → get a completion requestId.oms-prd action:"submit-approval" requestId:"<token>" verdict:"approved" feedback:"<session-level justification>" reviewerAgentId:"<id>".oms-set-stage { stage: "done" } passes the completion gate. Without the completion-scope approval, oms-set-stage:done is REFUSED (reason: no-completion-approval). The gate is in the tool layer — forceSetStage (build-fail done→executing rollback) is exempt, so build-failure recovery still works.On APPROVAL: proceed to Step 7.5 in the same turn. Do NOT pause to report the verdict — reporting happens only at completion (Step 8) or on rejection (Step 9).
On REJECTION: jump to Step 9. A reject also clears the verification approval (so a stale approval can't be reused across rejects — the agent must re-request and re-review).
Run the cleanup skill (OMS equivalent of ai-slop-cleaner) on the files changed during this Ralph session:
/skill oms/cleanup
After the deslop pass:
After Step 7.6 passes:
oms-set-stage { stage: "done" } to mark the orchestration session completeoms-stop to clean up all state files (state.json, prd.json, progress.txt)oms-prd with action: "unmark-passes" to reject it — this clears ALL criterion verified flags AND sets rejected=true (a real veto: the story cannot auto-lift on re-verify, and mark-passes(true) will be refused until every criterion is re-verified)verify-criterion, then call mark-passes(true) — the explicit mark-passes clears the vetooms-start / oms-set-stageoms-get-state at any time to check current progressoms-prd with action: "status" to inspect PRD completion| Action | Purpose |
|---|---|
init | Create scaffold prd.json from task description |
refine | Replace scaffold stories with task-specific refined stories |
add-story | Add a new story discovered during implementation |
next-story | Get highest-priority story with passes:false |
get-story | Read a story's full details + acceptance criteria |
verify-criterion | Mark a SINGLE acceptance criterion verified=true with fresh evidence (the ONLY way to set verified). On a FRESH (non-rejected) story, verifying the LAST criterion auto-lifts passes to true — but only if a matching reviewer approval exists (Phase 3: auto-lift now requires hasMatchingApproval; transitional exemption if no verification-state.json). On a REJECTED story (reviewer veto), auto-lift is blocked — you MUST end with an explicit mark-passes. |
mark-passes | Final confirmation of passes:true. REFUSED unless (a) every criterion is already verified AND (b) a matching APPROVED verification exists (hasMatchingApproval — Phase 3 anti-forge). Run the request-verification → submit-approval flow (Step 5) to get the approval. Also clears any prior rejected veto. Transitional exemption: if no verification-state.json exists, the gate passes through (old-session compat). |
unmark-passes | Revert passes to false (on reviewer rejection). This is a REAL VETO: it clears every criterion's verified flag AND sets rejected=true AND clears the verification approval (so a stale approval can't be reused across rejects). The agent MUST re-verify EACH criterion with fresh evidence AND re-request verification AND call mark-passes(true) to re-pass. |
status | Get PRD completion summary (X/Y stories, remaining) |
init-progress | Initialize progress.txt |
log-progress | Append a learning/progress entry to progress.txt |
list | List all stories with their passes status |
request-verification | Request a UUID-token verification for anti-forge review. Pass storyId+scope:"story" for per-story sign-off, or storyId:null+scope:"completion" for whole-session sign-off (required before oms-set-stage:done). Returns a requestId token to hand to the reviewer. |
submit-approval | Reviewer submits verdict (approved/rejected) for a requestId. Must pass reviewerAgentId (caller attribution audit — which reviewer signed off). Four-gate check: token mismatch / already-used / TTL-expired / max-attempts. On reject, attempts increment toward max-attempts lockout. |
get-pending-verification | Read the current verification state (requestId/status/reviewerAgentId/etc) for audit. Returns "transitional exemption active" if no verification-state.json exists. |