ccg-workflow 1.7.80 → 1.7.81

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.
package/README.md CHANGED
@@ -353,4 +353,4 @@ MIT
353
353
 
354
354
  ---
355
355
 
356
- v1.7.79 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
356
+ v1.7.81 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
package/README.zh-CN.md CHANGED
@@ -353,4 +353,4 @@ MIT
353
353
 
354
354
  ---
355
355
 
356
- v1.7.79 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [参与贡献](./CONTRIBUTING.md)
356
+ v1.7.81 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [参与贡献](./CONTRIBUTING.md)
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.DKLTZQCk.mjs';
4
+ import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.DLkUGirT.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:child_process';
7
7
  import 'node:util';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.DKLTZQCk.mjs';
1
+ export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.DLkUGirT.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:child_process';
@@ -10,7 +10,7 @@ import { parse, stringify } from 'smol-toml';
10
10
  import i18next from 'i18next';
11
11
  import ora from 'ora';
12
12
 
13
- const version = "1.7.80";
13
+ const version = "1.7.81";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.80",
3
+ "version": "1.7.81",
4
4
  "description": "Claude + Codex + Gemini multi-model collaboration system - smart routing development workflow",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -68,27 +68,34 @@ description: '智能 Git 提交:分析改动生成 Conventional Commit 信息
68
68
 
69
69
  **语言**:根据最近 50 次提交判断中文/英文
70
70
 
71
- ### 📦 阶段 5:Context 压缩(若 .context/ 存在)
71
+ ### 📦 阶段 5:Context 自动归档(若 .context/ 存在)
72
72
 
73
73
  `[模式:上下文归档]`
74
74
 
75
- 仅在项目存在 `.context/` 目录时执行,否则跳过。
75
+ **前置判断**:
76
+ - 若 `.context/` 目录不存在 → 在提交成功后输出提示:`💡 建议执行 /ccg:context init 启用决策追踪`,不阻断
77
+ - 若 `.context/` 存在 → 执行以下步骤
78
+
79
+ **从 git diff 自动生成 ContextEntry**:
76
80
 
77
81
  1. 获取当前分支名:`git branch --show-current`
78
- 2. 检查 `.context/current/branches/<branch>/session.log` 是否存在且非空
79
- 3. 若有内容:
80
- - **脱敏**:扫描 token/key/password/secret 模式 替换为 `[REDACTED]`
81
- - **压缩**:从 session.log 提取 decisions / bugs / alternatives,生成 ContextEntry JSON
82
- - **追加**:将 ContextEntry 作为一行追加到 `.context/history/commits.jsonl`
83
- - **重生成**:更新 `.context/history/commits.md` 人类视图
84
- - **暂存**:`git add .context/history/`
85
- - **清空**:清空 session.log(不删除文件)
86
- - **Trailer**:在 commit message 中添加 `Context-Id: <uuid>` trailer
87
- 4. session.log 为空或不存在,跳过此阶段
82
+ 2. 获取暂存区变更:`git diff --cached --stat` + `git diff --cached`(完整 diff)
83
+ 3. **分析 diff 生成 ContextEntry**:
84
+ - `summary`:从阶段 4 生成的 commit message 中取首行
85
+ - `decisions`:分析 diff 中的关键变更(新增依赖、架构调整、接口变更、配置修改),推断决策理由
86
+ - `bugs`:若 commit type `fix`,从 diff 中提取 bug 症状、根因、修复方式
87
+ - `changes.files`:从 `git diff --cached --name-only` 提取
88
+ - `tests`:若变更包含测试文件,记录测试相关信息
89
+ 4. **合并 session.log**(可选):若 `.context/current/branches/<branch>/session.log` 存在且非空,将其中的手动记录合并到 decisions/bugs 中,然后清空 session.log
90
+ 5. **脱敏**:扫描 token/key/password/secret 模式 替换为 `[REDACTED]`
91
+ 6. **追加**:将 ContextEntry 作为一行追加到 `.context/history/commits.jsonl`
92
+ 7. **重生成**:更新 `.context/history/commits.md` 人类视图
93
+ 8. **暂存**:`git add .context/history/`
94
+ 9. **Trailer**:在 commit message 中添加 `Context-Id: <uuid>` trailer
88
95
 
89
96
  **ContextEntry 格式**参见 `/ccg:context` 命令中的 Schema 定义。
90
97
 
91
- **失败降级**:若压缩过程出错,不阻断提交。写入 minimal ContextEntry(仅 summary + error),继续正常提交。
98
+ **失败降级**:若归档过程出错,不阻断提交。写入 minimal ContextEntry(仅 summary + files),继续正常提交。
92
99
 
93
100
  ### ✅ 阶段 6:执行提交
94
101
 
@@ -17,12 +17,14 @@ description: '项目上下文管理:初始化 .context 目录、记录决策
17
17
  | 子命令 | 说明 |
18
18
  |--------|------|
19
19
  | `init` | 初始化 `.context/` 目录结构 |
20
- | `log <message>` | 手动追加决策日志到 session.log |
20
+ | `log <message>` | (可选)手动追加备注到 session.log,commit 时会合并 |
21
21
  | `show` | 查看当前分支的 session.log |
22
- | `compress` | 压缩 session.log → uncommit.md |
22
+ | `compress` | 压缩 session.log → uncommit.md(手动预览用) |
23
23
  | `history` | 查看 history/commits.md |
24
24
  | `squash <ids...>` | 合并多条 history 记录(配合 git squash) |
25
25
 
26
+ > **核心用法**:`init` 一次,之后只管开发。`/ccg:commit` 提交时自动从 git diff 分析决策并归档到 history/。`log` 仅在你想手动补充备注时使用。
27
+
26
28
  ---
27
29
 
28
30
  ## 执行工作流