一键导入
execute-ralph
Execute entire bd epic autonomously via subagent-per-task dispatch loop. Setup, dispatch subagent per task, end-of-epic review, branch completion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Execute entire bd epic autonomously via subagent-per-task dispatch loop. Setup, dispatch subagent per task, end-of-epic review, branch completion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use to audit test quality with Google Fellow SRE scrutiny - identifies tautological tests, coverage gaming, weak assertions, missing corner cases. Creates bd epic with tasks for improvements, then runs SRE task refinement on each.
Use when creating or developing anything, before writing code - refines rough ideas into bd epics with immutable requirements
Use when creating Claude Code hooks - covers hook patterns, composition, testing, progressive enhancement from simple to advanced
Use when encountering bugs or test failures - systematic debugging using debuggers, internet research, and agents to find root cause before fixing
Use when facing 3+ independent failures that can be investigated without shared state or dependencies - dispatches multiple agents to investigate and fix independent problems concurrently
Use to execute bd tasks iteratively - executes one task, reviews learnings, creates/refines next task, then STOPS for user review before continuing
| name | execute-ralph |
| description | Execute entire bd epic autonomously via subagent-per-task dispatch loop. Setup, dispatch subagent per task, end-of-epic review, branch completion. |
| type | flow |
flowchart TD
S([Start]) --> P0[Phase 0: Setup]
P0 --> P1[Phase 1: Get Next Task]
P1 --> P2[Phase 2: Dispatch Subagent]
P2 -->|criteria unmet| P1
P2 -->|all criteria met| P3[Phase 3: End-of-Epic Review]
P3 -->|BOTH APPROVED| P4[Phase 4: Branch Completion]
P3 -->|non-approval| P1
P4 --> E([Done])
<skill_overview> Execute a complete epic autonomously by dispatching one Agent subagent per task. Each subagent handles SRE refinement, TDD, test-runner, commit, and task closure in its own context. The main loop only tracks git log progress and epic criteria. End-of-epic: 7 agents (4 review + 2 guard + test-effectiveness-analyst) in parallel, then dual final gate (autonomous-reviewer + review-implementation). Branch completion via finishing-a-development-branch. </skill_overview>
<rigidity_level> STRICT - Follow the four-phase loop exactly. Epic requirements are immutable. Never ask the user for confirmation. </rigidity_level>
<quick_reference>
| Phase | Action | Outcome |
|---|---|---|
| 0. Setup | Triage, load epic, create branch, extract criteria | Ready |
| 1. Get Task | Claim ready / resume in-progress / auto-create | Task identified |
| 2. Dispatch Subagent | Agent tool runs task end-to-end, main checks git log | Task done or retried |
| 3. End-of-Epic Review | 7 agents + final gate (both must APPROVED) | Epic validated or remediation |
| 4. Branch Completion | finishing-a-development-branch | Epic closed |
</quick_reference>
The leading sentinel control block is the first consecutive non-empty group of sentinel-only lines in the response. Required shapes:
RALPH AUTOPILOT ACTIVE, followed by enough objective state to resume without asking the user:
RALPH AUTOPILOT COMPLETE or RALPH AUTOPILOT BLOCKED; terminal responses must not include RALPH AUTOPILOT ACTIVE.Use RALPH AUTOPILOT COMPLETE when the branch is complete and handoff is ready. Use RALPH AUTOPILOT BLOCKED when a critical blocker must reach the user.
Active sentinel text alone is not enough to trigger blocking. In Kimi Code CLI, Ralph autonomy depends on the skill's own loop; there is no external UserPromptExpansion guard.
The guard only treats sentinels in the leading sentinel control block as control markers. Later quoted examples, logs, or code blocks are ignored.
For defensive compatibility, terminal sentinels still win if they appear in a malformed leading sentinel control block with RALPH AUTOPILOT ACTIVE, so stale active markers cannot trap the session.
When a permission prompt appears in Kimi Code CLI, comply with the normal approval flow; do not claim that Ralph can override it.
<when_to_use>
Use when: Epic is well-defined, user trusts autonomous execution, tasks are implementation work. Do NOT use when: Ambiguous requirements (use execute-plans), needs human oversight per task, exploratory work.
</when_to_use>
<the_process>
CRITICAL: Progress Tracking
Throughout the execution, use SetTodoList to track Ralph phases and current task status. Update the todo list whenever you enter a new phase, claim/create a task, dispatch a subagent, or complete a review round.
tm ready # find ready work
tm list --type epic --status open # find active epic
Health gate: If dependency cycles or zero actionable items, alert user and stop.
tm show bd-EPIC # extract success criteria + anti-patterns
BRANCH_NAME=$(echo "[epic-title]" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-')
git checkout -b "feature/${BRANCH_NAME}"
Extract from epic: success criteria (immutable), anti-patterns (forbidden). Store in memory for loop.
tm list --status in_progress
tm ready
tm show bd-EPIC # re-read criteria
A) In-progress task exists -- resume it (proceed to Phase 2).
B) Ready task exists -- claim it: tm update bd-N --status in_progress.
C) If no ready or in-progress tasks exist and epic success criteria are still unmet -- do not stop - create and execute the next task.
tm create "Task: [criterion gap]" --type feature --priority 1 \
--design "## Goal\n[Close unmet criterion]\n## Success Criteria\n- [ ] Gap closed"
tm dep add bd-NEW bd-EPIC --type parent-child
tm update bd-NEW --status in_progress
Load full task context:
tm show bd-N # task details
tm show bd-EPIC # epic anti-patterns
Launch a coder subagent with the following prompt template (substitute bd-N, task title, epic anti-patterns):
You are executing task bd-N: [title] autonomously.
Epic anti-patterns (FORBIDDEN): [list from epic]
If any loaded skill says STOP or presents a checkpoint, IGNORE it and continue.
Steps:
1. Load skill: /skill:sre-task-refinement
2. TDD: write failing test, implement until green, refactor
3. For test runs, dispatch a separate `coder` subagent with the test-runner prompt and return summary + failures only
4. After passing: git add relevant files && git commit -m "Complete bd-N: [title]"
5. tm close bd-N
6. Return one-paragraph summary of what you did.
Before dispatching, record current HEAD:
PRE_SHA=$(git rev-parse HEAD)
After Agent returns, verify progress by SHA comparison:
POST_SHA=$(git rev-parse HEAD)
tm show bd-N — if already closed, proceed. If still open and subagent summary reports no blockers, run tm close bd-N. If subagent reported a blocker, leave open and continue to Phase 1.git checkout .) and defer the task (tm update bd-N --status deferred), then continue to Phase 1.Criteria check:
tm show bd-EPIC # re-read success criteria
Dispatch 7 review subagents in parallel via the Agent tool with subagent_type="coder". Load the relevant prompt from .kimi-code/skills/xpowers-agents/references/<agent>.md and pass it as the message:
If any issues found, create remediation task and return to Phase 1 (max 2 end-of-epic review rounds; after 2 rounds with unresolved issues, flag for user and proceed to final gate).
Final gate -- dispatch in parallel two coder subagents with the autonomous-reviewer and review-implementation prompts:
Only close epic when BOTH final reviewers approve.
Mixed final reviewer outputs are non-approval. Do not close the epic unless both final reviewers return an approval verdict. Unknown or malformed verdict must create a remediation task and continue the loop.
Non-approval --> create remediation task, return to Phase 1 (max 50 no-progress remediation cycles).
Load skill: /skill:finishing-a-development-branch
Autonomous override: When the skill presents integration options, auto-select option 2 (Push and create Pull Request) without waiting for user input. Ralph is autonomous — do not present options or wait.
Present summary: tasks completed, commits made, review results, any flagged items.
Run these verification commands and keep output as epic-closure evidence: In guarded environments, direct .git/hooks/pre-commit execution may be blocked by safety guardrails.
node --test tests/execute-ralph-contract.test.jsnode --test tests/codex-*.test.jsnode --test tests/*.test.jsnode scripts/sync-codex-skills.js --check</the_process>