claude-code-workflow 6.3.50 → 6.3.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.claude/commands/view.md +367 -0
  2. package/.claude/commands/workflow/unified-execute-with-file.md +807 -0
  3. package/.claude/skills/ccw-help/SKILL.md +72 -12
  4. package/.claude/skills/ccw-help/command.json +922 -520
  5. package/.claude/skills/ccw-help/index/all-agents.json +97 -0
  6. package/.claude/skills/ccw-help/index/all-commands.json +805 -0
  7. package/.claude/skills/ccw-help/index/by-category.json +833 -0
  8. package/.claude/skills/ccw-help/index/by-use-case.json +819 -0
  9. package/.claude/skills/ccw-help/index/command-relationships.json +160 -0
  10. package/.claude/skills/ccw-help/index/essential-commands.json +90 -0
  11. package/.claude/skills/ccw-help/scripts/auto-update.py +34 -0
  12. package/.claude/skills/skill-generator/SKILL.md +255 -208
  13. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +238 -228
  14. package/.claude/skills/skill-generator/phases/02-structure-generation.md +261 -262
  15. package/.claude/skills/skill-generator/phases/03-phase-generation.md +976 -969
  16. package/.claude/skills/skill-generator/phases/04-specs-templates.md +398 -398
  17. package/.claude/skills/skill-generator/phases/05-validation.md +417 -417
  18. package/.claude/skills/skill-generator/specs/cli-integration.md +131 -131
  19. package/.claude/skills/skill-generator/specs/execution-modes.md +399 -396
  20. package/.claude/skills/skill-generator/specs/reference-docs-spec.md +271 -0
  21. package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -265
  22. package/.claude/skills/skill-generator/specs/skill-requirements.md +466 -466
  23. package/.claude/skills/skill-generator/templates/autonomous-action.md +91 -88
  24. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +89 -89
  25. package/.claude/skills/skill-generator/templates/code-analysis-action.md +148 -149
  26. package/.claude/skills/skill-generator/templates/llm-action.md +367 -367
  27. package/.claude/skills/skill-generator/templates/script-template.md +79 -79
  28. package/.claude/skills/skill-generator/templates/sequential-phase.md +129 -129
  29. package/.claude/skills/skill-generator/templates/skill-md.md +134 -75
  30. package/.codex/prompts/UNIFIED_EXECUTE_COMPARISON.md +205 -0
  31. package/.codex/prompts/unified-execute-with-file.md +722 -0
  32. package/.codex/skills/codex-issue-plan-execute/SKILL.md +239 -0
  33. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-complete.md +173 -0
  34. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-execute.md +220 -0
  35. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-init.md +86 -0
  36. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-list.md +165 -0
  37. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-plan.md +170 -0
  38. package/.codex/skills/codex-issue-plan-execute/phases/orchestrator.md +210 -0
  39. package/.codex/skills/codex-issue-plan-execute/phases/state-schema.md +136 -0
  40. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent-system.md +136 -0
  41. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent.md +135 -0
  42. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent-system.md +107 -0
  43. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent.md +122 -0
  44. package/.codex/skills/codex-issue-plan-execute/specs/issue-handling.md +187 -0
  45. package/.codex/skills/codex-issue-plan-execute/specs/quality-standards.md +231 -0
  46. package/.codex/skills/codex-issue-plan-execute/specs/solution-schema.md +270 -0
  47. package/.codex/skills/codex-issue-plan-execute/specs/subagent-roles.md +268 -0
  48. package/ccw/dist/commands/cli.d.ts.map +1 -1
  49. package/ccw/dist/commands/cli.js +23 -2
  50. package/ccw/dist/commands/cli.js.map +1 -1
  51. package/ccw/dist/core/routes/help-routes.d.ts.map +1 -1
  52. package/ccw/dist/core/routes/help-routes.js +51 -1
  53. package/ccw/dist/core/routes/help-routes.js.map +1 -1
  54. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  55. package/ccw/dist/tools/cli-executor-core.js +5 -3
  56. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  57. package/ccw/dist/tools/cli-executor-utils.d.ts +1 -0
  58. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
  59. package/ccw/dist/tools/cli-executor-utils.js +3 -1
  60. package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
  61. package/ccw/src/commands/cli.ts +26 -2
  62. package/ccw/src/core/routes/help-routes.ts +60 -1
  63. package/ccw/src/templates/dashboard-js/views/help.js +423 -1
  64. package/ccw/src/tools/cli-executor-core.ts +6 -3
  65. package/ccw/src/tools/cli-executor-utils.ts +5 -2
  66. package/package.json +1 -1
