$ARGUMENTS
Core protocol
- Language protocol: use for interacting with toolsEnglish, use for interacting with usersChinese
- Planning sovereignty: final solution selection, plan content integration,
.claude/plan/*.mdwriting plan files are all done by the Claude main thread - Use subagents on demand: only when the task spans modules, the search scope is unclear, or it can be split into multiple independent research subtasks, use the
Agenttool to launch subagents for supporting research or solution analysis - Read-only collaboration: subagents only perform retrieval, reading, and analysis; they do not modify product code and do not write plan files
- Stop-loss mechanism: do not proceed to the next phase until the current phase's output passes validation
- Planning only: this command allows reading context and writing
.claude/plan/*plan files, butmodifying product code is prohibited
Planning constraints
Working directory:
{{WORKDIR}}: use the absolute path of the current working directory as the root directory for retrieval and plan output- If the user has added multiple workspaces via
/add-dir, first use Glob/Grep to determine the task-related workspace - If it cannot be determined, use
AskUserQuestionto ask the user to choose the target workspace
Conditions for using subagents:
- Applicable: open-ended codebase search, cross-directory/cross-module reconnaissance, need to compare multiple implementation paths in parallel
- Preferred:
Explorefor read-only retrieval and structural reconnaissance,Planfor solution decomposition and implementation route analysis - Not applicable: known file paths, small single-file changes, simple tasks with very clear context
Important:
- Only generating and updating
.claude/plan/*.mdplan files is allowed - Describing or executing any third-party tool call syntax is not allowed
- Do not call external models, background tasks, session reuse, or additional Bash orchestration
- For retrieval or analysis content already delegated to subagents, the main thread should not execute it repeatedly
- The final plan must be consolidated uniformly by the main thread; directly forwarding raw subtask output to the user is prohibited
Execution workflow
Planning task:$ARGUMENTS
🔍 Phase 1: Requirement enhancement and scope convergence
[模式:准备]
- Analyze the intent, missing information, and implicit assumptions of $ARGUMENTS
- Complete into structured requirements: goals, technical constraints, scope boundaries, acceptance criteria
- Replace the original $ARGUMENTS with the enhanced requirements as input for subsequent phases
- If the requirements still have ambiguity, you must ask the user clarifying questions before continuing
🔎 Phase 2: Context retrieval
[模式:研究]
2.1 Direct retrieval (simple scenarios)
- When key files, symbols, or entry points are known, the main thread directly reads the relevant files
- Preferred output: entry file + line number + key symbol name
2.2 Parallel research by subagents (enabled on demand for complex scenarios)
When the task spans multiple modules, the search scope is unclear, or multiple rounds of retrieval are expected:
- Use the
Agenttool to launch multiple subagents in parallel in the same round - Typical splitting methods:
- Code path investigation: locate entry points, core call chains, key files
- Dependency and impact scope investigation: identify upstream and downstream modules, configurations, types, interface boundaries
- Solution analysis: evaluate 2-3 feasible implementation paths and their trade-offs
- subagents only return conclusions, evidence, and location information
- The main thread collects results before proceeding to the next phase
2.3 Completeness check
- Must obtain the necessary definitions and signatures of relevant classes, functions, and variables
- If context is insufficient, continue supplementary retrieval until the boundaries are clear
- It is prohibited to directly output a plan based on assumptions
💡 Phase 3: Main thread analysis and plan generation
[模式:分析]
- Merge the retrieval results of the main thread and subagents
- Prioritize selectingthe simplest, smallest-change, least-dependencyfeasible solution
- Clarify: implementation steps, key files, risk points, verification methods
- Generate and write
.claude/plan/<功能名>.mdimplementation plan:
## 📋 实施计划:<任务名称>
### 任务类型
- [ ] 前端
- [ ] 后端
- [ ] 全栈
### 技术方案
<主线程最终选定的方案>
### 实施步骤
1. <步骤 1> - 预期产物
2. <步骤 2> - 预期产物
...
### 关键文件
| 文件 | 操作 | 说明 |
|------|------|------|
| path/to/file.ts:L10-L50 | 修改 | 描述 |
### 风险与缓解
| 风险 | 缓解措施 |
|------|----------|
⛔ End of Phase 3: Plan delivery (non-execution)
/ac-plan 's responsibilities end here, and the following actions must be performed:
-
Create and write
.claude/plan/<功能名>.md -
Show the complete implementation plan to the user
-
Output the prompt inbold text(must use the actual saved file path):
📋 The plan has been generated and saved to
.claude/plan/实际功能名.mdPlease review the above plan. You can:
- 🔧 Modify the plan: tell me the parts that need adjustment, and I will update the plan
- ▶️ Execute the plan: copy the following command into a new session to execute
/ac-execute .claude/plan/实际功能名.md
⚠️ Note: the above
实际功能名.mdmust be replaced with the filename you actually saved!** -
Immediately terminate the current reply(Stop here. No more tool calls.)
⚠️ Absolutely prohibited:
- ❌ Asking the user "Y/N" and then automatically executing (execution is
/ac-execute's responsibility) - ❌ Any write operations to product code
- ❌ Automatically calling
/ac-executeor any implementation action - ❌ Continuing to trigger implementation-type actions when the user has not explicitly requested modifications
Plan saving
After planning is complete, save the plan to:
- First planning:
.claude/plan/<功能名>.md - Iteration version:
.claude/plan/<功能名>-v2.md、.claude/plan/<功能名>-v3.md...
The plan file write should be completed before showing the plan to the user.
Plan modification process
If the user requests modifications to the plan:
- Adjust the plan content based on user feedback
- Update the
.claude/plan/<功能名>.mdfile - Re-display the modified plan
- Prompt the user again to review or execute
Subsequent steps
After the user is satisfied with the review,manuallyexecute:
/ac-execute .claude/plan/<功能名>.md
Key rules
- Plan only, do not implement – this command does not perform any code changes
- Main thread writes the plan – the output is limited to the
.claude/plan/*.mdplan file generated by the main thread - subagents only perform auxiliary investigation – use as needed, not enabled by default, and do not directly output the final plan
- Do not ask Y/N – Display only the plan, letting the user decide the next step
- Session handoff is prohibited – The plan must not contain any external session identifiers or content requesting session handoff