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 +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccg-workflow.DKLTZQCk.mjs → ccg-workflow.DLkUGirT.mjs} +1 -1
- package/package.json +1 -1
- package/templates/commands/commit.md +20 -13
- package/templates/commands/context.md +4 -2
package/README.md
CHANGED
package/README.zh-CN.md
CHANGED
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.
|
|
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.
|
|
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';
|
package/package.json
CHANGED
|
@@ -68,27 +68,34 @@ description: '智能 Git 提交:分析改动生成 Conventional Commit 信息
|
|
|
68
68
|
|
|
69
69
|
**语言**:根据最近 50 次提交判断中文/英文
|
|
70
70
|
|
|
71
|
-
### 📦 阶段 5:Context
|
|
71
|
+
### 📦 阶段 5:Context 自动归档(若 .context/ 存在)
|
|
72
72
|
|
|
73
73
|
`[模式:上下文归档]`
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
**前置判断**:
|
|
76
|
+
- 若 `.context/` 目录不存在 → 在提交成功后输出提示:`💡 建议执行 /ccg:context init 启用决策追踪`,不阻断
|
|
77
|
+
- 若 `.context/` 存在 → 执行以下步骤
|
|
78
|
+
|
|
79
|
+
**从 git diff 自动生成 ContextEntry**:
|
|
76
80
|
|
|
77
81
|
1. 获取当前分支名:`git branch --show-current`
|
|
78
|
-
2.
|
|
79
|
-
3.
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
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>` |
|
|
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
|
## 执行工作流
|