Loading...
Loading...
Compare original and translation side by side
/apex add authentication middleware/apex -a -s implement user registration/apex -a -x -s fix login bug-a-s.claude/output/apex/-x-t-pr<parameters>| Short | Long | Description |
|---|---|---|
| | Disable auto mode |
| | Disable examine mode |
| | Disable save mode |
| | Disable test mode |
| | Disable economy mode |
| | Disable branch mode |
| | Disable PR mode |
/apex add authentication middleware/apex -a -s implement user registration/apex -a -x -s fix login bug-a-s.claude/output/apex/-x-t-pr<parameters>| 短参数 | 长参数 | 说明 |
|---|---|---|
| | 禁用自主模式 |
| | 禁用审查模式 |
| | 禁用保存模式 |
| | 禁用测试模式 |
| | 禁用经济型模式 |
| | 禁用分支模式 |
| | 禁用PR模式 |
</examples>
<parsing_rules>
**Flag parsing:**
1. Defaults loaded from `steps/step-00-init.md` `<defaults>` section
2. Command-line flags override defaults (enable with lowercase `-x`, disable with uppercase `-X`)
3. Flags removed from input, remainder becomes `{task_description}`
4. Task ID generated as `NN-kebab-case-description`
For detailed parsing algorithm, see `steps/step-00-init.md`.
</parsing_rules>
</parameters>
<output_structure>
**When `{save_mode}` = true:**
All outputs saved to PROJECT directory (where Claude Code is running):
**00-context.md structure:**
```markdown</examples>
<parsing_rules>
**参数解析规则:**
1. 从`steps/step-00-init.md`的`<defaults>`部分加载默认配置
2. 命令行参数覆盖默认配置(小写`-x`启用,大写`-X`禁用)
3. 参数将从输入中移除,剩余部分作为`{task_description}`
4. 任务ID格式为`NN-kebab-case-description`
详细解析算法请查看`steps/step-00-init.md`。
</parsing_rules>
</parameters>
<output_structure>
**当`{save_mode}` = true时:**
所有输出将保存至Claude Code运行的项目目录:
**00-context.md结构:**
```markdown
</output_structure>
<resume_workflow>
**Resume mode (`-r {task-id}`):**
When provided, step-00 will:
1. Locate the task folder in `.claude/output/apex/`
2. Restore state from `00-context.md`
3. Find the last completed step
4. Continue from the next step
Supports partial matching (e.g., `-r 01` finds `01-add-auth-middleware`).
For implementation details, see `steps/step-00-init.md`.
</resume_workflow>
<workflow>
**Standard flow:**
1. Parse flags and task description
2. If `-r`: Execute resume workflow
3. If `-s`: Create output folder and 00-context.md
4. Load step-01-analyze.md → gather context
5. Load step-02-plan.md → create strategy
6. Load step-03-execute.md → implement
7. Load step-04-validate.md → verify
8. If `--test`: Load step-07-tests.md → analyze and create tests
9. If `--test`: Load step-08-run-tests.md → run until green
10. If `-x` or user requests: Load step-05-examine.md → adversarial review
11. If findings: Load step-06-resolve.md → fix findings
12. If `-pr`: Load step-09-finish.md → create pull request
</workflow>
<state_variables>
**Persist throughout all steps:**
| Variable | Type | Description |
| ----------------------- | ------- | ------------------------------------------------------ |
| `{task_description}` | string | What to implement (flags removed) |
| `{feature_name}` | string | Kebab-case name without number (e.g., `add-auth-middleware`) |
| `{task_id}` | string | Full identifier with number (e.g., `01-add-auth-middleware`) |
| `{acceptance_criteria}` | list | Success criteria (inferred or explicit) |
| `{auto_mode}` | boolean | Skip confirmations, use recommended options |
| `{examine_mode}` | boolean | Auto-proceed to adversarial review |
| `{save_mode}` | boolean | Save outputs to .claude/output/apex/ |
| `{test_mode}` | boolean | Include test steps (07-08) |
| `{economy_mode}` | boolean | No subagents, direct tool usage only |
| `{branch_mode}` | boolean | Verify not on main, create branch if needed |
| `{pr_mode}` | boolean | Create pull request at end |
| `{interactive_mode}` | boolean | Configure flags interactively |
| `{resume_task}` | string | Task ID to resume (if -r provided) |
| `{output_dir}` | string | Full path to output directory |
| `{branch_name}` | string | Created branch name (if branch_mode) |
</state_variables>
<entry_point>
**FIRST ACTION:** Load `steps/step-00-init.md`
Step 00 handles:
- Flag parsing (-a, -x, -s, -r, --test)
- Resume mode detection and task lookup
- Output folder creation (if save_mode)
- 00-context.md creation (if save_mode)
- State variable initialization
After initialization, step-00 loads step-01-analyze.md.
</entry_point>
<step_files>
**Progressive loading - only load current step:**
| Step | File | Purpose |
| ---- | ---------------------------- | ---------------------------------------------------- |
| 00 | `steps/step-00-init.md` | Parse flags, create output folder, initialize state |
| 01 | `steps/step-01-analyze.md` | Smart context gathering with 1-10 parallel agents based on complexity |
| 02 | `steps/step-02-plan.md` | File-by-file implementation strategy |
| 03 | `steps/step-03-execute.md` | Todo-driven implementation |
| 04 | `steps/step-04-validate.md` | Self-check and validation |
| 05 | `steps/step-05-examine.md` | Adversarial code review (optional) |
| 06 | `steps/step-06-resolve.md` | Finding resolution (optional) |
| 07 | `steps/step-07-tests.md` | Test analysis and creation (if --test) |
| 08 | `steps/step-08-run-tests.md` | Test runner loop until green (if --test) |
| 09 | `steps/step-09-finish.md` | Create pull request (if --pull-request) |
</step_files>
<execution_rules>
- **Load one step at a time** - Only load the current step file
- **ULTRA THINK** before major decisions
- **Persist state variables** across all steps
- **Follow next_step directive** at end of each step
- **Save outputs** if `{save_mode}` = true (append to step file)
- **Use parallel agents** for independent exploration tasks
</output_structure>
<resume_workflow>
**恢复模式(`-r {task-id}`):**
当使用该参数时,step-00将执行以下操作:
1. 在`.claude/output/apex/`中定位任务文件夹
2. 从`00-context.md`恢复状态
3. 找到最后完成的步骤
4. 从下一个步骤继续执行
支持部分匹配(例如:`-r 01`将匹配`01-add-auth-middleware`)。
实现细节请查看`steps/step-00-init.md`。
</resume_workflow>
<workflow>
**标准工作流:**
1. 解析参数和任务描述
2. 如果启用`-r`: 执行恢复工作流
3. 如果启用`-s`: 创建输出文件夹和00-context.md
4. 加载step-01-analyze.md → 收集上下文信息
5. 加载step-02-plan.md → 制定实现策略
6. 加载step-03-execute.md → 执行实现
7. 加载step-04-validate.md → 验证结果
8. 如果启用`--test`: 加载step-07-tests.md → 分析并创建测试
9. 如果启用`--test`: 加载step-08-run-tests.md → 运行测试直至通过
10. 如果启用`-x`或用户请求: 加载step-05-examine.md → 对抗性审查
11. 如果发现问题: 加载step-06-resolve.md → 修复问题
12. 如果启用`-pr`: 加载step-09-finish.md → 创建Pull Request
</workflow>
<state_variables>
**在所有步骤中持久化的变量:**
| 变量名 | 类型 | 描述 |
| ----------------------- | ------- | ------------------------------------------------------ |
| `{task_description}` | 字符串 | 待实现内容(已移除参数) |
| `{feature_name}` | 字符串 | 不含数字的短横线命名(例如: `add-auth-middleware`) |
| `{task_id}` | 字符串 | 带数字的完整标识符(例如: `01-add-auth-middleware`) |
| `{acceptance_criteria}` | 列表 | 成功标准(推断或显式定义) |
| `{auto_mode}` | 布尔值 | 跳过确认步骤,使用推荐选项 |
| `{examine_mode}` | 布尔值 | 自动进入对抗性审查环节 |
| `{save_mode}` | 布尔值 | 将输出保存至.claude/output/apex/ |
| `{test_mode}` | 布尔值 | 包含测试步骤(07-08) |
| `{economy_mode}` | 布尔值 | 不使用子Agent,仅直接调用工具 |
| `{branch_mode}` | 布尔值 | 验证当前不在主分支,必要时创建新分支 |
| `{pr_mode}` | 布尔值 | 在流程末尾创建Pull Request |
| `{interactive_mode}` | 布尔值 | 交互式配置参数 |
| `{resume_task}` | 字符串 | 待恢复的任务ID(如果提供了-r参数) |
| `{output_dir}` | 字符串 | 输出目录的完整路径 |
| `{branch_name}` | 字符串 | 创建的分支名称(如果启用branch_mode) |
</state_variables>
<entry_point>
**第一步操作:** 加载`steps/step-00-init.md`
step-00负责:
- 参数解析(-a, -x, -s, -r, --test)
- 恢复模式检测与任务查找
- 创建输出文件夹(如果启用save_mode)
- 创建00-context.md(如果启用save_mode)
- 初始化状态变量
初始化完成后,step-00将加载step-01-analyze.md。
</entry_point>
<step_files>
**渐进式加载 - 仅加载当前步骤:**
| 步骤 | 文件 | 用途 |
| ---- | ---------------------------- | ---------------------------------------------------- |
| 00 | `steps/step-00-init.md` | 解析参数、创建输出文件夹、初始化状态 |
| 01 | `steps/step-01-analyze.md` | 根据任务复杂度,使用1-10个并行Agent智能收集上下文 |
| 02 | `steps/step-02-plan.md` | 制定逐文件的实现策略 |
| 03 | `steps/step-03-execute.md` | 基于待办事项的实现 |
| 04 | `steps/step-04-validate.md` | 自我检查与验证 |
| 05 | `steps/step-05-examine.md` | 对抗性代码审查(可选) |
| 06 | `steps/step-06-resolve.md` | 问题修复(可选) |
| 07 | `steps/step-07-tests.md` | 测试分析与创建(如果启用--test) |
| 08 | `steps/step-08-run-tests.md` | 循环运行测试直至通过(如果启用--test) |
| 09 | `steps/step-09-finish.md` | 创建Pull Request(如果启用--pull-request) |
</step_files>
<execution_rules>
- **逐步骤加载** - 仅加载当前步骤的文件
- **重大决策前深度思考**
- **跨步骤持久化状态变量**
- **遵循每个步骤末尾的next_step指令**
- **如果`{save_mode}`=true则保存输出**(追加到对应步骤文件)
- **独立探索任务使用并行Agent**explore-codebaseexplore-docswebsearch| Complexity | Agents | When |
|---|---|---|
| Simple | 1-2 | Bug fix, small tweak |
| Medium | 2-4 | New feature in familiar stack |
| Complex | 4-7 | Unfamiliar libraries, integrations |
| Major | 6-10 | Multiple systems, many unknowns |
{save_mode}scripts/setup-templates.shtemplates/scripts/update-progress.sh {task_id} {step_num} {step_name} "in_progress"scripts/update-progress.sh {task_id} {step_num} {step_name} "complete"templates/templates/README.md{save_mode}{test_mode}explore-codebaseexplore-docswebsearch| 复杂度 | Agent数量 | 适用场景 |
|---|---|---|
| 简单 | 1-2 | Bug修复、小调整 |
| 中等 | 2-4 | 熟悉技术栈的新功能开发 |
| 复杂 | 4-7 | 不熟悉的库、系统集成 |
| 重大 | 6-10 | 多系统交互、大量未知项 |
{save_mode}scripts/setup-templates.shtemplates/scripts/update-progress.sh {task_id} {step_num} {step_name} "in_progress"scripts/update-progress.sh {task_id} {step_num} {step_name} "complete"templates/templates/README.md{save_mode}{test_mode}