openmatrix 0.1.21 → 0.1.23
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.
|
@@ -54,6 +54,18 @@ export declare class GitCommitManager {
|
|
|
54
54
|
analyzeImpactScope(files: string[]): Promise<string[]>;
|
|
55
55
|
/**
|
|
56
56
|
* 生成提交信息
|
|
57
|
+
*
|
|
58
|
+
* 格式规范:
|
|
59
|
+
* <type>: (TASK-XXX) 简短描述
|
|
60
|
+
*
|
|
61
|
+
* - 改动点1
|
|
62
|
+
* - 改动点2
|
|
63
|
+
*
|
|
64
|
+
* 影响范围: 模块/功能
|
|
65
|
+
* 文件改动: 文件1, 文件2
|
|
66
|
+
*
|
|
67
|
+
* Run: run-xxx (可选)
|
|
68
|
+
* Co-Authored-By: OpenMatrix <https://github.com/bigfish1913/openmatrix>
|
|
57
69
|
*/
|
|
58
70
|
generateCommitMessage(info: CommitInfo): string;
|
|
59
71
|
/**
|
|
@@ -118,24 +118,39 @@ class GitCommitManager {
|
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
120
|
* 生成提交信息
|
|
121
|
+
*
|
|
122
|
+
* 格式规范:
|
|
123
|
+
* <type>: (TASK-XXX) 简短描述
|
|
124
|
+
*
|
|
125
|
+
* - 改动点1
|
|
126
|
+
* - 改动点2
|
|
127
|
+
*
|
|
128
|
+
* 影响范围: 模块/功能
|
|
129
|
+
* 文件改动: 文件1, 文件2
|
|
130
|
+
*
|
|
131
|
+
* Run: run-xxx (可选)
|
|
132
|
+
* Co-Authored-By: OpenMatrix <https://github.com/bigfish1913/openmatrix>
|
|
121
133
|
*/
|
|
122
134
|
generateCommitMessage(info) {
|
|
123
135
|
const lines = [];
|
|
124
|
-
//
|
|
125
|
-
const
|
|
126
|
-
tdd: '
|
|
127
|
-
develop: '
|
|
128
|
-
verify: '
|
|
129
|
-
accept: '
|
|
136
|
+
// 类型映射:根据 phase 确定提交类型
|
|
137
|
+
const phaseToType = {
|
|
138
|
+
tdd: 'test',
|
|
139
|
+
develop: 'feat',
|
|
140
|
+
verify: 'test',
|
|
141
|
+
accept: 'feat'
|
|
130
142
|
};
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
143
|
+
const commitType = phaseToType[info.phase] || 'feat';
|
|
144
|
+
// 标题行 - 限制 50 字符
|
|
145
|
+
let title = info.taskTitle;
|
|
146
|
+
if (title.length > 50) {
|
|
147
|
+
title = title.slice(0, 47) + '...';
|
|
148
|
+
}
|
|
149
|
+
// 格式: feat: (TASK-001) 简短描述
|
|
150
|
+
lines.push(`${commitType}: (${info.taskId}) ${title}`);
|
|
135
151
|
lines.push('');
|
|
136
|
-
// 修改内容
|
|
152
|
+
// 修改内容 - 使用文件名作为改动点
|
|
137
153
|
if (info.changes.length > 0) {
|
|
138
|
-
lines.push('## 修改内容');
|
|
139
154
|
for (const change of info.changes.slice(0, 10)) {
|
|
140
155
|
lines.push(`- ${change}`);
|
|
141
156
|
}
|
|
@@ -146,16 +161,25 @@ class GitCommitManager {
|
|
|
146
161
|
}
|
|
147
162
|
// 影响范围
|
|
148
163
|
if (info.impactScope.length > 0) {
|
|
149
|
-
lines.push(
|
|
150
|
-
|
|
151
|
-
|
|
164
|
+
lines.push(`影响范围: ${info.impactScope.join('、')}`);
|
|
165
|
+
}
|
|
166
|
+
// 文件改动 - 简化显示
|
|
167
|
+
const changedFiles = info.changes.slice(0, 5).map(f => {
|
|
168
|
+
const parts = f.split('/');
|
|
169
|
+
return parts.length > 2 ? parts.slice(-2).join('/') : f;
|
|
170
|
+
});
|
|
171
|
+
if (changedFiles.length > 0) {
|
|
172
|
+
const fileSummary = changedFiles.join(', ');
|
|
173
|
+
const suffix = info.changes.length > 5 ? ` 等 ${info.changes.length} 个文件` : '';
|
|
174
|
+
lines.push(`文件改动: ${fileSummary}${suffix}`);
|
|
175
|
+
}
|
|
176
|
+
lines.push('');
|
|
177
|
+
// Run ID (可选)
|
|
178
|
+
if (info.runId) {
|
|
179
|
+
lines.push(`Run: ${info.runId}`);
|
|
152
180
|
}
|
|
153
|
-
//
|
|
154
|
-
lines.push(
|
|
155
|
-
lines.push(`Task-ID: ${info.taskId}`);
|
|
156
|
-
lines.push(`Run-ID: ${info.runId}`);
|
|
157
|
-
lines.push(`Phase: ${info.phase}`);
|
|
158
|
-
lines.push(`Co-Authored-By: OpenMatrix Agent <agent@openmatrix.dev>`);
|
|
181
|
+
// Co-Author
|
|
182
|
+
lines.push(`Co-Authored-By: OpenMatrix <https://github.com/bigfish1913/openmatrix>`);
|
|
159
183
|
return lines.join('\n');
|
|
160
184
|
}
|
|
161
185
|
/**
|
package/package.json
CHANGED
package/skills/openmatrix.md
CHANGED
|
@@ -24,6 +24,37 @@ Everything else → smart selection between `/om:brainstorm` and `/om:start`.
|
|
|
24
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
25
|
</objective>
|
|
26
26
|
|
|
27
|
+
<process>
|
|
28
|
+
1. **检测用户输入**
|
|
29
|
+
- 用户直接发送任务描述(不带命令前缀)
|
|
30
|
+
- 分析是否为开发任务(写代码/改代码/做东西)
|
|
31
|
+
|
|
32
|
+
2. **判断任务复杂度**
|
|
33
|
+
|
|
34
|
+
**复杂任务** (满足任一条件):
|
|
35
|
+
- 新功能开发: "实现用户登录" / "添加支付功能"
|
|
36
|
+
- 多模块改动: "重构用户系统" / "优化整体性能"
|
|
37
|
+
- 架构相关: "搭建框架" / "从零开始"
|
|
38
|
+
- 关键词: "系统" / "架构" / "模块" / "集成" / "完整"
|
|
39
|
+
|
|
40
|
+
**简单任务** (满足任一条件):
|
|
41
|
+
- Bug 修复: "修复登录bug" / "解决样式问题"
|
|
42
|
+
- 小改动: "修改文案" / "改变量名"
|
|
43
|
+
- 单一功能: "添加一个按钮" / "写个工具函数"
|
|
44
|
+
- 关键词: "修复" / "解决" / "改" / "调整" / "简单"
|
|
45
|
+
|
|
46
|
+
3. **智能选择执行路径**
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
复杂任务 → 调用 /om:brainstorm
|
|
50
|
+
简单任务 → 调用 /om:start
|
|
51
|
+
不确定 → 默认 /om:brainstorm (宁可多问)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. **执行选择的命令**
|
|
55
|
+
- 调用 Skill 工具执行对应的 skill
|
|
56
|
+
</process>
|
|
57
|
+
|
|
27
58
|
<trigger-conditions>
|
|
28
59
|
## AUTO-INVOKE RULES (Mandatory)
|
|
29
60
|
|