CCG-WORKFLOW(1)

NAME

ccg-workflow多模型协作开发系统 - Claude 编排 + Codex 后端 + Gemini 前端,28 个命令覆盖开发全流程,一键安装零配置

SYNOPSIS

$sudo apt install jq

INFO

4.9k stars
360 forks
0 views

DESCRIPTION

多模型协作开发系统 - Claude 编排 + Codex 后端 + Gemini 前端,28 个命令覆盖开发全流程,一键安装零配置

README

CCG - Claude + Codex + Gemini Multi-Model Collaboration

npm version License: MIT Claude Code Tests

简体中文 | English

A multi-model collaboration development system where Claude Code orchestrates Codex + Gemini. Frontend tasks route to Gemini, backend tasks route to Codex, and Claude handles orchestration and code review.

Why CCG?

  • Zero-config model routing — Frontend tasks automatically go to Gemini, backend tasks to Codex. No manual switching.
  • Security by design — External models have no write access. They return patches; Claude reviews before applying.
  • 27 slash commands — From planning to execution, git workflow to code review, all accessible via /ccg:*.
  • Spec-driven development — Integrates OPSX to turn vague requirements into verifiable constraints, eliminating AI improvisation.

Architecture

Claude Code (Orchestrator)
       │
   ┌───┴───┐
   ↓       ↓
Codex   Gemini
(Backend) (Frontend)
   │       │
   └───┬───┘
       ↓
  Unified Patch

External models have no write access — they only return patches, which Claude reviews before applying.

Quick Start

Prerequisites

DependencyRequiredNotes
Node.js 20+Yesora@9.x requires Node >= 20. Node 18 causes SyntaxError
Claude Code CLIYesInstall guide
jqYesUsed for auto-authorization hook (install)
Codex CLINoEnables backend routing
Gemini CLINoEnables frontend routing

Installation

npx ccg-workflow

On first run, CCG prompts you to select a language (English / Chinese). This preference is saved for all future sessions.

Install jq

# macOS
brew install jq

Linux (Debian/Ubuntu)

sudo apt install jq

Linux (RHEL/CentOS)

sudo yum install jq

Windows

choco install jq # or: scoop install jq

Install Claude Code

npx ccg-workflow menu  # Select "Install Claude Code"

Supports: npm, homebrew, curl, powershell, cmd.

Commands

Development Workflow

CommandDescriptionModel
/ccg:workflowFull 6-phase development workflowCodex + Gemini
/ccg:planMulti-model collaborative planning (Phase 1-2)Codex + Gemini
/ccg:executeMulti-model collaborative execution (Phase 3-5)Codex + Gemini + Claude
/ccg:codex-execCodex full execution (plan → code → review)Codex + multi-model review
/ccg:featSmart feature developmentAuto-routed
/ccg:frontendFrontend tasks (fast mode)Gemini
/ccg:backendBackend tasks (fast mode)Codex

Analysis & Quality

CommandDescriptionModel
/ccg:analyzeTechnical analysisCodex + Gemini
/ccg:debugProblem diagnosis + fixCodex + Gemini
/ccg:optimizePerformance optimizationCodex + Gemini
/ccg:testTest generationAuto-routed
/ccg:reviewCode review (auto git diff)Codex + Gemini
/ccg:enhancePrompt enhancementBuilt-in

OPSX Spec-Driven

CommandDescription
/ccg:spec-initInitialize OPSX environment
/ccg:spec-researchRequirements → Constraints
/ccg:spec-planConstraints → Zero-decision plan
/ccg:spec-implExecute plan + archive
/ccg:spec-reviewDual-model cross-review

Agent Teams (v1.7.60+)

CommandDescription
/ccg:team-researchRequirements → constraints (parallel exploration)
/ccg:team-planConstraints → parallel implementation plan
/ccg:team-execSpawn Builder teammates for parallel coding
/ccg:team-reviewDual-model cross-review

Prerequisite: Enable Agent Teams in settings.json: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Git Tools

CommandDescription
/ccg:commitSmart commit (conventional commit format)
/ccg:rollbackInteractive rollback
/ccg:clean-branchesClean merged branches
/ccg:worktreeWorktree management

Project Setup

CommandDescription
/ccg:initInitialize project CLAUDE.md
/ccg:contextProject context management (.context/ init, log, compress, history)

Workflow Guides

Planning & Execution Separation

# 1. Generate implementation plan
/ccg:plan implement user authentication

2. Review the plan (editable)

Plan saved to .claude/plan/user-auth.md

3a. Execute (Claude refactors) — fine-grained control

