feature-planning

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Planning

功能规划

Systematically analyze feature requests and create detailed, actionable implementation plans.
系统性地分析功能请求,制定详细、可执行的落地计划。

When to Use

适用场景

  • Requests new feature ("add user authentication", "build dashboard")
  • Asks for enhancements ("improve performance", "add export")
  • Describes complex multi-step changes
  • Explicitly asks for planning ("plan how to implement X")
  • Provides vague requirements needing clarification
  • 请求新功能(如“添加用户认证”“构建数据看板”)
  • 提出功能增强需求(如“提升性能”“添加导出功能”)
  • 描述复杂的多步骤变更
  • 明确要求进行规划(如“规划如何实现X功能”)
  • 提供的需求模糊,需要进一步澄清

Planning Workflow

规划工作流

1. Understand Requirements

1. 理解需求

Ask clarifying questions:
  • What problem does this solve?
  • Who are the users?
  • Specific technical constraints?
  • What does success look like?
Explore the codebase: Use Task tool with
subagent_type='Explore'
and
thoroughness='medium'
to understand:
  • Existing architecture and patterns
  • Similar features to reference
  • Where new code should live
  • What will be affected
提出澄清问题:
  • 该功能要解决什么问题?
  • 目标用户是谁?
  • 有哪些具体的技术限制?
  • 成功的衡量标准是什么?
探索代码库: 使用Task工具,设置
subagent_type='Explore'
thoroughness='medium'
,以了解:
  • 现有架构与代码模式
  • 可参考的同类功能
  • 新代码的存放位置
  • 哪些部分会受到影响

2. Analyze & Design

2. 分析与设计

Identify components:
  • Database changes (models, migrations, schemas)
  • Backend logic (API endpoints, business logic, services)
  • Frontend changes (UI, state, routing)
  • Testing requirements
  • Documentation updates
Consider architecture:
  • Follow existing patterns (check CLAUDE.md)
  • Identify reusable components
  • Plan error handling and edge cases
  • Consider performance implications
  • Think about security and validation
Check dependencies:
  • New packages/libraries needed
  • Compatibility with existing stack
  • Configuration changes required
识别组件:
  • 数据库变更(模型、迁移、架构)
  • 后端逻辑(API接口、业务逻辑、服务)
  • 前端变更(UI界面、状态管理、路由)
  • 测试需求
  • 文档更新
架构考量:
  • 遵循现有代码模式(可查看CLAUDE.md)
  • 识别可复用组件
  • 规划错误处理与边界场景
  • 考量性能影响
  • 考虑安全与校验机制
检查依赖:
  • 是否需要引入新的包/库
  • 与现有技术栈的兼容性
  • 是否需要进行配置变更

3. Create Implementation Plan

3. 制定落地执行计划

Break feature into discrete, sequential tasks:
markdown
undefined
将功能拆解为独立、按序执行的任务
markdown
undefined

Feature: [Feature Name]

Feature: [Feature Name]

Overview

Overview

[Brief description of what will be built and why]
[Brief description of what will be built and why]

Architecture Decisions

Architecture Decisions

  • [Key decision 1 and rationale]
  • [Key decision 2 and rationale]
  • [Key decision 1 and rationale]
  • [Key decision 2 and rationale]

Implementation Tasks

Implementation Tasks

Task 1: [Component Name]

Task 1: [Component Name]

  • File:
    path/to/file.py:123
  • Description: [What needs to be done]
  • Details:
    • [Specific requirement 1]
    • [Specific requirement 2]
  • Dependencies: None (or list task numbers)
  • File:
    path/to/file.py:123
  • Description: [What needs to be done]
  • Details:
    • [Specific requirement 1]
    • [Specific requirement 2]
  • Dependencies: None (or list task numbers)

Task 2: [Component Name]

Task 2: [Component Name]

...
...

Testing Strategy

Testing Strategy

  • [What types of tests needed]
  • [Critical test cases to cover]
  • [What types of tests needed]
  • [Critical test cases to cover]

Integration Points

Integration Points

  • [How this connects with existing code]
  • [Potential impacts on other features]

**Include specific references:**
- File paths with line numbers (`src/utils/auth.py:45`)
- Existing patterns to follow
- Relevant documentation
  • [How this connects with existing code]
  • [Potential impacts on other features]

**包含具体参考信息:**
- 带行号的文件路径(如`src/utils/auth.py:45`)
- 需遵循的现有代码模式
- 相关文档

4. Review Plan with User

4. 与用户评审计划

Confirm:
  • Does this match expectations?
  • Missing requirements?
  • Adjust priorities or approach?
  • Ready to proceed?
确认以下内容:
  • 计划是否符合预期?
  • 是否遗漏需求?
  • 是否需要调整优先级或实现方式?
  • 是否可以开始执行?

5. Execute with plan-implementer

5. 借助plan-implementer执行

Launch plan-implementer agent for each task:
Task tool with:
- subagent_type: 'plan-implementer'
- description: 'Implement [task name]'
- prompt: Detailed task description from plan
Execution strategy:
  • Implement sequentially (respect dependencies)
  • Verify each task before next
  • Adjust plan if issues discovered
  • Let test-fixing skill handle failures
  • Let git-pushing skill handle commits
为每个任务启动plan-implementer agent:
Task tool with:
- subagent_type: 'plan-implementer'
- description: 'Implement [task name]'
- prompt: Detailed task description from plan
执行策略:
  • 按顺序执行(遵循任务依赖关系)
  • 完成一个任务并验证后再进行下一个
  • 若发现问题则调整计划
  • 由test-fixing skill处理测试失败
  • 由git-pushing skill处理代码提交

Best Practices

最佳实践

Planning:
  • Start broad, then specific
  • Reference existing code patterns
  • Include file paths and line numbers
  • Think through edge cases upfront
  • Keep tasks focused and atomic
Communication:
  • Explain architectural decisions
  • Highlight trade-offs and alternatives
  • Be explicit about assumptions
  • Provide context for future maintainers
Execution:
  • Implement one task at a time
  • Verify before moving forward
  • Keep user informed
  • Adapt based on discoveries
规划阶段:
  • 先从宏观入手,再细化到具体内容
  • 参考现有代码模式
  • 包含文件路径与行号
  • 提前考虑边界场景
  • 保持任务聚焦且独立可执行
沟通阶段:
  • 解释架构决策
  • 强调取舍方案与替代选项
  • 明确说明预设前提
  • 为后续维护人员提供背景信息
执行阶段:
  • 一次仅执行一个任务
  • 验证通过后再推进
  • 及时同步进展给用户
  • 根据实际发现调整方案

Integration

集成说明

  • plan-implementer agent: Receives task specs, implements
  • test-fixing skill: Auto-triggered on test failures
  • git-pushing skill: Triggered for commits
  • plan-implementer agent: 接收任务规格说明并执行开发
  • test-fixing skill: 测试失败时自动触发
  • git-pushing skill: 提交代码时触发