@@ -1,22 +1,22 @@
1
1
  # Autonomous Action Template
2
2
 
3
- 自主模式动作文件的模板。
3
+ Template for action files in Autonomous execution mode.
4
4
 
5
5
  ## Purpose
6
6
 
7
- 生成 Autonomous 执行模式的 Action 文件,定义可独立执行的动作单元。
7
+ Generate Action files for Autonomous execution mode, defining independent executable action units.
8
8
 
9
9
  ## Usage Context
10
10
 
11
11
  | Phase | Usage |
12
12
  |-------|-------|
13
- | Phase 3 (Phase Generation) | `config.execution_mode === 'autonomous'` 时生成 |
14
- | Generation Trigger | 为每个 `config.autonomous_config.actions` 生成一个 action 文件 |
13
+ | Phase 3 (Phase Generation) | Generated when `config.execution_mode === 'autonomous'` |
14
+ | Generation Trigger | Generate one action file for each `config.autonomous_config.actions` |
15
15
  | Output Location | `.claude/skills/{skill-name}/phases/actions/{action-id}.md` |
16
16
 
17
17
  ---
18
18
 
19
- ## 模板结构
19
+ ## Template Structure
20
20
 
21
21
  ```markdown
22
22
  # Action: {{action_name}}
@@ -34,8 +34,8 @@
34
34
  ## Scripts
35
35
 
36
36
  \`\`\`yaml
37
- # 声明本动作使用的脚本(可选)
38
- # - script-id # 对应 scripts/script-id.py .sh
37
+ # Declare scripts used in this action (optional)
38
+ # - script-id # Corresponds to scripts/script-id.py or .sh
39
39
  \`\`\`
40
40
 
41
41
  ## Execution
@@ -44,7 +44,7 @@
44
44
  async function execute(state) {
45
45
  {{execution_code}}
46
46
 
47
- // 调用脚本示例
47
+ // Script execution example
48
48
  // const result = await ExecuteScript('script-id', { input: state.context.data });
49
49
  // if (!result.success) throw new Error(result.stderr);
50
50
  }
@@ -71,63 +71,66 @@ return {
71
71
  {{next_actions_hints}}
72
72
  ```
73
73
 
74
- ## 变量说明
74
+ ## Variable Descriptions
75
75
 
76
- | 变量 | 说明 |
77
- |------|------|
78
- | `{{action_name}}` | 动作名称 |
79
- | `{{action_description}}` | 动作描述 |
80
- | `{{purpose}}` | 详细目的 |
81
- | `{{preconditions_list}}` | 前置条件列表 |
82
- | `{{execution_code}}` | 执行代码 |
83
- | `{{state_updates}}` | 状态更新 |
84
- | `{{error_handling_table}}` | 错误处理表格 |
85
- | `{{next_actions_hints}}` | 后续动作提示 |
76
+ | Variable | Description |
77
+ |----------|-------------|
78
+ | `{{action_name}}` | Action name |
79
+ | `{{action_description}}` | Action description |
80
+ | `{{purpose}}` | Detailed purpose |
81
+ | `{{preconditions_list}}` | List of preconditions |
82
+ | `{{execution_code}}` | Execution code |
83
+ | `{{state_updates}}` | State updates |
84
+ | `{{error_handling_table}}` | Error handling table |
85
+ | `{{next_actions_hints}}` | Next action hints |
86
86
 
