home / skills / yeachan-heo / oh-my-claudecode / ccg

ccg skill

/skills/ccg

This skill orchestrates Claude, Codex, and Gemini to decompose, parallelize tasks, and synthesize a cohesive backend and frontend solution.

npx playbooks add skill yeachan-heo/oh-my-claudecode --skill ccg

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.9 KB
---
name: ccg
description: Claude-Codex-Gemini tri-model orchestration - fans out backend tasks to Codex and frontend/UI tasks to Gemini in parallel, then Claude synthesizes results
---

# CCG (Claude-Codex-Gemini) Orchestration

## Overview

CCG is a tri-model orchestration pattern:

- **Claude** — Orchestrator/conductor: decomposes requests, fans out work, synthesizes results
- **Codex** (OpenAI) — Backend/code engine: architecture, APIs, security, code analysis
- **Gemini** (Google) — Frontend/design processor: UI components, styling, visual design, large-context tasks

Claude fans Codex and Gemini out **in parallel**, then synthesizes their outputs into a unified solution.

## Trigger

Activated when the user says `ccg` or `claude-codex-gemini` in their prompt.

## Execution Protocol

**ANNOUNCE immediately**: `"CCG MODE ENABLED — Orchestrating Claude + Codex + Gemini"`

### Phase 1: Decompose

Analyze the request and split into:
- **Backend tasks** → Codex (APIs, data models, business logic, tests, security)
- **Frontend tasks** → Gemini (UI components, styling, layout, responsive design)
- **Synthesis tasks** → Claude (integration, cross-cutting concerns, final wiring)

### Phase 2: Fan-Out (Parallel)

Run Codex and Gemini **simultaneously** using background mode.

**Codex — backend**:
1. Write prompt to `.omc/prompts/codex-{purpose}-{timestamp}.md`
2. Call `ask_codex` MCP tool:
   - `agent_role`: pick from `architect`, `executor`, `code-reviewer`, `security-reviewer`, `planner`, `critic`
   - `prompt_file`: the file you just wrote
   - `output_file`: `.omc/prompts/codex-{purpose}-{timestamp}-output.md`
   - `context_files`: relevant source files
   - `background: true` for non-blocking execution

**Gemini — frontend**:
1. Write prompt to `.omc/prompts/gemini-{purpose}-{timestamp}.md`
2. Call `ask_gemini` MCP tool:
   - `agent_role`: pick from `designer`, `writer`, `vision`
   - `prompt_file`: the file you just wrote
   - `output_file`: `.omc/prompts/gemini-{purpose}-{timestamp}-output.md`
   - `files`: relevant source files
   - `background: true` for non-blocking execution

### Phase 3: Await Results

Use `wait_for_job` (or poll with `check_job_status`) for both jobs. Wait for both to complete before synthesizing.

### Phase 4: Synthesize

Claude reads both output files and:
1. Reconciles any conflicts (e.g., API shape vs component props)
2. Integrates backend + frontend solutions into a cohesive whole
3. Applies cross-cutting concerns (error handling, typing, auth)
4. Implements any remaining integration glue code

## MCP Tool Selection Guide

### Use Codex (`ask_codex`) for:
- REST/GraphQL API design and implementation
- Database schema, migrations, data models
- Backend business logic and services
- Security audit and vulnerability analysis
- Architecture review and refactoring
- Test strategy, TDD, unit/integration tests
- Build errors and TypeScript issues

**Roles**: `architect`, `code-reviewer`, `security-reviewer`, `executor`, `planner`, `critic`, `tdd-guide`

### Use Gemini (`ask_gemini`) for:
- React/Vue/Svelte component implementation
- CSS, Tailwind, styled-components
- Responsive layouts and visual design
- UI/UX review and heuristic audits
- Large-scale documentation (1M token context)
- Image/screenshot/diagram analysis

**Roles**: `designer`, `writer`, `vision`

## Fallback

