@hunyed15/codecgc 0.1.6 → 0.1.8
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/.claude/hooks/route-edit.ps1 +58 -57
- package/INSTALLATION.md +117 -484
- package/README.md +118 -150
- package/bin/cgc-external-status.js +4 -0
- package/bin/cgc-start.js +4 -0
- package/bin/codecgc.js +141 -20
- package/codecgc/compound/codecgc-capability-matrix.md +37 -0
- package/codecgc/reference/README.md +69 -0
- package/codecgc/reference/maintainer-guide.md +93 -0
- package/codecgc/reference/mcp-tool-surface.md +112 -0
- package/codecgc/reference/onboarding.md +69 -0
- package/codecgc/reference/operation-guide.md +29 -23
- package/codecgc/reference/path-contract.md +53 -0
- package/codecgc/reference/policy-routing.md +57 -0
- package/codecgc/reference/project-structure.md +80 -0
- package/codecgc/reference/quickstart.md +108 -0
- package/codecgc/reference/real-workflow-loop.md +123 -0
- package/codecgc/reference/recovery-loop.md +109 -0
- package/codecgc/reference/release-maintenance-playbook.md +4 -1
- package/codecgc/reference/troubleshooting.md +112 -0
- package/codecgc/roadmap/codecgc-release-maintenance/delivery-plan.md +49 -0
- package/codecgc/roadmap/codecgc-release-maintenance/overview.md +41 -0
- package/codecgc/roadmap/codecgc-release-maintenance/phases.md +84 -0
- package/codecgcmcp/README.md +57 -11
- package/codecgcmcp/src/codecgcmcp/server.py +164 -26
- package/codexmcp/src/codexmcp/server.py +32 -26
- package/geminimcp/src/geminimcp/server.py +22 -14
- package/model-routing.yaml +31 -6
- package/package.json +11 -4
- package/scripts/audit_codecgc_external_capabilities.py +83 -4
- package/scripts/audit_codecgc_historical_audits.py +42 -2
- package/scripts/audit_codecgc_package_runtime.py +73 -4
- package/scripts/audit_codecgc_release_readiness.py +55 -3
- package/scripts/audit_codecgc_workflow_history.py +8 -5
- package/scripts/build_codecgc_task.py +62 -45
- package/scripts/codecgc_artifact_roots.py +8 -40
- package/scripts/codecgc_console_io.py +3 -45
- package/scripts/codecgc_executor_registry.py +4 -54
- package/scripts/codecgc_path_contract.py +7 -0
- package/scripts/codecgc_policy.py +275 -0
- package/scripts/codecgc_routing_paths.py +3 -16
- package/scripts/codecgc_routing_template.py +11 -135
- package/scripts/codecgc_runtime/__init__.py +1 -0
- package/scripts/codecgc_runtime/artifacts.py +42 -0
- package/scripts/codecgc_runtime/console.py +45 -0
- package/scripts/codecgc_runtime/executor_registry.py +55 -0
- package/scripts/codecgc_runtime/mcp_config.py +72 -0
- package/scripts/codecgc_runtime/path_contract.py +123 -0
- package/scripts/codecgc_runtime/paths.py +22 -0
- package/scripts/codecgc_runtime/routing_paths.py +16 -0
- package/scripts/codecgc_runtime/routing_template.py +169 -0
- package/scripts/codecgc_runtime/workflow_runtime.py +72 -0
- package/scripts/codecgc_runtime_paths.py +3 -22
- package/scripts/codecgc_step_control.py +3 -2
- package/scripts/codecgc_workflow_runtime.py +3 -71
- package/scripts/entry_codecgc_workflow.py +4 -0
- package/scripts/install_codecgc.py +490 -21
- package/scripts/normalize_codecgc_audits.py +5 -3
- package/scripts/postinstall_codecgc.js +6 -56
- package/scripts/review_codecgc_workflow.py +6 -3
- package/scripts/route_codecgc_workflow.py +67 -36
- package/scripts/run_codecgc_build.py +28 -0
- package/scripts/run_codecgc_fix.py +28 -0
- package/scripts/run_codecgc_task.py +5 -2
- package/scripts/run_codecgc_test.py +28 -0
- package/scripts/sync_codecgc_mcp_config.py +4 -54
- package/scripts/write_codecgc_review.py +7 -3
package/INSTALLATION.md
CHANGED
|
@@ -1,573 +1,206 @@
|
|
|
1
|
-
# CodeCGC
|
|
1
|
+
# CodeCGC 安装指南
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本文说明如何从 npm 安装 CodeCGC,并把它接入到具体项目中。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
2. [安装 CodeCGC](#安装-codecgc)
|
|
7
|
-
3. [安装 Python 依赖](#安装-python-依赖)
|
|
8
|
-
4. [安装 MCP 服务器](#安装-mcp-服务器)
|
|
9
|
-
5. [初始化项目](#初始化项目)
|
|
10
|
-
6. [验证安装](#验证安装)
|
|
11
|
-
7. [快速开始](#快速开始)
|
|
12
|
-
8. [常见问题](#常见问题)
|
|
5
|
+
## 环境要求
|
|
13
6
|
|
|
14
|
-
|
|
7
|
+
- Node.js >= 20
|
|
8
|
+
- npm >= 9
|
|
9
|
+
- Python >= 3.10
|
|
10
|
+
- 可选:Claude Code、Codex CLI、Gemini CLI
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
CodeCGC 的 npm 包提供 `cgc*` 命令;Python 运行时负责 MCP 编排器、执行器桥接、路由策略检查和工作流脚本。
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **Node.js**: >= 20.0.0
|
|
21
|
-
- **Python**: >= 3.10
|
|
22
|
-
- **npm**: >= 9.0.0 (随 Node.js 安装)
|
|
23
|
-
- **操作系统**: Windows 10+, macOS 10.15+, Linux (Ubuntu 20.04+)
|
|
24
|
-
|
|
25
|
-
### 检查当前环境
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
node --version # 应显示 v20.x.x 或更高
|
|
29
|
-
python --version # 应显示 Python 3.10.x 或更高
|
|
30
|
-
npm --version # 应显示 9.x.x 或更高
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 安装 CodeCGC
|
|
36
|
-
|
|
37
|
-
### 方式 1:从 npm 全局安装(推荐)
|
|
14
|
+
## 1. 全局安装 CLI
|
|
38
15
|
|
|
39
16
|
```bash
|
|
40
|
-
# 使用 npm 官方源安装
|
|
41
17
|
npm install -g @hunyed15/codecgc --registry=https://registry.npmjs.org/
|
|
42
18
|
```
|
|
43
19
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
cgc-install --mode user
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
这会写入:
|
|
51
|
-
|
|
52
|
-
- `~/.claude/mcp.json`
|
|
53
|
-
- `~/.claude/hooks/route-edit.ps1`
|
|
54
|
-
- `~/.claude/commands/cgc.md`
|
|
55
|
-
- `~/.claude/commands/cgc-install.md`
|
|
56
|
-
- `~/.claude/commands/cgc-status.md`
|
|
57
|
-
- `~/.claude/commands/cgc-doctor.md`
|
|
58
|
-
|
|
59
|
-
写入完成后,可以在 Claude 中直接输入:
|
|
60
|
-
|
|
61
|
-
```text
|
|
62
|
-
/cgc
|
|
63
|
-
/cgc-install
|
|
64
|
-
/cgc-status
|
|
65
|
-
/cgc-doctor
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
如果安装阶段因为 Python 未就绪而跳过了这一步,可以在装好 Python 后手动补执行该命令。
|
|
69
|
-
|
|
70
|
-
安装后,以下命令将全局可用:
|
|
71
|
-
- `cgc`
|
|
72
|
-
- `cgc-install`
|
|
73
|
-
- `cgc-status`
|
|
74
|
-
- `cgc-doctor`
|
|
75
|
-
- `cgc-plan`
|
|
76
|
-
- `cgc-build`
|
|
77
|
-
- `cgc-fix`
|
|
78
|
-
- `cgc-test`
|
|
79
|
-
- `cgc-review`
|
|
80
|
-
- `cgc-route`
|
|
81
|
-
- 等等...
|
|
82
|
-
|
|
83
|
-
### 方式 2:从源码本地安装
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# 1. 进入您的项目目录
|
|
87
|
-
cd your-project
|
|
20
|
+
全局安装只注册命令,不会默认写入 `~/.claude`。这是当前主线设计:每个业务项目通过项目级安装生成自己的 `.mcp.json`、`.claude/` 和 `model-routing.yaml`。
|
|
88
21
|
|
|
89
|
-
|
|
90
|
-
npm install /path/to/codecgc/release
|
|
91
|
-
```
|
|
22
|
+
验证命令:
|
|
92
23
|
|
|
93
|
-
使用时需要通过 `npx` 调用:
|
|
94
24
|
```bash
|
|
95
|
-
npx cgc --help
|
|
96
|
-
npx cgc-install
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### 方式 3:直接使用(无需安装)
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
# 进入 release 目录
|
|
103
|
-
cd /path/to/codecgc/release
|
|
104
|
-
|
|
105
|
-
# 直接运行命令
|
|
106
|
-
node bin/cgc.js --help
|
|
107
|
-
node bin/cgc-install.js
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 验证安装
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
cgc --version
|
|
114
25
|
cgc --help
|
|
26
|
+
cgc-install --help
|
|
27
|
+
cgc-doctor --help
|
|
115
28
|
```
|
|
116
29
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 安装 Python 依赖
|
|
30
|
+
## 2. 在目标项目执行项目级安装
|
|
122
31
|
|
|
123
|
-
CodeCGC
|
|
124
|
-
|
|
125
|
-
### 核心依赖
|
|
32
|
+
进入你要使用 CodeCGC 的项目根目录:
|
|
126
33
|
|
|
127
34
|
```bash
|
|
128
|
-
|
|
35
|
+
cd your-project
|
|
36
|
+
cgc-install
|
|
129
37
|
```
|
|
130
38
|
|
|
131
|
-
|
|
39
|
+
默认安装模式是项目级安装,等价于:
|
|
132
40
|
|
|
133
41
|
```bash
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
`requirements-dev.txt` 内容:
|
|
42
|
+
cgc-install --mode local --workspace .
|
|
138
43
|
```
|
|
139
|
-
pytest>=8.0.0
|
|
140
|
-
pytest-cov>=4.1.0
|
|
141
|
-
pyyaml>=6.0
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### 一键安装所有依赖
|
|
145
|
-
|
|
146
|
-
在 CodeCGC 项目根目录执行:
|
|
147
44
|
|
|
148
|
-
|
|
149
|
-
pip install -r requirements.txt
|
|
150
|
-
```
|
|
45
|
+
安装会创建或同步:
|
|
151
46
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
47
|
+
```text
|
|
48
|
+
.mcp.json
|
|
49
|
+
model-routing.yaml
|
|
50
|
+
.claude/
|
|
51
|
+
settings.json
|
|
52
|
+
hooks/
|
|
53
|
+
route-edit.ps1
|
|
54
|
+
commands/
|
|
55
|
+
cgc*.md
|
|
56
|
+
codecgc/
|
|
57
|
+
START_HERE.md
|
|
58
|
+
features/
|
|
59
|
+
issues/
|
|
60
|
+
execution/
|
|
61
|
+
requirements/
|
|
62
|
+
architecture/
|
|
63
|
+
roadmap/
|
|
64
|
+
compound/
|
|
65
|
+
docs/
|
|
66
|
+
reference/
|
|
67
|
+
fixtures/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
这些文件属于目标项目的 CodeCGC 集成面。不同电脑、不同项目的安装路径可能不同,因此应由 `cgc-install` 在本机生成,不应从 CodeCGC 源码仓库复制固定路径。
|
|
71
|
+
|
|
72
|
+
## 3. 首次启动和自检
|
|
73
|
+
|
|
74
|
+
安装后执行:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cgc-start
|
|
78
|
+
cgc-status
|
|
79
|
+
cgc-doctor
|
|
167
80
|
```
|
|
168
81
|
|
|
169
|
-
|
|
82
|
+
在 Claude 中也可以使用:
|
|
170
83
|
|
|
171
|
-
```
|
|
172
|
-
|
|
84
|
+
```text
|
|
85
|
+
/cgc-start
|
|
86
|
+
/cgc-status
|
|
87
|
+
/cgc-doctor
|
|
173
88
|
```
|
|
174
89
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### 2. Gemini MCP(前端执行器)
|
|
180
|
-
|
|
181
|
-
**位置**: `geminimcp/` 目录
|
|
182
|
-
|
|
183
|
-
**安装步骤**:
|
|
90
|
+
`cgc-start` 是只读的新手入口,会提示当前项目的最短使用路径。`cgc-status` 检查项目级集成文件是否齐全。`cgc-doctor` 检查 Python、MCP 运行时、执行器导入和项目集成状态。
|
|
184
91
|
|
|
185
|
-
|
|
186
|
-
cd geminimcp
|
|
187
|
-
pip install -e .
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
**验证安装**:
|
|
92
|
+
## 4. 日常使用
|
|
191
93
|
|
|
192
|
-
|
|
193
|
-
python -m geminimcp.server --help
|
|
194
|
-
```
|
|
94
|
+
推荐从一个入口开始:
|
|
195
95
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
### MCP 服务器配置
|
|
201
|
-
|
|
202
|
-
CodeCGC 会自动在项目中生成 `.mcp.json` 配置文件:
|
|
203
|
-
|
|
204
|
-
```json
|
|
205
|
-
{
|
|
206
|
-
"mcpServers": {
|
|
207
|
-
"codexmcp": {
|
|
208
|
-
"command": "python",
|
|
209
|
-
"args": ["-m", "codexmcp.server"],
|
|
210
|
-
"env": {}
|
|
211
|
-
},
|
|
212
|
-
"geminimcp": {
|
|
213
|
-
"command": "python",
|
|
214
|
-
"args": ["-m", "geminimcp.server"],
|
|
215
|
-
"env": {}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
96
|
+
```text
|
|
97
|
+
/cgc 新增一个登录页,放在 src/components/LoginForm.tsx
|
|
219
98
|
```
|
|
220
99
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## 初始化项目
|
|
226
|
-
|
|
227
|
-
### 1. 进入您的项目目录
|
|
100
|
+
命令行回退路径:
|
|
228
101
|
|
|
229
102
|
```bash
|
|
230
|
-
|
|
103
|
+
cgc "新增一个登录页,放在 src/components/LoginForm.tsx"
|
|
231
104
|
```
|
|
232
105
|
|
|
233
|
-
|
|
106
|
+
CodeCGC 会根据工作流状态决定下一步是规划、执行、审核、继续还是收尾。只有在你明确知道当前阶段时,才需要直接使用子命令:
|
|
234
107
|
|
|
235
108
|
```bash
|
|
236
|
-
cgc-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
├── .claude/
|
|
244
|
-
│ ├── hooks/
|
|
245
|
-
│ │ └── route-edit.ps1 # 路由钩子(阻止 Claude 直接编辑代码)
|
|
246
|
-
│ └── settings.json # Claude 配置
|
|
247
|
-
├── .mcp.json # MCP 服务器注册
|
|
248
|
-
├── model-routing.yaml # 路由规则配置
|
|
249
|
-
└── codecgc/ # 工作流产物存储
|
|
250
|
-
├── product/
|
|
251
|
-
│ ├── feature/ # 功能开发工作流
|
|
252
|
-
│ ├── issue/ # Bug 修复工作流
|
|
253
|
-
│ └── execution/ # 执行审计记录
|
|
254
|
-
├── architecture/ # 架构文档
|
|
255
|
-
├── requirements/ # 需求文档
|
|
256
|
-
├── decisions/ # 技术决策
|
|
257
|
-
├── learnings/ # 经验总结
|
|
258
|
-
└── roadmap/ # 路线图
|
|
109
|
+
cgc-plan ...
|
|
110
|
+
cgc-build ...
|
|
111
|
+
cgc-fix ...
|
|
112
|
+
cgc-test ...
|
|
113
|
+
cgc-review ...
|
|
114
|
+
cgc-route ...
|
|
115
|
+
cgc-history ...
|
|
259
116
|
```
|
|
260
117
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
编辑 `model-routing.yaml`,定义前端和后端的文件路径模式:
|
|
264
|
-
|
|
265
|
-
```yaml
|
|
266
|
-
# 前端文件路径模式
|
|
267
|
-
frontend_paths:
|
|
268
|
-
- "src/components/**"
|
|
269
|
-
- "src/pages/**"
|
|
270
|
-
- "src/ui/**"
|
|
271
|
-
- "*.tsx"
|
|
272
|
-
- "*.jsx"
|
|
273
|
-
- "*.vue"
|
|
274
|
-
|
|
275
|
-
# 后端文件路径模式
|
|
276
|
-
backend_paths:
|
|
277
|
-
- "src/api/**"
|
|
278
|
-
- "src/server/**"
|
|
279
|
-
- "src/db/**"
|
|
280
|
-
- "*.py"
|
|
281
|
-
- "*.go"
|
|
282
|
-
- "*.java"
|
|
283
|
-
|
|
284
|
-
# 共享路径(需要特殊处理)
|
|
285
|
-
shared_paths:
|
|
286
|
-
- "src/types/**"
|
|
287
|
-
- "src/utils/**"
|
|
288
|
-
|
|
289
|
-
# 路由规则
|
|
290
|
-
rules:
|
|
291
|
-
frontend_executor: geminimcp # 前端使用 Gemini
|
|
292
|
-
backend_executor: codexmcp # 后端使用 Codex
|
|
293
|
-
shared_policy: split-first # 共享文件优先拆分
|
|
294
|
-
claude_role: plan-review-accept-only # Claude 只规划和审查
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
---
|
|
118
|
+
## 5. 角色与写入边界
|
|
298
119
|
|
|
299
|
-
|
|
120
|
+
CodeCGC 的默认协作边界是:
|
|
300
121
|
|
|
301
|
-
|
|
122
|
+
- Claude:需求、规划、设计、文档、审核、验收和工作流状态。
|
|
123
|
+
- Codex:后端代码和后端测试。
|
|
124
|
+
- Gemini:前端代码和前端测试。
|
|
302
125
|
|
|
303
|
-
|
|
304
|
-
cgc-doctor
|
|
305
|
-
```
|
|
126
|
+
`model-routing.yaml` 是项目内路由策略的唯一来源。Claude 的 hook 不承载业务规则,只把 `Edit`、`Write`、`MultiEdit` 写入请求交给同一套策略检查器,从而避免 Claude 绕过路由边界直接修改代码。
|
|
306
127
|
|
|
307
|
-
|
|
308
|
-
```
|
|
309
|
-
✓ Python 可用: python 3.10.x
|
|
310
|
-
✓ Codex MCP 可导入
|
|
311
|
-
✓ Gemini MCP 可导入
|
|
312
|
-
✓ 项目集成就绪
|
|
313
|
-
✓ .mcp.json 存在
|
|
314
|
-
✓ model-routing.yaml 存在
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
### 2. 检查项目状态
|
|
318
|
-
|
|
319
|
-
```bash
|
|
320
|
-
cgc-status
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
**预期输出**:
|
|
324
|
-
```
|
|
325
|
-
项目集成状态: 就绪
|
|
326
|
-
工作流目录: codecgc/
|
|
327
|
-
MCP 配置: .mcp.json
|
|
328
|
-
路由配置: model-routing.yaml
|
|
329
|
-
```
|
|
128
|
+
## 6. 用户级安装
|
|
330
129
|
|
|
331
|
-
|
|
130
|
+
用户级安装不是默认路径。只有在你明确希望同步 `~/.claude` 时才使用:
|
|
332
131
|
|
|
333
132
|
```bash
|
|
334
|
-
|
|
335
|
-
|
|
133
|
+
cgc-install --mode user-dry-run
|
|
134
|
+
cgc-install --mode user
|
|
336
135
|
```
|
|
337
136
|
|
|
338
|
-
|
|
137
|
+
建议先使用 `user-dry-run` 预览变更。普通项目接入场景应使用默认项目级安装。
|
|
339
138
|
|
|
340
|
-
##
|
|
139
|
+
## 7. 发布包维护者检查
|
|
341
140
|
|
|
342
|
-
|
|
141
|
+
维护 CodeCGC 包时,建议在源码仓库运行:
|
|
343
142
|
|
|
344
143
|
```bash
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
# 3. 查看生成的文件
|
|
352
|
-
ls codecgc/product/feature/2026-05-04-user-login-page/
|
|
353
|
-
# - 2026-05-04-user-login-page-design.md
|
|
354
|
-
# - 2026-05-04-user-login-page-checklist.yaml
|
|
355
|
-
|
|
356
|
-
# 4. 执行第一个步骤
|
|
357
|
-
cgc-build --slug 2026-05-04-user-login-page
|
|
358
|
-
|
|
359
|
-
# 5. 审查执行结果
|
|
360
|
-
cgc-review --audit-file codecgc/product/execution/.../xxx.json --decision accepted
|
|
361
|
-
|
|
362
|
-
# 6. 继续执行后续步骤
|
|
363
|
-
cgc-build --slug 2026-05-04-user-login-page
|
|
364
|
-
|
|
365
|
-
# 7. 查询下一步
|
|
366
|
-
cgc-route --slug 2026-05-04-user-login-page
|
|
144
|
+
python -m pytest tests --basetemp D:\tmp\codecgc-pytest
|
|
145
|
+
python -m compileall -q scripts codecgcmcp\src codexmcp\src geminimcp\src
|
|
146
|
+
python scripts\audit_codecgc_package_runtime.py --format json
|
|
147
|
+
python scripts\audit_codecgc_release_readiness.py --format json
|
|
148
|
+
npm pack --dry-run --json
|
|
367
149
|
```
|
|
368
150
|
|
|
369
|
-
|
|
151
|
+
如果默认临时目录受限,可以指定发布探针目录:
|
|
370
152
|
|
|
371
153
|
```bash
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
# 2. 系统自动生成 issue 工作流
|
|
376
|
-
# 输出: 已创建 issue 工作流 2026-05-04-slow-user-list
|
|
377
|
-
|
|
378
|
-
# 3. 执行修复
|
|
379
|
-
cgc-fix --slug 2026-05-04-slow-user-list
|
|
380
|
-
|
|
381
|
-
# 4. 审查修复结果
|
|
382
|
-
cgc-review --audit-file ... --decision accepted
|
|
154
|
+
set CODECGC_RELEASE_PROBE_ROOT=D:\tmp
|
|
155
|
+
python scripts\audit_codecgc_release_readiness.py --format json
|
|
383
156
|
```
|
|
384
157
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
```bash
|
|
388
|
-
# 查看所有开放的功能工作流
|
|
389
|
-
cgc-history --flow feature --status open
|
|
158
|
+
## 8. 常见问题
|
|
390
159
|
|
|
391
|
-
|
|
392
|
-
cgc-history --last 10
|
|
393
|
-
|
|
394
|
-
# 查看项目生命周期
|
|
395
|
-
cgc-lifecycle
|
|
396
|
-
```
|
|
160
|
+
### `cgc` 命令找不到
|
|
397
161
|
|
|
398
|
-
|
|
162
|
+
确认 npm 全局 bin 目录已经加入 `PATH`:
|
|
399
163
|
|
|
400
|
-
## 常见问题
|
|
401
|
-
|
|
402
|
-
### Q1: `cgc` 命令找不到
|
|
403
|
-
|
|
404
|
-
**原因**: 全局安装失败或 npm 全局路径未加入 PATH
|
|
405
|
-
|
|
406
|
-
**解决**:
|
|
407
164
|
```bash
|
|
408
|
-
# 检查全局安装路径
|
|
409
165
|
npm config get prefix
|
|
410
|
-
|
|
411
|
-
# 将该路径添加到系统 PATH
|
|
412
|
-
# Windows: 添加到环境变量
|
|
413
|
-
# macOS/Linux: 添加到 ~/.bashrc 或 ~/.zshrc
|
|
414
|
-
export PATH="$PATH:$(npm config get prefix)/bin"
|
|
415
166
|
```
|
|
416
167
|
|
|
417
|
-
|
|
168
|
+
然后检查对应系统的全局 bin 路径是否在环境变量中。
|
|
418
169
|
|
|
419
|
-
|
|
170
|
+
### `cgc-doctor` 提示 Python 或 MCP 依赖缺失
|
|
420
171
|
|
|
421
|
-
|
|
422
|
-
```bash
|
|
423
|
-
pip install pyyaml
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
### Q3: MCP 服务器无法启动
|
|
172
|
+
先确认 Python 可用:
|
|
427
173
|
|
|
428
|
-
**原因**: MCP 服务器未正确安装
|
|
429
|
-
|
|
430
|
-
**解决**:
|
|
431
174
|
```bash
|
|
432
|
-
|
|
433
|
-
cd codexmcp
|
|
434
|
-
pip uninstall codexmcp -y
|
|
435
|
-
pip install -e .
|
|
436
|
-
|
|
437
|
-
# 重新安装 Gemini MCP
|
|
438
|
-
cd geminimcp
|
|
439
|
-
pip uninstall geminimcp -y
|
|
440
|
-
pip install -e .
|
|
441
|
-
|
|
442
|
-
# 验证
|
|
443
|
-
python -m codexmcp.server --help
|
|
444
|
-
python -m geminimcp.server --help
|
|
175
|
+
python --version
|
|
445
176
|
```
|
|
446
177
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
**原因**: Python 命令名称不匹配
|
|
178
|
+
再安装核心依赖:
|
|
450
179
|
|
|
451
|
-
**解决**:
|
|
452
180
|
```bash
|
|
453
|
-
|
|
454
|
-
which python3
|
|
455
|
-
|
|
456
|
-
# 创建软链接或别名
|
|
457
|
-
# Linux/macOS:
|
|
458
|
-
sudo ln -s $(which python3) /usr/local/bin/python
|
|
459
|
-
|
|
460
|
-
# Windows: 在 .mcp.json 中修改 command 为 "python3"
|
|
181
|
+
python -m pip install -r requirements.txt
|
|
461
182
|
```
|
|
462
183
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
**原因**: 默认 120 秒超时不够
|
|
466
|
-
|
|
467
|
-
**解决**: 在 checklist.yaml 中为该步骤指定更长的超时
|
|
468
|
-
```yaml
|
|
469
|
-
steps:
|
|
470
|
-
- action: "复杂重构任务"
|
|
471
|
-
status: pending
|
|
472
|
-
codecgc:
|
|
473
|
-
kind: backend
|
|
474
|
-
task_summary: "重构认证模块"
|
|
475
|
-
target_paths: ["src/auth/"]
|
|
476
|
-
timeout_seconds: 600 # 10 分钟
|
|
477
|
-
```
|
|
184
|
+
如果是在源码开发环境中,可以按 `cgc-doctor` 输出的建议执行 editable install。
|
|
478
185
|
|
|
479
|
-
###
|
|
186
|
+
### 项目级集成缺失或过期
|
|
480
187
|
|
|
481
|
-
|
|
188
|
+
在目标项目根目录重新执行:
|
|
482
189
|
|
|
483
|
-
**解决**:
|
|
484
190
|
```bash
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
# 测试路径匹配
|
|
489
|
-
cgc-route --slug your-workflow-slug
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
### Q7: 如何卸载 CodeCGC
|
|
493
|
-
|
|
494
|
-
```bash
|
|
495
|
-
# 卸载全局包
|
|
496
|
-
npm uninstall -g codecgc
|
|
497
|
-
|
|
498
|
-
# 卸载 MCP 服务器
|
|
499
|
-
pip uninstall codexmcp geminimcp -y
|
|
500
|
-
|
|
501
|
-
# 删除项目集成文件(可选)
|
|
502
|
-
rm -rf .claude .mcp.json model-routing.yaml codecgc/
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
---
|
|
506
|
-
|
|
507
|
-
## 进阶配置
|
|
508
|
-
|
|
509
|
-
### 自定义执行器沙箱模式
|
|
510
|
-
|
|
511
|
-
在 checklist.yaml 中为每个步骤指定沙箱策略:
|
|
512
|
-
|
|
513
|
-
```yaml
|
|
514
|
-
steps:
|
|
515
|
-
- action: "只读分析"
|
|
516
|
-
codecgc:
|
|
517
|
-
kind: backend
|
|
518
|
-
codex_sandbox: read-only # 只读模式
|
|
519
|
-
|
|
520
|
-
- action: "工作区写入"
|
|
521
|
-
codecgc:
|
|
522
|
-
kind: backend
|
|
523
|
-
codex_sandbox: workspace-write # 可写工作区
|
|
524
|
-
|
|
525
|
-
- action: "完全访问"
|
|
526
|
-
codecgc:
|
|
527
|
-
kind: backend
|
|
528
|
-
codex_sandbox: danger-full-access # 完全访问(危险)
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
### 保持执行器会话
|
|
532
|
-
|
|
533
|
-
通过 `session_id` 在多个步骤间保持上下文:
|
|
534
|
-
|
|
535
|
-
```yaml
|
|
536
|
-
steps:
|
|
537
|
-
- action: "步骤 1"
|
|
538
|
-
codecgc:
|
|
539
|
-
kind: backend
|
|
540
|
-
session_id: my-session-123
|
|
541
|
-
|
|
542
|
-
- action: "步骤 2"
|
|
543
|
-
codecgc:
|
|
544
|
-
kind: backend
|
|
545
|
-
session_id: my-session-123 # 复用同一会话
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
### 获取完整执行日志
|
|
549
|
-
|
|
550
|
-
```yaml
|
|
551
|
-
steps:
|
|
552
|
-
- action: "调试任务"
|
|
553
|
-
codecgc:
|
|
554
|
-
kind: backend
|
|
555
|
-
return_all_messages: true # 返回完整消息历史
|
|
191
|
+
cgc-install
|
|
192
|
+
cgc-status
|
|
556
193
|
```
|
|
557
194
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
## 技术支持
|
|
561
|
-
|
|
562
|
-
- **GitHub Issues**: https://github.com/hunyed15/CodeCGC/issues
|
|
563
|
-
- **文档**: 查看 `codecgc/` 目录下的参考文档
|
|
564
|
-
- **审计报告**: `codecgc/architecture/code-audit-2026-05-04.md`
|
|
195
|
+
### 写入被 hook 拦截
|
|
565
196
|
|
|
566
|
-
|
|
197
|
+
检查 `model-routing.yaml`。如果目标路径属于 unknown 或 shared,应该先明确文件归属或拆分任务,而不是绕过 hook。
|
|
567
198
|
|
|
568
|
-
##
|
|
199
|
+
## 参考
|
|
569
200
|
|
|
570
|
-
-
|
|
571
|
-
-
|
|
572
|
-
-
|
|
573
|
-
-
|
|
201
|
+
- `README.md`
|
|
202
|
+
- `codecgc/reference/quickstart.md`
|
|
203
|
+
- `codecgc/reference/onboarding.md`
|
|
204
|
+
- `codecgc/reference/project-structure.md`
|
|
205
|
+
- `codecgc/reference/policy-routing.md`
|
|
206
|
+
- `codecgc/reference/troubleshooting.md`
|