87
- ## 动作生命周期
87
+ ## Action Lifecycle
88
88
 
89
89
  ```
90
- 状态驱动执行流:
90
+ State-driven execution flow:
91
91
 
92
92
  state.status === 'pending'
93
-
94
- ┌─ Init ─┐ ← 1次执行,环境准备
95
- 创建工作目录 │
96
- 初始化 context │
97
- status → running │
98
- └────┬────┘
99
-
100
- ┌─ CRUD Loop ─┐ ← N次迭代,核心业务
101
- │ 编排器选择动作 │ List / Create / Edit / Delete
102
- execute(state) │ 共享模式: 收集输入 操作 context.items 返回更新
103
- 更新 state │
104
- └────┬────┘
105
-
106
- ┌─ Complete ─┐ ← 1次执行,保存结果
107
- │ 序列化输出 │
108
- │ status → completed │
109
- └──────────┘
110
-
111
- 共享状态结构:
112
- state.status → 'pending' | 'running' | 'completed'
113
- state.context.items → 业务数据数组
114
- state.completed_actions → 已执行动作 ID 列表
93
+ |
94
+ v
95
+ +-- Init --+ <- 1 execution, environment preparation
96
+ | Create working directory
97
+ | Initialize context
98
+ | status -> running
99
+ +----+----+
100
+ |
101
+ v
102
+ +-- CRUD Loop --+ <- N iterations, core business
103
+ | Orchestrator selects action | List / Create / Edit / Delete
104
+ | execute(state) | Shared pattern: collect input -> operate context.items -> return updates
105
+ | Update state
106
+ +----+----+
107
+ |
108
+ v
109
+ +-- Complete --+ <- 1 execution, save results
110
+ | Serialize output
111
+ | status -> completed
112
+ +----------+
113
+
114
+ Shared state structure:
115
+ state.status -> 'pending' | 'running' | 'completed'
116
+ state.context.items -> Business data array
117
+ state.completed_actions -> List of executed action IDs
115
118
  ```
116
119
 
117
- ## 动作类型模板
120
+ ## Action Type Templates
118
121
 
119
- ### 1. 初始化动作 (Init)
122
+ ### 1. Initialize Action (Init)
120
123
 
121
- **触发条件**: `state.status === 'pending'`,仅执行一次
124
+ **Trigger condition**: `state.status === 'pending'`, executes once
122
125
 
123
126
  ```markdown
124
127
  # Action: Initialize
125
128
 
126
- 初始化 Skill 执行状态。
129
+ Initialize Skill execution state.
127
130
 
128
131
  ## Purpose
129
132
 
130
- 设置初始状态,准备执行环境。
133
+ Set initial state, prepare execution environment.
131
134
 
132
135
  ## Preconditions
133
136
 
@@ -151,24 +154,24 @@ async function execute(state) {
151
154
 
152
155
  ## Next Actions
153
156
 
154
- - 成功: 进入主处理循环 (由编排器选择首个 CRUD 动作)
155
- - 失败: action-abort
157
+ - Success: Enter main processing loop (Orchestrator selects first CRUD action)
158
+ - Failure: action-abort
156
159
  ```
157
160
 
158
- ### 2. CRUD 动作 (List / Create / Edit / Delete)
161
+ ### 2. CRUD Actions (List / Create / Edit / Delete)
159
162
 
160
- **触发条件**: `state.status === 'running'`,循环执行直至用户退出
163
+ **Trigger condition**: `state.status === 'running'`, loop until user exits
161
164
 
162
- > Create 为示例展示共享模式。List / Edit / Delete 遵循同一结构,仅 `执行逻辑` `状态更新字段` 不同。
165
+ > Example shows Create action demonstrating shared pattern. List / Edit / Delete follow same structure with different execution logic and state update fields.
163
166
 
