一键导入
implement
Generate production code and tests for a story group using agent teams for parallel execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate production code and tests for a story group using agent teams for parallel execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Switch model mid-session preserving thinking blocks. Used by /model command and by BRD §6.2 failover when the primary provider rate-limits or fails.
Six-phase ReAct loop (pre-check, thinking, self-critique, action, tool, post). Activates per-workflow via the thinking_level knob in config/workflows.yaml. Replaces standard ReAct for workflows where independent verification of the reasoning improves outcomes.
Mines completed sessions for repeating {tool sequence → outcome} tuples. Scores by frequency × success_rate × novelty. High-scoring tuples become "instincts" — candidate skill seeds — in instincts/pending/.
Walk-back algorithm for the Spec-Auditor subagent. Given a failure at phase N, identifies the earliest phase whose spec, if tightened, would have prevented the failure. Proposes a surgical amendment.
Sessions stored as trees (not lists). /fork creates a branch from any point; /tree navigates; /branch labels a path; /export produces HTML for review. All branches live in one session file under sessions/<project>/<session_id>.json.
Progressive context refinement for subagents. Don't dump everything; retrieve in passes. Start with a list of file paths and one-line abstracts; load full content only when the abstract proves insufficient.
| name | implement |
| description | Generate production code and tests for a story group using agent teams for parallel execution. |
| argument-hint | [group-id] |
Generate production-quality code and tests for all stories in a dependency group, using a Claude Code agent team for parallel execution.
/implement C
Implements all stories in group C. The group ID corresponds to a node in specs/stories/dependency-graph.md.
Before running /implement, verify:
specs/stories/dependency-graph.md exists and lists groups with story assignments.specs/design/component-map.md exists and maps each story to the files it owns.If any prerequisite is missing, stop and report what is absent. Do not proceed with partial context.
Read .claude/skills/code-gen/SKILL.md in full. These six principles (small modules, static typing, functions under 50 lines, explicit error handling, no dead code, self-documenting names) apply to every line of code produced. Inject the full text into every teammate prompt.
Read specs/stories/dependency-graph.md. Identify:
Abort if upstream groups are not yet evaluated as PASS.
Read specs/design/component-map.md. For each story in the group, extract:
This ownership map is the single source of truth for file assignments during parallel execution.
Read .claude/state/learned-rules.md. Inject ALL rules verbatim into every teammate spawn prompt. Learned rules represent project-specific decisions made during previous sprints (naming conventions, library choices, API patterns). Skipping this step causes regressions.
Read project-manifest.json field execution.model_routing. This determines which model backs each agent spawn:
code_gen_agents.base_url endpoint. If using an OpenAI-compatible local model, prefix agent prompts with: Use model: {model_name} via {base_url}.If strategy is hybrid or local-only, verify the local endpoint is reachable before spawning:
curl -sf {base_url}/models > /dev/null || echo "WARN: Local model not reachable"
If unreachable, warn the human and wait for instructions. Do not fall back silently.
If the group contains 2 or more stories, spawn a Claude Code agent team:
Create 1 teammate per story, up to a maximum of 5 concurrent teammates.
If the group has more than 5 stories, batch them: first 5 stories run, then the remainder after all complete.
Each teammate spawn prompt must include:
.claude/state/learned-rules.md..claude/skills/code-gen/SKILL.md.Teammates must coordinate on shared types:
If two teammates claim ownership of the same file, escalate to the orchestrator (this agent). Do not merge partial changes. Resolve ownership, then continue.
If the group contains exactly 1 story, do not spawn a team. Execute the story using the generator agent directly:
After all teammates (or the generator) complete:
npm test or pytest (whichever applies to the project).npm run lint or ruff check ..tsc --noEmit or mypy ..All three must pass with zero errors before proceeding. If any fails, return the failure output to the responsible teammate for a fix, then re-run the validation gate.
Spawn the code-reviewer agent on the set of changed files:
If the reviewer still emits BLOCK findings after 3 retries, escalate to the user with a summary of the unresolved issues.
.claude/state/learned-rules.md recreates decisions the team has already made, causing style and pattern drift.