跳转到内容

配置参考

CCG 安装后的完整文件布局:

~/.claude/
├── commands/ccg/ # 斜杠命令(13 个 .md 文件)
│ ├── go.md # /ccg:go 智能入口
│ ├── commit.md # /ccg:commit
│ ├── rollback.md # /ccg:rollback
│ ├── clean-branches.md # /ccg:clean-branches
│ ├── worktree.md # /ccg:worktree
│ ├── init.md # /ccg:init
│ ├── context.md # /ccg:context
│ ├── spec-init.md # /ccg:spec-init
│ ├── spec-research.md # /ccg:spec-research
│ ├── spec-plan.md # /ccg:spec-plan
│ ├── spec-impl.md # /ccg:spec-impl
│ └── spec-review.md # /ccg:spec-review
├── hooks/ccg/ # Hook 脚本(4 个 .js 文件)
│ ├── workflow-state.js # 每轮状态注入
│ ├── session-start.js # 会话启动上下文
│ ├── subagent-context.js # 子 Agent spec 注入
│ └── skill-router.js # 域知识自动路由
├── .ccg/
│ ├── config.toml # CCG 主配置
│ ├── engine/ # 策略引擎
│ │ ├── strategies/ # 10 个策略定义文件
│ │ └── router.js # 模型路由器
│ └── prompts/ # 专家提示词
│ ├── codex/ # Codex 专家(6 个)
│ └── gemini/ # Gemini 专家(7 个)
├── skills/ccg/ # 质量关卡 + 域知识
│ ├── tools/
│ │ ├── verify-security/
│ │ ├── verify-quality/
│ │ ├── verify-change/
│ │ ├── verify-module/
│ │ └── gen-docs/
│ ├── orchestration/
│ │ └── multi-agent/
│ └── domains/ # 域知识文件
│ ├── security/
│ ├── architecture/
│ ├── ai/
│ ├── devops/
│ └── development/
├── bin/
│ └── codeagent-wrapper # 多模型执行桥(Go 编译二进制)
└── settings.json # Hook 注册 + 环境变量

主配置文件位于 ~/.claude/.ccg/config.toml

[models]
# 模型路由配置
frontend = "gemini" # 前端任务路由到 Gemini
backend = "codex" # 后端任务路由到 Codex
[mcp]
# MCP 工具配置
provider = "fast-context" # fast-context / ace-tool / context-weaver
[performance]
# 性能模式
parallel = true # 启用双模型并行
timeout = 7200 # Wrapper 超时(秒)

~/.claude/settings.json"env" 字段中设置:

变量默认值说明
CODEX_TIMEOUT7200codeagent-wrapper 超时时间(秒)
CODEAGENT_POST_MESSAGE_DELAY5Wrapper 执行完成后的延迟(秒)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS未设置设为 1 启用 Agent Teams 并行执行

安装器会修改 ~/.claude/settings.json,添加 Hook 注册和环境变量:

{
"hooks": {
"UserPromptSubmit": [
{ "type": "command", "command": "node ~/.claude/hooks/ccg/workflow-state.js" },
{ "type": "command", "command": "node ~/.claude/hooks/ccg/skill-router.js" }
],
"SessionStart": [
{ "type": "command", "command": "node ~/.claude/hooks/ccg/session-start.js" }
],
"PreToolUse": [
{ "type": "command", "command": "node ~/.claude/hooks/ccg/subagent-context.js" }
]
},
"env": {
"CODEX_TIMEOUT": "7200",
"CODEAGENT_POST_MESSAGE_DELAY": "5"
},
"permissions": {
"allow": [
"Bash(node ~/.claude/hooks/ccg/*)",
"Bash(~/.claude/bin/codeagent-wrapper*)"
]
}
}

项目根目录下的 .ccg/ 用于存放任务状态和编码规范:

<project-root>/
└── .ccg/
├── tasks/ # 任务持久化目录
│ └── <task-slug>/
│ ├── task.json
│ ├── plan.md
│ └── ...
└── spec/ # 项目编码规范
├── backend/index.md
├── frontend/index.md
└── guides/index.md
Terminal window
# 更新到最新版本
npx ccg-workflow@latest
# 进入交互式菜单(含卸载选项)
npx ccg-workflow

卸载时安装器会清理所有安装的文件:命令、Hook、config、skills、bin。不会影响 ~/.claude/settings.json 中其他非 CCG 的配置。