164
167
  ```markdown
165
168
  # Action: Create Item
166
169
 
167
- 创建新项目。
170
+ Create new item.
168
171
 
169
172
  ## Purpose
170
173
 
171
- 收集用户输入,向 context.items 追加新记录。
174
+ Collect user input, append new record to context.items.
172
175
 
173
176
  ## Preconditions
174
177
 
@@ -178,25 +181,25 @@ async function execute(state) {
178
181
 
179
182
  \`\`\`javascript
180
183
  async function execute(state) {
181
- // 1. 收集输入
184
+ // 1. Collect input
182
185
  const input = await AskUserQuestion({
183
186
  questions: [{
184
- question: "请输入项目名称:",
185
- header: "名称",
187
+ question: "Please enter item name:",
188
+ header: "Name",
186
189
  multiSelect: false,
187
- options: [{ label: "手动输入", description: "输入自定义名称" }]
190
+ options: [{ label: "Manual input", description: "Enter custom name" }]
188
191
  }]
189
192
  });
190
193
 
191
- // 2. 操作 context.items (核心逻辑因动作类型而异)
194
+ // 2. Operate context.items (core logic differs by action type)
192
195
  const newItem = {
193
196
  id: Date.now().toString(),
194
- name: input["名称"],
197
+ name: input["Name"],
195
198
  status: 'pending',
196
199
  created_at: new Date().toISOString()
197
200
  };
198
201
 
199
- // 3. 返回状态更新
202
+ // 3. Return state update
200
203
  return {
201
204
  stateUpdates: {
202
205
  context: {
@@ -211,31 +214,31 @@ async function execute(state) {
211
214
 
212
215
  ## Next Actions
213
216
 
214
- - 继续操作: 编排器根据 state 选择下一动作
215
- - 用户退出: action-complete
217
+ - Continue operations: Orchestrator selects next action based on state
218
+ - User exit: action-complete
216
219
  ```
217
220
 
218
- **其他 CRUD 动作差异对照:**
221
+ **Other CRUD Actions Differences:**
219
222
 
220
- | 动作 | 核心逻辑 | 额外前置条件 | 关键状态字段 |
221
- |------|---------|------------|------------|
222
- | List | `items.forEach( console.log)` | | `current_view: 'list'` |
223
- | Create | `items.push(newItem)` | | `last_created_id` |
224
- | Edit | `items.map( 替换匹配项)` | `selected_item_id !== null` | `updated_at` |
225
- | Delete | `items.filter( 排除匹配项)` | `selected_item_id !== null` | 确认对话 执行 |
223
+ | Action | Core Logic | Extra Preconditions | Key State Field |
224
+ |--------|-----------|-------------------|-----------------|
225
+ | List | `items.forEach(-> console.log)` | None | `current_view: 'list'` |
226
+ | Create | `items.push(newItem)` | None | `last_created_id` |
227
+ | Edit | `items.map(-> replace matching)` | `selected_item_id !== null` | `updated_at` |
228
+ | Delete | `items.filter(-> exclude matching)` | `selected_item_id !== null` | Confirm dialog -> execute |
226
229
 
227
- ### 3. 完成动作 (Complete)
230
+ ### 3. Complete Action
228
231
 
229
- **触发条件**: 用户明确退出或终止条件满足,仅执行一次
232
+ **Trigger condition**: User explicitly exits or termination condition met, executes once
230
233
 
231
234
  ```markdown
232
235
  # Action: Complete
233
236
 
234
- 完成任务并退出。
237
+ Complete task and exit.
235
238
 
236
239
  ## Purpose
237
240
 
238
- 序列化最终状态,结束 Skill 执行。
241
+ Serialize final state, end Skill execution.
239
242
 
240
243
  ## Preconditions
241
244
 
@@ -253,7 +256,7 @@ async function execute(state) {
253
256
  actions_executed: state.completed_actions.length
254
257
  };
255
258
 
256
- console.log(\`任务完成: \${summary.total_items} 项, \${summary.actions_executed} 次操作\`);
259
+ console.log(\`Task complete: \${summary.total_items} items, \${summary.actions_executed} operations\`);
257
260
 
258
261
  return {
259
262
  stateUpdates: {
@@ -267,31 +270,31 @@ async function execute(state) {
267
270
 
268
271
  ## Next Actions
269
272
 
270
- - 无(终止状态)
273
+ - None (terminal state)
271
274
  ```
