openmatrix 0.2.5 → 0.2.7

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.
@@ -48,7 +48,8 @@ class FileStore {
48
48
  }
49
49
  catch (error) {
50
50
  // 只隐藏"文件不存在"错误,其他错误(权限、磁盘等)抛出以便调用者处理
51
- if (error.code === 'ENOENT' || error.code === 'EISDIR') {
51
+ const nodeError = error;
52
+ if (nodeError.code === 'ENOENT' || nodeError.code === 'EISDIR') {
52
53
  return null;
53
54
  }
54
55
  throw error;
@@ -64,7 +65,8 @@ class FileStore {
64
65
  return await (0, promises_1.readFile)(fullPath, 'utf-8');
65
66
  }
66
67
  catch (error) {
67
- if (error.code === 'ENOENT' || error.code === 'EISDIR') {
68
+ const nodeError = error;
69
+ if (nodeError.code === 'ENOENT' || nodeError.code === 'EISDIR') {
68
70
  return null;
69
71
  }
70
72
  throw error;
@@ -126,7 +128,8 @@ class FileStore {
126
128
  return JSON.parse(content);
127
129
  }
128
130
  catch (error) {
129
- if (error.code === 'ENOENT' || error.code === 'EISDIR') {
131
+ const nodeError = error;
132
+ if (nodeError.code === 'ENOENT' || nodeError.code === 'EISDIR') {
130
133
  return null;
131
134
  }
132
135
  throw error;
@@ -267,3 +267,47 @@ export interface ResearchSession {
267
267
  createdAt: string;
268
268
  completedAt?: string;
269
269
  }
270
+ /** 问题类型 */
271
+ export type ProblemType = 'task_failure' | 'project_bug' | 'system_bug' | 'environment';
272
+ /** 诊断报告 */
273
+ export interface DiagnosisReport {
274
+ id: string;
275
+ problemType: ProblemType;
276
+ trigger: 'explicit' | 'auto';
277
+ description: string;
278
+ errorInfo?: {
279
+ message: string;
280
+ stack?: string;
281
+ timestamp: string;
282
+ };
283
+ relatedTaskId?: string;
284
+ relatedFiles?: string[];
285
+ rootCause: string;
286
+ impactScope: string[];
287
+ suggestedFix: string;
288
+ diagnosedAt: string;
289
+ diagnosisDuration?: number;
290
+ }
291
+ /** 调试会话状态 */
292
+ export type DebugStatus = 'initialized' | 'diagnosing' | 'awaiting_fix' | 'fixing' | 'verifying' | 'completed' | 'cancelled';
293
+ /** 调试会话 */
294
+ export interface DebugSession {
295
+ id: string;
296
+ status: DebugStatus;
297
+ report: DiagnosisReport;
298
+ fixDecision?: 'approve' | 'skip' | 'manual';
299
+ fixResult?: {
300
+ success: boolean;
301
+ operations: string[];
302
+ modifiedFiles: string[];
303
+ output: string;
304
+ };
305
+ verifyResult?: {
306
+ passed: boolean;
307
+ details: string;
308
+ };
309
+ retryCount: number;
310
+ createdAt: string;
311
+ updatedAt: string;
312
+ completedAt?: string;
313
+ }
@@ -42,10 +42,10 @@ export declare function initLoggerWithRunId(runId: string, omPath?: string): voi
42
42
  * 便捷方法: 直接记录日志
43
43
  */
44
44
  export declare const logger: {
45
- info: (message: string, meta?: any) => winston.Logger;
46
- error: (message: string, meta?: any) => winston.Logger;
47
- warn: (message: string, meta?: any) => winston.Logger;
48
- debug: (message: string, meta?: any) => winston.Logger;
45
+ info: (message: string, meta?: Record<string, unknown>) => winston.Logger;
46
+ error: (message: string, meta?: Record<string, unknown>) => winston.Logger;
47
+ warn: (message: string, meta?: Record<string, unknown>) => winston.Logger;
48
+ debug: (message: string, meta?: Record<string, unknown>) => winston.Logger;
49
49
  structured: {
50
50
  info: (operation: string, message: string, meta?: Record<string, unknown>, omPath?: string) => void;
51
51
  error: (operation: string, message: string, meta?: Record<string, unknown>, omPath?: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmatrix",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "AI Agent task orchestration system with Claude Code Skills integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/skills/auto.md CHANGED
@@ -173,7 +173,7 @@ openmatrix step --json # 获取下一个任务 + 检查是
173
173
  Agent({
174
174
  subagent_type: task.subagent_type,
175
175
  description: task.description,
176
- prompt: task.prompt + "\n\n⚠️ 完成后请输出简短摘要(不超过3行):\n1. 关键决策\n2. 创建/修改的文件\n3. 对后续任务的建议",
176
+ prompt: task.prompt + "\n\n⚠️ 完成后请输出简短摘要(不超过3行):\n1. 关键决策\n2. 创建/修改的文件\n3. 对后续任务的建议\n\n🚫 **禁止执行 git commit** — 所有提交统一通过 openmatrix complete 执行,确保使用正确的任务标题。",
177
177
  isolation: task.isolation,
178
178
  run_in_background: true
179
179
  })
@@ -182,6 +182,8 @@ Agent({
182
182
  > ⚠️ **必须使用原生 Agent 工具** — 禁止调用 gsd-executor、superpowers 或任何其他编排技能。
183
183
  >
184
184
  > **上下文节省**: 使用 `run_in_background: true` 后台执行,Agent 完成后仅返回简短摘要,大幅节省主会话上下文。
185
+ >
186
+ > 🚫 **Agent 内部禁止 git commit** — 所有提交必须通过 `openmatrix complete` 执行,否则会产生无意义提交。
185
187
 
186
188
  每个 Agent 完成后:
187
189
  1. **保存 Agent 上下文** — 将执行结果摘要写入 `.openmatrix/tasks/TASK-XXX/context.md`,格式如下:
@@ -0,0 +1,451 @@
1
+ ---
2
+ name: om:debug
3
+ description: 系统化调试 - 遇到任何 bug、测试失败或异常行为时使用,在提出修复方案之前执行
4
+ priority: high
5
+ ---
6
+
7
+ <NO-OTHER-SKILLS>
8
+ **绝对禁止**调用以下技能:
9
+ - ❌ superpowers:systematic-debugging → 你已经在 om:debug 中了
10
+ - ❌ superpowers:* → 全部被 OpenMatrix 替代
11
+ - ❌ gsd:* → 全部被 OpenMatrix 替代
12
+ - ❌ 任何其他任务编排相关的技能
13
+
14
+ **诊断和修复阶段只能使用 Agent 工具** — 直接调用 Agent,不通过任何中间层。
15
+ </NO-OTHER-SKILLS>
16
+
17
+ <MANDATORY-EXECUTION-ORDER>
18
+ ## 执行顺序 - 必须严格按此顺序,不得跳过
19
+
20
+ ```
21
+ Step 1: 接收问题描述(参数、指定任务、或询问用户)
22
+ Step 2: 调用 CLI: openmatrix debug 初始化会话
23
+ Step 3: 第一阶段:根因调查(Explore Agent)
24
+ Step 4: 第二阶段:模式分析(Explore Agent)
25
+ Step 5: 展示诊断报告 + 修复建议
26
+ ⛔ 调查阶段结束,必须等待用户确认
27
+ Step 6: AskUserQuestion 是否需要修复
28
+ ↓ 用户确认"需要修复"
29
+ Step 7: AskUserQuestion 选择修复策略
30
+ Step 8: 实施修复(Agent)
31
+ Step 9: 验证修复结果
32
+ Step 10: 写入 Debug Report 并展示
33
+ ```
34
+
35
+ **铁律:不做根因调查,不许提修复方案**
36
+ **铁律:调查完成后必须询问用户是否修复,不得自动进入修复流程**
37
+ </MANDATORY-EXECUTION-ORDER>
38
+
39
+ <objective>
40
+ 系统化调试 - 通过四阶段流程诊断和修复问题。不依赖任务流程,可独立使用。
41
+ </objective>
42
+
43
+ <process>
44
+
45
+ ## Step 1: 接收问题
46
+
47
+ **检查 `$ARGUMENTS`:**
48
+
49
+ | 参数 | 处理方式 |
50
+ |------|---------|
51
+ | `--task TASK-XXX` | 读取指定失败任务 |
52
+ | `<问题描述>` | 直接使用描述 |
53
+ | 空 | 询问用户问题描述 |
54
+
55
+ **如果是空参数,询问:**
56
+
57
+ AskUserQuestion: `header: "问题描述"`, `multiSelect: false`
58
+ **question:** 请描述你遇到的问题
59
+
60
+ | label | description |
61
+ |-------|-------------|
62
+ | 描述问题 | 输入自由文本描述 |
63
+ | 选择失败任务 | 从当前失败任务中选择 |
64
+ | 取消 | 退出调试模式 |
65
+
66
+ **如果有失败任务(检查 .openmatrix/state.json):**
67
+ ```bash
68
+ cat .openmatrix/state.json 2>/dev/null | grep -o '"failed":[0-9]*'
69
+ ```
70
+ 如果 `statistics.failed > 0`,读取 `.openmatrix/tasks/` 目录找到 failed 任务并展示。
71
+
72
+ ## Step 2: 调用 CLI 初始化
73
+
74
+ **带任务 ID:**
75
+ ```bash
76
+ openmatrix debug --task TASK-XXX --json
77
+ ```
78
+
79
+ **带描述:**
80
+ ```bash
81
+ openmatrix debug "问题描述" --json
82
+ ```
83
+
84
+ CLI 返回:
85
+ ```json
86
+ {
87
+ "sessionId": "DEBUG-xxx",
88
+ "status": "diagnosing",
89
+ "problemType": "task_failure",
90
+ "report": {
91
+ "description": "...",
92
+ "relatedTaskId": "TASK-003",
93
+ "relatedFiles": ["src/xxx.ts"]
94
+ }
95
+ }
96
+ ```
97
+
98
+ 从返回结果中读取 `sessionId`,后续步骤使用此 ID。
99
+
100
+ ## Step 3: 第一阶段 - 根因调查
101
+
102
+ **调用 Explore Agent:**
103
+
104
+ ```typescript
105
+ Agent({
106
+ subagent_type: "Explore",
107
+ description: "根因调查 - 第一阶段",
108
+ prompt: `你是调试专家。正在进行系统化调试的第一阶段:根因调查。
109
+
110
+ **铁律:在找到根因之前,不要提出任何修复方案。**
111
+
112
+ ## 问题信息
113
+ - 问题类型: ${problemType}
114
+ - 问题描述: ${description}
115
+ ${relatedTaskId ? `- 关联任务: ${relatedTaskId}` : ''}
116
+
117
+ ## 任务
118
+ 1. 仔细阅读所有错误信息(不要跳过任何警告或错误)
119
+ 2. 收集相关文件和日志
120
+ 3. 检查近期代码变更(git diff、最近提交)
121
+ 4. 如果有多个组件,追踪数据流,找到断裂点
122
+ 5. 定位问题根源
123
+
124
+ ## 输出格式
125
+ 请按以下格式输出:
126
+
127
+ ### 错误信息
128
+ - 错误类型: ...
129
+ - 错误位置: 文件:行号
130
+ - 错误详情: ...
131
+
132
+ ### 复现步骤
133
+ 1. ...
134
+
135
+ ### 近期变更
136
+ - 提交1: 描述
137
+ - 提交2: 描述
138
+
139
+ ### 根因分析
140
+ [详细描述问题根源]
141
+
142
+ ### 影响范围
143
+ - 文件1
144
+ - 文件2
145
+
146
+ ## 禁止行为
147
+ ❌ 提出修复方案
148
+ ❌ 修改任何文件
149
+ ❌ 做出未经证实的假设`,
150
+ run_in_background: false
151
+ })
152
+ ```
153
+
154
+ ## Step 4: 第二阶段 - 模式分析
155
+
156
+ **调用 Explore Agent:**
157
+
158
+ ```typescript
159
+ Agent({
160
+ subagent_type: "Explore",
161
+ description: "模式分析 - 第二阶段",
162
+ prompt: `继续进行系统化调试的第二阶段:模式分析。
163
+
164
+ ## 第一阶段发现
165
+
166
+ ${第一阶段根因调查的完整输出}
167
+
168
+ ## 任务
169
+ 1. 在代码库中找到类似的、正常工作的代码
170
+ 2. 对比正常代码和异常代码的差异
171
+ 3. 列出所有差异点(无论多小)
172
+ 4. 理解功能依赖关系和隐含假设
173
+
174
+ ## 输出格式
175
+
176
+ ### 正常示例
177
+ - 文件: path:line
178
+ - 说明: 为什么这段代码能正常工作
179
+
180
+ ### 差异点
181
+ 1. 差异1: 正常代码 vs 异常代码
182
+ 2. 差异2: ...
183
+
184
+ ### 依赖关系
185
+ - 需要哪些前置条件
186
+ - 有哪些隐含假设`,
187
+ run_in_background: false
188
+ })
189
+ ```
190
+
191
+ ## Step 5: 展示诊断报告
192
+
193
+ **第一阶段和第二阶段完成后,展示诊断报告:**
194
+
195
+ ```
196
+ 🔍 诊断报告
197
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
198
+
199
+ 问题类型: xxx
200
+
201
+ 根因分析
202
+ [来自第一阶段调查的根因描述]
203
+
204
+ 正常示例
205
+ 文件: path:line
206
+ 说明: ...
207
+
208
+ 差异点
209
+ 1. ...
210
+ 2. ...
211
+
212
+ 影响范围
213
+ - 文件1
214
+ - 文件2
215
+
216
+ 修复建议
217
+ [基于差异分析的具体修复建议]
218
+
219
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
220
+ ```
221
+
222
+ ## Step 6: 确认是否修复
223
+
224
+ **⛔ 调查阶段结束,必须在此暂停等待用户确认。不得跳过此步骤自动进入修复。**
225
+
226
+ AskUserQuestion: `header: "是否修复"`, `multiSelect: false`
227
+ **question:** 调查已完成,是否需要修复?
228
+
229
+ | label | description |
230
+ |-------|-------------|
231
+ | 需要修复 | 选择修复策略并执行 |
232
+ | 仅查看报告 | 不修复,仅输出诊断报告后结束 |
233
+ | 继续深入调查 | 根因不够清晰,继续调查 |
234
+
235
+ **用户选择 "继续深入调查"** → 回到 Step 3,带着新信息重新调查。
236
+ **用户选择 "仅查看报告"** → 跳到 Step 10,输出诊断报告后结束。
237
+
238
+ ## Step 7: 选择修复策略
239
+
240
+ **仅在用户选择"需要修复"后执行此步骤。**
241
+
242
+ AskUserQuestion: `header: "修复策略"`, `multiSelect: false`
243
+ **question:** 选择修复策略?
244
+
245
+ | label | description |
246
+ |-------|-------------|
247
+ | 自动修复 (推荐) | 调用 Agent 执行修复 |
248
+ | 手动修复 | 仅展示具体修复建议,用户自行修改 |
249
+
250
+ ## Step 8: 实施修复
251
+
252
+ **如果用户选择自动修复:**
253
+
254
+ **修复前安全检查(必须执行):**
255
+ ```bash
256
+ git status --porcelain
257
+ git log --oneline -5
258
+ ```
259
+
260
+ ```typescript
261
+ Agent({
262
+ subagent_type: "general-purpose",
263
+ description: "实施 bug 修复",
264
+ prompt: `根据诊断报告执行修复。
265
+
266
+ ## 铁律
267
+ 1. 只实施单一修复(不要做额外改动)
268
+ 2. 每次只改一个变量
269
+ 3. 不在诊断不清的情况下盲目尝试
270
+ 4. 不做"顺便"的重构
271
+
272
+ ## 诊断报告
273
+ ${诊断报告全文}
274
+
275
+ ## 修复建议
276
+ ${suggestedFix}
277
+
278
+ ## 任务
279
+ 1. 根据修复建议实施修改
280
+ 2. 确保修改范围最小化
281
+ 3. 完成后输出修改了哪些文件和具体改动
282
+
283
+ ## 禁止行为
284
+ ❌ 修改与修复无关的文件
285
+ ❌ 进行额外的重构
286
+ ❌ 同时修复多个问题`,
287
+ run_in_background: false
288
+ })
289
+ ```
290
+
291
+ **Agent 完成后:**
292
+ 1. 检查 Git 状态
293
+ 2. 提交修复(如果文件有变更)
294
+ 3. 进入 Step 9 验证
295
+
296
+ ## Step 9: 验证修复
297
+
298
+ **根据问题类型选择验证方式:**
299
+
300
+ | 问题类型 | 验证方式 |
301
+ |---------|---------|
302
+ | task_failure | 重新运行失败任务或相关测试 |
303
+ | project_bug | 运行相关测试或构建 |
304
+ | system_bug | 验证 CLI 功能 |
305
+ | environment | 检查依赖安装状态 |
306
+
307
+ **任务失败:**
308
+ ```bash
309
+ # 运行相关测试
310
+ npm test -- --run 2>&1 | tail -20
311
+ ```
312
+
313
+ **项目 bug:**
314
+ ```bash
315
+ npm run build 2>&1 | tail -10
316
+ ```
317
+
318
+ **环境:**
319
+ ```bash
320
+ npm ls --depth=0 2>&1 | tail -20
321
+ ```
322
+
323
+ **验证结果判断:**
324
+ - 测试全通过 / 构建成功 → 验证通过
325
+ - 仍有失败 / 构建失败 → 验证未通过
326
+
327
+ AskUserQuestion: `header: "验证结果"`, `multiSelect: false`
328
+ **question:** 修复验证通过了吗?
329
+
330
+ | label | description |
331
+ |-------|-------------|
332
+ | 通过 | 修复成功,记录报告 |
333
+ | 未通过 | 修复未生效,重新分析 |
334
+ | 部分通过 | 部分修复,继续诊断 |
335
+
336
+ **如果验证未通过:**
337
+ - 重试计数 +1
338
+ - **< 3 次** → 回到 Step 3(带着新信息重新分析)
339
+ - **>= 3 次** → 输出"已尝试 3 次以上修复,建议暂停并质疑架构",进入 Step 10
340
+
341
+ ## Step 10: 写入 Debug Report
342
+
343
+ 完成调试会话:
344
+ ```bash
345
+ openmatrix debug --list
346
+ ```
347
+
348
+ **生成诊断报告文件(在界面输出):**
349
+
350
+ ```markdown
351
+ # Debug Report
352
+
353
+ **会话 ID**: ${sessionId}
354
+ **日期**: ${timestamp}
355
+ **状态**: ${status}
356
+
357
+ ## 问题描述
358
+ ${description}
359
+
360
+ ## 问题类型
361
+ ${problemType}
362
+
363
+ ## 诊断结果
364
+ ### 根因
365
+ ${rootCause}
366
+
367
+ ### 影响范围
368
+ ${impactScope}
369
+
370
+ ## 修复操作
371
+ ${operations}
372
+
373
+ ## 验证结果
374
+ ${verifyResult}
375
+
376
+ ## 经验教训
377
+ ${lessons}
378
+ ```
379
+
380
+ **Git 提交修复(如果有文件变更):**
381
+ ```bash
382
+ git status --porcelain
383
+ # 如果有未提交文件:
384
+ git add -A && git commit -m "$(cat <<'EOF'
385
+ fix: 修复 bug - 问题描述
386
+
387
+ 根因: ...
388
+ 修复: ...
389
+
390
+ 影响范围: ...
391
+ 文件改动: ...
392
+
393
+ Co-Authored-By: OpenMatrix https://github.com/bigfish1913/openmatrix
394
+ EOF
395
+ )"
396
+ ```
397
+
398
+ </process>
399
+
400
+ <arguments>
401
+ $ARGUMENTS
402
+ </arguments>
403
+
404
+ <examples>
405
+ /om:debug # 交互式调试
406
+ /om:debug --task TASK-003 # 调试指定失败任务
407
+ /om:debug "API 返回 500 错误" # 带问题描述调试
408
+ </examples>
409
+
410
+ <notes>
411
+ ## 四阶段流程
412
+
413
+ ```
414
+ Step 1: 接收问题
415
+
416
+ Step 2: CLI 初始化会话
417
+
418
+ Step 3: 第一阶段 - 根因调查(只读)
419
+
420
+ Step 4: 第二阶段 - 模式分析(只读)
421
+
422
+ Step 5: 展示诊断报告 + 修复建议
423
+
424
+ ⛔ 调查阶段结束 — 必须等待用户确认
425
+
426
+ Step 6: AskUserQuestion 是否需要修复
427
+ ├─ "仅查看报告" → Step 10 输出报告
428
+ ├─ "继续深入调查" → 回到 Step 3
429
+ └─ "需要修复" ↓
430
+ Step 7: AskUserQuestion 选择修复策略
431
+
432
+ Step 8: 实施修复
433
+
434
+ Step 9: 验证修复结果
435
+ ├─ 未通过 (< 3次) → 回到 Step 3
436
+ ├─ 未通过 (>= 3次) → Step 10
437
+ └─ 通过 ↓
438
+ Step 10: 写入 Debug Report
439
+ ```
440
+
441
+ ## 铁律
442
+
443
+ **不做根因调查,不许提修复方案**
444
+
445
+ ## 红线
446
+
447
+ - 3 次修复失败 → 暂停,质疑架构
448
+ - 不修改未关联的文件
449
+ - 单一修复原则
450
+ - 修复前必须有验证方法
451
+ </notes>
package/skills/om.md CHANGED
@@ -82,6 +82,7 @@ OpenMatrix 默认入口 — 用户无需记忆命令,直接描述任务即可
82
82
  /om:status - View status
83
83
  /om:meeting - Handle blockers
84
84
  /om:report - Generate report
85
+ /om:debug - Systematic debugging (bug/error investigation)
85
86
  ```
86
87
  </process>
87
88
 
@@ -99,5 +100,5 @@ $ARGUMENTS
99
100
 
100
101
  <notes>
101
102
  `/om` is shorthand for the OpenMatrix workflow. Same skill set as `openmatrix`, shorter invocation.
102
- Available commands: `/om:brainstorm`, `/om:start`, `/om:auto`, `/om:status`, `/om:meeting`, `/om:report`, `/om:resume`, `/om:retry`, `/om:research`, `/om:approve`, `/om:check`
103
+ Available commands: `/om:brainstorm`, `/om:start`, `/om:auto`, `/om:status`, `/om:meeting`, `/om:report`, `/om:resume`, `/om:retry`, `/om:research`, `/om:approve`, `/om:check`, `/om:debug`
103
104
  </notes>
package/skills/start.md CHANGED
@@ -23,6 +23,7 @@ description: "Use when starting a new development task cycle with interactive qu
23
23
  Step 1: 初始化 .openmatrix 目录
24
24
  Step 2: 解析任务输入(文件或描述)
25
25
  Step 3: 智能分析任务类型(开发/非开发)
26
+ Step 3.5: 提交文档(git add docs/ + 所有 .md 文件, commit)
26
27
  Step 4: 必选问题(开发任务:质量+E2E+模式; 非开发:仅模式)← 不可跳过
27
28
  Step 5: 可选问题(仅复杂开发任务)+ 展示执行计划
28
29
  Step 6: AI 提取 goals,生成 plan
@@ -141,6 +142,41 @@ cat .openmatrix/research/context.json 2>/dev/null || echo "NO_RESEARCH"
141
142
 
142
143
  ---
143
144
 
145
+ ### Step 3.5: 提交文档(必须执行,不可跳过)
146
+
147
+ 在开始任何新任务之前,先提交所有已变更的文档文件,确保文档和代码同步提交。
148
+
149
+ ```bash
150
+ git status --porcelain
151
+ ```
152
+
153
+ 检查是否有文档变更(包括 `docs/` 目录、所有 `.md` 文件、`.openmatrix/` 下的文档):
154
+
155
+ ```bash
156
+ git diff --name-only | grep -E '\.md$|^docs/' 2>/dev/null
157
+ git ls-files --others --exclude-standard | grep -E '\.md$|^docs/' 2>/dev/null
158
+ ```
159
+
160
+ 如果有文档变更(未追踪或未提交),执行提交:
161
+
162
+ ```bash
163
+ git add docs/ .openmatrix/*.md CLAUDE.md README.md README_EN.md
164
+ git commit -m "$(cat <<'EOF'
165
+ docs: 更新项目文档
166
+
167
+ 更新内容: ...
168
+
169
+ Co-Authored-By: OpenMatrix https://github.com/bigfish1913/openmatrix
170
+ EOF
171
+ )"
172
+ ```
173
+
174
+ **如果没有文档变更,跳过此步骤继续。**
175
+
176
+ > ⚠️ **此步骤不可跳过** — 避免"代码提交了但文档没提交"的情况。
177
+
178
+ ---
179
+
144
180
  ### Step 4: 必选问题(不可跳过,不可使用默认值,必须通过 AskUserQuestion 让用户选择)
145
181
 
146
182
  根据 `goalTypes` 字段判断需要询问哪些问题:
@@ -359,7 +395,7 @@ openmatrix step --json # 获取下一个任务 + 检查是
359
395
  Agent({
360
396
  subagent_type: task.subagent_type,
361
397
  description: task.description,
362
- prompt: task.prompt + "\n\n⚠️ 完成后请输出简短摘要(不超过3行):\n1. 关键决策\n2. 创建/修改的文件\n3. 对后续任务的建议",
398
+ prompt: task.prompt + "\n\n⚠️ 完成后请输出简短摘要(不超过3行):\n1. 关键决策\n2. 创建/修改的文件\n3. 对后续任务的建议\n\n🚫 **禁止执行 git commit** — 所有提交统一通过 openmatrix complete 执行,确保使用正确的任务标题。",
363
399
  isolation: task.isolation,
364
400
  run_in_background: true
365
401
  })
@@ -368,6 +404,8 @@ Agent({
368
404
  > ⚠️ **必须使用原生 Agent 工具** — 禁止调用 gsd-executor、superpowers 或任何其他编排技能。
369
405
  >
370
406
  > **上下文节省**: 使用 `run_in_background: true` 后台执行,Agent 完成后仅返回简短摘要,不返回完整输出,大幅节省主会话上下文。
407
+ >
408
+ > 🚫 **Agent 内部禁止 git commit** — 所有提交必须通过 `openmatrix complete` 执行,否则会产生 "Test Task" 等无意义提交。
371
409
 
372
410
  每个 Agent 完成后(收到后台完成通知时):
373
411
  1. **标记完成并更新统计(必须执行):**
@@ -508,7 +546,7 @@ $ARGUMENTS
508
546
  ## 执行流程
509
547
 
510
548
  ```
511
- Step 1-5: 初始化 + 问答 + 确认 → Step 6: 提取 goals + plan → Step 7: 写入 tasks-input.json
549
+ Step 1-3: 初始化 + 解析输入 + 分析类型 → Step 3.5: 提交文档 → Step 4-5: 问答 + 确认 → Step 6: 提取 goals + plan → Step 7: 写入 tasks-input.json
512
550
  → Step 8: openmatrix start --tasks-json (必须) → Step 9: 读取 subagentTasks
513
551
  → Step 10: Agent 逐个执行 (只有这里写代码)
514
552
  ```