openmatrix 0.1.55 → 0.1.57

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.
@@ -1,190 +1,97 @@
1
- ---
2
- name: openmatrix
3
- description: "TRIGGER for ANY implementation task. User wants to build/create/add/fix/implement/refactor something? This is the DEFAULT. Examples: 'add feature', 'fix bug', 'implement login', 'refactor code', 'create command'. ALWAYS prefer this over direct coding."
4
- priority: critical
5
- always_load: true
6
- ---
7
-
8
- <EXTREMELY-IMPORTANT>
9
- This skill MUST be invoked when the user describes ANY work to be done.
10
-
11
- **If you're unsure whether to invoke INVOKE IT.**
12
-
13
- **If user mentions: add/create/implement/fix/build/make/write/develop/refactor/optimize/update/modify/change → INVOKE THIS SKILL.**
14
-
15
- **Direct coding without OpenMatrix is ONLY allowed for:**
16
- - Simple one-line fixes (typos, variable names)
17
- - Answering questions (no code changes needed)
18
- - Information retrieval (reading files, explaining code)
19
-
20
- Everything else smart selection between `/om:brainstorm` and `/om:start`.
21
- </EXTREMELY-IMPORTANT>
22
-
23
- <objective>
24
- Automatically detect when user wants to accomplish a development task and intelligently choose between brainstorm (for complex tasks) or start (for simple tasks).
25
- </objective>
26
-
27
- <process>
28
- 1. **询问是否启用智能选择**
29
-
30
- 使用 AskUserQuestion 询问用户:
31
- ```
32
- 问题: 是否启用智能模式?
33
- 选项:
34
- - 🧠 智能选择 (推荐) - 自动判断任务复杂度,选择 brainstorm 或 start
35
- - 🚀 直接执行 - 跳过头脑风暴,直接开始任务
36
- - 🧐 先探索需求 - 强制使用头脑风暴模式
37
- ```
38
-
39
- 2. **根据选择执行不同流程**
40
-
41
- **选择"智能选择"**:
42
- - 分析任务复杂度
43
- - 展示推断结果,让用户确认或修改
44
- - 执行选择的命令
45
-
46
- **选择"直接执行"**:
47
- - 直接调用 /om:start
48
-
49
- **选择"先探索需求"**:
50
- - 直接调用 /om:brainstorm
51
-
52
- 3. **智能分析(如果启用)**
53
-
54
- **复杂任务** (满足任一条件):
55
- - 新功能开发: "实现用户登录" / "添加支付功能"
56
- - 多模块改动: "重构用户系统" / "优化整体性能"
57
- - 架构相关: "搭建框架" / "从零开始"
58
- - 关键词: "系统" / "架构" / "模块" / "集成" / "完整"
59
-
60
- **简单任务** (满足任一条件):
61
- - Bug 修复: "修复登录bug" / "解决样式问题"
62
- - 小改动: "修改文案" / "改变量名"
63
- - 单一功能: "添加一个按钮" / "写个工具函数"
64
- - 关键词: "修复" / "解决" / "改" / "调整" / "简单"
65
-
66
- 4. **展示推断结果并确认**
67
-
68
- 使用 AskUserQuestion 展示推断结果:
69
- ```
70
- 问题: 检测到这是一个【复杂/简单】任务,将使用【brainstorm/start】模式
71
- 选项:
72
- - 确认执行 - 使用推荐的模式
73
- - 🧠 改用头脑风暴 - 先探索需求再执行
74
- - 🚀 改用直接执行 - 跳过探索直接开始
75
- - ✏️ 自定义输入 - 输入其他指令
76
- ```
77
-
78
- 5. **执行选择的命令**
79
- </process>
80
-
81
- <trigger-conditions>
82
- ## AUTO-INVOKE RULES (Mandatory)
83
-
84
- **Invoke IMMEDIATELY when user input contains ANY of these patterns:**
85
-
86
- ### Action Verbs (触发词)
87
- | Chinese | English | Action |
88
- |---------|---------|--------|
89
- | 实现/开发/做/写 | implement/build/create/make/write | → Smart Select |
90
- | 添加/增加/加 | add/append | → Smart Select |
91
- | 修复/解决/改 | fix/resolve/repair | → Smart Select |
92
- | 重构/优化/改进 | refactor/optimize/improve | → Smart Select |
93
- | 更新/修改/改 | update/modify/change | → Smart Select |
94
-
95
- ### Context Patterns (触发场景)
96
- - **Feature requests**: "用户登录" / "支付功能" / "API接口"
97
- - **Bug reports**: "报错" / "不工作" / "有问题" / "崩溃"
98
- - **Code changes**: "这段代码" / "这个文件" / "那个模块"
99
- - **Multi-step tasks**: "先做A" / "然后B" / "最后C"
100
- - **System building**: "做一个系统" / "搭建框架" / "从零开始"
101
-
102
- ### The 3-Second Test
103
- ```
104
- 用户输入 → 能在3秒内判断是"要做事情"吗?
105
- ↓ Yes ↓ No
106
- Smart Select 直接回答
107
- ```
108
- </trigger-conditions>
109
-
110
- <smart-selection>
111
- ## 智能选择:Brainstorm vs Start
112
-
113
- **根据任务复杂度自动选择执行路径:**
114
-
115
- ### 🧠 复杂任务 → `/om:brainstorm`
116
- **触发条件 (满足任一):**
117
- - 新功能开发: "实现用户登录" / "添加支付功能" / "开发 API"
118
- - 多模块改动: "重构用户系统" / "优化整体性能"
119
- - 架构相关: "搭建框架" / "从零开始" / "设计架构"
120
- - 不确定因素: 需要技术选型、涉及多种方案选择
121
- - 关键词: "系统" / "架构" / "模块" / "集成" / "完整" / "从零"
122
-
123
- ### 🚀 简单任务 → `/om:start`
124
- **触发条件 (满足任一):**
125
- - Bug 修复: "修复登录bug" / "解决样式问题" / "改个报错"
126
- - 小改动: "修改文案" / "改变量名" / "调整配置"
127
- - 单一功能: "添加一个按钮" / "写个工具函数"
128
- - 明确需求: 需求清晰,无需额外探索
129
- - 关键词: "修复" / "解决" / "改" / "调整" / "小" / "简单"
130
-
131
- ### 选择流程
132
- ```
133
- 用户输入任务描述
134
-
135
-
136
- ┌─────────────────────┐
137
- │ 分析任务复杂度 │
138
- └──────────┬──────────┘
139
-
140
- ┌─────┴─────┐
141
- │ │
142
- 复杂任务 简单任务
143
- │ │
144
- ▼ ▼
145
- /om:brainstorm /om:start
146
- ```
147
-
148
- ### 判断示例
149
- | 用户输入 | 复杂度 | 执行路径 |
150
- |---------|--------|---------|
151
- | "实现用户登录功能" | 复杂 | `/om:brainstorm` |
152
- | "做一个完整的支付系统" | 复杂 | `/om:brainstorm` |
153
- | "从零搭建后台管理" | 复杂 | `/om:brainstorm` |
154
- | "修复登录页面的样式问题" | 简单 | `/om:start` |
155
- | "改一下这个变量名" | 简单 | `/om:start` |
156
- | "添加一个测试用例" | 简单 | `/om:start` |
157
- | "重构这个模块" | 中等 | `/om:brainstorm` (保守选择) |
158
- | "优化性能" | 中等 | `/om:brainstorm` (保守选择) |
159
-
160
- **不确定时的默认选择: `/om:brainstorm`** (宁可多问,不可漏问)
161
- </smart-selection>
162
-
163
- <exclusions>
164
- ## When NOT to Invoke (Rare Cases)
165
-
166
- **Do NOT invoke ONLY when:**
167
- - Pure question: "怎么实现?" / "如何配置?" / "what is..." / "为什么"
168
- - Information request: "显示配置" / "列出文件" / "show me..." / "看一下"
169
- - Status check: "状态" / "进度" / "status"
170
- - Casual chat: "你好" / "谢谢" / "hello"
171
-
172
- **Key Test:**
173
- ```
174
- 用户要我写代码/改代码/做东西吗?
175
- ↓ Yes → Smart Select (brainstorm/start)
176
- ↓ No → 直接回答
177
- ```
178
-
179
- **When in doubt → INVOKE. It handles both simple and complex tasks.**
180
- </exclusions>
181
-
182
- <examples>
183
- | User Input | Complexity | Action |
184
- |------------|------------|--------|
185
- | `实现用户登录功能` | 复杂 | → `/om:brainstorm` |
186
- | `做一个完整的订单系统` | 复杂 | → `/om:brainstorm` |
187
- | `修复登录页面的样式问题` | 简单 | → `/om:start` |
188
- | `改一下这个变量名` | 简单 | → `/om:start` |
189
- | `重构用户模块` | 中等 | → `/om:brainstorm` |
190
- | `怎么实现登录?` | - | ❌ Question, not task |
1
+ ---
2
+ name: openmatrix
3
+ description: "Use when starting any conversation where user wants development work done. Establishes how to detect development tasks and route to OpenMatrix workflow. Examples: 'implement X', 'build a game', 'fix bug', 'refactor module', 'add feature'."
4
+ priority: critical
5
+ always_load: true
6
+ ---
7
+
8
+ <EXTREMELY-IMPORTANT>
9
+ ## How to Detect Development Tasks
10
+
11
+ When the user's message indicates they want code produced or changed, this is a **development task** and OpenMatrix handles it.
12
+
13
+ **The Development Task Detection Flow:**
14
+ ```
15
+ User message received
16
+
17
+
18
+ Is the user asking me to PRODUCE code changes?
19
+
20
+ YES ──→ OpenMatrix handles this
21
+ │ (has its own brainstorm + plan + execute)
22
+
23
+ NO ──→ Other skills or direct answer
24
+ ```
25
+
26
+ **What counts as "produce code changes":**
27
+ | Signal | Example |
28
+ |--------|---------|
29
+ | User describes a goal to implement | "实现这个游戏", "build a login page" |
30
+ | User references a spec/doc and wants it built | "@docs/require.md 实现这个游戏" |
31
+ | User reports a bug to fix | "修复登录bug", "fix the crash" |
32
+ | User wants code refactored/optimized | "重构用户模块", "optimize performance" |
33
+ | User wants a feature added | "添加API接口", "add dark mode" |
34
+
35
+ **What does NOT count:**
36
+ | Signal | Example | Route |
37
+ |--------|---------|-------|
38
+ | Asking how something works | "怎么实现?" / "how does X work?" | Direct answer |
39
+ | Requesting information | "显示配置" / "show me the code" | Direct answer |
40
+ | Checking status | "进度" / "status" | Direct answer |
41
+
42
+ **IMPORTANT:** OpenMatrix includes its own brainstorm mode (`/om:brainstorm`).
43
+ When a development task is complex (new feature, multi-module, from-scratch), use `/om:brainstorm`.
44
+ When a development task is simple (bug fix, small change, clear requirement), use `/om:start`.
45
+ </EXTREMELY-IMPORTANT>
46
+
47
+ <NO-OTHER-SKILLS>
48
+ 执行此技能时,不得调用 superpowers、gsd 或其他任务编排相关的技能。OpenMatrix 独立运行,不依赖外部任务编排系统。
49
+ </NO-OTHER-SKILLS>
50
+
51
+ <objective>
52
+ Detect development task intent and route to OpenMatrix's internal workflow.
53
+ </objective>
54
+
55
+ <process>
56
+ 1. **Intent Analysis**
57
+
58
+ Determine if user wants to "do work" or "get information":
59
+
60
+ | User Intent | Behavioral Signal | Route |
61
+ |---------|---------|------|
62
+ | Build something | Describes goal, cites spec to implement | → OpenMatrix |
63
+ | Fix something | Reports problem, describes error | → OpenMatrix |
64
+ | Change something | Points to code to modify, proposes improvement | → OpenMatrix |
65
+ | Ask something | Question form, seeking explanation | → Direct answer |
66
+ | View something | Status check, info retrieval | → Direct answer |
67
+
68
+ 2. **Complexity Assessment**
69
+
70
+ **Complex → `/om:brainstorm`** (explore requirements first):
71
+ - New feature (from scratch)
72
+ - Multi-module changes (architecture involved)
73
+ - Unclear requirements (need to explore first)
74
+
75
+ **Simple `/om:start`** (clear requirements):
76
+ - Bug fix
77
+ - Small change
78
+ - Single feature
79
+ - Clear requirement
80
+
81
+ 3. **Execute directly, no extra confirmation**
82
+
83
+ After assessment, invoke the command directly.
84
+ </process>
85
+
86
+ <examples>
87
+ | User Input | Intent | Complexity | Action |
88
+ |------------|--------|------------|--------|
89
+ | `实现这个游戏` (with @file) | Build | Complex | `/om:brainstorm` |
90
+ | `实现用户登录功能` | Build | Complex | `/om:brainstorm` |
91
+ | `修复登录页面的样式问题` | Fix | Simple | `/om:start` |
92
+ | `改一下这个变量名` | Change | Simple | `/om:start` |
93
+ | `添加一个测试用例` | Build | Simple | `/om:start` |
94
+ | `重构用户模块` | Change | Medium | → `/om:brainstorm` |
95
+ | `从零搭建后台管理` | Build | Complex | → `/om:brainstorm` |
96
+ | `怎么实现登录?` | Ask | - | ❌ Direct answer |
97
+ | `这个函数有什么问题?` | Ask | - | Direct answer |
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: om:research
3
+ description: 领域调研和问题探索 - 为后续任务提供知识基础
4
+ ---
5
+
6
+ <NO-OTHER-SKILLS>
7
+ 执行此技能时,不得调用其他任务编排相关的技能。OpenMatrix 独立运行,不依赖外部任务编排系统。
8
+ </NO-OTHER-SKILLS>
9
+
10
+ <objective>
11
+ 在执行垂直领域任务前,由 AI 分析主题、识别领域、引导用户补全信息、生成领域专属文档,为后续 start 提供扎实的知识基础。
12
+ </objective>
13
+
14
+ <process>
15
+ 1. **初始化研究会话**
16
+
17
+ 调用 CLI 创建研究会话:
18
+ ```bash
19
+ openmatrix research "$ARGUMENTS" --json
20
+ ```
21
+
22
+ 返回:
23
+ ```json
24
+ {
25
+ "status": "initialized",
26
+ "message": "研究会话已创建,需要 AI 分析领域",
27
+ "topic": "做一个游戏",
28
+ "hint": "请使用 Agent 分析主题,识别领域和调研方向"
29
+ }
30
+ ```
31
+
32
+ 2. **AI 分析主题 (关键步骤)**
33
+
34
+ 启动 Agent 分析用户主题,识别领域和调研方向:
35
+
36
+ ```
37
+ Agent (Explore): 分析主题 "${topic}"
38
+
39
+ 分析要求:
40
+ 1. 识别领域: 这属于什么行业/技术领域?
41
+ 2. 调研方面: 这个领域有哪些核心方面需要了解?(5-10个)
42
+ 3. 关键决策: 用户需要做出哪些重要选择?
43
+ 4. 问题估算: 预计需要问多少个问题?
44
+
45
+ 严格输出 JSON:
46
+ {
47
+ "domain": "领域名称",
48
+ "aspects": ["方面1", "方面2", ...],
49
+ "keyDecisions": ["决策1", "决策2", ...],
50
+ "estimatedQuestions": 数字
51
+ }
52
+ ```
53
+
54
+ Agent prompt:
55
+ ```
56
+ 你是一个领域分析专家。请分析以下主题:
57
+
58
+ ## 用户主题
59
+ {topic}
60
+
61
+ ## 分析要求
62
+ 1. 识别领域: 这属于什么行业/技术领域?要具体,如"游戏开发"而不是"软件开发"
63
+ 2. 调研方面: 这个领域有哪些核心方面需要了解?列出 5-10 个
64
+ 3. 关键决策: 用户需要做出哪些重要选择?如"技术选型"、"平台选择"
65
+ 4. 问题估算: 预计需要问多少个问题才能收集足够信息?
66
+
67
+ ## 输出格式
68
+ 请严格输出以下 JSON 格式,不要有其他内容:
69
+ ```json
70
+ {
71
+ "domain": "领域名称",
72
+ "aspects": ["方面1", "方面2", "方面3", ...],
73
+ "keyDecisions": ["决策1", "决策2", ...],
74
+ "estimatedQuestions": 数字
75
+ }
76
+ ```
77
+ ```
78
+
79
+ 3. **更新会话并展示预览**
80
+
81
+ Agent 返回分析结果后,更新会话文件:
82
+ ```bash
83
+ # 读取当前会话并更新
84
+ # 将 domain, aspects, estimatedQuestions 写入 .openmatrix/research/session.json
85
+ # status 改为 'preview'
86
+ ```
87
+
88
+ 然后展示给用户确认:
89
+ ```typescript
90
+ AskUserQuestion({
91
+ questions: [{
92
+ question: `检测到「${domain}」领域,将调研以下方面:\n\n${aspects.map(a => `• ${a}`).join('\n')}\n\n预计 ${estimatedQuestions} 个问题,是否开始?`,
93
+ header: "确认研究",
94
+ options: [
95
+ { label: "开始研究", description: "启动并行 Agent 进行深度调研" },
96
+ { label: "跳过研究", description: "直接进入任务执行" },
97
+ { label: "调整范围", description: "修改研究方向" }
98
+ ],
99
+ multiSelect: false
100
+ }]
101
+ })
102
+ ```
103
+
104
+ 4. **确认后启动并行研究**
105
+
106
+ 用户确认后,调用 CLI:
107
+ ```bash
108
+ openmatrix research --confirm --json
109
+ ```
110
+
111
+ 返回:
112
+ ```json
113
+ {
114
+ "status": "researching",
115
+ "message": "开始深度研究",
116
+ "topic": "做一个游戏",
117
+ "domain": "游戏开发",
118
+ "aspects": [...],
119
+ "agents": [
120
+ { "role": "domain_researcher", "focus": "...", "status": "pending" },
121
+ { "role": "tech_explorer", "focus": "...", "status": "pending" },
122
+ { "role": "scenario_analyst", "focus": "...", "status": "pending" }
123
+ ],
124
+ "hint": "使用 Agent 工具并行执行研究"
125
+ }
126
+ ```
127
+
128
+ 5. **并行启动研究 Agent**
129
+
130
+ 使用 Agent 工具并行启动 2-3 个研究 Agent:
131
+
132
+ ```
133
+ Agent 1 (domain_researcher): 用 WebSearch 搜索 {domain} 领域核心概念、行业标准
134
+ Agent 2 (tech_explorer): 用 WebSearch 搜索 {domain} 主流技术方案、架构模式
135
+ Agent 3 (scenario_analyst): 结合 "{topic}" 分析实际应用场景、常见挑战
136
+ ```
137
+
138
+ 6. **基于研究结果生成领域问卷**
139
+
140
+ 研究完成后,从报告中提取关键决策点,转化为问题:
141
+
142
+ ```typescript
143
+ // 批量提问 (每次最多 4 个问题)
144
+ AskUserQuestion({ questions: domainQuestions.slice(0, 4) });
145
+ ```
146
+
147
+ 7. **生成领域专属文档**
148
+
149
+ 基于研究结果和用户回答,生成领域文档:
150
+
151
+ | 领域 | 文档类型 |
152
+ |------|----------|
153
+ | 游戏开发 | GDD (游戏设计文档) |
154
+ | Web 网站 | PRD (产品需求文档) |
155
+ | 支付系统 | 技术方案文档 |
156
+ | 后台管理 | 功能规格文档 |
157
+ | 通用 | 研究报告 |
158
+
159
+ 8. **完成研究并接入 start**
160
+
161
+ ```bash
162
+ openmatrix research --complete --results '<json>' --json
163
+ ```
164
+
165
+ 然后询问用户是否开始执行:
166
+ ```typescript
167
+ AskUserQuestion({
168
+ questions: [{
169
+ question: `研究完成!已生成「${domain}」领域文档。\n\n下一步?`,
170
+ header: "下一步",
171
+ options: [
172
+ { label: "开始执行 (推荐)", description: "自动接入 /om:start" },
173
+ { label: "查看报告", description: "先查看研究报告" },
174
+ { label: "继续研究", description: "深入某个方向" }
175
+ ],
176
+ multiSelect: false
177
+ }]
178
+ })
179
+ ```
180
+
181
+ </process>
182
+
183
+ <arguments>
184
+ $ARGUMENTS
185
+ </arguments>
186
+
187
+ <examples>
188
+ /om:research "做一个游戏"
189
+ /om:research "开发一个支付系统"
190
+ /om:research "构建一个电商网站"
191
+ </examples>
192
+
193
+ <notes>
194
+ ## 核心变化
195
+
196
+ **AI 分析领域,而非关键词匹配**
197
+
198
+ 旧方式: CLI 内置关键词列表,硬编码领域检测
199
+ 新方式: Agent 分析主题,动态识别领域和调研方向
200
+
201
+ ## 流程图
202
+
203
+ ```
204
+ ┌──────────────────────┐
205
+ │ /om:research "做游戏" │
206
+ └──────────┬───────────┘
207
+
208
+
209
+ ┌──────────────────────┐
210
+ │ CLI: 创建初始会话 │ status: "initialized"
211
+ └──────────┬───────────┘
212
+
213
+
214
+ ┌──────────────────────┐
215
+ │ Agent: 分析主题 │ 识别领域、方面、决策
216
+ └──────────┬───────────┘
217
+
218
+
219
+ ┌──────────────────────┐
220
+ │ 更新会话 → preview │
221
+ │ 展示给用户确认 │
222
+ └──────────┬───────────┘
223
+
224
+
225
+ ┌──────────────────────┐
226
+ │ 用户确认 → --confirm │
227
+ │ 并行 Agent 研究 │
228
+ └──────────┬───────────┘
229
+
230
+
231
+ ┌──────────────────────┐
232
+ │ 问卷 → 领域文档 │
233
+ │ → --complete │
234
+ └──────────┬───────────┘
235
+
236
+
237
+ ┌──────────────────────┐
238
+ │ 接入 /om:start │
239
+ └──────────────────────┘
240
+ ```
241
+
242
+ ## 与 brainstorm 的集成
243
+
244
+ brainstorm 检测到垂直领域时,返回 `suggestResearch`。
245
+ brainstorm skill 询问用户是否进入 research,确认后调用 `/om:research`。
246
+
247
+ ## 输出文件
248
+
249
+ ```
250
+ .openmatrix/research/
251
+ ├── session.json # 研究会话状态
252
+ ├── RESEARCH.md # 领域专属文档 (GDD/PRD/技术方案)
253
+ ├── knowledge/
254
+ │ ├── finding-1.md # 关键发现
255
+ │ └── finding-2.md
256
+ └── context.json # → start 的任务上下文
257
+ ```
258
+ </notes>