openmatrix 0.1.27 → 0.1.29
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.
|
@@ -7,7 +7,8 @@ const smart_question_analyzer_js_1 = require("../../orchestrator/smart-question-
|
|
|
7
7
|
exports.analyzeCommand = new commander_1.Command('analyze')
|
|
8
8
|
.description('智能分析任务,推断配置,返回需要确认的问题列表')
|
|
9
9
|
.argument('[task]', '任务描述')
|
|
10
|
-
.option('--json', '输出 JSON
|
|
10
|
+
.option('--json', '输出 JSON 格式(供程序解析)')
|
|
11
|
+
.option('--markdown', '输出 Markdown 格式(默认)')
|
|
11
12
|
.action(async (task, options) => {
|
|
12
13
|
const analyzer = new smart_question_analyzer_js_1.SmartQuestionAnalyzer(process.cwd());
|
|
13
14
|
if (!task) {
|
|
@@ -31,8 +32,8 @@ exports.analyzeCommand = new commander_1.Command('analyze')
|
|
|
31
32
|
console.log(JSON.stringify(output, null, 2));
|
|
32
33
|
}
|
|
33
34
|
else {
|
|
34
|
-
//
|
|
35
|
-
console.log('\n' + analyzer.
|
|
35
|
+
// 默认输出 Markdown 格式
|
|
36
|
+
console.log('\n' + analyzer.generateMarkdown(result));
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
catch (error) {
|
|
@@ -615,5 +615,48 @@ class SmartQuestionAnalyzer {
|
|
|
615
615
|
}
|
|
616
616
|
return lines.join('\n');
|
|
617
617
|
}
|
|
618
|
+
/**
|
|
619
|
+
* 生成 Markdown 格式输出
|
|
620
|
+
*/
|
|
621
|
+
generateMarkdown(result) {
|
|
622
|
+
const lines = [];
|
|
623
|
+
lines.push('## 🔍 我理解的任务\n');
|
|
624
|
+
lines.push(`| 属性 | 值 |`);
|
|
625
|
+
lines.push(`|------|-----|`);
|
|
626
|
+
lines.push(`| 📋 类型 | ${result.understanding.taskTypeLabel} |`);
|
|
627
|
+
lines.push(`| 📁 范围 | ${result.understanding.scopeLabel} |`);
|
|
628
|
+
lines.push(`| ⚡ 复杂度 | ${result.understanding.complexityLabel} |`);
|
|
629
|
+
lines.push(`| ⏱️ 预计 | ${result.understanding.estimatedCommits} |`);
|
|
630
|
+
// 建议
|
|
631
|
+
if (result.understanding.suggestions.length > 0) {
|
|
632
|
+
lines.push('\n## 💡 建议执行方式\n');
|
|
633
|
+
for (const suggestion of result.understanding.suggestions) {
|
|
634
|
+
lines.push(`- ${suggestion}`);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
// 推断的配置
|
|
638
|
+
lines.push('\n## 📊 推荐配置\n');
|
|
639
|
+
lines.push(`| 配置项 | 推荐值 | 置信度 |`);
|
|
640
|
+
lines.push(`|--------|--------|--------|`);
|
|
641
|
+
for (const inference of result.inferences) {
|
|
642
|
+
const answer = Array.isArray(inference.inferredAnswer)
|
|
643
|
+
? inference.inferredAnswer.join(', ')
|
|
644
|
+
: inference.inferredAnswer || '待确认';
|
|
645
|
+
const confidenceIcon = inference.confidence === 'high' ? '✅' :
|
|
646
|
+
inference.confidence === 'medium' ? '🤔' : '❓';
|
|
647
|
+
lines.push(`| ${inference.questionId} | ${answer} | ${confidenceIcon} |`);
|
|
648
|
+
}
|
|
649
|
+
// 需要确认的问题
|
|
650
|
+
if (result.questionsToAsk.length > 0) {
|
|
651
|
+
lines.push('\n## ❓ 需要确认\n');
|
|
652
|
+
for (const q of result.questionsToAsk) {
|
|
653
|
+
lines.push(`- ${q}`);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
lines.push('\n✅ **所有配置已推断,可直接执行**');
|
|
658
|
+
}
|
|
659
|
+
return lines.join('\n');
|
|
660
|
+
}
|
|
618
661
|
}
|
|
619
662
|
exports.SmartQuestionAnalyzer = SmartQuestionAnalyzer;
|
package/package.json
CHANGED
package/skills/brainstorm.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: om:brainstorm
|
|
3
3
|
description: 头脑风暴 - 探索需求和设计后再执行任务
|
|
4
|
+
priority: high
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
<NO-OTHER-SKILLS>
|
|
7
|
-
|
|
8
|
+
执行此技能时,不得调用其他任务编排相关的技能,包括 superpowers:brainstorming。
|
|
9
|
+
OpenMatrix 独立运行,使用自己的头脑风暴流程。
|
|
8
10
|
</NO-OTHER-SKILLS>
|
|
9
11
|
|
|
10
12
|
<objective>
|
package/skills/openmatrix.md
CHANGED
|
@@ -27,11 +27,13 @@ Everything else → analyze and execute.
|
|
|
27
27
|
<process>
|
|
28
28
|
1. **分析任务并展示理解**
|
|
29
29
|
|
|
30
|
-
调用 CLI
|
|
30
|
+
调用 CLI 分析任务(传入任务描述):
|
|
31
31
|
```bash
|
|
32
|
-
openmatrix analyze --
|
|
32
|
+
openmatrix analyze "$ARGUMENTS" --markdown
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
如果 `$ARGUMENTS` 为空,先询问用户任务内容。
|
|
36
|
+
|
|
35
37
|
**展示 AI 的理解和推荐:**
|
|
36
38
|
```
|
|
37
39
|
🔍 我理解的任务:
|
|
@@ -76,7 +78,8 @@ Everything else → analyze and execute.
|
|
|
76
78
|
- 调用 `/om:start`,进入配置流程
|
|
77
79
|
|
|
78
80
|
**选择"先头脑风暴"**:
|
|
79
|
-
-
|
|
81
|
+
- 使用 Skill 工具调用 `om:brainstorm` skill(不要调用 superpowers:brainstorming)
|
|
82
|
+
- 调用方式: Skill({ skill: "om:brainstorm", args: "$ARGUMENTS" })
|
|
80
83
|
</process>
|
|
81
84
|
|
|
82
85
|
<trigger-conditions>
|
package/skills/start.md
CHANGED
|
@@ -49,11 +49,13 @@ description: 启动新的任务执行周期
|
|
|
49
49
|
|
|
50
50
|
## Step 1: 展示理解 + 推荐
|
|
51
51
|
|
|
52
|
-
**调用 CLI
|
|
52
|
+
**调用 CLI 分析任务(传入任务描述):**
|
|
53
53
|
```bash
|
|
54
|
-
openmatrix analyze --
|
|
54
|
+
openmatrix analyze "$ARGUMENTS" --markdown
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
如果 `$ARGUMENTS` 为空,先询问用户任务内容。
|
|
58
|
+
|
|
57
59
|
**展示 AI 的理解和推荐:**
|
|
58
60
|
```
|
|
59
61
|
🔍 我理解的任务:
|