feature-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Development Workflow

特性开发工作流

This skill provides a systematic 7-phase approach to building new features, ensuring better-designed features that integrate seamlessly with existing code.
该Skill提供了一个系统化的7阶段新特性构建方法,确保设计更优的特性能够与现有代码无缝集成。

Philosophy

核心理念

Building features requires more than just writing code. You need to:
  • Understand the codebase before making changes
  • Ask questions to clarify ambiguous requirements
  • Design thoughtfully before implementing
  • Review for quality after building
开发特性不仅仅是编写代码。你需要:
  • 修改前先了解代码库
  • 通过提问澄清模糊需求
  • 实现前进行周密设计
  • 开发完成后进行质量审查

The 7-Phase Workflow

7阶段工作流

Phase 1: Discovery

阶段1:需求探索

Goal: Understand what needs to be built
Actions:
  • Clarify the feature request if unclear
  • Ask what problem you're solving
  • Identify constraints and requirements
  • Summarize understanding and confirm with the user
When to proceed: Only after confirming understanding with the user
目标:明确需要开发的内容
行动步骤
  • 若特性需求不明确,先进行澄清
  • 询问需要解决的问题
  • 确定约束条件和需求
  • 总结理解内容并与用户确认
进入下一阶段的时机:仅在与用户确认理解一致后

Phase 2: Codebase Exploration

阶段2:代码库探索

Goal: Understand relevant existing code and patterns
Actions:
  • Use explore-agent to analyze different aspects in parallel:
    • Find features similar to the requested feature
    • Map the architecture and abstractions for relevant areas
    • Analyze current implementation of related features
  • Launch multiple explore-agents concurrently to maximize efficiency
Expected Output:
  • List of similar features with file references
  • Architecture patterns and abstractions used
  • Key files to understand with line numbers
  • Integration points and dependencies
Before proceeding: Read all identified key files to build deep understanding
目标:了解相关的现有代码和模式
行动步骤
  • 使用explore-agent并行分析不同方面:
    • 查找与需求特性相似的现有特性
    • 梳理相关领域的架构和抽象设计
    • 分析相关特性的当前实现方式
  • 同时启动多个explore-agent以提升效率
预期产出
  • 带有文件引用的相似特性列表
  • 所使用的架构模式和抽象设计
  • 需要重点理解的关键文件及对应行号
  • 集成点和依赖关系
进入下一阶段前:阅读所有已识别的关键文件,建立深入理解

Phase 3: Clarifying Questions

阶段3:问题澄清

Goal: Fill in gaps and resolve all ambiguities
Actions:
  • Review codebase findings and feature request
  • Identify underspecified aspects:
    • Edge cases
    • Error handling
    • Integration points
    • Backward compatibility
    • Performance needs
  • Present all questions in an organized list
  • Wait for user answers before proceeding
Critical: This phase ensures nothing is ambiguous before design begins.
目标:填补信息空白,解决所有模糊点
行动步骤
  • 回顾代码库探索结果和特性需求
  • 找出未明确的方面:
    • 边缘情况
    • 错误处理
    • 集成点
    • 向后兼容性
    • 性能需求
  • 将所有问题整理成结构化列表呈现
  • 等待用户答复后再进入下一阶段
关键提示:该阶段确保在设计开始前没有任何模糊点。

Phase 4: Architecture Design

阶段4:架构设计

Goal: Design multiple implementation approaches
Actions:
  • Design 2-3 different approaches:
    • Minimal changes: Smallest change, maximum reuse
    • Clean architecture: Maintainability, elegant abstractions
    • Pragmatic balance: Speed + quality
  • Present comparison with trade-offs and recommendation
  • Ask which approach the user prefers
Before proceeding: Wait for explicit user approval of architecture
目标:设计多种实现方案
行动步骤
  • 设计2-3种不同的方案:
    • 最小改动方案:改动量最小,最大化复用现有代码
    • 整洁架构方案:注重可维护性,采用优雅的抽象设计
    • 务实平衡方案:兼顾开发速度与质量
  • 呈现各方案的对比、权衡点及推荐建议
  • 询问用户偏好的方案