272
275
 
273
- ## 生成函数
276
+ ## Generation Function
274
277
 
275
278
  ```javascript
276
279
  function generateAction(actionConfig, skillConfig) {
277
280
  return `# Action: ${actionConfig.name}
278
281
 
279
- ${actionConfig.description || `执行 ${actionConfig.name} 操作`}
282
+ ${actionConfig.description || `Execute ${actionConfig.name} operation`}
280
283
 
281
284
  ## Purpose
282
285
 
283
- ${actionConfig.purpose || 'TODO: 描述此动作的详细目的'}
286
+ ${actionConfig.purpose || 'TODO: Describe detailed purpose of this action'}
284
287
 
285
288
  ## Preconditions
286
289
 
287
- ${actionConfig.preconditions?.map(p => `- [ ] ${p}`).join('\n') || '- [ ] 无特殊前置条件'}
290
+ ${actionConfig.preconditions?.map(p => `- [ ] ${p}`).join('\n') || '- [ ] No special preconditions'}
288
291
 
289
292
  ## Execution
290
293
 
291
294
  \`\`\`javascript
292
295
  async function execute(state) {
293
- // TODO: 实现动作逻辑
294
-
296
+ // TODO: Implement action logic
297
+
295
298
  return {
296
299
  stateUpdates: {
297
300
  completed_actions: [...state.completed_actions, '${actionConfig.id}']
@@ -305,7 +308,7 @@ async function execute(state) {
305
308
  \`\`\`javascript
306
309
  return {
307
310
  stateUpdates: {
308
- // TODO: 定义状态更新
311
+ // TODO: Define state updates
309
312
  ${actionConfig.effects?.map(e => ` // Effect: ${e}`).join('\n') || ''}
310
313
  }
311
314
  };
@@ -315,13 +318,13 @@ ${actionConfig.effects?.map(e => ` // Effect: ${e}`).join('\n') || ''}
315
318
 
316
319
  | Error Type | Recovery |
317
320
  |------------|----------|
318
- | 数据验证失败 | 返回错误,不更新状态 |
319
- | 执行异常 | 记录错误,增加 error_count |
321
+ | Data validation failed | Return error, no state update |
322
+ | Execution exception | Log error, increment error_count |
320
323
 
321
324
  ## Next Actions (Hints)
322
325
 
323
- - 成功: 由编排器根据状态决定
324
- - 失败: 重试或 action-abort
326
+ - Success: Orchestrator decides based on state
327
+ - Failure: Retry or action-abort
325
328
  `;
326
329
  }
327
330
  ```
@@ -1,59 +1,59 @@
1
1
  # Autonomous Orchestrator Template
2
2
 
3
- 自主模式编排器的模板。
3
+ Template for orchestrator file in Autonomous execution mode.
4
4
 
5
5
  ## Purpose
6
6
 
7
- 生成 Autonomous 执行模式的 Orchestrator 文件,负责状态驱动的动作选择和执行循环。
7
+ Generate Orchestrator file for Autonomous execution mode, responsible for state-driven action selection and execution loop.
8
8
 
9
9
  ## Usage Context
10
10
 
11
11
  | Phase | Usage |
12
12
  |-------|-------|
13
- | Phase 3 (Phase Generation) | `config.execution_mode === 'autonomous'` 时生成 |
14
- | Generation Trigger | 创建编排器逻辑,管理动作选择和状态更新 |
13
+ | Phase 3 (Phase Generation) | Generated when `config.execution_mode === 'autonomous'` |
14
+ | Generation Trigger | Create orchestrator logic to manage action selection and state updates |
15
15
  | Output Location | `.claude/skills/{skill-name}/phases/orchestrator.md` |
16
16
 
17
17
  ---
18
18
 
19
- ## ⚠️ 重要提示
19
+ ## Important Notes
20
20
 
