拉尔夫
- 作者仓库星标 23
- 许可证 MIT
- 作者仓库 oh-my-droid
- 领域
- 效率工具
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @MeroZemory · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- Docker
- 运行环境要求
- Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Ralph Skill
[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
## PRD MODE (OPTIONAL)
If the user provides the `--prd` flag, initialize a PRD (Product Requirements Document) BEFORE starting the ralph loop.
### Detecting PRD Mode
Check if `{{PROMPT}}` contains the flag pattern: `--prd` or `--PRD`
### PRD Initialization Workflow
When `--prd` flag detected:
1. **Create PRD File Structure** (`.omd/prd.json` and `.omd/progress.txt`)
2. **Parse the task** (everything after `--prd` flag)
3. **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
}
]
}
```
4. **Create progress.txt**:
```
# Ralph Progress Log
Started: [ISO timestamp]
## 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
### Example Usage
User input: `--prd build a todo app with React and TypeScript`
Your workflow:
1. Detect `--prd` flag
2. Extract task: "build a todo app with React and TypeScript"
3. Create `.omd/prd.json` with user stories
4. Create `.omd/progress.txt`
5. Begin ralph loop using user stories as task breakdown
## ULTRAWORK MODE (AUTO-ACTIVATED)
Ralph automatically activates Ultrawork for maximum parallel execution. You MUST follow these rules:
### 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
### Smart Model Routing (SAVE TOKENS)
| 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" |
### Available Agents by Tier
| Domain | LOW (Haiku) | MEDIUM (Sonnet) | HIGH (Opus) |
|--------|-------------|-----------------|-------------|
| **Analysis** | `architect-low` | `architect-medium` | `architect` |
| **Execution** | `executor-low` | `executor` | `executor-high` |
| **Search** | `explore` | `explore-medium` | - |
| **Research** | `researcher-low` | `researcher` | - |
| **Frontend** | `designer-low` | `designer` | `designer-high` |
| **Docs** | `writer` | - | - |
| **Visual** | - | `vision` | - |
| **Planning** | - | - | `planner` |
| **Critique** | - | - | `critic` |
| **Pre-Planning** | - | - | `analyst` |
| **Testing** | - | `qa-tester` | - |
| **Security** | `security-reviewer-low` | - | `security-reviewer` |
| **Build** | `build-fixer-low` | `build-fixer` | - |
| **TDD** | `tdd-guide-low` | `tdd-guide` | - |
| **Code Review** | `code-reviewer-low` | - | `code-reviewer` |
**CRITICAL: Always pass `model` parameter explicitly!**
```
Task(subagent_type="oh-my-droid:architect-low", model="claude-haiku-4-5-20251001", prompt="...")
Task(subagent_type="oh-my-droid:executor", model="claude-sonnet-4-5-20250929", prompt="...")
Task(subagent_type="oh-my-droid:architect", model="claude-opus-4-5-20251101", prompt="...")
```
### Background Execution Rules
**Run in Background** (set `run_in_background: true`):
- Package installation: npm install, pip install, cargo build
- Build processes: npm run build, make, tsc
- Test suites: npm test, pytest, cargo test
- Docker operations: docker build, docker pull
**Run Blocking** (foreground):
- Quick status checks: git status, ls, pwd
- File reads, edits
- Simple commands
## COMPLETION REQUIREMENTS
Before claiming completion, you MUST:
1. Verify ALL requirements from the original task are met
2. Ensure no partial implementations
3. Check that code compiles/runs without errors
4. Verify tests pass (if applicable)
5. 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)
1. **IDENTIFY**: What command proves the task is complete?
2. **RUN**: Execute verification (test, build, lint)
3. **READ**: Check output - did it actually pass?
4. **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
1. Fresh test run output showing pass
2. Fresh build output showing success
3. lsp_diagnostics showing 0 errors
4. THEN Architect verification
5. THEN completion promise
**Skipping verification = Task NOT complete**
## ARCHITECT VERIFICATION (MANDATORY)
When you believe the task is complete:
1. **First**, spawn Architect to verify your work (ALWAYS pass model explicitly!):
```
Task(subagent_type="oh-my-droid:architect", model="claude-opus-4-5-20251101", prompt="Verify this implementation is complete: [describe what you did]")
```
2. **Wait for Architect's assessment**
3. **If Architect approves**: Run `/cancel` to cleanly exit ralph mode
4. **If Architect finds issues**: Fix them, then repeat verification
DO NOT exit without Architect 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
## STATE CLEANUP ON COMPLETION
**IMPORTANT: Use the cancel skill for proper state cleanup**
When work is complete and Architect verification passes, run `/cancel` to cleanly exit ralph mode. This handles:
- 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.
## 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 `/cancel` to cleanly exit and clean up all state files
- Do not stop until the task is truly done
Original task:
{{PROMPT}}
章节与文件索引
按说明文件中的顺序排列。
PRD模式(可选)
检测 PRD 模式
PRD初始化工作流程
用法示例
ULTRAWORK 模式(自动激活)
文件/命令 -> --prd · {{PROMPT}} · --PRD · .omd/prd.json · .omd/progress.txt · --prd build a todo app with React and TypeScript · architect-low · architect-medium
内容校验值 -> 1b071486498d
当前原文的自动摘译,尚未人工审校。
PRD模式(可选)
如果用户提供了
--prd标志,请在启动 ralph 循环之前初始化 PRD(产品需求文档)。检测 PRD 模式
检查
{{PROMPT}}是否包含标志模式:--prd或--PRDPRD初始化工作流程
当检测到
--prd标志时: 创建 PRD 文件结构(.omd/prd.json和.omd/progress.txt) 解析任务(--prd标志之后的所有内容) 使用以下结构分解为用户故事: 创建progress.txt:用法示例
用户输入:
--prd build a todo app with React and TypeScript您的工作流程:检测--prd标记 提取任务:“使用 React 和 TypeScript 构建待办事项应用程序” 使用用户故事创建.omd/prd.jsonULTRAWORK 模式(自动激活)
Ralph 自动激活 Ultrawork 以实现最大程度的并行执行。您必须遵守以下规则: