openmatrix 0.1.25 → 0.1.27
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.
|
@@ -259,47 +259,47 @@ class SmartQuestionAnalyzer {
|
|
|
259
259
|
* 检测复杂度
|
|
260
260
|
*/
|
|
261
261
|
detectComplexity(desc, taskType, scope) {
|
|
262
|
-
//
|
|
263
|
-
const simpleKeywords = /(fix|bug
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const complexKeywords = /(系统|架构|模块|集成|完整|从零|重构|优化整体)/i;
|
|
262
|
+
// 简单任务关键词
|
|
263
|
+
const simpleKeywords = /(fix|bug|修复|改|调整|样式|变量名|文案|按钮|颜色|字体)/i;
|
|
264
|
+
// 复杂任务关键词 - 需要更精确
|
|
265
|
+
const complexKeywords = /(系统|架构|集成|完整|从零|优化整体|多模块|全栈)/i;
|
|
267
266
|
const multiScope = scope.areas.length >= 3;
|
|
268
|
-
// Bug
|
|
267
|
+
// Bug 修复
|
|
269
268
|
if (taskType.type === 'bugfix') {
|
|
270
|
-
if (simpleKeywords.test(desc) ||
|
|
269
|
+
if (simpleKeywords.test(desc) || desc.length < 50) {
|
|
271
270
|
return { level: 'simple', label: '简单', estimatedCommits: '预计 1 个 commit' };
|
|
272
271
|
}
|
|
273
272
|
return { level: 'medium', label: '中等', estimatedCommits: '预计 1-2 个 commit' };
|
|
274
273
|
}
|
|
275
|
-
//
|
|
274
|
+
// 文档、配置
|
|
276
275
|
if (taskType.type === 'docs' || taskType.type === 'config') {
|
|
277
276
|
return { level: 'simple', label: '简单', estimatedCommits: '预计 1 个 commit' };
|
|
278
277
|
}
|
|
279
|
-
//
|
|
278
|
+
// 测试
|
|
280
279
|
if (taskType.type === 'test') {
|
|
281
280
|
if (multiScope) {
|
|
282
281
|
return { level: 'medium', label: '中等', estimatedCommits: '预计 2-3 个 commit' };
|
|
283
282
|
}
|
|
284
283
|
return { level: 'simple', label: '简单', estimatedCommits: '预计 1 个 commit' };
|
|
285
284
|
}
|
|
286
|
-
//
|
|
285
|
+
// 复杂关键词检测
|
|
287
286
|
if (complexKeywords.test(desc) || multiScope) {
|
|
288
287
|
return { level: 'complex', label: '复杂', estimatedCommits: '预计 3+ 个 commit' };
|
|
289
288
|
}
|
|
290
|
-
// 新功能
|
|
289
|
+
// 新功能 - 默认 medium
|
|
291
290
|
if (taskType.type === 'feature') {
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
// 只有非常简单的单文件修改才判断为 simple
|
|
292
|
+
if (desc.length < 20 && scope.areas.length === 1 && /(按钮|链接|文案|颜色)/.test(desc)) {
|
|
293
|
+
return { level: 'simple', label: '简单', estimatedCommits: '预计 1 个 commit' };
|
|
294
294
|
}
|
|
295
295
|
if (desc.length > 100 || scope.areas.length >= 2) {
|
|
296
296
|
return { level: 'medium', label: '中等', estimatedCommits: '预计 2-3 个 commit' };
|
|
297
297
|
}
|
|
298
298
|
return { level: 'medium', label: '中等', estimatedCommits: '预计 2-3 个 commit' };
|
|
299
299
|
}
|
|
300
|
-
// 重构
|
|
300
|
+
// 重构 - 默认 medium
|
|
301
301
|
if (taskType.type === 'refactor') {
|
|
302
|
-
if (multiScope) {
|
|
302
|
+
if (multiScope || /(整体|全部|系统)/.test(desc)) {
|
|
303
303
|
return { level: 'complex', label: '复杂', estimatedCommits: '预计 3+ 个 commit' };
|
|
304
304
|
}
|
|
305
305
|
return { level: 'medium', label: '中等', estimatedCommits: '预计 2-3 个 commit' };
|
|
@@ -312,6 +312,10 @@ class SmartQuestionAnalyzer {
|
|
|
312
312
|
*/
|
|
313
313
|
generateSuggestions(taskType, complexity, desc) {
|
|
314
314
|
const suggestions = [];
|
|
315
|
+
// 复杂任务优先建议头脑风暴
|
|
316
|
+
if (complexity.level === 'complex') {
|
|
317
|
+
suggestions.push('建议先头脑风暴,明确需求');
|
|
318
|
+
}
|
|
315
319
|
// 根据任务类型建议
|
|
316
320
|
switch (taskType.type) {
|
|
317
321
|
case 'bugfix':
|
|
@@ -320,7 +324,6 @@ class SmartQuestionAnalyzer {
|
|
|
320
324
|
break;
|
|
321
325
|
case 'feature':
|
|
322
326
|
if (complexity.level === 'complex') {
|
|
323
|
-
suggestions.push('建议先头脑风暴,明确需求');
|
|
324
327
|
suggestions.push('使用 strict 模式保证质量');
|
|
325
328
|
}
|
|
326
329
|
else {
|
|
@@ -343,7 +346,13 @@ class SmartQuestionAnalyzer {
|
|
|
343
346
|
suggestions.push('使用 fast 模式');
|
|
344
347
|
break;
|
|
345
348
|
default:
|
|
346
|
-
|
|
349
|
+
if (complexity.level !== 'complex') {
|
|
350
|
+
suggestions.push('根据实际情况选择模式');
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
// 确保至少有一个建议
|
|
354
|
+
if (suggestions.length === 0) {
|
|
355
|
+
suggestions.push('建议先确认任务需求');
|
|
347
356
|
}
|
|
348
357
|
return suggestions;
|
|
349
358
|
}
|
package/package.json
CHANGED
package/skills/start.md
CHANGED
|
@@ -152,15 +152,38 @@ openmatrix plan --json
|
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
**选择执行模式:**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
选择执行模式:
|
|
158
|
+
|
|
159
|
+
🚀 全自动执行
|
|
160
|
+
遇到问题自动跳过并记录到 Meeting,最后统一处理
|
|
161
|
+
|
|
162
|
+
⏸️ 关键节点确认
|
|
163
|
+
在 plan/merge 时暂停确认,平衡速度和控制
|
|
164
|
+
|
|
165
|
+
📋 每步确认
|
|
166
|
+
每个任务完成后暂停,适合重要任务
|
|
167
|
+
```
|
|
168
|
+
|
|
155
169
|
```typescript
|
|
156
170
|
AskUserQuestion({
|
|
157
171
|
questions: [{
|
|
158
172
|
question: "选择执行模式:",
|
|
159
173
|
header: "模式",
|
|
160
174
|
options: [
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
175
|
+
{
|
|
176
|
+
label: "🚀 全自动执行",
|
|
177
|
+
description: "遇到问题自动跳过并记录到 Meeting,最后统一处理"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
label: "⏸️ 关键节点确认",
|
|
181
|
+
description: "在 plan/merge 时暂停确认,平衡速度和控制"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
label: "📋 每步确认",
|
|
185
|
+
description: "每个任务完成后暂停,适合重要任务"
|
|
186
|
+
}
|
|
164
187
|
],
|
|
165
188
|
multiSelect: false
|
|
166
189
|
}]
|
|
@@ -297,11 +320,11 @@ $ARGUMENTS
|
|
|
297
320
|
|
|
298
321
|
## 执行模式对比
|
|
299
322
|
|
|
300
|
-
| 模式 | 审批点 | 风险操作确认 | 适用场景 |
|
|
301
|
-
|
|
302
|
-
|
|
|
303
|
-
| 关键节点确认 | plan/merge 暂停 | ✅ 需要 | 常规任务 |
|
|
304
|
-
| 每步确认 | 每任务暂停 | ✅ 需要 | 重要任务 |
|
|
323
|
+
| 模式 | 审批点 | 问题处理 | 风险操作确认 | 适用场景 |
|
|
324
|
+
|------|--------|---------|-------------|---------|
|
|
325
|
+
| 全自动执行 | 自动批准 | 自动跳过,记录到 Meeting | ✅ 需要 | 简单任务、信任 AI |
|
|
326
|
+
| 关键节点确认 | plan/merge 暂停 | 记录到 Meeting | ✅ 需要 | 常规任务 |
|
|
327
|
+
| 每步确认 | 每任务暂停 | 即时处理 | ✅ 需要 | 重要任务 |
|
|
305
328
|
|
|
306
329
|
## Git 提交格式
|
|
307
330
|
|