openmatrix 0.1.95 → 0.1.97
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.
|
@@ -342,33 +342,23 @@ class GitCommitManager {
|
|
|
342
342
|
const commitMessage = this.generateCommitMessage(fullInfo, filesWithStatus);
|
|
343
343
|
// 暂存所有文件(.gitignore 已更新,.openmatrix/ 等目录会被排除)
|
|
344
344
|
await execAsync('git add .', { cwd: this.repoPath });
|
|
345
|
-
//
|
|
346
|
-
//
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
'.gradle/',
|
|
363
|
-
'vendor/',
|
|
364
|
-
'.env',
|
|
365
|
-
'.env.local',
|
|
366
|
-
'.env.*.local',
|
|
367
|
-
'*.tsbuildinfo',
|
|
368
|
-
'*.pyc',
|
|
369
|
-
];
|
|
370
|
-
for (const pattern of unstagePatterns) {
|
|
371
|
-
await execAsync(`git reset HEAD -- "${pattern}"`, { cwd: this.repoPath }).catch(() => { });
|
|
345
|
+
// 动态检查:用 git check-ignore 逐个检查暂存文件,移除应被忽略的
|
|
346
|
+
// 这样无论 .gitignore 怎么更新,都不会误提交构建产物、依赖目录等
|
|
347
|
+
const { stdout: stagedFiles } = await execAsync('git diff --cached --name-only', { cwd: this.repoPath });
|
|
348
|
+
const filesToUnstage = [];
|
|
349
|
+
for (const file of stagedFiles.split('\n').filter(Boolean)) {
|
|
350
|
+
try {
|
|
351
|
+
await execAsync(`git check-ignore -q "${file}"`, { cwd: this.repoPath });
|
|
352
|
+
// check-ignore 返回 0 → 文件应该被忽略
|
|
353
|
+
filesToUnstage.push(file);
|
|
354
|
+
}
|
|
355
|
+
catch {
|
|
356
|
+
// check-ignore 返回 1 → 文件不应被忽略,保留暂存
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (filesToUnstage.length > 0) {
|
|
360
|
+
const unstageCmd = filesToUnstage.map(f => `"${f}"`).join(' ');
|
|
361
|
+
await execAsync(`git reset HEAD -- ${unstageCmd}`, { cwd: this.repoPath }).catch(() => { });
|
|
372
362
|
}
|
|
373
363
|
// 检查是否有文件被暂存(避免空提交)
|
|
374
364
|
const { stdout: staged } = await execAsync('git diff --cached --name-only', { cwd: this.repoPath });
|
package/package.json
CHANGED
package/skills/start.md
CHANGED
|
@@ -137,13 +137,19 @@ git init
|
|
|
137
137
|
| 任务类型 | 需要询问的问题 |
|
|
138
138
|
|---------|---------------|
|
|
139
139
|
| **开发任务**(新功能、Bug修复、重构) | 4.1 质量等级 + 4.2 E2E + 4.3 执行模式 |
|
|
140
|
+
| **测试任务**(纯测试、写测试用例) | 仅 4.3 执行模式 |
|
|
140
141
|
| **非开发任务**(文档、配置、纯阅读) | 仅 4.3 执行模式 |
|
|
141
142
|
|
|
143
|
+
**判断依据:** 查看 Step 6 生成的 `tasks-input.json` 中的 `goalTypes` 字段:
|
|
144
|
+
- `development` → 开发任务 → 问 4.1 + 4.2 + 4.3
|
|
145
|
+
- `testing` → 测试任务 → 仅问 4.3
|
|
146
|
+
- `documentation` / `other` → 非开发任务 → 仅问 4.3
|
|
147
|
+
|
|
142
148
|
**⚠️ 以下问题不可跳过,不可使用默认值:**
|
|
143
149
|
|
|
144
|
-
#### 4.1
|
|
150
|
+
#### 4.1 质量等级(仅开发任务,测试/文档任务跳过)
|
|
145
151
|
|
|
146
|
-
|
|
152
|
+
如果是代码开发任务(`goalTypes` 包含 `development`),必须询问:
|
|
147
153
|
|
|
148
154
|
```typescript
|
|
149
155
|
AskUserQuestion({
|
|
@@ -162,7 +168,7 @@ AskUserQuestion({
|
|
|
162
168
|
})
|
|
163
169
|
```
|
|
164
170
|
|
|
165
|
-
#### 4.2 E2E
|
|
171
|
+
#### 4.2 E2E 测试(仅开发任务且选 strict/balanced 时)
|
|
166
172
|
|
|
167
173
|
如果开发任务且用户选择了 `strict` 或 `balanced`,继续询问:
|
|
168
174
|
|