ralph
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRalph Skill
Ralph Skill
[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
[RALPH + ULTRAWORK - 迭代 {{ITERATION}}/{{MAX}}]
你之前的尝试未输出完成承诺。请继续处理任务。
PRD MODE (OPTIONAL)
PRD模式(可选)
If the user provides the flag, initialize a PRD (Product Requirements Document) BEFORE starting the ralph loop.
--prd如果用户提供标志,请在启动ralph循环之前初始化PRD(产品需求文档)。
--prdDetecting PRD Mode
检测PRD模式
Check if contains the flag pattern: or
{{PROMPT}}--prd--PRD检查是否包含标志模式:或
{{PROMPT}}--prd--PRDPRD Initialization Workflow
PRD初始化工作流
When flag detected:
--prd- Create PRD File Structure (and
.omc/prd.json).omc/progress.txt - Parse the task (everything after flag)
--prd - Break down into user stories with this structure:
json
{
"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
}
]
}- Create progress.txt:
undefined当检测到标志时:
--prd- 创建PRD文件结构(和
.omc/prd.json).omc/progress.txt - 解析任务(标志之后的所有内容)
--prd - 拆解为用户故事,结构如下:
json
{
"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
}
]
}- 创建progress.txt:
undefinedRalph Progress Log
Ralph进度日志
Started: [ISO timestamp]
开始时间: [ISO时间戳]
Codebase Patterns
代码库模式
(No patterns discovered yet)
5. **Guidelines for PRD creation**:
- Right-sized stories: Each completable in one focused session
- Verifiable criteria: Include "Typecheck passes", "Tests pass"
- Independent stories: Minimize dependencies
- Priority order: Foundational work (DB, types) before UI
6. **After PRD created**: Proceed to normal ralph loop execution using the user stories as your task list(尚未发现任何模式)
5. **PRD创建指南**:
- 合理拆分故事:每个故事可在一个专注的会话内完成
- 可验证的标准:包含“类型检查通过”、“测试通过”
- 独立的故事:最小化依赖关系
- 优先级排序:基础工作(数据库、类型定义)优先于UI
6. **PRD创建完成后**:使用用户故事作为任务列表,执行常规ralph循环Example Usage
使用示例
User input:
--prd build a todo app with React and TypeScriptYour workflow:
- Detect flag
--prd - Extract task: "build a todo app with React and TypeScript"
- Create with user stories
.omc/prd.json - Create
.omc/progress.txt - Begin ralph loop using user stories as task breakdown
用户输入:
--prd build a todo app with React and TypeScript你的工作流:
- 检测到标志
--prd - 提取任务:“build a todo app with React and TypeScript”
- 创建包含用户故事的
.omc/prd.json - 创建
.omc/progress.txt - 以用户故事为任务拆解,启动ralph循环
ULTRAWORK MODE (AUTO-ACTIVATED)
ULTRAWORK模式(自动激活)
Ralph is a persistence wrapper that includes Ultrawork as a component for maximum parallel execution. You MUST follow these rules:
Ralph是一个持久化包装器,包含Ultrawork组件以实现最大程度的并行执行。你必须遵循以下规则:
Parallel Execution Rules
并行执行规则
- PARALLEL: Fire independent calls simultaneously - NEVER wait sequentially
- BACKGROUND FIRST: Use Task(run_in_background=true) for long operations (10+ concurrent)
- DELEGATE: Route tasks to specialist agents immediately
- 并行执行:同时发起独立调用——绝不要按顺序等待
- 优先后台执行:对长时间操作使用Task(run_in_background=true)(10+并发)
- 任务委派:立即将任务路由给专业Agent
Smart Model Routing (SAVE TOKENS)
智能模型路由(节省Token)
| Task Complexity | Tier | Examples |
|---|---|---|
| Simple lookups | LOW (haiku) | "What does this function return?", "Find where X is defined" |
| Standard work | MEDIUM (sonnet) | "Add error handling", "Implement this feature" |
| Complex analysis | HIGH (opus) | "Debug this race condition", "Refactor auth module" |
| 任务复杂度 | 层级 | 示例 |
|---|---|---|
| 简单查询 | 低级(haiku) | "这个函数返回什么?", "查找X的定义位置" |
| 标准工作 | 中级(sonnet) | "添加错误处理", "实现此功能" |
| 复杂分析 | 高级(opus) | "调试此竞态条件", "重构认证模块" |
Available Agents by Tier
各层级可用Agent
FIRST ACTION: Before delegating any work, read the agent reference file:
Read file: docs/shared/agent-tiers.mdThis provides the complete agent tier matrix, MCP tool assignments, and selection guidance.
CRITICAL: Always pass parameter explicitly!
modelTask(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="...")
Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="...")
Task(subagent_type="oh-my-claudecode:architect", model="opus", prompt="...")首要操作:在委派任何工作之前,读取Agent参考文件:
Read file: docs/shared/agent-tiers.md该文件提供完整的Agent层级矩阵、MCP工具分配和选择指南。
关键:始终显式传递参数!
modelTask(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="...")
Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="...")
Task(subagent_type="oh-my-claudecode:architect", model="opus", prompt="...")Background Execution Rules
后台执行规则
Run in Background (set ):
run_in_background: true- Package installation (npm install, pip install, cargo build, etc.)
- Build processes (project build command, make, etc.)
- Test suites (project test command, etc.)
- Docker operations: docker build, docker pull
Run Blocking (foreground):
- Quick status checks: git status, ls, pwd
- File reads, edits
- Simple commands
后台运行(设置):
run_in_background: true- 包安装(npm install, pip install, cargo build等)
- 构建流程(项目构建命令、make等)
- 测试套件(项目测试命令等)
- Docker操作:docker build, docker pull
阻塞运行(前台):
- 快速状态检查:git status, ls, pwd
- 文件读取、编辑
- 简单命令
COMPLETION REQUIREMENTS
完成要求
Before claiming completion, you MUST:
- Verify ALL requirements from the original task are met
- Ensure no partial implementations
- Check that code compiles/runs without errors
- Verify tests pass (if applicable)
- TODO LIST: Zero pending/in_progress tasks
在声明任务完成之前,你必须:
- 验证原始任务的所有要求均已满足
- 确保无部分实现的内容
- 检查代码可编译/运行且无错误
- 验证测试通过(如适用)
- 待办列表:无待处理/进行中的任务
VERIFICATION BEFORE COMPLETION (IRON LAW)
完成前验证(铁则)
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
Before outputting the completion promise:
无新鲜验证证据,不得声明任务完成
在输出完成承诺之前:
Steps (MANDATORY)
步骤(强制性)
- IDENTIFY: What command proves the task is complete?
- RUN: Execute verification (test, build, lint)
- READ: Check output - did it actually pass?
- ONLY THEN: Proceed to Architect verification
- 确定:什么命令可以证明任务已完成?
- 执行:执行验证操作(测试、构建、代码检查)
- 查看:检查输出——是否真的通过?
- 仅在此时:进行架构师验证
Red Flags (STOP and verify)
危险信号(停止并验证)
- Using "should", "probably", "seems to"
- About to output completion without fresh evidence
- Expressing satisfaction before verification
- 使用“应该”、“可能”、“似乎”等词汇
- 未获取新鲜证据就准备输出完成承诺
- 在验证前表示满意
Evidence Chain
证据链
- Fresh test run output showing pass
- Fresh build output showing success
- lsp_diagnostics showing 0 errors
- THEN Architect verification
- THEN completion promise
Skipping verification = Task NOT complete
- 显示通过的新鲜测试运行输出
- 显示成功的新鲜构建输出
- lsp_diagnostics显示0个错误
- 然后进行架构师验证
- 然后输出完成承诺
跳过验证 = 任务未完成
VERIFICATION PROTOCOL (TIERED)
验证协议(分层)
Ralph uses tiered verification to save tokens while maintaining quality.
Ralph使用分层验证以在保证质量的同时节省Token。
Verification Tier Selection
验证层级选择
Before spawning architect for verification, determine the appropriate tier:
| Change Profile | Tier | Agent |
|---|---|---|
| <5 files, <100 lines, full tests | LIGHT | architect-low (haiku) |
| Standard changes | STANDARD | architect-medium (sonnet) |
| >20 files, security/architectural | THOROUGH | architect (opus) |
在生成架构师进行验证之前,确定合适的层级:
| 变更概况 | 层级 | Agent |
|---|---|---|
| <5个文件,<100行代码,完整测试 | 轻量 | architect-low (haiku) |
| 标准变更 | 标准 | architect-medium (sonnet) |
| >20个文件,安全/架构相关 | 全面 | architect (opus) |
Ralph Minimum Verification Tier
Ralph最低验证层级
Floor: STANDARD (architect-medium / sonnet)
Even for small changes (<5 files), ralph requires at least STANDARD tier verification. The LIGHT tier (haiku) is insufficient for ralph's completion guarantee. When tier selection returns LIGHT, upgrade to STANDARD.
下限:标准(architect-medium / sonnet)
即使是小变更(<5个文件),ralph也至少需要标准层级的验证。轻量层级(haiku)不足以满足ralph的完成保证。当层级选择为轻量时,升级为标准层级。
Verification Flow
验证流程
- Collect change metadata: Count files, lines, detect security/architectural patterns
- Select tier: Apply rules from
/docs/shared/verification-tiers.md - Spawn appropriate architect:
// LIGHT - small, well-tested changes Task(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="Quick verification: [describe changes]") // STANDARD - most changes Task(subagent_type="oh-my-claudecode:architect-medium", model="sonnet", prompt="Verify implementation: [describe changes]") // THOROUGH - large/security/architectural changes Task(subagent_type="oh-my-claudecode:architect", model="opus", prompt="Full verification: [describe changes]") - Wait for verdict
- If approved: Run to cleanly exit
/oh-my-claudecode:cancel - If rejected: Fix issues and re-verify (same tier)
For complete tier selection rules, read:
docs/shared/verification-tiers.md- 收集变更元数据:统计文件数量、代码行数,检测安全/架构模式
- 选择层级:应用中的规则
/docs/shared/verification-tiers.md - 生成合适的架构师:
// 轻量 - 小型、测试完善的变更 Task(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="Quick verification: [describe changes]") // 标准 - 大多数变更 Task(subagent_type="oh-my-claudecode:architect-medium", model="sonnet", prompt="Verify implementation: [describe changes]") // 全面 - 大型/安全/架构变更 Task(subagent_type="oh-my-claudecode:architect", model="opus", prompt="Full verification: [describe changes]") - 等待裁决
- 如果通过:运行以干净退出
/oh-my-claudecode:cancel - 如果被拒绝:修复问题并重新验证(同一层级)
完整的层级选择规则,请阅读:
docs/shared/verification-tiers.mdExternal Model Consultation (Preferred)
外部模型咨询(推荐)
During architect verification, the architect agent SHOULD consult Codex for validation cross-check.
在架构师验证期间,架构师Agent应咨询Codex以进行验证交叉检查。
Protocol
协议
- Architect forms OWN verification analysis first
- Consults Codex with
agent_role: "architect" - Never blocks on unavailable tools
- Verification proceeds regardless of Codex availability
- 架构师首先形成自己的验证分析
- 使用咨询Codex
agent_role: "architect" - 绝不因工具不可用而阻塞
- 无论Codex是否可用,验证都将继续进行
When Architect Should Consult
架构师应咨询的场景
- Security-sensitive changes
- Architectural refactoring
- Complex multi-system integration
- 安全敏感变更
- 架构重构
- 复杂多系统集成
When to Skip
可跳过的场景
- Simple feature additions
- Well-tested changes
- Time-critical verification
- 简单功能添加
- 测试完善的变更
- 时间紧迫的验证
ZERO TOLERANCE
零容忍规则
- NO Scope Reduction - deliver FULL implementation
- NO Partial Completion - finish 100%
- NO Premature Stopping - ALL TODOs must be complete
- NO TEST DELETION - fix code, not tests
- 不得缩小范围——交付完整实现
- 不得部分完成——100%完成
- 不得提前停止——所有待办事项必须完成
- 不得删除测试——修复代码,而非测试
STATE CLEANUP ON COMPLETION
完成时的状态清理
IMPORTANT: Use the cancel skill for proper state cleanup
When work is complete and Architect verification passes, run to cleanly exit ralph mode. This handles:
/oh-my-claudecode:cancel- Deletion of ralph state files (both local and global)
- Cleanup of linked ultrawork or ecomode state
- Proper termination of the ralph loop
This ensures clean state for future sessions without leaving stale state files behind.
重要:使用cancel skill进行适当的状态清理
当工作完成且架构师验证通过后,运行以干净退出ralph模式。这将处理:
/oh-my-claudecode:cancel- 删除ralph状态文件(本地和全局)
- 清理关联的ultrawork或ecomode状态
- 正确终止ralph循环
这确保未来会话的状态干净,不会留下陈旧的状态文件。
INSTRUCTIONS
指令
- Review your progress so far
- Continue from where you left off
- Use parallel execution and background tasks
- When FULLY complete AND Architect verified: Run to cleanly exit and clean up all state files
/oh-my-claudecode:cancel - Do not stop until the task is truly done
Original task:
{{PROMPT}}
- 回顾你目前的进度
- 从上次中断的地方继续
- 使用并行执行和后台任务
- 当完全完成且通过架构师验证后:运行以干净退出并清理所有状态文件
/oh-my-claudecode:cancel - 直到任务真正完成才停止
原始任务:
{{PROMPT}}