If **Codex MCP unavailable** → use `Task(subagent_type="oh-my-claudecode:executor", model="sonnet")` for backend tasks.

If **Gemini MCP unavailable** → use `Task(subagent_type="oh-my-claudecode:designer", model="sonnet")` for frontend tasks.

If **both unavailable** → use Claude directly with the standard agent catalog.

## Example

**User**: `ccg Add a user profile page with a REST API endpoint and React frontend`

```
CCG MODE ENABLED — Orchestrating Claude + Codex + Gemini

Decomposition:
  Backend  → Codex: /api/users/:id endpoint, Prisma user model, auth middleware
  Frontend → Gemini: React UserProfile component, avatar, form, responsive layout

Fan-out (parallel):
  [Codex]  Implementing REST endpoint + data layer...
  [Gemini] Designing UserProfile component + styling...

[Both complete]

Synthesis:
  - Align API response type with React component props
  - Wire fetch hook to /api/users/:id endpoint
  - Add error boundary and loading state across layers
  - Export unified UserProfilePage with data fetching
```

## Integration with Other Skills

CCG composes with other OMC modes:

| Combination | Effect |
|-------------|--------|
| `ccg ralph` | CCG loop with ralph persistence until verified complete |
| `ccg ultrawork` | CCG with max parallelism within each model |
| `ccg team` | CCG orchestration within a multi-agent team |

## Cancellation

Stop active CCG work: say `cancelomc` or run `/oh-my-claudecode:cancel`.

## State

CCG does not maintain persistent state files. Each invocation is stateless — Claude manages the workflow inline. MCP job IDs are tracked in-context during the session.

Overview

This skill implements a Claude-Codex-Gemini tri-model orchestration pattern that decomposes developer requests, runs backend and frontend work in parallel, and synthesizes a unified implementation. It is teams-first and designed for multi-agent code workflows where Claude acts as conductor, Codex handles backend/code tasks, and Gemini handles UI/design tasks. The pattern emphasizes parallel execution, clear role assignment, and a final integration step to reconcile interfaces and cross-cutting concerns.

How this skill works

On trigger, Claude immediately announces CCG mode, decomposes the request into backend, frontend, and synthesis tasks, and fans out parallel jobs: Codex (backend) and Gemini (frontend) run in background mode via MCP tools. Claude waits for both outputs, reconciles conflicts (API shapes vs component props), applies cross-cutting concerns (typing, auth, error handling), and emits integration glue code and a cohesive deliverable. If an MCP is unavailable, defined fallback subagents are used to preserve flow.

When to use it

  • Building a full-stack feature that requires coordinated API and UI work
  • Adding endpoints, data models, or security changes alongside React/Vue components
  • Refactoring where API shapes and component props must be reconciled
  • Parallelizing work to speed delivery while keeping a single orchestrator
  • Generating design-forward UI with large-context needs plus backend code

Best practices

  • Clearly describe backend vs frontend responsibilities in the initial prompt
  • Include relevant source files for context so Codex/Gemini can run independently
  • Choose appropriate agent roles (architect, designer, security-reviewer) for each task
  • Use background execution and wait_for_job to avoid blocking the orchestration
  • Review synthesized output for edge cases like auth flows, types, and error boundaries

Example use cases

  • Add a REST endpoint and a React user profile page with matching props and types
  • Create a new database model, migration, endpoint, and admin UI component in parallel
  • Perform a security audit on APIs while iterating on component styling and layout
  • Refactor API responses and update consuming UI components with a single integration pass
  • Produce design assets and long-context documentation for a complex UI while wiring backend services

FAQ

What happens if Codex or Gemini MCP is unavailable?

Fallback subagents are used: an oh-my-claudecode executor for backend or designer for frontend; if both are unavailable, Claude handles tasks directly.

How are conflicts between API shapes and component props resolved?

Claude synthesizes both outputs, reconciles types and shapes, and emits glue code such as adapters, fetch hooks, or prop transformations.