进入下一阶段前:等待用户明确批准所选架构

Phase 5: Implementation

阶段5:特性实现

Goal: Build the feature
Actions:
  • Read all relevant files identified in previous phases
  • Implement following chosen architecture
  • Follow codebase conventions strictly
  • Write clean, well-documented code
  • Track progress with todo_write tool
Important: Implementation only starts after user approves architecture
目标:开发特性
行动步骤
  • 阅读前序阶段识别的所有相关文件
  • 按照选定的架构进行实现
  • 严格遵循代码库的规范
  • 编写清晰、注释完善的代码
  • 使用todo_write工具跟踪进度
重要提示:仅在用户批准架构后才可开始实现

Phase 6: Quality Review

阶段6:质量审查

Goal: Ensure code is simple, DRY, elegant, and functionally correct
Actions:
  • Launch debugger agent to review for bugs and correctness
  • Review code for:
    • Simplicity and DRY principles
    • Functional correctness and logic errors
    • Project conventions and patterns
  • Present findings and ask user what to do:
    • Fix now
    • Fix later
    • Proceed as-is
  • Address issues based on user decision
目标:确保代码简洁、遵循DRY原则、设计优雅且功能正确
行动步骤
  • 启动debugger agent审查代码中的缺陷和正确性
  • 从以下方面审查代码:
    • 简洁性与DRY原则
    • 功能正确性与逻辑错误
    • 项目规范与模式
  • 呈现审查结果并询问用户处理方式:
    • 立即修复
    • 后续修复
    • 保持现状继续推进
  • 根据用户的决定处理问题

Phase 7: Summary

阶段7:总结归档

Goal: Document what was accomplished
Actions:
  • Mark all todos complete
  • Summarize:
    • What was built
    • Key decisions made
    • Files modified
    • Suggested next steps
目标:记录已完成的工作
行动步骤
  • 将所有待办事项标记为已完成
  • 总结内容包括:
    • 已开发的内容
    • 做出的关键决策
    • 修改的文件
    • 建议的后续步骤

When to Use This Workflow

适用场景

Use for:
  • New features that touch multiple files
  • Features requiring architectural decisions
  • Complex integrations with existing code
  • Features where requirements are somewhat unclear
Don't use for:
  • Single-line bug fixes
  • Trivial changes
  • Well-defined, simple tasks
  • Urgent hotfixes
适用场景:
  • 涉及多个文件的新特性
  • 需要进行架构决策的特性
  • 与现有代码存在复杂集成的特性
  • 需求存在一定模糊性的特性
不适用场景:
  • 单行代码的Bug修复
  • 微小的改动
  • 需求明确的简单任务
  • 紧急热修复

Best Practices

最佳实践

  1. Use the full workflow for complex features: The 7 phases ensure thorough planning
  2. Answer clarifying questions thoughtfully: Phase 3 prevents future confusion
  3. Choose architecture deliberately: Phase 4 gives you options for a reason
  4. Don't skip code review: Phase 6 catches issues before they reach production
  5. Read the suggested files: Phase 2 identifies key files—read them to understand context
  1. 针对复杂特性使用完整工作流:7个阶段确保规划周全
  2. 认真答复澄清问题:阶段3可避免后续出现混淆
  3. 审慎选择架构:阶段4提供多种方案是有其原因的
  4. 不要跳过代码审查:阶段6可在问题进入生产环境前发现它们
  5. 阅读推荐的文件:阶段2识别出的关键文件是理解上下文的关键,请务必阅读

Specialized Agents Used

使用的专用Agent

This workflow leverages these specialized agents:
  • explore-agent: For deep codebase analysis and pattern discovery
  • debugger: For quality review and bug detection
  • plan-agent: For architecture design and implementation planning
Launch agents in parallel when possible to maximize efficiency.
该工作流使用以下专用Agent:
  • explore-agent:用于深度代码库分析和模式发现
  • debugger:用于质量审查和缺陷检测
  • plan-agent:用于架构设计和实现规划
尽可能并行启动Agent以提升效率。