feature-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFeature Workflow
功能开发工作流
Follow this workflow for new features or significant changes.
在开发新功能或进行重大变更时,请遵循此工作流。
Steps
步骤
-
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
-
Plan: Create initial plan with clear, actionable steps
- Create a markdown feature file in named
docs/features/YYYY-MM-DD-HHMM_FEATURE_NAME.md - Use for timestamp (e.g.,
date +%Y-%m-%d-%H%M)docs/features/2025-11-26-1530_AUTHENTICATION.md
- Create a markdown feature file in
-
Present Summary: Present brief plan to user
- Use : "Go to clarifying"
question_tool - If user adds context/feedback: immediately update feature file
- Continue showing prompt until user confirms
- Only proceed to Clarify after confirmation
- Use
-
Clarify: Ask questions to ensure complete understanding (REQUIRED if ANY ambiguity exists)
- Ask ALL questions at once in a single call with multiple questions
question_tool - Use when options can be predefined; plain text otherwise
question_tool - 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
- Ask ALL questions at once in a single
-
Confirm: Present final plan summary
- Use : "Implement this plan"
question_tool - 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
- Use
-
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
-
Validate: Run all quality gates in order
- If any gate fails: fix issues and re-run all gates from the beginning
-
Update Feature File: Sync feature file with any discussions, decisions, or changes not yet documented
-
Complete: After all quality gates pass
- Summarize changes made
- Ask about committing (see Version Control in AGENTS.md)
-
调研:了解代码库、需求和约束条件
- 检查现有类似功能的实现模式
- 查看相关测试以理解预期行为
- 识别依赖项和潜在副作用
-
规划:制定包含清晰可执行步骤的初始方案
- 在目录下创建一个Markdown格式的功能文档,命名格式为
docs/features/YYYY-MM-DD-HHMM_FEATURE_NAME.md - 使用生成时间戳(例如:
date +%Y-%m-%d-%H%M)docs/features/2025-11-26-1530_AUTHENTICATION.md
- 在
-
展示方案摘要:向用户展示简要方案
- 使用:“进入澄清环节”
question_tool - 如果用户补充上下文/反馈:立即更新功能文档
- 持续展示提示直到用户确认
- 仅在确认后进入澄清环节
- 使用
-
澄清细节:提出问题以确保完全理解需求(若存在任何歧义则必须执行此步骤)
- 在单次调用中一次性提出所有问题
question_tool - 当选项可预定义时使用;否则使用纯文本提问
question_tool - 如果答案揭示新的歧义:再次一次性提出跟进问题
- 提问场景:架构、文件结构、用户侧变更、破坏性变更、核心模式
- 无需提问场景:次要实现细节
- 若存在不确定性绝不能跳过——默认假设是不可接受的
- 在所有澄清问题解决后:将决策内容更新到功能文档,然后进入确认环节
- 在单次
-
确认最终方案:展示最终方案摘要
- 使用:“执行此方案”
question_tool - 如果用户无修改确认:进入开发阶段
- 如果用户提出修改/补充细节:更新功能文档并再次询问“执行此方案”
- 任何方案修改都需要重新确认才能进入开发
- 使用
-
开发实现:逐步执行方案
- 遵循代码风格和架构规范
- 边开发边编写测试
- 若开发大型功能,在关键节点提交增量代码
-
验证测试:按顺序运行所有质量检查环节
- 若任何检查失败:修复问题后从头重新运行所有检查
-
更新功能文档:将所有未记录的讨论、决策或变更同步到功能文档中
-
完成交付:在所有质量检查通过后
- 总结已完成的变更
- 询问提交相关事宜(详见AGENTS.md中的版本控制部分)