openmatrix 0.2.19 → 0.2.21

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.
@@ -504,3 +504,312 @@ export interface EnvironmentDetectorConfig {
504
504
  /** 最大建议数量 */
505
505
  maxDeployOptions?: number;
506
506
  }
507
+ /**
508
+ * 测试框架类型
509
+ */
510
+ export type TestFramework = 'vitest' | 'jest' | 'mocha' | 'jasmine' | 'playwright' | 'cypress' | 'selenium' | 'puppeteer' | 'appium' | 'detox' | 'pytest' | 'unittest' | 'junit' | 'testng' | 'xctest' | 'gotest' | 'cargo-test' | 'unknown';
511
+ /**
512
+ * 测试类型
513
+ */
514
+ export type TestType = 'unit' | 'integration' | 'e2e' | 'api' | 'ui' | 'visual' | 'performance' | 'accessibility';
515
+ /**
516
+ * 测试框架检测结果
517
+ */
518
+ export interface TestFrameworkInfo {
519
+ /** 框架类型 */
520
+ framework: TestFramework;
521
+ /** 框架版本 */
522
+ version?: string;
523
+ /** 配置文件路径 */
524
+ configFile?: string;
525
+ /** 是否为主要测试框架 */
526
+ isPrimary: boolean;
527
+ /** 支持的测试类型 */
528
+ supportedTypes: TestType[];
529
+ /** 可用的测试命令 */
530
+ commands: {
531
+ /** 运行所有测试 */
532
+ test: string;
533
+ /** 运行特定测试文件 */
534
+ testFile?: string;
535
+ /** 运行测试并生成覆盖率 */
536
+ testCoverage?: string;
537
+ /** 监听模式 */
538
+ watch?: string;
539
+ /** 更新快照 */
540
+ updateSnapshot?: string;
541
+ };
542
+ }
543
+ /**
544
+ * 测试配置 - 用户确认的测试配置
545
+ */
546
+ export interface TestConfig {
547
+ /** 目标文件或目录 */
548
+ target: string;
549
+ /** 测试类型列表 */
550
+ testTypes: TestType[];
551
+ /** 测试框架(AI 推荐,用户确认) */
552
+ framework: TestFramework;
553
+ /** 是否生成 UI/E2E 测试 */
554
+ includeUI: boolean;
555
+ /** 覆盖率目标 (%) */
556
+ coverageTarget?: number;
557
+ /** 测试文件输出目录 */
558
+ outputDir?: string;
559
+ /** 测试文件命名模式 */
560
+ namingPattern?: string;
561
+ /** 是否包含快照测试 */
562
+ includeSnapshots?: boolean;
563
+ /** 是否包含 Mock 数据 */
564
+ includeMocks?: boolean;
565
+ /** 额外配置选项 */
566
+ extraOptions?: Record<string, unknown>;
567
+ }
568
+ /**
569
+ * 测试用例 - 单个测试用例描述
570
+ */
571
+ export interface TestCase {
572
+ /** 测试用例 ID */
573
+ id: string;
574
+ /** 测试用例名称 */
575
+ name: string;
576
+ /** 测试类型 */
577
+ type: TestType;
578
+ /** 测试描述 */
579
+ description: string;
580
+ /** 测试文件路径(相对于项目根目录) */
581
+ filePath: string;
582
+ /** 被测试的源文件 */
583
+ sourceFile: string;
584
+ /** 被测试的函数/模块/组件 */
585
+ target: string;
586
+ /** 测试优先级 */
587
+ priority: 'P0' | 'P1' | 'P2' | 'P3';
588
+ /** 测试标签 */
589
+ tags?: string[];
590
+ /** 前置条件 */
591
+ preconditions?: string[];
592
+ /** 测试步骤 */
593
+ steps: TestStep[];
594
+ /** 预期结果 */
595
+ expectedResults: string[];
596
+ /** Mock 需求 */
597
+ mockRequirements?: MockRequirement[];
598
+ /** 测试数据 */
599
+ testData?: Record<string, unknown>;
600
+ /** 依赖的其他测试 */
601
+ dependencies?: string[];
602
+ }
603
+ /**
604
+ * 测试步骤
605
+ */
606
+ export interface TestStep {
607
+ /** 步骤序号 */
608
+ step: number;
609
+ /** 步骤描述 */
610
+ action: string;
611
+ /** 输入数据 */
612
+ input?: unknown;
613
+ /** 预期输出 */
614
+ expectedOutput?: unknown;
615
+ }
616
+ /**
617
+ * Mock 需求
618
+ */
619
+ export interface MockRequirement {
620
+ /** Mock 目标类型 */
621
+ type: 'function' | 'module' | 'api' | 'component' | 'service';
622
+ /** Mock 目标名称 */
623
+ target: string;
624
+ /** Mock 行为描述 */
625
+ behavior: string;
626
+ /** 返回值 */
627
+ returnValue?: unknown;
628
+ /** 是否需要验证调用 */
629
+ verifyCalls?: boolean;
630
+ }
631
+ /**
632
+ * 测试风格信息
633
+ */
634
+ export interface TestStyle {
635
+ /** 命名约定: describe/it vs test */
636
+ namingConvention: 'describe-it' | 'test' | 'mixed';
637
+ /** 断言库 */
638
+ assertionLibrary: 'expect' | 'assert' | 'should' | 'chai' | 'unknown';
639
+ /** 是否使用 TypeScript */
640
+ usesTypeScript: boolean;
641
+ /** 是否使用 JSX/TSX */
642
+ usesJSX: boolean;
643
+ /** 测试文件后缀 */
644
+ fileSuffix: string;
645
+ /** 测试文件位置: 同目录 vs 独立目录 */
646
+ fileLocation: 'adjacent' | 'separate';
647
+ }
648
+ /**
649
+ * 前端项目信息
650
+ */
651
+ export interface FrontendInfo {
652
+ /** 是否为前端项目 */
653
+ isFrontend: boolean;
654
+ /** 是否有 UI 组件 */
655
+ hasUIComponents: boolean;
656
+ }
657
+ /**
658
+ * 覆盖率报告
659
+ */
660
+ export interface CoverageReport {
661
+ /** 总覆盖率 */
662
+ total: number;
663
+ /** 各文件覆盖率 */
664
+ files: Array<{
665
+ path: string;
666
+ coverage: number;
667
+ uncoveredLines?: number[];
668
+ }>;
669
+ }
670
+ /**
671
+ * 测试扫描结果 - CLI 输出的原始数据
672
+ * 注意:CLI 只负责收集事实,不做推荐判断
673
+ */
674
+ export interface TestScanResult {
675
+ /** 扫描时间 */
676
+ timestamp: string;
677
+ /** 项目根目录 */
678
+ projectRoot: string;
679
+ /** 扫描目标 */
680
+ target: string;
681
+ /** 检测到的测试框架 */
682
+ frameworks: TestFrameworkInfo[];
683
+ /** 现有测试文件列表 */
684
+ existingTests: ExistingTestFile[];
685
+ /** 源文件列表(未覆盖的) */
686
+ uncoveredSources: UncoveredSourceFile[];
687
+ /** 项目类型 */
688
+ projectType: ProjectType;
689
+ /** 是否为前端项目 */
690
+ isFrontend: boolean;
691
+ /** 是否有 UI 组件 */
692
+ hasUIComponents: boolean;
693
+ /** 测试覆盖率报告(如果存在) */
694
+ coverageReport?: CoverageReport;
695
+ /** 现有测试风格(从现有测试文件推断) */
696
+ testStyle?: TestStyle;
697
+ /** 原始数据摘要 */
698
+ summary: {
699
+ /** 框架数量 */
700
+ frameworkCount: number;
701
+ /** 现有测试文件数量 */
702
+ existingTestCount: number;
703
+ /** 未覆盖源文件数量 */
704
+ uncoveredSourceCount: number;
705
+ /** 是否有测试配置 */
706
+ hasTestConfig: boolean;
707
+ /** 是否有覆盖率配置 */
708
+ hasCoverageConfig: boolean;
709
+ };
710
+ }
711
+ /**
712
+ * 现有测试文件信息
713
+ */
714
+ export interface ExistingTestFile {
715
+ /** 文件路径 */
716
+ path: string;
717
+ /** 测试类型 */
718
+ type: TestType;
719
+ /** 关联的源文件 */
720
+ sourceFile?: string;
721
+ /** 测试用例数量(如果可解析) */
722
+ testCount?: number;
723
+ /** 最后修改时间 */
724
+ lastModified?: string;
725
+ }
726
+ /**
727
+ * 未覆盖的源文件信息
728
+ */
729
+ export interface UncoveredSourceFile {
730
+ /** 文件路径 */
731
+ path: string;
732
+ /** 文件类型 */
733
+ fileType: 'module' | 'component' | 'service' | 'util' | 'class' | 'function' | 'unknown';
734
+ /** 导出的函数/类/组件 */
735
+ exports: string[];
736
+ /** 是否有对应的测试文件 */
737
+ hasTest: boolean;
738
+ /** 建议的测试类型 */
739
+ suggestedTestTypes: TestType[];
740
+ /** 复杂度指标(可选) */
741
+ complexity?: {
742
+ /** 行数 */
743
+ lines: number;
744
+ /** 函数数量 */
745
+ functions: number;
746
+ /** 圈复杂度 */
747
+ cyclomaticComplexity?: number;
748
+ };
749
+ }
750
+ /**
751
+ * 测试生成结果
752
+ */
753
+ export interface TestGenerationResult {
754
+ /** 生成时间 */
755
+ timestamp: string;
756
+ /** 关联的测试配置 */
757
+ config: TestConfig;
758
+ /** 生成的测试文件 */
759
+ files: GeneratedTestFile[];
760
+ /** 生成的测试用例 */
761
+ testCases: TestCase[];
762
+ /** 生成的 Mock 文件 */
763
+ mockFiles?: GeneratedMockFile[];
764
+ /** 生成统计 */
765
+ statistics: {
766
+ /** 测试文件数量 */
767
+ fileCount: number;
768
+ /** 测试用例数量 */
769
+ testCaseCount: number;
770
+ /** 单元测试数量 */
771
+ unitTestCount: number;
772
+ /** 集成测试数量 */
773
+ integrationTestCount: number;
774
+ /** E2E 测试数量 */
775
+ e2eTestCount: number;
776
+ /** Mock 文件数量 */
777
+ mockFileCount: number;
778
+ /** 预估覆盖率提升 */
779
+ estimatedCoverageIncrease?: number;
780
+ };
781
+ /** 运行测试的命令 */
782
+ runCommand: string;
783
+ /** 注意事项 */
784
+ notes?: string[];
785
+ }
786
+ /**
787
+ * 生成的测试文件
788
+ */
789
+ export interface GeneratedTestFile {
790
+ /** 文件路径 */
791
+ path: string;
792
+ /** 文件内容 */
793
+ content: string;
794
+ /** 测试类型 */
795
+ type: TestType;
796
+ /** 关联的源文件 */
797
+ sourceFile: string;
798
+ /** 包含的测试用例 ID 列表 */
799
+ testCaseIds: string[];
800
+ /** 是否覆盖现有文件 */
801
+ overwrites: boolean;
802
+ }
803
+ /**
804
+ * 生成的 Mock 文件
805
+ */
806
+ export interface GeneratedMockFile {
807
+ /** 文件路径 */
808
+ path: string;
809
+ /** 文件内容 */
810
+ content: string;
811
+ /** Mock 类型 */
812
+ type: 'function' | 'module' | 'api' | 'component' | 'service';
813
+ /** 描述 */
814
+ description: string;
815
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmatrix",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
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/approve.md CHANGED
@@ -1,8 +1,39 @@
1
1
  ---
2
2
  name: om:approve
3
- description: "Use when handling pending approvals including plan review, merge confirmation, deploy approval, and blocked task decisions during OpenMatrix execution. Triggers on: 审批, approve, 批准, plan review, merge conflict resolution, deploy confirmation, 阻塞处理, technical decision, pending approval, waiting for approval, 待确认."
3
+ description: "Use when handling pending approvals including plan review, merge confirmation, deploy approval, and blocked task decisions during OpenMatrix execution. Triggers on APPROVAL intent: user wants to review and approve pending items, handle merge conflicts, or confirm deploy. DO NOT trigger on: starting tasks, debugging, or status checks. Intent signals: user mentions 'approve', 'review plan', 'confirm merge', 'approve deploy', or refers to pending approval actions."
4
4
  ---
5
5
 
6
+ <INTENT-JUDGMENT>
7
+ ## 意图判断指南
8
+
9
+ **AI 应根据用户语义判断意图:**
10
+
11
+ ### 触发信号(审批意图)
12
+
13
+ - 用户要审批计划
14
+ - 处理合并冲突
15
+ - 确认部署
16
+ - 处理待审批项
17
+
18
+ ### 不触发信号
19
+
20
+ | 用户意图 | 应调用 |
21
+ |---------|--------|
22
+ | 开始任务 | /om:start |
23
+ | 调查问题 | /om:debug |
24
+ | 查看状态 | /om:status |
25
+
26
+ ### 示例判断
27
+
28
+ | 用户消息 | 判断 | 结果 |
29
+ |---------|------|------|
30
+ | "审批这个计划" | 审批意图 | 触发 ✓ |
31
+ | "确认合并" | 确认意图 | 触发 ✓ |
32
+ | "批准部署" | 部署审批意图 | 触发 ✓ |
33
+ | "为什么没通过审批" | 调查意图 | /om:debug |
34
+ | "开始实现" | 开发意图 | /om:start |
35
+ </INTENT-JUDGMENT>
36
+
6
37
  <NO-OTHER-SKILLS>
7
38
  执行此技能时,不得调用 superpowers、gsd 或其他任务编排相关的技能。OpenMatrix 独立运行,不依赖外部任务编排系统。
8
39
  </NO-OTHER-SKILLS>
package/skills/auto.md CHANGED
@@ -1,8 +1,39 @@
1
1
  ---
2
2
  name: om:auto
3
- description: "Use when the user wants fully automated task execution with zero manual approvals. Triggers on: 全自动, 无人值守, hands-free, non-stop, don't ask me, 直接执行, skip all confirmations, batch refactor, large migration, bulk changes. Use for multi-task execution where the user doesn't want to be interrupted at any approval point (plan/merge/deploy)."
3
+ description: "Use when the user wants fully automated task execution with zero manual approvals. Triggers on AUTOMATION intent: user explicitly requests hands-free execution, wants to skip all confirmations, or needs batch processing without interruptions. DO NOT trigger on: interactive requests, debugging, or status checks. Intent signals: user says 'fully auto', 'hands-free', 'no interruptions', 'skip approvals', or describes large batch operations."
4
4
  ---
5
5
 
6
+ <INTENT-JUDGMENT>
7
+ ## 意图判断指南
8
+
9
+ **AI 应根据用户语义判断意图:**
10
+
11
+ ### 触发信号(全自动意图)
12
+
13
+ - 用户明确要"全自动执行"
14
+ - 需要跳过所有审批确认
15
+ - 批量操作,不希望中断
16
+ - 用户表达"直接执行"、"不要问我"
17
+
18
+ ### 不触发信号
19
+
20
+ | 用户意图 | 应调用 |
21
+ |---------|--------|
22
+ | 需要交互确认 | /om:start |
23
+ | 调查问题 | /om:debug |
24
+ | 查看状态 | /om:status |
25
+
26
+ ### 示例判断
27
+
28
+ | 用户消息 | 判断 | 结果 |
29
+ |---------|------|------|
30
+ | "全自动执行" | 全自动意图 | 触发 ✓ |
31
+ | "不要问我直接做" | 无中断意图 | 触发 ✓ |
32
+ | "批量重构跳过确认" | 批量自动化 | 触发 ✓ |
33
+ | "交互式执行" | 需要确认 | /om:start |
34
+ | "查看执行状态" | 状态检查 | /om:status |
35
+ </INTENT-JUDGMENT>
36
+
6
37
  <NOTE>
7
38
  ## 注意:区分 `/om:auto` 指令与「全自动执行」模式
8
39
 
@@ -1,8 +1,40 @@
1
1
  ---
2
2
  name: om:brainstorm
3
- description: "Use when the user wants to explore requirements, design alternatives, or validate ideas before implementation. Triggers on: 头脑风暴, 设计方案, 需求分析, 技术选型, architecture design, 'how should I build', multi-module features, new projects from scratch, unclear requirements, complex system design. Use even if the user just says 'implement X' and the task involves multiple modules or unclear requirements brainstorm first, don't jump straight to coding."
3
+ description: "Use when the user wants to explore requirements, design alternatives, or validate ideas before implementation. Triggers on CLARIFICATION/DESIGN intent: user needs to clarify unclear requirements, explore multiple approaches, or design architecture before coding. DO NOT trigger on: simple implementation requests (clear path), status checks, or pure information queries. Intent signals: user says 'how should I', mentions multiple options/uncertainties, describes complex system from scratch, or task scope is ambiguous."
4
4
  ---
5
5
 
6
+ <INTENT-JUDGMENT>
7
+ ## 意图判断指南
8
+
9
+ **AI 应根据用户语义判断意图:**
10
+
11
+ ### 触发信号(澄清/设计意图)
12
+
13
+ - 用户想探索多种实现方案
14
+ - 需求不明确,需要澄清
15
+ - 涉及多模块协同,需要设计
16
+ - 从零开始搭建,需要架构规划
17
+ - 用户表达"怎么设计"、"什么方案"
18
+
19
+ ### 不触发信号
20
+
21
+ | 用户意图 | 应调用 |
22
+ |---------|--------|
23
+ | 明确的实现任务 | /om:start 或 /om:feature |
24
+ | 状态检查 | /om:status |
25
+ | 简单问题咨询 | 直接回答 |
26
+
27
+ ### 示例判断
28
+
29
+ | 用户消息 | 判断 | 结果 |
30
+ |---------|------|------|
31
+ | "登录功能怎么设计?" | 设计意图 | 触发 ✓ |
32
+ | "从零搭建后台系统" | 架构规划意图 | 触发 ✓ |
33
+ | "OAuth 选哪个方案?" | 方案探索意图 | 触发 ✓ |
34
+ | "给按钮加点击事件" | 明确实现 | /om:feature |
35
+ | "查看当前任务状态" | 状态检查 | /om:status |
36
+ </INTENT-JUDGMENT>
37
+
6
38
  <NO-OTHER-SKILLS>
7
39
  **绝对禁止**调用以下技能(OpenMatrix 完全替代它们):
8
40
  - ❌ superpowers:brainstorming → 你已经在 om:brainstorm 中了
@@ -201,9 +233,9 @@ AskUserQuestion: `header: "确认"`, `multiSelect: false`
201
233
  | 继续 | 设计合理,继续下一部分 |
202
234
  | 修改 | 我有调整建议 |
203
235
 
204
- ## 步骤 6: 总结确认
236
+ ## 步骤 6: 总结确认 + 自动路由判断
205
237
 
206
- 所有设计部分确认后,**先在界面展示完整总结**,再用简短 AskUserQuestion 确认:
238
+ 所有设计部分确认后,**先在界面展示完整总结和路由判断**,再让用户确认:
207
239
 
208
240
  **输出总结到界面(普通文本):**
209
241
 
@@ -227,18 +259,30 @@ AskUserQuestion: `header: "确认"`, `multiSelect: false`
227
259
 
228
260
  验收标准
229
261
  - CRUD 接口完整 / 测试覆盖率 > 80%
262
+
263
+ ---
264
+ 路由判断: 标准流程 (start)
265
+ 理由: 澄清后任务明确,需完整追踪和质量门禁
230
266
  ```
231
267
 
232
- **然后让用户选择下一步:**
268
+ **AI 根据澄清结果自动判断路由:**
269
+
270
+ | 判断条件 | 路由 |
271
+ |---------|------|
272
+ | 单一改动点 + 实现路径清晰 | feature |
273
+ | 任务明确 + 需完整追踪 | start |
274
+ | 仍有多方案/需进一步设计 | 继续 brainstorm |
275
+
276
+ **然后让用户确认:**
233
277
 
234
278
  AskUserQuestion: `header: "下一步"`, `multiSelect: false`
235
- **question:** 头脑风暴完成,是否开始执行任务?
279
+ **question:** 头脑风暴完成。AI 判断路由:${route}(${reason})。确认后自动进入对应流程。
236
280
 
237
281
  | label | description |
238
282
  |-------|-------------|
239
- | 开始执行 (推荐) | 写入 tasks-input.json 并调用 /om:start |
283
+ | 确认并执行 (推荐) | 自动调用 /om:${route} |
240
284
  | 继续探索 | 还有问题需要进一步讨论 |
241
- | 仅生成计划 | 生成详细计划但不执行 |
285
+ | 仅生成文档 | 生成设计文档但不执行 |
242
286
 
243
287
  ## 步骤 7: 输出设计文档
244
288
 
@@ -300,9 +344,9 @@ AskUserQuestion: `header: "下一步"`, `multiSelect: false`
300
344
  | 开始执行 (推荐) | 写入 tasks-input.json 并调用 /om:start |
301
345
  | 修改设计 | 需要调整设计方案 |
302
346
 
303
- ## 步骤 8: 写入 tasks-input.json 并调用 /om:start
347
+ ## 步骤 8: 写入任务文件并调用对应 Skill
304
348
 
305
- 用户选择"开始执行"后:
349
+ 用户选择"确认并执行"后:
306
350
 
307
351
  1. **检测状态:**
308
352
  ```bash
@@ -314,7 +358,18 @@ ls .openmatrix/state.json 2>/dev/null
314
358
  openmatrix start --init-only
315
359
  ```
316
360
 
317
- 3. **写入 `.openmatrix/tasks-input.json`:**
361
+ 3. **根据路由判断结果写入不同文件:**
362
+
363
+ **路由为 feature 时**,写入 `.openmatrix/feature-session.json`:
364
+ ```json
365
+ {
366
+ "taskDescription": "任务描述",
367
+ "designNotes": "关键设计要点(可选)",
368
+ "startedAt": "ISO时间戳"
369
+ }
370
+ ```
371
+
372
+ **路由为 start 时**,写入 `.openmatrix/tasks-input.json`:
318
373
  ```json
319
374
  {
320
375
  "title": "任务标题",
@@ -326,16 +381,19 @@ openmatrix start --init-only
326
381
  }
327
382
  ```
328
383
 
329
- > **注意**: `quality`、`mode`、`e2eTests` 不在此写入,由 `/om:start` 的必选问题决定。
384
+ > **注意**: `quality`、`mode`、`e2eTests` 不在此写入,由对应 Skill 的必选问题决定。
330
385
 
331
- 4. **⚠️ 必须执行(不可跳过):使用 Skill 工具调用 `/om:start`**
386
+ 4. **⚠️ 必须执行(不可跳过):根据路由调用对应 Skill**
332
387
 
333
388
  ```
334
- Skill 工具: skill = "om:start"
389
+ Skill 工具:
390
+ - feature → skill = "om:feature"
391
+ - start → skill = "om:start"
335
392
  ```
336
393
 
337
- 这不是可选的 — 如果不调用 `/om:start`,任务不会开始执行。
338
- `/om:start` 会检测到已存在的 `tasks-input.json`,然后询问必选问题(质量等级、E2E、执行模式)。
394
+ 这不是可选的 — 如果不调用对应 Skill,任务不会开始执行。
395
+ - `/om:feature` 会检测已存在的 `feature-session.json`,快速进入执行
396
+ - `/om:start` 会检测已存在的 `tasks-input.json`,询问必选问题(质量等级、E2E、执行模式)
339
397
 
340
398
  </process>
341
399
 
@@ -361,6 +419,14 @@ $ARGUMENTS
361
419
  - **问题要贴合任务** — 不问泛泛的问题,而是针对具体任务深入
362
420
  - **理解目的 > 理解实现** — 先搞清楚为什么做,再讨论怎么做
363
421
 
422
+ ## 路由判断(澄清完成后自动判断)
423
+
424
+ brainstorm 澄清完成后,自动判断下一步路由:
425
+ - **feature**: 单一改动点 + 实现路径清晰 → 写入 feature-session.json,调用 /om:feature
426
+ - **start**: 任务明确但需完整追踪 → 写入 tasks-input.json,调用 /om:start
427
+
428
+ 不再让用户二次选择流程,根据澄清结果直接进入对应执行流程。
429
+
364
430
  ## 领域调研集成
365
431
 
366
432
  - 检测到垂直领域(游戏、支付、区块链等)时,主动建议 `/om:research`
@@ -437,21 +503,26 @@ $ARGUMENTS
437
503
  │ NO
438
504
 
439
505
  ┌─────────────────┐
440
- │ 总结 + 确认
506
+ │ 总结 + 路由判断
507
+ │ (自动判断 │
508
+ │ feature/start)│
441
509
  └────────┬────────┘
442
510
 
511
+ 确认执行?
512
+ │ YES
443
513
 
444
514
  ┌─────────────────┐
445
515
  │ 写入设计文档 │
446
516
  │ (docs/openmatrix/) │
447
517
  └────────┬────────┘
448
518
 
449
- 开始执行
450
-
451
-
452
- ┌─────────────────┐
453
- │ 写入 JSON
454
- │ 调用 /om:start │
455
- └─────────────────┘
519
+ ├──────┬──────────┐
520
+ │ │
521
+ feature start 仅文档
522
+ │ │ │
523
+ ▼ ▼
524
+ ┌─────────┐ ┌─────────┐ 完成
525
+ │/om:feature│ │/om:start │
526
+ └─────────┘ └─────────┘
456
527
  ```
457
528
  </notes>
package/skills/debug.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: om:debug
3
- description: "Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes. Use for ANY technical issue: 测试失败, bug, 异常行为, 构建失败, 集成问题, 没触发, 没执行, 不工作, 原因, 为什么. Use ESPECIALLY when: under time pressure, 'just one quick fix' seems obvious, previous fix didn't work, you don't fully understand the issue. Don't skip when: issue seems simple (simple bugs have root causes too), you're in a hurry (systematic is faster than guessing)."
3
+ description: "Use when user encounters ANY technical problem and needs systematic diagnosis. Triggers on PROBLEM-EXPLORATION intent: user wants to understand WHY something failed, investigate root cause, or diagnose unexpected behavior. DO NOT trigger on: simple questions (how to do X), implementation requests (build/fix/add), or status checks. Intent signals: user seems confused about failure, asks '为什么', mentions error/issue without clear solution, wants to investigate before fixing."
4
4
  priority: high
5
5
  ---
6
6
 
@@ -14,6 +14,61 @@ priority: high
14
14
  **诊断和修复阶段只能使用 Agent 工具** — 直接调用 Agent,不通过任何中间层。
15
15
  </NO-OTHER-SKILLS>
16
16
 
17
+ <INTENT-JUDGMENT>
18
+ ## 意图判断指南
19
+
20
+ **AI 应根据用户语义判断意图,而非关键词匹配:**
21
+
22
+ ### 触发信号(问题探索意图)
23
+
24
+ 用户表现出:
25
+ - 需要理解失败原因(不知道为什么出错)
26
+ - 想先调查再行动(排查、诊断、定位)
27
+ - 对问题感到困惑(不清楚根因)
28
+ - 多次尝试未成功(之前修复没生效)
29
+ - 系统行为不符合预期(奇怪、意外)
30
+
31
+ ### 不触发信号(其他意图)
32
+
33
+ | 用户意图 | 应调用的 skill |
34
+ |---------|---------------|
35
+ | 想要实现新功能 | /om 或 /om:start |
36
+ | 想要修复已知问题(明确知道改什么) | /om:start |
37
+ | 询问如何做某事 | 直接回答,不调用 skill |
38
+ | 查看当前状态 | /om:status |
39
+ | 简单问题咨询 | 直接回答 |
40
+
41
+ ### 判断流程
42
+
43
+ ```
44
+ 用户消息
45
+
46
+ ├── 是否描述了技术问题/失败?
47
+ │ ├─ 否 → 不触发
48
+ │ └─ 是 ↓
49
+
50
+ ├── 用户是否理解问题原因?
51
+ │ ├─ 是,明确知道怎么修 → /om:start (直接修复)
52
+ │ └─ 否,想先调查 → 触发 /om:debug ✓
53
+
54
+ ├── 用户是否想先诊断再修复?
55
+ │ ├─ 是 → 触发 /om:debug ✓
56
+ │ └─ 否 → 根据其他意图选择
57
+ ```
58
+
59
+ ### 示例判断
60
+
61
+ | 用户消息 | 判断 | 结果 |
62
+ |---------|------|------|
63
+ | "测试失败了" | 描述问题,未说明原因 | 触发 debug |
64
+ | "查一下为什么没触发" | 明确要调查 | 触发 debug ✓ |
65
+ | "帮我排查这个问题" | 排查意图明确 | 触发 debug ✓ |
66
+ | "不知道为什么出错了" | 困惑,需要诊断 | 触发 debug ✓ |
67
+ | "修复登录页bug" | 明确要修复,知道改哪 | /om:start |
68
+ | "API返回500,帮我改一下" | 要修复而非调查 | /om:start |
69
+ | "怎么调试node进程" | 询问方法,非排查 | 直接回答 |
70
+ </INTENT-JUDGMENT>
71
+
17
72
  <MANDATORY-EXECUTION-ORDER>
18
73
  ## 执行顺序 - 必须严格按此顺序,不得跳过
19
74