fengshao1227/ccg-workflow

多模型协作工作流引擎 — /ccg:go 一个命令,AI 自动分析意图、选择策略、编排 Codex + Gemini + Claude 协作执行

CCG – Claude + Codex + Gemini Multi‑Model Collaboration

What it is – ccg-workflow is a Node‑JS‑based CLI that turns Claude Code into a central orchestrator for other code‑generation models (OpenAI Codex, xAI Grok, Moonshot Kimi Code, Antigravity). It injects a set of JavaScript hooks into every Claude session so the model never loses context, then dispatches parallel analyses or implementations to the external models via a small Go binary (codeagent‑wrapper). The result is a “workflow engine” that can take a natural‑language request (e.g. “add JWT authentication to this API”) and automatically:

  1. Gather project context (git status, file tree, tech stack).
  2. Classify the task and pick an appropriate built‑in strategy.
  3. Create a persistent task directory (.ccg/tasks/...) containing specs, plans, research, and review artefacts.
  4. Run dual‑model analysis or implementation, present a hard‑stop plan for user approval, and optionally spawn long‑living “agent teams” that own their own files.
  5. Apply quality‑gate checks (security, code‑quality, documentation) and finally commit or roll back the changes.

Core Concepts

Component Role
Claude Code Lead orchestrator that decides strategy and drives the conversation.
Hook Engine Four JS hooks (workflow-state.js, session-start.js, subagent-context.js, skill-router.js) automatically inject task state, project context, and domain knowledge into every Claude turn.
codeagent‑wrapper A compiled Go binary that bridges Claude to external LLM APIs (Codex, Gemini, etc.) so they can run in parallel without a separate CLI.
Task System Persistent .ccg/tasks/<name>/ folder storing JSON status, markdown plans, research, and review files.
Strategies Ten pre‑defined workflows (e.g. direct-fix, full-collaborate, debug-investigate) automatically selected based on task complexity.
Quality Gates Built‑in checks (/ccg:verify-security, /ccg:verify-quality, …) that run before a change is accepted.
Domain Knowledge >100 markdown files covering security, DevOps, AI/MLOps, etc.; the router injects the relevant snippets into Claude prompts.
Skills Stand‑alone commands (/ccg:bt-panel, /ccg:seo-page-builder, /ccg:adsense-site-auditor) that can be used without the full multi‑model engine.

Quick‑Start Options

Option What you get How to install
A – Full install Multi‑model orchestration, all commands, hooks, Go bridge, task engine. npx ccg-workflow (interactive wizard) or npx ccg-workflow init --skip-prompt for a non‑interactive setup. Requires Node ≥ 20 and the Claude Code CLI.
B – Native plugin Only the reusable skills and quality‑gate files; no external model routing or Go binary. claude plugin marketplace add fengshao1227/ccg-workflow then claude plugin install ccg@ccg. Invoke with /ccg:<skill>.

Typical Workflow (example)

You: /ccg:go add JWT authentication to this API

CCG Engine:
  1️⃣ Reads git status, detects a Node/Express backend.
  2️⃣ Classifies as a *medium‑complexity* feature → selects `full‑collaborate`.
  3️⃣ Creates `.ccg/tasks/add-jwt-auth/` with a starter `task.json`.
  4️⃣ Fires Codex and Gemini in parallel to draft implementation.
  5️⃣ Shows a plan markdown and waits for your approval (hard stop).
  6️⃣ Spawns an Agent Team that writes the code, runs tests, and creates a review report.
  7️⃣ Runs `/ccg:verify-security` and `/ccg:verify-quality` gates.
  8️⃣ Commits the change or rolls back on request.

All state is persisted in the task folder, so you can resume later or audit what happened.


Key Commands (selected)

  • /ccg:go – Smart entry point; describe any development intent.
  • /ccg:commit – Generates a conventional‑commit message and creates the commit.
  • /ccg:rollback – Interactive undo of the last task.
  • /ccg:spec‑* – OpenSpec integration (init, research, plan, impl, review).
  • /ccg:bt‑panel – Deploys a build to a Baota/aaPanel server via its HTTP API.
  • /ccg:seo‑page‑builder – Generates or audits SEO‑focused pages.
  • npx ccg-workflow dsh install – Installs the same engine as a DeepSeek Harness plugin (dsh‑ccg).

Installation & Configuration

# Full install (interactive)
npx ccg-workflow

# Or non‑interactive
npx ccg-workflow init --skip-prompt

Configuration lives under ~/.claude/:

~/.claude/
├── commands/ccg/          # slash‑command definitions
├── hooks/ccg/             # the four JS hook files
├── skills/ccg/            # quality‑gate scripts & domain knowledge
├── .ccg/
│   ├── config.toml        # model routing, API tokens, performance tweaks
│   ├── engine/            # strategy JSON + router code
│   └── prompts/           # expert prompts for each external model
└── bin/codeagent-wrapper  # compiled Go bridge

Environment variables (set in ~/.claude/settings.json under "env") control timeouts and optional parallel‑team mode.


Use Cases

  • Feature development – Write new code (e.g., auth, API endpoints) with minimal manual coding.
  • Bug fixing – Run direct-fix or debug-investigate to get dual‑model diagnosis and patches.
  • Code review / audit – Use review-audit strategy for automated cross‑model review and security checks.
  • Documentation generation/ccg:gen-docs auto‑creates README/DESIGN files from the task artefacts.
  • Site operations – Deploy builds or audit SEO/AdSense compliance via the built‑in skills.

License & Community

  • License: MIT (permissive, commercial‑friendly).
  • Contributors: 8 core contributors listed in the README.
  • Support: X/Twitter @CCG_Workflow, email fengshao1227@gmail.com, GitHub Issues, and a community forum on Linux.do.
  • Sponsorship: APIMart (low‑cost AI image/video API) and Gamma Remover (PDF/PPTX watermark tool).

Bottom Line

ccg-workflow is a full‑stack, multi‑model orchestration tool that lets developers interact with Claude Code as a “project manager” while delegating heavy‑lifting code generation and review to other LLMs. It provides persistent task artefacts, built‑in quality gates, and a set of ready‑to‑use operational skills, all installable via a single npx command or as a native Claude plugin.

Related

  • Project
  • Project
  • Project
  • Project
  • Project