implement
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplement Feature
特性实现
Parallel subagent execution for feature implementation with scope control and reflection.
通过并行子Agent执行实现特性开发,包含范围控制与复盘机制。
Quick Start
快速开始
bash
/implement user authentication
/implement real-time notifications
/implement dashboard analyticsbash
/implement user authentication
/implement real-time notifications
/implement dashboard analyticsStep 0: Project Context Discovery
步骤0:项目上下文探测
BEFORE any work, detect the project tier. This becomes the complexity ceiling for all patterns.
在开展任何工作前,先探测项目层级。这将成为所有模式的复杂度上限。
Auto-Detection
自动探测
Scan codebase for signals: README keywords (take-home, interview), , Dockerfile, terraform/, k8s/, CONTRIBUTING.md.
.github/workflows/扫描代码库以识别信号:README关键词(take-home、interview)、、Dockerfile、terraform/、k8s/、CONTRIBUTING.md。
.github/workflows/Tier Classification
层级分类
| Signal | Tier | Architecture Ceiling |
|---|---|---|
| README says "take-home", time limit | 1. Interview (details) | Flat files, 8-15 files |
| < 10 files, no CI | 2. Hackathon | Single file if possible |
| 3. MVP | MVC monolith |
| Module boundaries, Redis, queues | 4. Growth | Modular monolith, DI |
| K8s/Terraform, monorepo | 5. Enterprise | Hexagonal/DDD |
| CONTRIBUTING.md, LICENSE | 6. Open Source | Minimal API, exhaustive tests |
If confidence is low, use to ask the user. Pass detected tier to ALL downstream agents — see .
AskUserQuestionscope-appropriate-architecture| 信号 | 层级 | 架构上限 |
|---|---|---|
| README标注“带回家完成”、有时间限制 | 1. 面试场景(详情) | 扁平文件,8-15个文件 |
| 文件数<10、无CI | 2. 黑客松场景 | 尽可能采用单文件架构 |
存在 | 3. MVP场景 | MVC单体架构 |
| 存在模块边界、Redis、队列 | 4. 增长期场景 | 模块化单体、依赖注入(DI) |
| 存在K8s/Terraform、单体仓库 | 5. 企业级场景 | 六边形架构/领域驱动设计(DDD) |
| 存在CONTRIBUTING.md、LICENSE | 6. 开源场景 | 极简API、全面测试 |
若探测置信度较低,使用询问用户。将探测到的层级传递给所有下游Agent——参考。
AskUserQuestionscope-appropriate-architectureTier → Workflow Mapping
层级→工作流映射
| Tier | Phases | Max Agents |
|---|---|---|
| 1. Interview | 1, 5 only | 2 |
| 2. Hackathon | 5 only | 1 |
| 3. MVP | 1-6, 9 | 3-4 |
| 4-5. Growth/Enterprise | All 10 | 5-8 |
| 6. Open Source | 1-7, 9-10 | 3-4 |
Use to verify scope (full-stack / backend-only / frontend-only / prototype) and constraints.
AskUserQuestion| 层级 | 阶段 | 最大Agent数量 |
|---|---|---|
| 1. 面试场景 | 仅阶段1、5 | 2 |
| 2. 黑客松场景 | 仅阶段5 | 1 |
| 3. MVP场景 | 阶段1-6、9 | 3-4 |
| 4-5. 增长期/企业级场景 | 全部10个阶段 | 5-8 |
| 6. 开源场景 | 阶段1-7、9-10 | 3-4 |
使用确认范围(全栈/仅后端/仅前端/原型)与约束条件。
AskUserQuestionOrchestration Mode
编排模式
- Agent Teams (mesh) when and complexity >= 2.5
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Task tool (star) otherwise; to override
ORCHESTKIT_FORCE_TASK_TOOL=1 - See Orchestration Modes
- 当且复杂度≥2.5时,采用Agent Teams(网格)模式
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - 否则采用任务工具(星型)模式;可设置强制切换
ORCHESTKIT_FORCE_TASK_TOOL=1 - 参考编排模式
Task Management (MANDATORY)
任务管理(强制要求)
Create tasks with BEFORE doing any work. Each phase gets a subtask. Update status with as you progress.
TaskCreateTaskUpdate在开展任何工作前,使用创建任务。每个阶段对应一个子任务。在推进过程中使用更新状态。
TaskCreateTaskUpdateWorkflow (10 Phases)
工作流(10个阶段)
| Phase | Activities | Agents |
|---|---|---|
| 1. Discovery | Research best practices, Context7 docs, break into tasks | — |
| 2. Micro-Planning | Detailed plan per task (guide) | — |
| 3. Worktree | Isolate in git worktree for 5+ file features (workflow) | — |
| 4. Architecture | 5 parallel background agents | workflow-architect, backend-system-architect, frontend-ui-developer, llm-integrator, ux-researcher |
| 5. Implementation + Tests | Parallel agents, single-pass artifacts with mandatory tests | backend-system-architect, frontend-ui-developer, llm-integrator, test-generator, rapid-ui-designer |
| 6. Integration Verification | Code review + real-service integration tests | backend, frontend, code-quality-reviewer, security-auditor |
| 7. Scope Creep | Compare planned vs actual (detection) | workflow-architect |
| 8. E2E Verification | Browser + API E2E testing (guide) | — |
| 9. Documentation | Save decisions to memory graph | — |
| 10. Reflection | Lessons learned, estimation accuracy | workflow-architect |
See Agent Phases for detailed agent prompts and spawn templates.
For Agent Teams mode, see Agent Teams Phases.
| 阶段 | 活动内容 | 涉及Agent |
|---|---|---|
| 1. 调研 | 研究最佳实践、Context7文档、拆分任务 | — |
| 2. 微规划 | 针对每个任务制定详细计划(指南) | — |
| 3. 工作树 | 对于涉及5个以上文件的特性,使用git worktree进行隔离(工作流) | — |
| 4. 架构设计 | 5个并行后台Agent | workflow-architect, backend-system-architect, frontend-ui-developer, llm-integrator, ux-researcher |
| 5. 实现+测试 | 并行Agent执行,一次性生成包含强制测试的产物 | backend-system-architect, frontend-ui-developer, llm-integrator, test-generator, rapid-ui-designer |
| 6. 集成验证 | 代码审查+真实服务集成测试 | backend, frontend, code-quality-reviewer, security-auditor |
| 7. 范围蔓延检测 | 对比计划与实际情况(检测方法) | workflow-architect |
| 8. 端到端验证 | 浏览器+API端到端测试(指南) | — |
| 9. 文档记录 | 将决策保存至内存图谱 | — |
| 10. 复盘 | 总结经验教训、评估预估准确性 | workflow-architect |
参考Agent阶段获取详细的Agent提示词与生成模板。
若使用Agent Teams模式,参考Agent Teams阶段。
Issue Tracking
问题追踪
If working on a GitHub issue, run the Start Work ceremony from and post progress comments after major phases.
issue-progress-tracking若处理GitHub问题,执行中的启动工作流程,并在主要阶段完成后发布进度评论。
issue-progress-trackingFeedback Loop
反馈循环
Maintain checkpoints after each task. See Feedback Loop for triggers and actions.
在每个任务完成后设置检查点。参考反馈循环获取触发条件与操作指南。
Test Requirements Matrix
测试要求矩阵
Phase 5 test-generator MUST produce tests matching the change type:
| Change Type | Required Tests | |
|---|---|---|
| API endpoint | Unit + Integration + Contract | |
| DB schema/migration | Migration + Integration | |
| UI component | Unit + Snapshot + A11y | |
| Business logic | Unit + Property-based | |
| LLM/AI feature | Unit + Eval | |
| Full-stack feature | All of the above | All matching rules |
阶段5的test-generator必须生成与变更类型匹配的测试:
| 变更类型 | 必填测试 | |
|---|---|---|
| API端点 | 单元测试+集成测试+契约测试 | |
| 数据库 schema/迁移 | 迁移测试+集成测试 | |
| UI组件 | 单元测试+快照测试+无障碍测试 | |
| 业务逻辑 | 单元测试+基于属性的测试 | |
| LLM/AI特性 | 单元测试+评估测试 | |
| 全栈特性 | 以上所有测试 | 所有匹配规则 |
Real-Service Detection (Phase 6)
真实服务探测(阶段6)
Before running integration tests, detect infrastructure:
python
undefined在运行集成测试前,探测基础设施:
python
undefinedAuto-detect real service testing capability (PARALLEL)
自动探测真实服务测试能力(并行执行)
Glob(pattern="/docker-compose*.yml")
Glob(pattern="/testcontainers*")
Grep(pattern="testcontainers|docker-compose", glob="requirements*.txt")
Grep(pattern="testcontainers|docker-compose", glob="package.json")
If detected: run integration tests against real services, not just mocks. Reference `testing-patterns` rules: `integration-database`, `integration-api`, `data-seeding-cleanup`.Glob(pattern="/docker-compose*.yml")
Glob(pattern="/testcontainers*")
Grep(pattern="testcontainers|docker-compose", glob="requirements*.txt")
Grep(pattern="testcontainers|docker-compose", glob="package.json")
若探测到相关配置:针对真实服务运行集成测试,而非仅使用模拟服务。参考`testing-patterns`规则:`integration-database`, `integration-api`, `data-seeding-cleanup`。Phase 9 Gate
阶段9准入条件
Do NOT proceed to Phase 9 (Documentation) if test-generator produced 0 tests. Return to Phase 5 and generate tests for the implemented code.
若test-generator未生成任何测试,不得进入阶段9(文档记录)。返回阶段5为已实现代码生成测试。
Key Principles
核心原则
- Tests are NOT optional — each task includes its tests, matched to change type (see matrix above)
- Parallel when independent — use , launch all agents in ONE message
run_in_background: true - 128K output — generate complete artifacts in a single pass, don't split unnecessarily
- Micro-plan before implementing — scope boundaries, file list, acceptance criteria
- Detect scope creep (phase 7) — score 0-10, split PR if significant
- Real services when available — if docker-compose/testcontainers exist, use them in Phase 6
- Reflect and capture lessons (phase 10) — persist to memory graph
- 测试并非可选项 —— 每个任务都需包含与变更类型匹配的测试(见上方矩阵)
- 独立任务并行执行 —— 使用,在一条消息中启动所有Agent
run_in_background: true - 单次生成完整产物 —— 生成完整的产物,避免不必要的拆分
- 先微规划再实现 —— 明确范围边界、文件列表、验收标准
- 检测范围蔓延(阶段7)—— 评分0-10,若蔓延显著则拆分PR
- 优先使用真实服务 —— 若存在docker-compose/testcontainers,在阶段6中使用
- 复盘并总结经验(阶段10)—— 将结果持久化至内存图谱
Related Skills
相关技能
- explore: Explore codebase before implementing
- verify: Verify implementations work correctly
- worktree-coordination: Git worktree management patterns
- issue-progress-tracking: Auto-updates GitHub issues with commit progress
- explore: 实现前探索代码库
- verify: 验证实现是否正常工作
- worktree-coordination: Git worktree管理模式
- issue-progress-tracking: 自动更新GitHub问题的提交进度
References
参考资料
- Agent Phases
- Agent Teams Phases
- Interview Mode
- Orchestration Modes
- Feedback Loop
- CC Enhancements
- Agent Teams Full-Stack Pipeline
- Team Worktree Setup
- Micro-Planning Guide
- Scope Creep Detection
- Worktree Workflow
- E2E Verification
- Agent阶段
- Agent Teams阶段
- 面试模式
- 编排模式
- 反馈循环
- CC增强
- Agent Teams全栈流水线
- 团队Worktree设置
- 微规划指南
- 范围蔓延检测
- Worktree工作流
- 端到端验证