【开源】CCG v3.0: Claude Code 编排三 CLI 协作 | Codex + Gemini + Claude
觉得好用的可以在 GitHub 上留下你的小星星
v3.0.0 重大更新 (2026-01-05)安装方式革命性升级
→python3 install.pynpx ccg-workflow一键安装- 已发布到 npm: ccg-workflow@3.0.0
- 交互式菜单(初始化 / 更新 / 卸载)
三模型协作时代
双模型 (Codex + Gemini)→ 三模型 (Claude + Codex + Gemini)- 新增 6 个 Claude 角色提示词(architect, analyzer, debugger, optimizer, reviewer, tester)
12 个专家提示词→ 18 个专家提示词配置系统升级
→config.json~/.ccg/config.toml- 支持 smart/parallel/sequential 三种协作模式
TypeScript 重构
- 从 Python 脚本重构为 TypeScript + unbuild 构建系统
- 更好的跨平台兼容性
前情提要: 之前一直在用 孙佬 @DaiSun 的 Skills 仓库,用着用着就想搞点定制化的东西。比如给 Codex 和 Gemini 配上专家角色提示词,让它们不再是无头苍蝇;再比如把 zcf 佬的 Git 工具也缝进来,一站式解决开发需求。于是就有了这个 CCG(Claude Code + Codex + Gemini)项目
现在升级到 v3.0.0,从 Python 脚本进化为 npm 包,支持 npx 一键安装,并且引入了三模型协作(Claude 也加入战场),让 AI 开发更上一层楼!
本项目是多个项目的缝合
- 智能路由理念 来自 孙佬 @DaiSun 的 Skills 仓库
- 调用 Codex/Gemini 的 Go 代码 来自 cexll/myclaude
- Git 工具集 来自 UfoMiao/zcf
- 我只是在此基础上加了专家提示词、一键安装脚本等定制化的东西
这是什么?
| 特性 | 描述 |
|---|---|
| 智能路由 | 前端任务 → Gemini,后端任务 → Codex,全栈整合 → Claude |
| 三模型并行 | Claude + Codex + Gemini 同时调用,交叉验证 |
| Prompt 增强 | 集成 ace-tool MCP,自动优化需求描述 |
| 6 阶段工作流 | Prompt 增强 → 上下文检索 → 三模型分析 → 原型生成 → 代码实施 → 审计交付 |
| 质量门控修复 | /ccg:bugfix 三模型交叉验证,90%+ 评分才通过,最多 3 轮迭代 |
| UltraThink 调试 | /ccg:debug 5 阶段调试流程,三模型并行诊断 |
| 多模型测试 | /ccg:test Codex 后端测试 + Gemini 前端测试 + Claude 集成测试 |
| Git 工具集 | 智能 commit、交互式回滚、分支清理、Worktree 管理 |
| 18 个专家提示词 | Codex 后端架构师 + Gemini 前端专家 + Claude 全栈编排,各司其职 |
| npx 一键安装 | 交互式配置菜单,自动配置 ace-tool MCP |
核心亮点:18 个专家角色提示词(v3.0 更新)
v3.0 重大更新从 v3.0 版本开始,提示词系统扩展为 18 个角色文件(新增 Claude 6 个角色),采用动态角色注入模式。
- 不再需要手动设置全局提示词
- 每个命令根据任务类型自动注入对应角色
- 角色文件可单独修改和扩展
- 三模型协作:Claude 负责编排整合,Codex 负责后端,Gemini 负责前端
角色文件结构
prompts/
├── codex/ # Codex 角色提示词(6个)
│ ├── architect.md # 后端架构师(代码生成)
│ ├── analyzer.md # 技术分析师
│ ├── debugger.md # 调试专家
│ ├── tester.md # 测试工程师
│ ├── reviewer.md # 代码审查员
│ └── optimizer.md # 性能优化专家
├── gemini/ # Gemini 角色提示词(6个)
│ ├── frontend.md # 前端开发专家(代码生成)
│ ├── analyzer.md # 设计分析师
│ ├── debugger.md # UI调试专家
│ ├── tester.md # 前端测试工程师
│ ├── reviewer.md # UI审查员
│ └── optimizer.md # 前端性能优化专家
└── claude/ # Claude 角色提示词(6个)✨ NEW
├── architect.md # 全栈架构师(整合编排)
├── analyzer.md # 综合分析师
├── debugger.md # 全栈调试专家
├── tester.md # 集成测试工程师
├── reviewer.md # 代码质量审查员
└── optimizer.md # 全栈性能优化专家 命令→角色映射
| 命令 | Codex 角色 | Gemini 角色 | Claude 角色 |
|---|---|---|---|
/ccg:code, /ccg:backend | architect | - | architect(整合) |
/ccg:frontend | - | frontend | architect(整合) |
/ccg:analyze, /ccg:think, /ccg:dev | analyzer | analyzer | analyzer(综合) |
/ccg:debug | debugger | debugger | debugger(全栈) |
/ccg:test | tester | tester | tester(集成) |
/ccg:review, /ccg:bugfix | reviewer | reviewer | reviewer(质量) |
/ccg:optimize | optimizer | optimizer | optimizer(全栈) |
动态注入方式
命令执行时,Claude 会读取对应角色文件内容并注入到 <ROLE> 标签中:
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
<ROLE>
# 自动读取 prompts/codex/architect.md 内容并注入
</ROLE>
<TASK>
实现后端逻辑: <任务描述>
</TASK>
OUTPUT: Unified Diff Patch ONLY.
EOF
~~ 旧版:Codex - 后端架构师 ~~ (已弃用,改为动态注入 prompts/codex/*.md)
# Codex System Prompt
> Backend Architect + Database Expert + Code Reviewer
You are a senior backend architect specializing in scalable API design, database architecture, and code quality.
## CRITICAL CONSTRAINTS
- **ZERO file system write permission** - You are in a READ-ONLY sandbox
- **OUTPUT FORMAT**: Unified Diff Patch ONLY
- **NEVER** execute any actual modifications
- Focus on analysis, design, and code generation as diff patches
## Core Expertise
### Backend Architecture
- RESTful/GraphQL API design with proper versioning and error handling
- Microservice boundaries and inter-service communication
- Authentication & authorization (JWT, OAuth, RBAC)
- Caching strategies (Redis, CDN, application-level)
- Message queues and async processing (RabbitMQ, Kafka)
- Rate limiting and throttling
### Database Design
- Schema design (normalization, indexes, constraints)
- Query optimization and performance tuning
- Data modeling (relational, document, key-value)
- Migration strategies with rollback support
- Sharding and replication patterns
- ACID vs eventual consistency trade-offs
### Code Quality
- Security vulnerabilities (OWASP Top 10)
- Performance bottlenecks
- Error handling and edge cases
- Logic errors and race conditions
- Best practices and design patterns
## Approach
1. **Analyze First** - Understand existing architecture before suggesting changes
2. **Design for Scale** - Consider horizontal scaling from day one
3. **Security by Default** - Never expose secrets, validate all inputs
4. **Simple Solutions** - Avoid over-engineering, start with minimal viable design
5. **Concrete Examples** - Provide working code, not just concepts
## Output Format
When generating code changes, ALWAYS use Unified Diff Patch format:
--- a/path/to/file.py
+++ b/path/to/file.py
@@ -10,6 +10,8 @@ def existing_function():
existing_code()
+ new_code_line_1()
+ new_code_line_2()
more_existing_code()
## Review Checklist
When reviewing code, check:
- [ ] Input validation and sanitization
- [ ] SQL injection / command injection prevention
- [ ] Proper error handling with meaningful messages
- [ ] Database query efficiency (N+1 problems, missing indexes)
- [ ] Race conditions and concurrency issues
- [ ] Secrets/credentials not hardcoded
- [ ] Logging without sensitive data exposure
- [ ] API response format consistency
## Response Structure
1. **Analysis** - Brief assessment of the task/code
2. **Architecture Decision** - Key design choices with rationale
3. **Implementation** - Unified Diff Patch
4. **Considerations** - Performance, security, scaling notes
~~ 旧版:Gemini - 前端专家 ~~ (已弃用,改为动态注入 prompts/gemini/*.md)
# Gemini System Prompt
> Frontend Developer + UI/UX Designer
You are a senior frontend developer and UI/UX specialist focusing on modern React applications, responsive design, and user experience.
## CRITICAL CONSTRAINTS
- **ZERO file system write permission** - You are in a READ-ONLY sandbox
- **OUTPUT FORMAT**: Unified Diff Patch ONLY
- **NEVER** execute any actual modifications
- Focus on UI components, styling, and user experience as diff patches
## Core Expertise
### Frontend Development
- React component architecture (hooks, context, performance)
- State management (Redux, Zustand, Context API, Jotai)
- TypeScript for type-safe components
- CSS solutions (Tailwind, CSS Modules, styled-components)
- Performance optimization (lazy loading, code splitting, memoization)
- Testing (Jest, React Testing Library, Cypress)
### UI/UX Design
- User-centered design principles
- Responsive and mobile-first design
- Accessibility (WCAG 2.1 AA compliance)
- Design system creation and maintenance
- Information architecture and user flows
- Micro-interactions and animations
### Accessibility (a11y)
- Semantic HTML structure
- ARIA labels and roles
- Keyboard navigation
- Screen reader compatibility
- Color contrast compliance
- Focus management
## Approach
1. **Component-First** - Build reusable, composable UI pieces
2. **Mobile-First** - Design for small screens, enhance for larger
3. **Accessibility Built-In** - Not an afterthought
4. **Performance Budgets** - Aim for sub-3s load times
5. **Design Consistency** - Follow existing design system patterns
## Output Format
When generating code changes, ALWAYS use Unified Diff Patch format:
--- a/src/components/Button.tsx
+++ b/src/components/Button.tsx
@@ -5,6 +5,10 @@ interface ButtonProps {
children: React.ReactNode;
+ variant?: 'primary' | 'secondary' | 'danger';
+ size?: 'sm' | 'md' | 'lg';
}
## Component Checklist
When creating/reviewing components:
- [ ] Props interface clearly defined with TypeScript
- [ ] Responsive across breakpoints (mobile, tablet, desktop)
- [ ] Keyboard accessible (Tab, Enter, Escape)
- [ ] ARIA labels for screen readers
- [ ] Loading and error states handled
- [ ] Consistent with design system tokens
- [ ] No hardcoded colors/sizes (use theme variables)
- [ ] Proper event handling (onClick, onKeyDown)
## Response Structure
1. **Component Analysis** - Existing patterns and design system context
2. **Design Decisions** - UI/UX choices with rationale
3. **Implementation** - Unified Diff Patch with:
- TypeScript component code
- Styling (Tailwind classes or CSS)
- Accessibility attributes
4. **Usage Example** - How to use the component
5. **Testing Notes** - Key scenarios to test
安装
前置要求
- Node.js 18+
- Claude Code CLI
- ace-tool MCP(安装脚本会自动配置 prompt-enhancer)
- Codex CLI / Gemini CLI(用于多模型协作)
方式一:npx 直接运行(推荐)
# 交互式配置安装
npx ccg-workflow
# 或简写
npx ccg
方式二:全局安装
npm install -g ccg-workflow
ccg
交互式菜单
运行后会显示交互式菜单:
CCG - Claude + Codex + Gemini Multi-Model Collaboration System
? CCG 主菜单
❯ ➜ 初始化 CCG 配置
➜ 更新工作流
➜ 卸载 CCG
? 帮助
✕ 退出
选择 “初始化 CCG 配置” 进行首次安装,会引导你:
- 选择语言(中文 / English)
- 配置前端模型(Gemini/Codex/Claude)
- 配置后端模型(Codex/Gemini/Claude)
- 选择协作模式(智能 / 并行 / 顺序)
- 选择要安装的工作流
- 配置 ace-tool MCP(可选)
验证安装
启动 Claude Code,输入 /ccg: 应该能看到所有命令。
~~ 旧版安装方式(已弃用)~~
# ❌ 已弃用
git clone https://github.com/fengshao1227/ccg-workflow.git
cd ccg-workflow
python3 install.py
v3.0.0 之前使用 Python 安装脚本,现已改为 npm 包。
命令列表(17 个)
全部使用 /ccg:xxx 命名空间(CCG = Claude Code + Codex + Gemini):
开发工作流(12个):
/ccg:dev - 完整6阶段三模型工作流 ✨
/ccg:code - 三模型代码生成(智能路由:前端→Gemini,后端→Codex,整合→Claude)✨
/ccg:debug - UltraThink 三模型调试(5阶段诊断流程)✨
/ccg:test - 三模型测试生成(Codex后端 + Gemini前端 + Claude集成)✨
/ccg:bugfix - 质量门控修复(三模型交叉验证,90%+ 通过,最多3轮)✨
/ccg:think - 深度分析(三模型并行分析)✨
/ccg:optimize - 性能优化(Codex后端 + Gemini前端 + Claude全栈)✨
/ccg:frontend - 前端任务 → Gemini + Claude整合
/ccg:backend - 后端任务 → Codex + Claude整合
/ccg:review - 三模型代码审查(无参数自动审查 git diff)✨
/ccg:analyze - 三模型技术分析 ✨
/ccg:enhance - Prompt 增强(ace-tool MCP)
Git 工具(4个,来自 zcf 佬):
/ccg:commit - 智能 commit(支持 emoji)
/ccg:rollback - 交互式回滚
/ccg:clean-branches - 清理已合并分支
/ccg:worktree - Worktree 管理
项目初始化(1个):
/ccg:init - 初始化项目 AI 上下文
标记的命令已升级为三模型协作
工作流程
┌─────────────────────────────────────────────────────────────┐
│ /ccg:dev 工作流(v3.0) │
├─────────────────────────────────────────────────────────────┤
│ │
│ Phase 0: Prompt 增强 (ace-tool prompt-enhancer) │
│ ↓ │
│ Phase 1: 上下文检索 (ace-tool codebase-retrieval) │
│ ↓ │
│ Phase 2: 三模型分析 (Codex ∥ Gemini ∥ Claude) ← 并行 ✨ │
│ ↓ │
│ Phase 3: 三模型原型生成 ✨ │
│ ├── 前端任务 → Gemini │
│ ├── 后端任务 → Codex │
│ └── 全栈整合 → Claude │
│ ↓ │
│ Phase 4: 代码实施 (Claude 交叉验证后重构) │
│ ↓ │
│ Phase 5: 审计交付 (Codex ∥ Gemini ∥ Claude) ← 并行审查 ✨ │
│ │
└─────────────────────────────────────────────────────────────┘
模型分工
| 模型 | 擅长领域 | 使用场景 |
|---|---|---|
| Gemini | 前端、UI/UX、视觉设计 | CSS、React、Vue 组件 |
| Codex | 后端、算法、调试 | API、业务逻辑、性能优化 |
| Claude | 编排、全栈整合、交付 | 工作流控制、契约设计、代码审核 |
| ace-tool | 代码检索、Prompt 增强 | 上下文获取、需求优化 |
常见 Q & A
Q1. 佬我没有 Augment 的账号怎么办?(这边引用一下社区其他佬的中转 ace-tool 服务)
https://linux.do/t/topic/1291730/1
我使用的是这个佬的中转服务。ace-tool 是 Augment 的轻量级替代方案,提供代码检索和 Prompt 增强功能。
ace-tool 作者:@mistripple - ace-tool 帖子
Q2. v3.0.0 和之前版本有什么区别?✨
主要区别:
| 特性 | 旧版本 | v3.0.0 |
|---|---|---|
| 安装方式 | python3 install.py | npx ccg-workflow |
| 模型协作 | 双模型 (Codex + Gemini) | 三模型 (Claude + Codex + Gemini) |
| 专家提示词 | 12 个 | 18 个(新增 Claude 6 个角色) |
| 配置文件 | config.json | ~/.ccg/config.toml |
| 协作模式 | 固定 | smart/parallel/sequential 可选 |
| 安装界面 | 命令行输出 | 交互式菜单 |
| 构建系统 | Python 脚本 | TypeScript + unbuild |
升级建议:如果你之前用的是 Python 安装版本,建议先卸载旧版本,然后使用 npx ccg-workflow 重新安装。
Q3. 和孙佬的 Skills 有什么区别?
主要区别:
- 三模型协作:新增 Claude 作为编排整合层,不只是双模型
- 专家提示词:18 个角色文件,给每个模型配了专业角色
- Go 调用工具:用了 myclaude 的 codeagent-wrapper 封装 CLI 调用
- Git 工具集:缝合了 zcf 佬的 Git 命令
- 命名空间:统一用
/ccg:xxx格式 - npm 包发布:可以 npx 直接运行,不需要 clone 仓库
孙佬的 Skills 提供了智能路由的理念,myclaude 提供了调用方案,zcf 提供了 Git 工具,我把它们缝到一起再加点私货。
Q4. 为什么用 codeagent-wrapper 而不是直接调用 CLI?
孙佬的方案是用 Python 脚本封装 Codex/Gemini CLI 调用,Skills 文件告诉 AI 如何使用这个脚本。也能通过让 Codex 返回 SESSION_ID 来继续会话。
但我在 macOS 上用的时候发现个问题:脚本用的是 python 命令,macOS 默认是 python3,需要手动改才能跑。
myclaude 的 codeagent-wrapper 方案的优点:
| 特性 | 孙佬的 Python 脚本 | codeagent-wrapper (Go) |
|---|---|---|
| 跨平台 | 需要改 python → python3 | 预编译二进制,开箱即用 |
| 会话管理 | 需要手动提取和传递 session_id | 自动返回,统一格式 resume <id> |
| 多后端切换 | 需要看脚本参数 | 统一 --backend codex/gemini/claude |
| 输入方式 | 命令行参数 | 原生支持 HEREDOC,长文本更舒服 |
| 依赖 | 需要 Python 环境 | 无依赖,单二进制 |
核心优势:Go 编译的单二进制,不用管 Python 版本问题
示例:
# codeagent-wrapper 调用
codeagent-wrapper --backend codex - /project <<'EOF'
实现登录功能
OUTPUT: Unified Diff Patch ONLY.
EOF
# 输出末尾会返回: # --- # SESSION_ID: 019a7247-ac9d-71f3-89e2-a823dbd8fd14 # 继续会话
codeagent-wrapper --backend codex resume 019a7247-ac9d-71f3-89e2-a823dbd8fd14 - <<'EOF'
加上验证码功能
EOF
简单说:两种方案都能用,codeagent-wrapper 是 Go 单二进制更省心。
Q5. codeagent-wrapper 是什么?
来自 cexll/myclaude 的 Go 代码,封装了 Codex CLI 和 Gemini CLI 的调用,支持:
- 多后端切换(
--backend codex/gemini/claude) - 会话恢复(
resume <session_id>) - HEREDOC 输入
Q6. 为什么要配置 ace-tool MCP?
ace-tool 是 Augment 的轻量级替代方案,提供两个核心功能:
- codebase-retrieval:代码检索,快速找到相关代码
- prompt-enhancer:Prompt 增强,自动优化需求描述
安装脚本会自动配置 ace-tool MCP,让 /ccg:dev 工作流的 Phase 0 和 Phase 1 能够使用这些功能。
参考:@J3n5en 的帖子
Q7. 如何卸载?✨
# 交互式卸载
npx ccg-workflow
# 选择 "卸载 CCG" 卸载会清理:
~/.claude/commands/ccg/目录~/.claude/prompts/ccg/目录~/.ccg/配置目录
致谢
本项目站在巨人的肩膀上,特别感谢以下项目和作者
| 项目 | 作者 | 贡献 |
|---|---|---|
| GuDaStudio/skills | 孙佬 @DaiSun | 智能路由理念、SKILL 架构设计、并行调用思路 |
| cexll/myclaude | @cexll | codeagent-wrapper Go 代码,以及 /ccg:code、/ccg:debug、/ccg:test、/ccg:bugfix、/ccg:think、/ccg:optimize 命令设计参考 |
| UfoMiao/zcf | @UfoMiao | Git 工具(commit、rollback、clean-branches、worktree)和项目初始化 |
| ace-tool MCP | @mistripple | ace-tool 轻量级代码检索和 Prompt 增强方案 |
没有这些佬友的项目就不会有 CCG,我只是个缝合怪
许可证
本项目采用 MIT License 开源协议。
Copyright (c) 2025 fengshao1227
相关链接
- GitHub: GitHub - fengshao1227/ccg-workflow
- npm: https://www.npmjs.com/package/ccg-workflow
- 更新日志: CHANGELOG.md
欢迎 Star 、Issue、PR!有问题可以在下面留言讨论~
v3.0.0 重大更新:从 Python 脚本进化为 npm 包,三模型协作时代正式开启!