21
- > **Phase 0 是强制前置阶段**:在 Orchestrator 启动执行循环之前,必须先完成 Phase 0 的规范研读。
21
+ > **Phase 0 is mandatory prerequisite**: Before Orchestrator starts execution loop, Phase 0 specification review must be completed first.
22
22
  >
23
- > 生成 Orchestrator 时,需要确保:
24
- > 1. SKILL.md 中已包含 Phase 0 规范研读步骤
25
- > 2. Orchestrator 启动前验证规范已阅读
26
- > 3. 所有 Action 文件都引用相关的规范文档
27
- > 4. Architecture Overview Phase 0 位于 Orchestrator 之前
23
+ > When generating Orchestrator, ensure:
24
+ > 1. Phase 0 specification review step is included in SKILL.md
25
+ > 2. Orchestrator validates specification has been reviewed before starting execution loop
26
+ > 3. All Action files reference related specification documents
27
+ > 4. Architecture Overview places Phase 0 before Orchestrator
28
28
 
29
- ## 模板结构
29
+ ## Template Structure
30
30
 
31
31
  ```markdown
32
32
  # Orchestrator
33
33
 
34
34
  ## Role
35
35
 
36
- 根据当前状态选择并执行下一个动作。
36
+ Select and execute next action based on current state.
37
37
 
38
38
  ## State Management
39
39
 
40
- ### 读取状态
40
+ ### Read State
41
41
 
42
42
  \`\`\`javascript
43
- const state = JSON.parse(Read(`${workDir}/state.json`));
43
+ const state = JSON.parse(Read(\`${workDir}/state.json\`));
44
44
  \`\`\`
45
45
 
46
- ### 更新状态
46
+ ### Update State
47
47
 
48
48
  \`\`\`javascript
49
49
  function updateState(updates) {
50
- const state = JSON.parse(Read(`${workDir}/state.json`));
50
+ const state = JSON.parse(Read(\`${workDir}/state.json\`));
51
51
  const newState = {
52
52
  ...state,
53
53
  ...updates,
54
54
  updated_at: new Date().toISOString()
55
55
  };
56
- Write(`${workDir}/state.json`, JSON.stringify(newState, null, 2));
56
+ Write(\`${workDir}/state.json\`, JSON.stringify(newState, null, 2));
57
57
  return newState;
58
58
  }
59
59
  \`\`\`
@@ -62,18 +62,18 @@ function updateState(updates) {
62
62
 
63
63
  \`\`\`javascript
64
64
  function selectNextAction(state) {
65
- // 1. 终止条件检查
65
+ // 1. Check termination conditions
66
66
  {{termination_checks}}
67
-
68
- // 2. 错误限制检查
67
+
68
+ // 2. Check error limit
69
69
  if (state.error_count >= 3) {
70
70
  return 'action-abort';
71
71
  }
72
-
73
- // 3. 动作选择逻辑
72
+
73
+ // 3. Action selection logic
74
74
  {{action_selection_logic}}
75
-
76
- // 4. 默认完成
75
+
76
+ // 4. Default completion
77
77
  return 'action-complete';
78
78
  }
79
79
  \`\`\`
@@ -83,34 +83,34 @@ function selectNextAction(state) {
83
83
  \`\`\`javascript
84
84
  async function runOrchestrator() {
85
85
  console.log('=== Orchestrator Started ===');
86
-
86
+
87
87
  let iteration = 0;
88
88
  const MAX_ITERATIONS = 100;
89
-
89
+
90
90
  while (iteration < MAX_ITERATIONS) {
91
91
  iteration++;
92
-
93
- // 1. 读取当前状态
94
- const state = JSON.parse(Read(`${workDir}/state.json`));
95
- console.log(`[Iteration ${iteration}] Status: ${state.status}`);
96
-
97
- // 2. 选择下一个动作
92
+
93
+ // 1. Read current state
94
+ const state = JSON.parse(Read(\`${workDir}/state.json\`));
95
+ console.log(\`[Iteration ${iteration}] Status: ${state.status}\`);
96
+
97
+ // 2. Select next action
98
98
  const actionId = selectNextAction(state);
99
-
99
+
100
100
  if (!actionId) {
101
101
  console.log('No action selected, terminating.');
102
102
  break;
103
103
  }
104
-
105
- console.log(`[Iteration ${iteration}] Executing: ${actionId}`);
106
-
107
- // 3. 更新状态:当前动作
104
+
105
+ console.log(\`[Iteration ${iteration}] Executing: ${actionId}\`);
106
+
107
+ // 3. Update state: current action
108
108
  updateState({ current_action: actionId });
109
-
110
- // 4. 执行动作
109
+
110
+ // 4. Execute action
111
111
  try {
112
- const actionPrompt = Read(`phases/actions/${actionId}.md`);
113
-
112
+ const actionPrompt = Read(\`phases/actions/${actionId}.md\`);
113
+
114
114
  const result = await Task({
115
115
  subagent_type: 'universal-executor',
116
116
  run_in_background: false,
@@ -125,18 +125,18 @@ async function runOrchestrator() {
125
125
  Return JSON with stateUpdates field.
126
126
  \`
127
127
  });
128
-
128
+
129
129
  const actionResult = JSON.parse(result);
130
-
131
- // 5. 更新状态:动作完成
130
+
131
+ // 5. Update state: action completed
132
132
  updateState({
133
133
  current_action: null,
134
134
  completed_actions: [...state.completed_actions, actionId],
135
135
  ...actionResult.stateUpdates
136
136
  });
137
-
137
+
138
138
  } catch (error) {
139
- // 错误处理
139
+ // Error handling
140
140
  updateState({
141
141
  current_action: null,
142
142
  errors: [...state.errors, {
@@ -148,7 +148,7 @@ Return JSON with stateUpdates field.
148
148
  });
149
149
  }
150
150
  }
151
-
151
+
152
152
  console.log('=== Orchestrator Finished ===');
153
153
  }
154
154
  \`\`\`
@@ -167,28 +167,28 @@ Return JSON with stateUpdates field.
167
167
 
168
168
  | Error Type | Recovery Strategy |
169
169
  |------------|-------------------|
170
- | 动作执行失败 | 重试最多 3 |
171
- | 状态不一致 | 回滚到上一个稳定状态 |
172
- | 用户中止 | 保存当前状态,允许恢复 |
170
+ | Action execution failed | Retry up to 3 times |
171
+ | State inconsistency | Rollback to last stable state |
172
+ | User abort | Save current state, allow recovery |
173
173
  ```
