feature-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Workflow

功能开发工作流

Follow this workflow for new features or significant changes.
在开发新功能或进行重大变更时,请遵循此工作流。

Steps

步骤

  1. Research: Understand the codebase, requirements, and constraints
    • Check existing patterns and implementations for similar functionality
    • Review related tests to understand expected behavior
    • Identify dependencies and potential side effects
  2. Plan: Create initial plan with clear, actionable steps
    • Create a markdown feature file in
      docs/features/
      named
      YYYY-MM-DD-HHMM_FEATURE_NAME.md
    • Use
      date +%Y-%m-%d-%H%M
      for timestamp (e.g.,
      docs/features/2025-11-26-1530_AUTHENTICATION.md
      )
  3. Present Summary: Present brief plan to user
    • Use
      question_tool
      : "Go to clarifying"
    • If user adds context/feedback: immediately update feature file
    • Continue showing prompt until user confirms
    • Only proceed to Clarify after confirmation
  4. Clarify: Ask questions to ensure complete understanding (REQUIRED if ANY ambiguity exists)
    • Ask ALL questions at once in a single
      question_tool
      call with multiple questions
    • Use
      question_tool
      when options can be predefined; plain text otherwise
    • If answers reveal new ambiguities: ask follow-up questions (again, all at once)
    • When to ask: architecture, file structure, user-facing changes, breaking changes, major patterns
    • When NOT to ask: minor implementation details
    • NEVER skip if uncertain - defaulting to assumption is unacceptable
    • After ALL clarifying questions resolved: update feature file with decisions, then go to Confirm
  5. Confirm: Present final plan summary
    • Use
      question_tool
      : "Implement this plan"
    • If user confirms with no changes: proceed to implementation
    • If user provides changes/details: update feature file and ask "Implement this plan" again
    • Any plan modification requires re-confirmation before implementation
  6. Implement: Execute plan incrementally
    • Follow code style and architecture guidelines
    • Write tests alongside implementation
    • Make incremental commits for major milestones if working on large features
  7. Validate: Run all quality gates in order
    • If any gate fails: fix issues and re-run all gates from the beginning
  8. Update Feature File: Sync feature file with any discussions, decisions, or changes not yet documented
  9. Complete: After all quality gates pass
    • Summarize changes made
    • Ask about committing (see Version Control in AGENTS.md)
  1. 调研:了解代码库、需求和约束条件
    • 检查现有类似功能的实现模式
    • 查看相关测试以理解预期行为
    • 识别依赖项和潜在副作用
  2. 规划:制定包含清晰可执行步骤的初始方案
    • docs/features/
      目录下创建一个Markdown格式的功能文档,命名格式为
      YYYY-MM-DD-HHMM_FEATURE_NAME.md
    • 使用
      date +%Y-%m-%d-%H%M
      生成时间戳(例如:
      docs/features/2025-11-26-1530_AUTHENTICATION.md
  3. 展示方案摘要:向用户展示简要方案
    • 使用
      question_tool
      :“进入澄清环节”
    • 如果用户补充上下文/反馈:立即更新功能文档
    • 持续展示提示直到用户确认
    • 仅在确认后进入澄清环节
  4. 澄清细节:提出问题以确保完全理解需求(若存在任何歧义则必须执行此步骤)
    • 在单次
      question_tool
      调用中一次性提出所有问题
    • 当选项可预定义时使用
      question_tool
      ;否则使用纯文本提问
    • 如果答案揭示新的歧义:再次一次性提出跟进问题
    • 提问场景:架构、文件结构、用户侧变更、破坏性变更、核心模式
    • 无需提问场景:次要实现细节
    • 若存在不确定性绝不能跳过——默认假设是不可接受的
    • 在所有澄清问题解决后:将决策内容更新到功能文档,然后进入确认环节
  5. 确认最终方案:展示最终方案摘要
    • 使用
      question_tool
      :“执行此方案”
    • 如果用户无修改确认:进入开发阶段
    • 如果用户提出修改/补充细节:更新功能文档并再次询问“执行此方案”
    • 任何方案修改都需要重新确认才能进入开发
  6. 开发实现:逐步执行方案
    • 遵循代码风格和架构规范
    • 边开发边编写测试
    • 若开发大型功能,在关键节点提交增量代码
  7. 验证测试:按顺序运行所有质量检查环节
    • 若任何检查失败:修复问题后从头重新运行所有检查
  8. 更新功能文档:将所有未记录的讨论、决策或变更同步到功能文档中
  9. 完成交付:在所有质量检查通过后
    • 总结已完成的变更
    • 询问提交相关事宜(详见AGENTS.md中的版本控制部分)