implement

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implement 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 analytics

bash
/implement user authentication
/implement real-time notifications
/implement dashboard analytics

Step 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),
.github/workflows/
, Dockerfile, terraform/, k8s/, CONTRIBUTING.md.
扫描代码库以识别信号:README关键词(take-home、interview)、
.github/workflows/
、Dockerfile、terraform/、k8s/、CONTRIBUTING.md。

Tier Classification

层级分类

SignalTierArchitecture Ceiling
README says "take-home", time limit1. Interview (details)Flat files, 8-15 files
< 10 files, no CI2. HackathonSingle file if possible
.github/workflows/
, managed DB
3. MVPMVC monolith
Module boundaries, Redis, queues4. GrowthModular monolith, DI
K8s/Terraform, monorepo5. EnterpriseHexagonal/DDD
CONTRIBUTING.md, LICENSE6. Open SourceMinimal API, exhaustive tests
If confidence is low, use
AskUserQuestion
to ask the user. Pass detected tier to ALL downstream agents — see
scope-appropriate-architecture
.
信号层级架构上限
README标注“带回家完成”、有时间限制1. 面试场景详情扁平文件,8-15个文件
文件数<10、无CI2. 黑客松场景尽可能采用单文件架构
存在
.github/workflows/
、托管数据库
3. MVP场景MVC单体架构
存在模块边界、Redis、队列4. 增长期场景模块化单体、依赖注入(DI)
存在K8s/Terraform、单体仓库5. 企业级场景六边形架构/领域驱动设计(DDD)
存在CONTRIBUTING.md、LICENSE6. 开源场景极简API、全面测试
若探测置信度较低,使用
AskUserQuestion
询问用户。将探测到的层级传递给所有下游Agent——参考
scope-appropriate-architecture

Tier → Workflow Mapping

层级→工作流映射

TierPhasesMax Agents
1. Interview1, 5 only2
2. Hackathon5 only1
3. MVP1-6, 93-4
4-5. Growth/EnterpriseAll 105-8
6. Open Source1-7, 9-103-4
Use
AskUserQuestion
to verify scope (full-stack / backend-only / frontend-only / prototype) and constraints.
层级阶段最大Agent数量
1. 面试场景仅阶段1、52
2. 黑客松场景仅阶段51
3. MVP场景阶段1-6、93-4
4-5. 增长期/企业级场景全部10个阶段5-8
6. 开源场景阶段1-7、9-103-4
使用
AskUserQuestion
确认范围(全栈/仅后端/仅前端/原型)与约束条件。

Orchestration Mode

编排模式

  • Agent Teams (mesh) when
    CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
    and complexity >= 2.5
  • Task tool (star) otherwise;
    ORCHESTKIT_FORCE_TASK_TOOL=1
    to override
  • See Orchestration Modes

  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
    且复杂度≥2.5时,采用Agent Teams(网格)模式
  • 否则采用任务工具(星型)模式;可设置
    ORCHESTKIT_FORCE_TASK_TOOL=1
    强制切换
  • 参考编排模式

Task Management (MANDATORY)

任务管理(强制要求)

Create tasks with
TaskCreate
BEFORE doing any work. Each phase gets a subtask. Update status with
TaskUpdate
as you progress.

在开展任何工作前,使用
TaskCreate
创建任务。每个阶段对应一个子任务。在推进过程中使用
TaskUpdate
更新状态。

Workflow (10 Phases)

工作流(10个阶段)

PhaseActivitiesAgents
1. DiscoveryResearch best practices, Context7 docs, break into tasks
2. Micro-PlanningDetailed plan per task (guide)
3. WorktreeIsolate in git worktree for 5+ file features (workflow)
4. Architecture5 parallel background agentsworkflow-architect, backend-system-architect, frontend-ui-developer, llm-integrator, ux-researcher
5. Implementation + TestsParallel agents, single-pass artifacts with mandatory testsbackend-system-architect, frontend-ui-developer, llm-integrator, test-generator, rapid-ui-designer
6. Integration VerificationCode review + real-service integration testsbackend, frontend, code-quality-reviewer, security-auditor
7. Scope CreepCompare planned vs actual (detection)workflow-architect
8. E2E VerificationBrowser + API E2E testing (guide)
9. DocumentationSave decisions to memory graph
10. ReflectionLessons learned, estimation accuracyworkflow-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个并行后台Agentworkflow-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
issue-progress-tracking
and post progress comments after major phases.
若处理GitHub问题,执行
issue-progress-tracking
中的启动工作流程,并在主要阶段完成后发布进度评论。

Feedback 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 TypeRequired Tests
testing-patterns
Rules
API endpointUnit + Integration + Contract
integration-api
,
verification-contract
,
mocking-msw
DB schema/migrationMigration + Integration
integration-database
,
data-seeding-cleanup
UI componentUnit + Snapshot + A11y
unit-aaa-pattern
,
integration-component
,
a11y-jest-axe
,
e2e-playwright
Business logicUnit + Property-based
unit-aaa-pattern
,
pytest-markers
,
verification-property
LLM/AI featureUnit + Eval
llm-deepeval
,
llm-mocking
,
llm-structured
Full-stack featureAll of the aboveAll matching rules
阶段5的test-generator必须生成与变更类型匹配的测试:
变更类型必填测试
testing-patterns
规则
API端点单元测试+集成测试+契约测试
integration-api
,
verification-contract
,
mocking-msw
数据库 schema/迁移迁移测试+集成测试
integration-database
,
data-seeding-cleanup
UI组件单元测试+快照测试+无障碍测试
unit-aaa-pattern
,
integration-component
,
a11y-jest-axe
,
e2e-playwright
业务逻辑单元测试+基于属性的测试
unit-aaa-pattern
,
pytest-markers
,
verification-property
LLM/AI特性单元测试+评估测试
llm-deepeval
,
llm-mocking
,
llm-structured
全栈特性以上所有测试所有匹配规则

Real-Service Detection (Phase 6)

真实服务探测(阶段6)

Before running integration tests, detect infrastructure:
python
undefined
在运行集成测试前,探测基础设施:
python
undefined

Auto-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
    run_in_background: true
    , launch all agents in ONE message
  • 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

  • 测试并非可选项 —— 每个任务都需包含与变更类型匹配的测试(见上方矩阵)
  • 独立任务并行执行 —— 使用
    run_in_background: true
    ,在一条消息中启动所有Agent
  • 单次生成完整产物 —— 生成完整的产物,避免不必要的拆分
  • 先微规划再实现 —— 明确范围边界、文件列表、验收标准
  • 检测范围蔓延(阶段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工作流
  • 端到端验证