openmatrix 0.1.77 → 0.1.79

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.
@@ -225,9 +225,25 @@ class GitCommitManager {
225
225
  return { success: false, message: 'Auto-commit is disabled' };
226
226
  }
227
227
  try {
228
- // 检查是否在 Git 仓库中
228
+ // 检查是否在 Git 仓库中,如果不是则自动初始化
229
229
  if (!await this.isGitRepo()) {
230
- return { success: false, error: 'Not a git repository' };
230
+ await execAsync('git init', { cwd: this.repoPath });
231
+ // 确保 .gitignore 存在并包含 .openmatrix
232
+ const gitignorePath = path.join(this.repoPath, '.gitignore');
233
+ let gitignoreContent = '';
234
+ try {
235
+ gitignoreContent = await fs.readFile(gitignorePath, 'utf-8');
236
+ }
237
+ catch {
238
+ // 文件不存在
239
+ }
240
+ if (!gitignoreContent.includes('.openmatrix')) {
241
+ const addition = (gitignoreContent && !gitignoreContent.endsWith('\n') ? '\n' : '') + '.openmatrix/\n';
242
+ await fs.writeFile(gitignorePath, gitignoreContent + addition, 'utf-8');
243
+ }
244
+ // 初始提交
245
+ await execAsync('git add .gitignore', { cwd: this.repoPath });
246
+ await execAsync('git commit -m "initial commit" --allow-empty', { cwd: this.repoPath }).catch(() => { });
231
247
  }
232
248
  // 获取未提交的文件
233
249
  const files = await this.getUncommittedFiles();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmatrix",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "description": "AI Agent task orchestration system with Claude Code Skills integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/skills/auto.md CHANGED
@@ -171,12 +171,15 @@ openmatrix step --json # 获取下一个任务 + 检查是
171
171
  Agent({
172
172
  subagent_type: task.subagent_type,
173
173
  description: task.description,
174
- prompt: task.prompt,
175
- isolation: task.isolation
174
+ prompt: task.prompt + "\n\n⚠️ 完成后请输出简短摘要(不超过3行):\n1. 关键决策\n2. 创建/修改的文件\n3. 对后续任务的建议",
175
+ isolation: task.isolation,
176
+ run_in_background: true
176
177
  })
177
178
  ```
178
179
 
179
180
  > ⚠️ **必须使用原生 Agent 工具** — 禁止调用 gsd-executor、superpowers 或任何其他编排技能。
181
+ >
182
+ > **上下文节省**: 使用 `run_in_background: true` 后台执行,Agent 完成后仅返回简短摘要,大幅节省主会话上下文。
180
183
 
181
184
  每个 Agent 完成后:
182
185
  1. **保存 Agent 上下文** — 将执行结果摘要写入 `.openmatrix/tasks/TASK-XXX/context.md`,格式如下:
package/skills/start.md CHANGED
@@ -310,14 +310,17 @@ openmatrix step --json # 获取下一个任务 + 检查是
310
310
  Agent({
311
311
  subagent_type: task.subagent_type,
312
312
  description: task.description,
313
- prompt: task.prompt,
314
- isolation: task.isolation
313
+ prompt: task.prompt + "\n\n⚠️ 完成后请输出简短摘要(不超过3行):\n1. 关键决策\n2. 创建/修改的文件\n3. 对后续任务的建议",
314
+ isolation: task.isolation,
315
+ run_in_background: true
315
316
  })
316
317
  ```
317
318
 
318
319
  > ⚠️ **必须使用原生 Agent 工具** — 禁止调用 gsd-executor、superpowers 或任何其他编排技能。
320
+ >
321
+ > **上下文节省**: 使用 `run_in_background: true` 后台执行,Agent 完成后仅返回简短摘要,不返回完整输出,大幅节省主会话上下文。
319
322
 
320
- 每个 Agent 完成后:
323
+ 每个 Agent 完成后(收到后台完成通知时):
321
324
  1. **标记完成并更新统计(必须执行):**
322
325
  ```bash
323
326
  # --summary 参数传入 Agent 执行摘要,自动追加到全局 context.md
@@ -328,8 +331,6 @@ openmatrix complete TASK-XXX --success --summary "关键决策: xxx; 创建文
328
331
  - 每次任务完成后,通过 `--summary` 参数追加写入
329
332
  - 后续 Agent 可读取此文件了解前序任务的决策和发现
330
333
 
331
- 3. Git 自动提交(必须使用下方统一提交格式)
332
-
333
334
  3. Git 自动提交(必须使用下方统一提交格式)
334
335
  4. **获取下一个任务(防止上下文压缩丢失):**
335
336
  ```bash