用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cbgbt/bottlerocket-forest --skill implement-commit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Deep code review generating PR comments via principled question-driven analysis
正在显示 SKILL.md
基于 SOC 职业分类
| name | implement-commit |
| description | Implement commits from an implementation plan using a TDD pipeline |
Execute commits from an implementation-plan.toml using a mechanical TDD pipeline.
docs/features/NNNN-name/implementation-plan.tomlYou are a mechanical orchestrator. The driver (ic-driver.py) handles state transitions.
You only:
You MUST NOT read relevant files unless something fails - preserve your tokens, trust the ic-driver
import json
from pydantic import BaseModel
from typing import Literal
# Paths
feature_dir = "docs/features/NNNN-feature"
plan_path = f"{feature_dir}/implementation-plan.toml"
state_dir = ".ic"
driver = "skills/implement-commit/ic-driver.py"
workspace = "." # From plan meta
# Response models
class PhaseResult(BaseModel):
status: Literal["ok", "problems"]
files_created: list[str] = []
files_modified: list[str] = []
notes: str | None = None
class GateDiscovery(BaseModel):
designer_gate: str
test_gate: str
class FormatterDiscovery(BaseModel):
fmt_cmd: str
lint_cmd: str
class StyleResult(BaseModel):
status: Literal["accept", "violations"]
violations: list[str] = []
class ArbiterResult(BaseModel):
proceed: bool
reasoning: str
# Agent files for spawns
agents = {
"designer": "skills/implement-commit/agents/designer.md",
"tester": "skills/implement-commit/agents/tester.md",
"implementor": "skills/implement-commit/agents/implementor.md",
"arbiter": "skills/implement-commit/agents/arbiter.md",
}
style_guides = {
"designer": "docs/style/rust-design.md",
"tester": "docs/style/rust-test.md",
"implementor": "docs/style/rust-impl.md",
}
For each commit (in dependency order):
commit_id = 1 # From dependency analysis
state_path = f"{state_dir}/commit-{commit_id}.json"
# Initialize
bash(f"python {driver} init --plan {plan_path} --commit {commit_id} --state {state_path}", on_error="raise")
# Drive loop
while True:
try:
output = bash(f"python {driver} next --state {state_path}", on_error="raise")
except BashError as e:
# Driver needs LLM help - see Handling Escalation below
handle_escalation(e, state_path)
continue
action = json.loads(output)
if action["action"] == "done":
break
if action["action"] == "spawn":
result = execute_spawn(action)
bash(
f"python {driver} report --state {state_path} --result '{json.dumps(result)}'",
on_error="raise"
)
def execute_spawn(action: dict) -> dict:
phase = action.get("phase")
# Determine context files
context_files = [f"{feature_dir}/design.md"]
if phase and phase in agents:
context_files.append(agents[phase])
if phase in style_guides:
context_files.append(style_guides[phase])
# Determine response model
if action.get("response_schema") == "GateDiscovery":
model = GateDiscovery
elif action.get("response_schema") == "FormatterDiscovery":
model = FormatterDiscovery
elif action.get("style_review"):
model = StyleResult
elif action.get("arbiter"):
model = ArbiterResult
else:
model = PhaseResult
# Execute spawn
result = spawn(
prompt=action["prompt"],
context_files=context_files,
response_model=model,
read_only=action.get("style_review") or action.get("scope_review"),
isolate_to=Cwd(workspace) if not action.get("style_review") else None,
)
result_dict = result.parsed.model_dump()
# Preserve action flags for driver state machine
if action.get("arbiter"):
result_dict["arbiter"] = True
return result_dict
When driver exits 1, it needs LLM help:
def handle_escalation(e: BashError, state_path: str):
# Parse escalation from stderr
escalation = json.loads(e.stderr)
error = escalation["error"]
# LLM intervention - understand and fix the issue
# This is where you THINK - the driver gave you control
if "gate failed" in error.lower():
# Could be code error or gate misconfiguration
# Spawn a fixer or adjust gates
spawn(
prompt=f"Fix this gate failure: {error}",
context_files=[...],
isolate_to=Cwd(workspace),
)
elif "arbiter rejected" in error.lower():
# Style issues too severe
agent_feedback(f"Style review failed: {error}")
elif "scope violations" in error.lower():
# Out of scope changes
agent_feedback(f"Scope violation: {error}")
else:
agent_feedback(f"Unknown escalation: {error}")
# Resume after fix
bash(f"python {driver} resume --state {state_path}", on_error="raise")
| Command | Purpose |
|---|---|
init | Create state file for a commit |
next | Get next action (spawn) or execute gate/bash directly |
report | Report spawn result, advance state |
resume | Continue after LLM intervention |
status | Show current state (debugging) |
EXPLORE_GATES -> EXPLORE_FORMATTERS ->
DESIGNER_PHASE -> DESIGNER_GATE -> DESIGNER_STYLE ->
TESTER_PHASE -> TESTER_GATE -> TESTER_STYLE ->
IMPLEMENTOR_PHASE -> IMPLEMENTOR_GATE -> IMPLEMENTOR_STYLE ->
SCOPE_REVIEW -> FORMAT -> COMMIT -> DONE
skills/implement-commit/
├── SKILL.md # This file
├── ic-driver.py # State machine driver
└── agents/
├── designer.md # Creates types and signatures
├── tester.md # Writes tests
├── implementor.md # Implements logic
└── arbiter.md # Decides style review proceed/fail
Reviewers use separate skills: review-scope, review-style.