174
174
 
175
- ## 变量说明
175
+ ## Variable Descriptions
176
176
 
177
- | 变量 | 说明 |
178
- |------|------|
179
- | `{{termination_checks}}` | 终止条件检查代码 |
180
- | `{{action_selection_logic}}` | 动作选择逻辑代码 |
181
- | `{{action_catalog_table}}` | 动作目录表格 |
182
- | `{{termination_conditions_list}}` | 终止条件列表 |
177
+ | Variable | Description |
178
+ |----------|-------------|
179
+ | `{{termination_checks}}` | Termination condition check code |
180
+ | `{{action_selection_logic}}` | Action selection logic code |
181
+ | `{{action_catalog_table}}` | Action directory table |
182
+ | `{{termination_conditions_list}}` | List of termination conditions |
183
183
 
184
- ## 生成函数
184
+ ## Generation Function
185
185
 
186
186
  ```javascript
187
187
  function generateOrchestrator(config) {
188
188
  const actions = config.autonomous_config.actions;
189
189
  const terminations = config.autonomous_config.termination_conditions || [];
190
-
191
- // 生成终止条件检查
190
+
191
+ // Generate termination checks
192
192
  const terminationChecks = terminations.map(t => {
193
193
  const checks = {
194
194
  'user_exit': 'if (state.status === "user_exit") return null;',
@@ -198,24 +198,24 @@ function generateOrchestrator(config) {
198
198
  };
199
199
  return checks[t] || `if (state.${t}) return null;`;
200
200
  }).join('\n ');
201
-
202
- // 生成动作选择逻辑
201
+
202
+ // Generate action selection logic
203
203
  const actionSelectionLogic = actions.map(action => {
204
204
  if (!action.preconditions?.length) {
205
- return `// ${action.name}: 无前置条件,需要手动添加选择逻辑`;
205
+ return `// ${action.name}: No preconditions, add selection logic manually`;
206
206
  }
