ralph
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseralph (Ouroboros) — Specification-First AI Development
ralph (Ouroboros) — 规约优先AI开发
Stop prompting. Start specifying."The beginning is the end, and the end is the beginning." The serpent doesn't repeat — it evolves.
停止输入提示词,开始明确规约。「起点即终点,终点即起点。」 衔尾蛇不会重复,只会不断演化。
When to use this skill
什么时候使用这个技能
- Before writing any code — expose hidden assumptions with Socratic interviewing
- Long-running tasks that need autonomous iteration until verified
- Vague requirements — crystallize them into an immutable spec (Ambiguity ≤ 0.2)
- Tasks requiring guaranteed completion — loop until verification passes
- When stuck — 5 lateral thinking personas break through stagnation
- Drift detection — measure how far execution has deviated from original spec
- 编写任何代码之前 — 通过苏格拉底式访谈暴露隐藏的假设
- 需要自主迭代直到通过验证的长期运行任务
- 模糊的需求 — 将其具象化为不可变更的规约(歧义度 ≤ 0.2)
- 需要保证完成的任务 — 循环运行直到验证通过
- 遇到瓶颈时 — 5种横向思考角色帮你突破停滞
- 偏差检测 — 衡量执行与原始规约的偏离程度
Core Architecture: The Loop
核心架构:循环
Interview → Seed → Execute → Evaluate
↑ ↓
└──── Evolutionary Loop ────┘Each cycle evolves, not repeats. Evaluation output feeds back as input for the next generation until the system converges.
Interview → Seed → Execute → Evaluate
↑ ↓
└──── Evolutionary Loop ────┘每个周期都是演化而非重复。评估的输出会作为下一代的输入反馈回去,直到系统收敛。
Double Diamond
双钻石模型
◇ Wonder ◇ Design
╱ (diverge) ╱ (diverge)
╱ explore ╱ create
╱ ╱
◆ ──────────── ◆ ──────────── ◆
╲ ╲
╲ define ╲ deliver
╲ (converge) ╲ (converge)
◇ Ontology ◇ EvaluationThe first diamond is Socratic: diverge into questions, converge into ontological clarity.
The second diamond is pragmatic: diverge into design options, converge into verified delivery.
◇ Wonder ◇ Design
╱ (diverge) ╱ (diverge)
╱ explore ╱ create
╱ ╱
◆ ──────────── ◆ ──────────── ◆
╲ ╲
╲ define ╲ deliver
╲ (converge) ╲ (converge)
◇ Ontology ◇ Evaluation第一个钻石是苏格拉底式的:发散提出问题,收敛获得清晰的本体定义。第二个钻石是务实导向的:发散设计方案,收敛得到验证过的交付成果。
1. Commands (Full Reference)
1. 命令(完整参考)
| Command | Trigger Keywords | What It Does |
|---|---|---|
| | Socratic questioning → expose hidden assumptions |
| | Crystallize interview into immutable spec (Ambiguity ≤ 0.2) |
| | Execute via Double Diamond decomposition |
| | 3-stage gate: Mechanical → Semantic → Multi-Model Consensus |
| | Evolutionary loop until ontology converges (similarity ≥ 0.95) |
| | 5 lateral thinking personas when stuck |
| | Drift detection + session tracking |
| | Persistent loop until verified — The boulder never stops |
| | Register MCP server (one-time) |
| | Full reference |
| Command | Trigger Keywords | What It Does |
|---|---|---|
| | 苏格拉底式提问 → 暴露隐藏的假设 |
| | 将访谈内容具象化为不可变更的规约(歧义度 ≤ 0.2) |
| | 通过双钻石模型拆解执行 |
| | 三阶段校验:机械校验 → 语义校验 → 多模型共识 |
| | 演化循环直到本体收敛(相似度 ≥ 0.95) |
| | 遇到瓶颈时提供5种横向思考角色 |
| | 偏差检测 + 会话追踪 |
| | 持续循环直到通过验证——巨石永不停歇 |
| | 注册MCP服务器(仅需一次) |
| | 完整参考文档 |
2. Interview → Specification Flow
2. 访谈→规约流程
Philosophy: From Wonder to Ontology
设计理念:从疑问到本体
Wonder → "How should I live?" → "What IS 'live'?" → Ontology — Socrates
Wonder Ontology
💡 🔬
"What do I want?" → "What IS the thing I want?"
"Build a task CLI" → "What IS a task? What IS priority?"
"Fix the auth bug" → "Is this the root cause, or a symptom?"疑问 → "我应该怎么活?" → "什么是『活』?" → 本体 — 苏格拉底
Wonder Ontology
💡 🔬
"What do I want?" → "What IS the thing I want?"
"Build a task CLI" → "What IS a task? What IS priority?"
"Fix the auth bug" → "Is this the root cause, or a symptom?"Step 1: Interview (expose hidden assumptions)
步骤1:访谈(暴露隐藏假设)
ooo interview "I want to build a task management CLI"The Socratic Interviewer asks questions until Ambiguity ≤ 0.2.
Ambiguity formula:
Ambiguity = 1 − Σ(clarityᵢ × weightᵢ)
Greenfield: Goal(40%) + Constraint(30%) + Success(30%)
Brownfield: Goal(35%) + Constraint(25%) + Success(25%) + Context(15%)
Threshold: Ambiguity ≤ 0.2 → ready for SeedExample scoring:
Goal: 0.9 × 0.4 = 0.36
Constraint: 0.8 × 0.3 = 0.24
Success: 0.7 × 0.3 = 0.21
──────
Clarity = 0.81
Ambiguity = 1 − 0.81 = 0.19 ≤ 0.2 → ✓ Ready for Seedooo interview "I want to build a task management CLI"苏格拉底式访谈者会持续提问直到歧义度 ≤ 0.2。
歧义度计算公式:
Ambiguity = 1 − Σ(clarityᵢ × weightᵢ)
Greenfield: Goal(40%) + Constraint(30%) + Success(30%)
Brownfield: Goal(35%) + Constraint(25%) + Success(25%) + Context(15%)
Threshold: Ambiguity ≤ 0.2 → ready for Seed评分示例:
Goal: 0.9 × 0.4 = 0.36
Constraint: 0.8 × 0.3 = 0.24
Success: 0.7 × 0.3 = 0.21
──────
Clarity = 0.81
Ambiguity = 1 − 0.81 = 0.19 ≤ 0.2 → ✓ 可以进入生成种子阶段Step 2: Seed (crystallize into immutable spec)
步骤2:生成种子(具象化为不可变更的规约)
ooo seedGenerates YAML specification:
yaml
goal: Build a CLI task management tool
constraints:
- Python 3.14+
- No external database
- SQLite for persistence
acceptance_criteria:
- Tasks can be created
- Tasks can be listed
- Tasks can be marked complete
ontology_schema:
name: TaskManager
fields:
- name: tasks
type: array
- name: title
type: stringooo seed生成YAML格式的规约:
yaml
goal: Build a CLI task management tool
constraints:
- Python 3.14+
- No external database
- SQLite for persistence
acceptance_criteria:
- Tasks can be created
- Tasks can be listed
- Tasks can be marked complete
ontology_schema:
name: TaskManager
fields:
- name: tasks
type: array
- name: title
type: stringStep 3: Run (execute via Double Diamond)
步骤3:运行(通过双钻石模型执行)
ooo run seed.yaml
ooo run # uses seed from conversation contextooo run seed.yaml
ooo run # 使用会话上下文中的种子规约Step 4: Evaluate (3-stage verification)
步骤4:评估(三阶段验证)
ooo evaluate <session_id>| Stage | Cost | What It Checks |
|---|---|---|
| Mechanical | $0 | Lint, build, tests, coverage |
| Semantic | Standard | AC compliance, goal alignment, drift score |
| Consensus | Frontier (optional) | Multi-model vote, majority ratio |
Drift thresholds:
- — Excellent: on track
0.0 – 0.15 - — Acceptable: monitor closely
0.15 – 0.30 - — Exceeded: course correction needed
0.30+
ooo evaluate <session_id>| 阶段 | 成本 | 校验内容 |
|---|---|---|
| 机械校验 | $0 | 语法检查、构建、测试、覆盖率 |
| 语义校验 | 标准 | 验收标准合规性、目标对齐度、偏差得分 |
| 共识校验 | 高级(可选) | 多模型投票,多数通过 |
偏差阈值:
- — 优秀:正常推进
0.0 – 0.15 - — 可接受:密切监控
0.15 – 0.30 - — 超出阈值:需要修正方向
0.30+
3. Ralph — Persistent Loop Until Verified
3. Ralph — 持续循环直到验证通过
ooo ralph "fix all failing tests"
/ouroboros:ralph "fix all failing tests""The boulder never stops."
Each failure is data for the next attempt. Only complete success or max iterations stops it.
ooo ralph "fix all failing tests"
/ouroboros:ralph "fix all failing tests"「巨石永不停歇。」
每一次失败都是下一次尝试的数据输入。只有完全成功或达到最大迭代次数才会停止。
How Ralph Works
Ralph运行原理
┌─────────────────────────────────┐
│ 1. EXECUTE (parallel) │
│ Independent tasks │
│ concurrent scheduling │
├─────────────────────────────────┤
│ 2. VERIFY │
│ Check completion │
│ Validate tests pass │
│ Measure drift vs seed │
├─────────────────────────────────┤
│ 3. LOOP (if failed) │
│ Analyze failure │
│ Fix identified issues │
│ Repeat from step 1 │
├─────────────────────────────────┤
│ 4. PERSIST (checkpoint) │
│ .omc/state/ralph-state.json │
│ Resume after interruption │
└─────────────────────────────────┘┌─────────────────────────────────┐
│ 1. EXECUTE (parallel) │
│ Independent tasks │
│ concurrent scheduling │
├─────────────────────────────────┤
│ 2. VERIFY │
│ Check completion │
│ Validate tests pass │
│ Measure drift vs seed │
├─────────────────────────────────┤
│ 3. LOOP (if failed) │
│ Analyze failure │
│ Fix identified issues │
│ Repeat from step 1 │
├─────────────────────────────────┤
│ 4. PERSIST (checkpoint) │
│ .omc/state/ralph-state.json │
│ Resume after interruption │
└─────────────────────────────────┘State File
状态文件
Create on start:
.omc/state/ralph-state.jsonjson
{
"mode": "ralph",
"session_id": "<uuid>",
"request": "<user request>",
"status": "running",
"iteration": 0,
"max_iterations": 10,
"last_checkpoint": null,
"verification_history": []
}启动时创建:
.omc/state/ralph-state.jsonjson
{
"mode": "ralph",
"session_id": "<uuid>",
"request": "<user request>",
"status": "running",
"iteration": 0,
"max_iterations": 10,
"last_checkpoint": null,
"verification_history": []
}Loop Logic
循环逻辑
while iteration < max_iterations:
result = execute_parallel(request, context)
verification = verify_result(result, acceptance_criteria)
state.verification_history.append({
"iteration": iteration,
"passed": verification.passed,
"score": verification.score,
"timestamp": <now>
})
if verification.passed:
save_checkpoint("complete")
break
iteration += 1
save_checkpoint("iteration_{iteration}")while iteration < max_iterations:
result = execute_parallel(request, context)
verification = verify_result(result, acceptance_criteria)
state.verification_history.append({
"iteration": iteration,
"passed": verification.passed,
"score": verification.score,
"timestamp": <now>
})
if verification.passed:
save_checkpoint("complete")
break
iteration += 1
save_checkpoint("iteration_{iteration}")Progress Report Format
进度报告格式
[Ralph Iteration 1/10]
Executing in parallel...
Verification: FAILED
Score: 0.65
Issues:
- 3 tests still failing
- Type errors in src/api.py
The boulder never stops. Continuing...
[Ralph Iteration 3/10]
Executing in parallel...
Verification: PASSED
Score: 1.0
Ralph COMPLETE
==============
Request: Fix all failing tests
Duration: 8m 32s
Iterations: 3
Verification History:
- Iteration 1: FAILED (0.65)
- Iteration 2: FAILED (0.85)
- Iteration 3: PASSED (1.0)[Ralph Iteration 1/10]
Executing in parallel...
Verification: FAILED
Score: 0.65
Issues:
- 3 tests still failing
- Type errors in src/api.py
The boulder never stops. Continuing...
[Ralph Iteration 3/10]
Executing in parallel...
Verification: PASSED
Score: 1.0
Ralph COMPLETE
==============
Request: Fix all failing tests
Duration: 8m 32s
Iterations: 3
Verification History:
- Iteration 1: FAILED (0.65)
- Iteration 2: FAILED (0.85)
- Iteration 3: PASSED (1.0)Cancellation
取消操作
| Action | Command |
|---|---|
| Save checkpoint & exit | |
| Force clear all state | |
| Resume after interruption | |
| 操作 | 命令 |
|---|---|
| 保存检查点并退出 | |
| 强制清空所有状态 | |
| 中断后恢复 | |
4. Evolutionary Loop (Evolve)
4. 演化循环(Evolve)
ooo evolve "build a task management CLI"
ooo evolve "build a task management CLI" --no-execute # ontology-only, fast modeooo evolve "build a task management CLI"
ooo evolve "build a task management CLI" --no-execute # 仅生成本体,快速模式Flow
流程
Gen 1: Interview → Seed(O₁) → Execute → Evaluate
Gen 2: Wonder → Reflect → Seed(O₂) → Execute → Evaluate
Gen 3: Wonder → Reflect → Seed(O₃) → Execute → Evaluate
...until ontology converges (similarity ≥ 0.95) or max 30 generationsGen 1: Interview → Seed(O₁) → Execute → Evaluate
Gen 2: Wonder → Reflect → Seed(O₂) → Execute → Evaluate
Gen 3: Wonder → Reflect → Seed(O₃) → Execute → Evaluate
...直到本体收敛(相似度 ≥ 0.95)或达到最大30代Convergence Formula
收敛公式
Similarity = 0.5 × name_overlap + 0.3 × type_match + 0.2 × exact_match
Threshold: Similarity ≥ 0.95 → CONVERGED
Gen 1: {Task, Priority, Status}
Gen 2: {Task, Priority, Status, DueDate} → similarity 0.78 → CONTINUE
Gen 3: {Task, Priority, Status, DueDate} → similarity 1.00 → CONVERGED ✓Similarity = 0.5 × name_overlap + 0.3 × type_match + 0.2 × exact_match
Threshold: Similarity ≥ 0.95 → CONVERGED
Gen 1: {Task, Priority, Status}
Gen 2: {Task, Priority, Status, DueDate} → similarity 0.78 → CONTINUE
Gen 3: {Task, Priority, Status, DueDate} → similarity 1.00 → CONVERGED ✓Stagnation Detection
停滞检测
| Signal | Condition | Meaning |
|---|---|---|
| Stagnation | Similarity ≥ 0.95 for 3 consecutive gens | Ontology has stabilized |
| Oscillation | Gen N ≈ Gen N-2 (period-2 cycle) | Stuck bouncing between two designs |
| Repetitive feedback | ≥ 70% question overlap across 3 gens | Wonder asking the same things |
| Hard cap | 30 generations reached | Safety valve |
| 信号 | 条件 | 含义 |
|---|---|---|
| 停滞 | 连续3代相似度 ≥ 0.95 | 本体已稳定 |
| 震荡 | 第N代 ≈ 第N-2代(周期2循环) | 在两个设计之间来回摇摆 |
| 重复反馈 | 3代的问题重叠度 ≥ 70% | 一直在询问相同的问题 |
| 上限 | 达到30代 | 安全阈值触发 |
Ralph in Evolve Mode
演化模式下的Ralph
Ralph Cycle 1: evolve_step(lineage, seed) → Gen 1 → action=CONTINUE
Ralph Cycle 2: evolve_step(lineage) → Gen 2 → action=CONTINUE
Ralph Cycle 3: evolve_step(lineage) → Gen 3 → action=CONVERGED ✓
└── Ralph stops.
The ontology has stabilized.Ralph Cycle 1: evolve_step(lineage, seed) → Gen 1 → action=CONTINUE
Ralph Cycle 2: evolve_step(lineage) → Gen 2 → action=CONTINUE
Ralph Cycle 3: evolve_step(lineage) → Gen 3 → action=CONVERGED ✓
└── Ralph stops.
The ontology has stabilized.Rewind
回滚
ooo evolve --status <lineage_id> # check lineage status
ooo evolve --rewind <lineage_id> <gen_N> # roll back to generation Nooo evolve --status <lineage_id> # 查看谱系状态
ooo evolve --rewind <lineage_id> <gen_N> # 回滚到第N代5. The Nine Minds (Agents)
5. 九种思维(Agents)
Loaded on-demand — never preloaded:
| Agent | Role | Core Question |
|---|---|---|
| Socratic Interviewer | Questions-only. Never builds. | "What are you assuming?" |
| Ontologist | Finds essence, not symptoms | "What IS this, really?" |
| Seed Architect | Crystallizes specs from dialogue | "Is this complete and unambiguous?" |
| Evaluator | 3-stage verification | "Did we build the right thing?" |
| Contrarian | Challenges every assumption | "What if the opposite were true?" |
| Hacker | Finds unconventional paths | "What constraints are actually real?" |
| Simplifier | Removes complexity | "What's the simplest thing that could work?" |
| Researcher | Stops coding, starts investigating | "What evidence do we actually have?" |
| Architect | Identifies structural causes | "If we started over, would we build it this way?" |
按需加载,不会预加载:
| Agent | 角色 | 核心问题 |
|---|---|---|
| 苏格拉底式访谈者 | 只提问题,从不构建 | 「你在假设什么?」 |
| 本体专家 | 找到本质,而非表象 | 「这到底是什么?」 |
| 种子架构师 | 从对话中具象化规约 | 「这个规约完整且无歧义吗?」 |
| 评估者 | 三阶段验证 | 「我们构建的是正确的东西吗?」 |
| 唱反调者 | 挑战所有假设 | 「如果反过来是对的呢?」 |
| 黑客 | 找到非常规路径 | 「哪些约束是真的存在的?」 |
| 简化者 | 移除复杂度 | 「能运行的最简单方案是什么?」 |
| 研究者 | 停止编码,开始调研 | 「我们实际有什么证据?」 |
| 架构师 | 识别结构性原因 | 「如果我们从头开始,还会这么做吗?」 |
6. Unstuck — Lateral Thinking
6. 破局——横向思考
When blocked after repeated failures, choose a persona:
ooo unstuck # auto-select based on situation
ooo unstuck simplifier # cut scope to MVP — "Start with exactly 2 tables"
ooo unstuck hacker # make it work first, elegance later
ooo unstuck contrarian # challenge all assumptions
ooo unstuck researcher # stop coding, find missing information
ooo unstuck architect # restructure the approach entirelyWhen to use each:
- Repeated similar failures → (challenge assumptions)
contrarian - Too many options → (reduce scope)
simplifier - Missing information → (seek data)
researcher - Analysis paralysis → (just make it work)
hacker - Structural issues → (redesign)
architect
多次失败遇到瓶颈时,选择一个角色:
ooo unstuck # 根据情况自动选择
ooo unstuck simplifier # 缩减范围到MVP——「从刚好2张表开始」
ooo unstuck hacker # 先跑通,再谈优雅
ooo unstuck contrarian # 挑战所有假设
ooo unstuck researcher # 停止编码,查找缺失信息
ooo unstuck architect # 完全重构方案使用场景:
- 多次出现类似失败 → (挑战假设)
contrarian - 选项太多 → (缩减范围)
simplifier - 信息缺失 → (寻找数据)
researcher - 分析瘫痪 → (先跑通再说)
hacker - 结构性问题 → (重新设计)
architect
7. Platform Installation & Usage
7. 平台安装与使用
Claude Code (Native Plugin — Full Mode)
Claude Code(原生插件——全功能模式)
bash
undefinedbash
undefinedInstall
安装
claude plugin marketplace add Q00/ouroboros
claude plugin install ouroboros@ouroboros
claude plugin marketplace add Q00/ouroboros
claude plugin install ouroboros@ouroboros
One-time setup
一次初始化设置
ooo setup
ooo setup
Use
使用
ooo interview "I want to build a task CLI"
ooo seed
ooo run
ooo evaluate <session_id>
ooo ralph "fix all failing tests"
All `ooo` commands work natively. Hooks auto-activate:
- `UserPromptSubmit` → keyword-detector.mjs detects triggers
- `PostToolUse(Write|Edit)` → drift-monitor.mjs tracks deviation
- `SessionStart` → session initialization
**Claude Code hooks.json** (installed at `${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json`):
```json
{
"hooks": {
"SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start.mjs\"", "timeout": 5 }] }],
"UserPromptSubmit": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/keyword-detector.mjs\"", "timeout": 5 }] }],
"PostToolUse": [{ "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/drift-monitor.mjs\"", "timeout": 3 }] }]
}
}ooo interview "I want to build a task CLI"
ooo seed
ooo run
ooo evaluate <session_id>
ooo ralph "fix all failing tests"
所有`ooo`命令原生可用,钩子自动激活:
- `UserPromptSubmit` → keyword-detector.mjs 检测触发词
- `PostToolUse(Write|Edit)` → drift-monitor.mjs 追踪偏差
- `SessionStart` → 会话初始化
**Claude Code hooks.json**(安装在`${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json`):
```json
{
"hooks": {
"SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start.mjs\"", "timeout": 5 }] }],
"UserPromptSubmit": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/keyword-detector.mjs\"", "timeout": 5 }] }],
"PostToolUse": [{ "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/drift-monitor.mjs\"", "timeout": 3 }] }]
}
}Codex CLI (Adapted Mode — bash loop)
Codex CLI(适配模式——bash循环)
Codex CLI has no native AfterAgent hooks. Use the setup script to configure:
bash
undefinedCodex CLI没有原生的AfterAgent钩子,使用设置脚本配置:
bash
undefinedSetup
设置
bash <your-agent-skills>/ralph/scripts/setup-codex-hook.sh
bash <your-agent-skills>/ralph/scripts/setup-codex-hook.sh
Restart Codex, then use:
重启Codex后使用:
/prompts:ralph # load ralph loop context
/prompts:ouroboros # load full ouroboros context
/prompts:ralph # 加载ralph循环上下文
/prompts:ouroboros # 加载完整ouroboros上下文
Use ooo commands in conversation:
在对话中使用ooo命令:
ooo interview "build a REST API"
ooo ralph "fix all TypeScript errors"
**Codex ralph loop contract:**
1. Treat `/ralph "<task>" [--completion-promise=TEXT] [--max-iterations=N]` as a contract command
2. Parse completion signal inside XML: `<promise>VALUE</promise>`
3. If promise missing and iteration < max-iterations → continue immediately with same original command
4. If promise found or max-iterations reached → finish with status report
**Completion promise syntax:**
```xml
<promise>DONE</promise>Manual state management for Codex:
- Create at loop start
.omc/state/ralph-state.json - Update counter each cycle
iteration - Set when promise found
status: "complete" - Default completion promise: | Default max iterations:
DONE10
ooo interview "build a REST API"
ooo ralph "fix all TypeScript errors"
**Codex ralph循环协议:**
1. 将`/ralph "<task>" [--completion-promise=TEXT] [--max-iterations=N]`视为协议命令
2. 解析XML中的完成信号:`<promise>VALUE</promise>`
3. 如果没有找到promise且迭代次数未达上限 → 立即用原命令继续执行
4. 如果找到promise或达到最大迭代次数 → 输出状态报告并结束
**完成承诺语法:**
```xml
<promise>DONE</promise>Codex手动状态管理:
- 循环启动时创建
.omc/state/ralph-state.json - 每个周期更新计数
iteration - 找到promise时设置
status: "complete" - 默认完成承诺:| 默认最大迭代次数:
DONE10
Gemini CLI (AfterAgent Hook Mode)
Gemini CLI(AfterAgent钩子模式)
bash
undefinedbash
undefinedInstall via extensions
通过扩展安装
gemini extensions install https://github.com/Q00/ouroboros
gemini extensions install https://github.com/Q00/ouroboros
OR install skills-template
或者安装skills-template
gemini extensions install https://github.com/supercent-io/skills-template
Required in `~/.gemini/settings.json`:
```json
{
"hooksConfig": { "enabled": true },
"context": {
"includeDirectories": ["~/.gemini/extensions/ralph"]
}
}AfterAgent hook for loop continuation (add to ):
~/.gemini/settings.jsonjson
{
"hooks": {
"AfterAgent": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "bash ~/.gemini/hooks/ralph-check.sh",
"timeout": 10
}]
}]
}
}Run in sandbox + YOLO mode to prevent constant confirmation prompts:
bash
gemini -s -yThen use commands directly:
oooooo interview "build a task CLI"
ooo ralph "fix all tests"⚠️ Gemini v0.30.0 bug: always in hook JSON.
Workaround: check directly instead of relying on the hook field.
stop_hook_activefalse.omc/state/ralph-state.jsongemini extensions install https://github.com/supercent-io/skills-template
需要在`~/.gemini/settings.json`中配置:
```json
{
"hooksConfig": { "enabled": true },
"context": {
"includeDirectories": ["~/.gemini/extensions/ralph"]
}
}用于循环续跑的AfterAgent钩子(添加到):
~/.gemini/settings.jsonjson
{
"hooks": {
"AfterAgent": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "bash ~/.gemini/hooks/ralph-check.sh",
"timeout": 10
}]
}]
}
}在沙箱+YOLO模式下运行,避免持续的确认提示:
bash
gemini -s -y然后直接使用命令:
oooooo interview "build a task CLI"
ooo ralph "fix all tests"⚠️ Gemini v0.30.0 已知bug: 钩子JSON中的始终为。
解决方案:直接检查,不要依赖钩子字段。
stop_hook_activefalse.omc/state/ralph-state.json8. Platform Support Matrix
8. 平台支持矩阵
| Platform | Native Support | Mechanism | ooo Commands | Loop |
|---|---|---|---|---|
| Claude Code | ✅ Full | Plugin + hooks | All | Auto via hooks |
| Codex CLI | 🔧 Adapted | bash + | Via conversation | Manual state file |
| Gemini CLI | ✅ Native | AfterAgent hook | All | Auto via hook |
| OpenCode | ✅ Native | Skills system | All | Auto via loop |
| 平台 | 原生支持 | 实现机制 | ooo命令支持 | 循环 |
|---|---|---|---|---|
| Claude Code | ✅ 全功能 | 插件+钩子 | 所有 | 钩子自动触发 |
| Codex CLI | 🔧 适配 | bash + | 通过对话使用 | 手动状态文件 |
| Gemini CLI | ✅ 原生 | AfterAgent钩子 | 所有 | 钩子自动触发 |
| OpenCode | ✅ 原生 | 技能系统 | 所有 | 自动循环 |
9. Quick Reference
9. 快速参考
| Action | Command |
|---|---|
| Socratic interview | |
| Generate spec | |
| Execute spec | |
| 3-stage evaluate | |
| Evolve until converged | |
| Persistent loop | |
| Break stagnation | |
| Check drift | |
| First-time setup | |
| Cancel | |
| Force cancel + clear | |
| Resume | |
| Cancel (Gemini/Codex) | |
| 操作 | 命令 |
|---|---|
| 苏格拉底式访谈 | |
| 生成规约 | |
| 执行规约 | |
| 三阶段评估 | |
| 演化直到收敛 | |
| 持续循环执行 | |
| 突破停滞 | |
| 检查偏差 | |
| 首次初始化 | |
| 取消 | |
| 强制取消+清空状态 | |
| 恢复 | |
| 取消(Gemini/Codex) | |
10. Installation
10. 安装
bash
undefinedbash
undefinedClaude Code
Claude Code
claude plugin marketplace add Q00/ouroboros
claude plugin install ouroboros@ouroboros
ooo setup
claude plugin marketplace add Q00/ouroboros
claude plugin install ouroboros@ouroboros
ooo setup
Codex CLI
Codex CLI
bash <skills>/ralph/scripts/setup-codex-hook.sh
bash <skills>/ralph/scripts/setup-codex-hook.sh
Gemini CLI (extensions)
Gemini CLI (扩展)
gemini extensions install https://github.com/Q00/ouroboros
gemini extensions install https://github.com/Q00/ouroboros
All platforms via skills-template
所有平台通过skills-template安装
npx skills add https://github.com/supercent-io/skills-template --skill ralph
Source: [Q00/ouroboros](https://github.com/Q00/ouroboros) — MIT Licensenpx skills add https://github.com/supercent-io/skills-template --skill ralph
源码: [Q00/ouroboros](https://github.com/Q00/ouroboros) — MIT License