/ccg:execute .claude/plan/user-auth.md

3b. Execute (Codex does everything) — efficient, low Claude token usage

/ccg:codex-exec .claude/plan/user-auth.md

OPSX Spec-Driven Workflow

Integrates OPSX architecture to turn requirements into constraints, eliminating AI improvisation:

/ccg:spec-init                          # Initialize OPSX environment
/ccg:spec-research implement user auth  # Research → constraints
/ccg:spec-plan                          # Parallel analysis → zero-decision plan
/ccg:spec-impl                          # Execute the plan
/ccg:spec-review                        # Independent review (anytime)

Tip: /ccg:spec-* commands internally call /opsx:*. You can /clear between phases — state is persisted in the openspec/ directory.

Agent Teams Parallel Workflow

Leverage Claude Code Agent Teams to spawn multiple Builder teammates for parallel coding:

/ccg:team-research implement kanban API  # 1. Requirements → constraints
# /clear
/ccg:team-plan kanban-api               # 2. Plan → parallel tasks
# /clear
/ccg:team-exec                          # 3. Builders code in parallel
# /clear
/ccg:team-review                        # 4. Dual-model cross-review

vs Traditional Workflow: Team series uses /clear between steps to isolate context, passing state through files. Ideal for tasks decomposable into 3+ independent modules.

Configuration

Directory Structure

~/.claude/
├── commands/ccg/       # 26 slash commands
├── agents/ccg/         # Sub-agents
├── skills/ccg/         # Quality gates + multi-agent orchestration
├── bin/codeagent-wrapper
└── .ccg/
    ├── config.toml     # CCG configuration
    └── prompts/
        ├── codex/      # 6 Codex expert prompts
        └── gemini/     # 7 Gemini expert prompts

Environment Variables

Configure in ~/.claude/settings.json under "env":

VariableDescriptionDefaultWhen to change
CODEAGENT_POST_MESSAGE_DELAYWait after Codex completion (sec)5Set to 1 if Codex process hangs
CODEX_TIMEOUTWrapper execution timeout (sec)7200Increase for very long tasks
BASH_DEFAULT_TIMEOUT_MSClaude Code Bash timeout (ms)120000Increase if commands time out
BASH_MAX_TIMEOUT_MSClaude Code Bash max timeout (ms)600000Increase for long builds
Example settings.json
{
  "env": {
    "CODEAGENT_POST_MESSAGE_DELAY": "1",
    "CODEX_TIMEOUT": "7200",
    "BASH_DEFAULT_TIMEOUT_MS": "600000",
    "BASH_MAX_TIMEOUT_MS": "3600000"
  }
}

MCP Configuration

npx ccg-workflow menu  # Select "Configure MCP"

Code retrieval (choose one):

  • ace-tool (recommended) — Code search via search_context. Official | Third-party proxy
  • fast-context (recommended) — Windsurf Fast Context, AI-powered search without full-repo indexing. Requires Windsurf account
  • ContextWeaver (alternative) — Local hybrid search, requires SiliconFlow API Key (free)

Optional tools:

  • Context7 — Latest library documentation (auto-installed)
  • Playwright — Browser automation / testing
  • DeepWiki — Knowledge base queries
  • Exa — Search engine (requires API Key)

Auto-Authorization Hook

CCG automatically installs a Hook to auto-authorize codeagent-wrapper commands (requires jq).

Manual setup (for versions before v1.7.71)

Add to ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.command' 2>/dev/null | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || true",
            "timeout": 1
          }
        ]
      }
    ]
  }
}

Utilities

npx ccg-workflow menu  # Select "Tools"
  • ccusage — Claude Code usage analytics
  • CCometixLine — Status bar tool (Git + usage tracking)

Update / Uninstall

# Update
npx ccg-workflow@latest            # npx users
npm install -g ccg-workflow@latest  # npm global users

Uninstall

npx ccg-workflow # Select "Uninstall" npm uninstall -g ccg-workflow # npm global users need this extra step

FAQ

Codex CLI 0.80.0 process does not exit

In --json mode, Codex does not automatically exit after output completion.

Fix: Set CODEAGENT_POST_MESSAGE_DELAY=1 in your environment variables.

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Looking for a place to start? Check out issues labeled good first issue.

Contributors

fengshao1227
fengshao1227
RebornQ
RebornQ
23q3
23q3
MrNine-666
MrNine-666
GGzili
GGzili

Credits

Star History

Star History Chart

Contact

License

MIT


v1.7.83 | Issues | Contributing

SEE ALSO

clihub3/12/2026CCG-WORKFLOW(1)