207
207
  const conditions = action.preconditions.map(p => `state.${p}`).join(' && ');
208
208
  return `if (${conditions}) return '${action.id}';`;
209
209
  }).join('\n ');
210
-
211
- // 生成动作目录表格
212
- const actionCatalogTable = actions.map(a =>
210
+
211
+ // Generate action catalog table
212
+ const actionCatalogTable = actions.map(a =>
213
213
  `| [${a.id}](actions/${a.id}.md) | ${a.description || a.name} | ${a.preconditions?.join(', ') || '-'} |`
214
214
  ).join('\n');
215
-
216
- // 生成终止条件列表
215
+
216
+ // Generate termination conditions list
217
217
  const terminationConditionsList = terminations.map(t => `- ${t}`).join('\n');
218
-
218
+
219
219
  return template
220
220
  .replace('{{termination_checks}}', terminationChecks)
221
221
  .replace('{{action_selection_logic}}', actionSelectionLogic)
@@ -224,11 +224,11 @@ function generateOrchestrator(config) {
224
224
  }
225
225
  ```
226
226
 
227
- ## 编排策略
227
+ ## Orchestration Strategies
228
228
 
229
- ### 1. 优先级策略
229
+ ### 1. Priority Strategy
230
230
 
231
- 按预定义优先级选择动作:
231
+ Select action by predefined priority:
232
232
 
233
233
  ```javascript
234
234
  const PRIORITY = ['action-init', 'action-process', 'action-review', 'action-complete'];
@@ -243,16 +243,16 @@ function selectByPriority(state, availableActions) {
243
243
  }
244
244
  ```
245
245
 
246
- ### 2. 用户驱动策略
246
+ ### 2. User-Driven Strategy
247
247
 
248
- 询问用户选择下一个动作:
248
+ Ask user to select next action:
249
249
 
250
250
  ```javascript
251
251
  async function selectByUser(state, availableActions) {
252
252
  const response = await AskUserQuestion({
253
253
  questions: [{
254
- question: "选择下一个操作:",
255
- header: "操作",
254
+ question: "Select next operation:",
255
+ header: "Operations",
256
256
  multiSelect: false,
257
257
  options: availableActions.map(a => ({
258
258
  label: a.name,
@@ -260,32 +260,32 @@ async function selectByUser(state, availableActions) {
260
260
  }))
261
261
  }]
262
262
  });
263
-
264
- return availableActions.find(a => a.name === response["操作"])?.id;
263
+
264
+ return availableActions.find(a => a.name === response["Operations"])?.id;
265
265
  }
266
266
  ```
267
267
 
268
- ### 3. 状态驱动策略
268
+ ### 3. State-Driven Strategy
269
269
 
270
- 完全基于状态自动决策:
270
+ Fully automatic decision based on state:
271
271
 
272
272
  ```javascript
273
273
  function selectByState(state) {
274
- // 初始化
274
+ // Initialization
275
275
  if (state.status === 'pending') return 'action-init';
276
-
277
- // 有待处理项
276
+
277
+ // Has pending items
278
278
  if (state.pending_items?.length > 0) return 'action-process';
279
-
280
- // 需要审核
279
+
280
+ // Needs review
281
281
  if (state.needs_review) return 'action-review';
282
-
283
- // 完成
282
+
283
+ // Completed
284
284
  return 'action-complete';
285
285
  }
286
286
  ```
287
287
 
288
- ## 状态机示例
288
+ ## State Machine Example
289
289
 
290
290
  ```mermaid
291
291
  stateDiagram-v2