一键导入
ralph
Bounded continuation loop on top of Ultrawork with architect verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bounded continuation loop on top of Ultrawork with architect verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
[OMAGY] Run an anti-slop cleanup/refactor/deslop workflow
Run read-only deep repository analysis with ranked synthesis, concrete evidence, and explicit Evidence/Inference/Unknown boundaries.
Full OMX-style autonomous pipeline for Omagy: interview, plan, goal execution, optional team, review, and UltraQA.
Professor-critic research workflow with durable Omagy artifacts for agy.
Stateful validator-gated research loop with artifact-gated completion.
[Omagy] Bounded best-practice research wrapper using official/upstream evidence first
| name | ralph |
| description | Bounded continuation loop on top of Ultrawork with architect verification. |
[RALPH + ULTRAWORK DISCIPLINE - ITERATION {{ITERATION}}/{{MAX}}]
Ralph is the persistence loop that keeps working on a task until it is fully complete, freshly verified, cleaned up, and architect-approved. It wraps the Ultrawork execution discipline with session persistence, automatic continuation, quality cleanup, regression re-verification, and a Stop-hook completion audit.<Invocation_Contract>
/omagy:ralph ... invocation as a Ralph runtime invocation, not
as a plain natural-language request.omagy ralph start or,
when resuming, omagy ralph status --json followed by omagy ralph next --json. Do not run Read, ListDir, Search, Bash, command -v,
build/test commands, target file reads, implementation work, or verification
before Ralph runtime activation.task,
desired_outcome, known_facts, constraints, unknowns, and touchpoints
payload and run omagy ralph start --input '<json>' --json before executing
the task.omagy ralph record,
complete with omagy ralph complete, and read back
omagy state read --input '{"mode":"ralph"}' --json.
</Invocation_Contract><Final_Response_Wording_Gate>
read-only, do not modify files, no source changes, 不修改, 不要修改, or equivalent, classify workspace cleanliness
before the final answer:
verified_clean: a current-run cleanliness command succeeded and showed no
changes.not_verified: the cleanliness command failed, was unavailable, or the
directory is not a Git repository.not_verified, the final answer must include exactly this
sentence and no other cleanliness/no-modification sentence:
No source-writing tool call was observed; workspace cleanliness is not verified because <cleanliness command> failed or was unavailable.not_verified state, do not translate, paraphrase, soften, or add Chinese
equivalents. Forbidden final-answer phrases include: "可以确认没有执行任何写操作",
"没有修改任何文件", "未修改源代码", "没有任何源文件被修改",
"未改变任何工作区文件", "confirmed no modification", and "no files were
changed".<Use_When>
/omagy:plan handoff./omagy:ralph code-review then fix all issues.
</Use_When><Do_Not_Use_When>
/omagy:plan or
/omagy:deep-interview./omagy:ultrawork./omagy:code-review./omagy:team.
</Do_Not_Use_When><Why_This_Exists> Complex agent tasks often fail by declaring partial work complete, skipping tests, ignoring review findings, or losing context across retries. Ralph exists to prevent that failure mode: every run starts from grounded context, continues until the task is done or blocked, verifies with current-run evidence, asks an architect lane to challenge the result, performs a cleanup/deslop pass, reruns verification, and only then records a passing completion audit. </Why_This_Exists>
<Execution_Policy>
.omagy/context/*.md snapshot and
Ralph state records context_snapshot_path./omagy:ultrawork workflow state. Ralph owns persistence and completion..omagy/state/ralph-progress.json as Ralph's canonical progress
ledger. Record meaningful iterations, blockers, verification results,
architect verdicts, cleanup/deslop results, and visual feedback through
omagy ralph record or omagy ralph record-visual.get_goal or update_goal. Capture the host objective in Ralph state as
host_objective / host_objective_source, and treat the completion audit as
the authoritative objective closure contract.omagy ralph --json or
/omagy:ralph with no extra task text so the runtime resolves the latest
visible /omagy:ralph "<task>" plan handoff and seeds approved_plan plus
staffing fields. If there is no unique handoff, stop and return to
/omagy:plan. ```bash
omagy ralph start --input '{"task":"<task statement>","desired_outcome":"<desired outcome>","known_facts":["<evidence>"],"constraints":["<constraint>"],"unknowns":["<open question>"],"touchpoints":["<likely file/module>"]}' --json
```
/omagy:deep-interview --quick <task> before creating the snapshot.context_snapshot_path.Review progress:
omagy ralph status --json.omagy ralph progress --json.Continue from the real current state:
omagy ralph next --json.Plan-approved execution gate:
If the user asks to execute the latest approved plan, PRD, or test spec, start with:
omagy ralph --json
The runtime resolves the latest visible /omagy:ralph "<task>" handoff
from the approved PRD, validates the matching test spec, and records
approved_plan_path, approved_plan, approved_test_spec_paths,
approved_deep_interview_spec_paths, available_agent_types,
staffing_summary, and staffing_allocations in Ralph state.
For a specific plan or task, use omagy plan handoff --mode ralph --json
first only to inspect/diagnose the handoff, then launch Ralph with the
exact task text or no task text for the latest approved handoff.
If the handoff is missing, ambiguous, or lacks a matching test spec, stop
and return to /omagy:plan instead of entering the Ralph loop.
Execute with Ultrawork discipline:
available_agent_types,
staffing_summary, and staffing_allocations, then use only available
Omagy agent roles such as implementer, explorer, verifier,
quality-reviewer, security-reviewer, and architect.Verify completion with fresh evidence:
Identify the commands, file reads, artifacts, or manual checks that prove the task is complete.
Run fresh verification in the current run and read the output.
Record the verification in Ralph's progress ledger:
omagy ralph record --input '{"kind":"verification","status":"pass","summary":"<verification result>","command":"<command or check>","evidence":["<current-run evidence>"],"phase":"verifying"}' --json
Every final claim must map to evidence from the current run.
Architect verification (required):
Ralph's floor is always architect verification.
Use STANDARD-style scrutiny for ordinary changes.
Use THOROUGH-style scrutiny for broad, cross-module, security, persistence, data-loss, or architectural changes.
If the architect lane rejects or raises a concrete blocker, fix the issue and return to Step 5.
Record the architect result:
omagy ralph record --input '{"kind":"architect","status":"pass","summary":"architect approved","evidence":["<architect verdict>"],"phase":"verifying"}' --json
Mandatory deslop / cleanup pass:
After architect approval, run a cleanup pass on Ralph-owned changed files.
In Omagy, use /omagy:ai-slop-cleaner for this pass.
Use the quality-reviewer lane only as an optional review of the cleanup
result, not as the cleanup workflow itself.
Scope cleanup to changed files and artifacts owned by this Ralph run.
If the prompt contains --no-deslop, skip this step and state that the
user explicitly disabled it.
Record the cleanup result:
omagy ralph record --input '{"kind":"deslop","status":"pass","summary":"quality cleanup completed","evidence":["<cleanup evidence>"],"phase":"verifying"}' --json
Regression re-verification:
Complete through runtime audit:
Write a passing Ralph completion audit before final answer:
omagy ralph complete --input '{"completion_audit":{"passed":true,"prompt_to_artifact_checklist":["<user request item -> artifact/evidence>"],"verification_evidence":["<command, test, or artifact>"]}}' --json
For large audits, write a repo-relative JSON audit artifact and reference
it with completion_audit_path.
Do not place prompt_to_artifact_checklist or verification_evidence as
bare top-level fields; they must live under completion_audit or in the
referenced audit artifact.
Before final answer, read back the persisted Ralph state:
omagy state read --input '{"mode":"ralph"}' --json
Confirm the read-back state has completion_audit.passed === true, a
non-empty completion_audit.prompt_to_artifact_checklist, non-empty
completion_audit.verification_evidence, and no
completion_audit_gate: "blocked" marker.
Without a passing audit, omagy hook Stop blocks completion even when the
phase says complete or completed.
<Tool_Usage>
omagy ralph start for context snapshot creation and runtime activation.omagy ralph status --json and omagy ralph next --json for
continuation.omagy state write/read only for compact lifecycle state. Do not embed
large markdown in shell JSON.omagy artifact read/write for PRDs, test specs, reports, audits, and
other large artifacts./omagy:code-review as read-only evidence. When Ralph owns a
review-then-fix loop, feed findings into the next Ralph iteration rather than
mutating plain code-review into an auto-fix command./omagy:cancel or omagy ralph cancel --json only when
the user stops the run or a fundamental blocker requires handoff.
</Tool_Usage><Evidence_Discipline>
Read(...), Bash(...),
Agent(<role>), or omagy ralph progress --json; do not write stale
Codex-specific labels such as view_file.read-only, do not modify files, no source changes,
or equivalent, attempt a cleanliness check such as git status --short or an
explicit filesystem audit after the task. If the check fails or no reliable
check is available, mark workspace cleanliness not verified.omagy ralph complete. Do not call omagy ralph complete first and backfill
cleanliness evidence later.completion_audit.verification_evidence must include the cleanliness check
command and result when the user requested no source modifications.status:"pass" and do not write completion_audit.passed:true. Failure
observation can be reported as observed, but it is not passing verification
evidence for Ralph completion.<cleanliness command> failed or was unavailable."completion_audit.prompt_to_artifact_checklist
must use a neutral left-side label such as "Attempted workspace cleanliness
verification" or "尝试验证工作区清洁度"; do not use "No source
modification", "Do not modify files", "不修改源代码", or equivalent as the
checklist requirement label.
</Evidence_Discipline>Ralph state is persisted through Omagy workflow/state runtime. Ralph progress is
persisted separately in the canonical ledger at
.omagy/state/ralph-progress.json or the active session-scoped state directory.
On start:
omagy ralph start --input '{"task":"<task>","desired_outcome":"<outcome>","known_facts":["<fact>"],"constraints":["<constraint>"],"unknowns":[],"touchpoints":["<path or module>"]}' --json
The runtime initializes iteration:0 and max_iterations":50 for the active
Ralph loop.
On each iteration:
omagy ralph record --input '{"kind":"iteration","status":"info","summary":"<what changed or what is next>","iteration":<current>,"phase":"executing","evidence":["<artifact or observation>"]}' --json
On verification/fix transition:
omagy ralph record --input '{"kind":"verification","status":"pass","summary":"<fresh verification result>","command":"<command>","phase":"verifying","evidence":["<evidence>"]}' --json
On completion:
omagy ralph complete --input '{"completion_audit":{"passed":true,"prompt_to_artifact_checklist":["<requirement -> evidence>"],"verification_evidence":["<fresh evidence>"]}}' --json
omagy state read --input '{"mode":"ralph"}' --json
The final answer is allowed only after the read-back state confirms the
passing audit. If read-back shows completion_audit_gate: "blocked" or any
missing audit evidence, return to the Ralph loop instead of answering final.
On cancellation:
omagy ralph cancel --json
If iteration >= max_iterations, Omagy marks Ralph with canonical lifecycle
outcome blocked instead of looping forever.
When entered after /omagy:plan, Ralph must not guess which plan to execute.
Use omagy ralph --json (or the slash-command equivalent with no extra task
text) so the runtime resolves the latest approved /omagy:ralph launch hint,
validates the matching PRD/test-spec pair, and creates the Ralph context from
those artifacts. If the handoff cannot prove a matching PRD/test-spec pair, do
not start implementation.
State should record:
{
"approved_plan_path": "<prd path>",
"approved_plan": {
"source_path": "<prd path>",
"test_spec_paths": ["<test spec path>"],
"deep_interview_spec_paths": [],
"command": "<launch hint>",
"task": "<approved task>"
},
"available_agent_types": ["implementer", "verifier", "architect"],
"staffing_summary": "implementer x1 (...); verifier x1 (...); architect x1 (...)",
"staffing_allocations": []
}
Use /omagy:ralph --prd "<task>" or omagy ralph --prd "<task>" when the
run is driven by an explicit user-story PRD instead of a loose task prompt.
Prompt-side /omagy:ralph activation alone is lighter-weight and does not imply
PRD mode.
PRD mode has a startup gate:
.omagy/prd.json must exist before Ralph starts..omagy/prd.json must be a JSON object.userStories exists, it must be an array.passes: true, status: "passed", status: "complete",
or status: "completed" must include current architect approval through
architect_validation or architect_review.approved: true, verdict: "approved",
verdict: "approve", status: "approved", or status: "approve".When PRD mode starts successfully, Omagy creates or reuses a canonical
.omagy/plans/prd-<timestamp>-<slug>.md snapshot generated from
.omagy/prd.json, records prd_mode: true, required_prd_json_path,
canonical_prd_path, prd_story_count, prd_completed_story_count, and
prd_startup_gate: "passed" in Ralph state, then continues through the normal
Ralph loop.
Plain /omagy:code-review is read-only. Ralph is the write-capable owner of
review-then-fix loops:
/omagy:code-review after implementation or against the requested
scope./omagy:code-review.omagy ralph status --json shows Ralph active at iteration 3.npm test -> current run passes.npm run build -> current run passes./omagy:ai-slop-cleaner cleanup pass finds no blocking cleanup or changes are
reverified.omagy ralph complete ... records a passing audit.
<Escalation_And_Stop_Conditions>
internal/contracts/explicit-terminal-stop-model.md and
reports exactly one canonical lifecycle outcome: finished, blocked,
failed, userinterlude, or askuserQuestion.
</Escalation_And_Stop_Conditions><Final_Checklist>
.omagy/context/{task-slug}-{timestamp}.md.context_snapshot_path./omagy:ai-slop-cleaner cleanup/deslop pass completed, unless --no-deslop
was explicitly provided.omagy ralph complete recorded a passing
completion_audit.omagy state read --input '{"mode":"ralph"}' --json read back the
persisted audit and confirmed it is passing.prompt_to_artifact_checklist or
verification_evidence fields were used as completion evidence.If the user includes --no-deslop, skip the cleanup/deslop pass and state that
the user explicitly disabled it. Fresh verification and architect verification
are still required.
Ralph accepts OMX-aligned visual reference flags on the CLI path:
omagy ralph -i refs/home.png -i refs/detail.png --images-dir screenshots "match the reference UI"
The runtime records these as visual_reference_images and visual_images_dir
in Ralph state and adds them to .omagy/ralph/session-instructions.md.
If the task includes screenshots, visual references, or a target URL, Ralph must add a visual verification lane before final completion. Use available agy screenshot/browser/subagent capabilities and persist visual evidence in the completion audit. Do not claim a visual match without current-run visual evidence.
Use the host's available execution surface:
Original task: {{PROMPT}}