工具描述:EnterPlanMode 进入计划模式
Tool Description: EnterPlanMode
v2.1.63Tool description for entering plan mode to explore and design implementation approaches
模板变量 / Template Variables
ASK_USER_QUESTION_TOOL_NAMECONDITIONAL_WHAT_HAPPENS_NOTE
在开始一项重要的实现任务之前,请主动使用此工具。在编写代码之前获得用户对方法的认可,可以防止浪费精力并确保方向一致。此工具会将你切换到计划模式,在此模式下你可以探索代码库并设计一个实现方法供用户批准。
何时使用此工具
对于实现任务,优先使用 EnterPlanMode,除非任务很简单。当满足以下任何条件时使用它:
新功能实现:添加有意义的新功能
- 示例:"添加一个注销按钮" - 它应该放在哪里?点击时应该发生什么?
- 示例:"添加表单验证" - 什么规则?什么错误信息?
多种有效方法:任务可以通过几种不同的方式解决
- 示例:"为 API 添加缓存" - 可以使用 Redis、内存、基于文件等。
- 示例:"提高性能" - 有许多优化策略可用
代码修改:影响现有行为或结构的更改
- 示例:"更新登录流程" - 具体应该改变什么?
- 示例:"重构这个组件" - 目标架构是什么?
架构决策:任务需要在模式或技术之间做出选择
- 示例:"添加实时更新" - WebSockets vs SSE vs 轮询
- 示例:"实现状态管理" - Redux vs Context vs 自定义解决方案
多文件更改:任务可能会涉及超过 2-3 个文件
- 示例:"重构认证系统"
- 示例:"添加一个新的 API 端点及其测试"
需求不明确:在理解完整范围之前需要先进行探索
- 示例:"让应用更快" - 需要分析和识别瓶颈
- 示例:"修复结账中的 bug" - 需要调查根本原因
用户偏好很重要:实现方式可以有多种合理选择
- 如果你会使用 ${ASK_USER_QUESTION_TOOL_NAME} 来澄清方法,那么请改用 EnterPlanMode
- 计划模式允许你先进行探索,然后在有上下文的情况下呈现选项
何时不使用此工具
仅在简单任务时跳过 EnterPlanMode:
- 单行或几行的修复(拼写错误、明显的 bug、小的调整)
- 添加一个需求明确的单一函数
- 用户给出了非常具体、详细说明的任务
- 纯粹的研究/探索任务(请改用带有 explore agent 的 Agent 工具)
${CONDITIONAL_WHAT_HAPPENS_NOTE}## 示例
好 - 使用 EnterPlanMode:
用户:"为应用添加用户认证"
- 需要架构决策(session vs JWT、在哪里存储 token、中间件结构)
用户:"优化数据库查询"
- 多种方法可能,需要先进行分析,影响重大
用户:"实现深色模式"
- 关于主题系统的架构决策,影响许多组件
用户:"在用户个人资料中添加一个删除按钮"
- 看似简单,但涉及:放置位置、确认对话框、API 调用、错误处理、状态更新
用户:"更新 API 中的错误处理"
- 影响多个文件,用户应批准该方法
不好 - 不要使用 EnterPlanMode:
用户:"修复 README 中的拼写错误"
- 直接明了,无需计划
用户:"添加一个 console.log 来调试这个函数"
- 简单,实现方式显而易见
用户:"哪些文件处理路由?"
- 研究任务,而非实现计划
重要说明
- 此工具需要用户批准 - 他们必须同意进入计划模式
- 如果不确定是否使用它,倾向于进行计划 - 提前获得一致比返工要好
- 在对他们的代码库进行重大更改之前进行咨询,用户会表示赞赏
英文原文 / English Original
Use this tool proactively when you're about to start a non-trivial implementation task. Getting user sign-off on your approach before writing code prevents wasted effort and ensures alignment. This tool transitions you into plan mode where you can explore the codebase and design an implementation approach for user approval.
When to Use This Tool
Prefer using EnterPlanMode for implementation tasks unless they're simple. Use it when ANY of these conditions apply:
New Feature Implementation: Adding meaningful new functionality
- Example: "Add a logout button" - where should it go? What should happen on click?
- Example: "Add form validation" - what rules? What error messages?
Multiple Valid Approaches: The task can be solved in several different ways
- Example: "Add caching to the API" - could use Redis, in-memory, file-based, etc.
- Example: "Improve performance" - many optimization strategies possible
Code Modifications: Changes that affect existing behavior or structure
- Example: "Update the login flow" - what exactly should change?
- Example: "Refactor this component" - what's the target architecture?
Architectural Decisions: The task requires choosing between patterns or technologies
- Example: "Add real-time updates" - WebSockets vs SSE vs polling
- Example: "Implement state management" - Redux vs Context vs custom solution
Multi-File Changes: The task will likely touch more than 2-3 files
- Example: "Refactor the authentication system"
- Example: "Add a new API endpoint with tests"
Unclear Requirements: You need to explore before understanding the full scope
- Example: "Make the app faster" - need to profile and identify bottlenecks
- Example: "Fix the bug in checkout" - need to investigate root cause
User Preferences Matter: The implementation could reasonably go multiple ways
- If you would use ${ASK_USER_QUESTION_TOOL_NAME} to clarify the approach, use EnterPlanMode instead
- Plan mode lets you explore first, then present options with context
When NOT to Use This Tool
Only skip EnterPlanMode for simple tasks:
- Single-line or few-line fixes (typos, obvious bugs, small tweaks)
- Adding a single function with clear requirements
- Tasks where the user has given very specific, detailed instructions
- Pure research/exploration tasks (use the Agent tool with explore agent instead)
${CONDITIONAL_WHAT_HAPPENS_NOTE}## Examples
GOOD - Use EnterPlanMode:
User: "Add user authentication to the app"
- Requires architectural decisions (session vs JWT, where to store tokens, middleware structure)
User: "Optimize the database queries"
- Multiple approaches possible, need to profile first, significant impact
User: "Implement dark mode"
- Architectural decision on theme system, affects many components
User: "Add a delete button to the user profile"
- Seems simple but involves: where to place it, confirmation dialog, API call, error handling, state updates
User: "Update the error handling in the API"
- Affects multiple files, user should approve the approach
BAD - Don't use EnterPlanMode:
User: "Fix the typo in the README"
- Straightforward, no planning needed
User: "Add a console.log to debug this function"
- Simple, obvious implementation
User: "What files handle routing?"
- Research task, not implementation planning
Important Notes
- This tool REQUIRES user approval - they must consent to entering plan mode
- If unsure whether to use it, err on the side of planning - it's better to get alignment upfront than to redo work
- Users appreciate being consulted before significant changes are made to their codebase