How the Tri-Model /ccg Skill Synthesizes Codex and Gemini Responses in oh-my-claudecode
The /ccg skill implements a three-stage pipeline where Claude decomposes user requests into specialized Codex and Gemini prompts, executes them in parallel via Bash CLI calls, and synthesizes the resulting markdown artifacts into a unified recommendation with conflict resolution.
The oh-my-claudecode (OMC) framework extends Claude Code with specialized skills for complex multi-model workflows. The /ccg (Claude-Codex-Gemini) tri-model skill demonstrates this capability by orchestrating parallel calls to OpenAI Codex and Google Gemini, then reconciling their outputs through intelligent synthesis according to the source code in skills/ccg/SKILL.md.
Tri-Model Pipeline Architecture
The /ccg skill operates through three distinct stages defined in skills/ccg/SKILL.md (lines 1-105). This architecture ensures specialized expertise from each model while maintaining coherent final output.
Stage 1: Request Decomposition
Claude first analyzes the user request and splits it into two specialized advisor prompts. The Codex prompt targets backend analysis, security considerations, and test strategy. The Gemini prompt focuses on UX design, usability improvements, and documentation polish. This decomposition logic is encoded in the skill's front-matter and execution protocol.
Stage 2: Parallel Advisor Execution
Rather than using nested skill calls—which the framework explicitly prohibits—the skill invokes external models through Bash CLI commands:
omc ask codex "<codex prompt>"
omc ask gemini "<gemini prompt>"
These commands write responses as markdown artifacts to .omc/artifacts/ask/codex-*.md and .omc/artifacts/ask/gemini-*.md respectively. The skill runs these commands in parallel to minimize latency while adhering to the constraint that "skill nesting is not supported in Claude Code."
Stage 3: Claude Synthesis
After both artifacts are written, Claude reads the latest Codex and Gemini response files and performs synthesis. The output includes:
- Agreed recommendations from both advisors
- Explicit conflicts where opinions diverge
- A final direction with clear rationale
- An actionable checklist for implementation
Source Code Implementation
The orchestration relies on several key components across the OMC codebase.
Skill Definition and Metadata
The canonical behavior is defined in skills/ccg/SKILL.md, which contains the decomposition templates, CLI invocation patterns, and synthesis instructions. This file is parsed by the skill loader in src/features/builtin-skills/skills.ts (lines 58-70), which uses rewriteOmcCliInvocations() to process Bash commands and appends pipeline guidance via renderSkillPipelineGuidance().
Keyword Detection
The skill is triggered by the regex /\b(ccg|claude-codex-gemini)\b/i registered in src/hooks/keyword-detector/index.ts (line 33). This ensures that user inputs containing "ccg" or "claude-codex-gemini" activate the tri-model workflow with appropriate priority ordering among other available skills.
Pipeline Parsing
Multi-stage orchestration metadata is handled by parseSkillPipelineMetadata() in src/utils/skill-pipeline.ts (lines 41-63). This utility extracts pipeline configuration from skill front-matter, enabling the framework to render appropriate guidance for multi-step skills like /ccg.
Practical Usage Examples
CLI Invocation
Trigger the tri-model analysis from the terminal:
/oh-my-claudecode:ccg Review this PR – architecture/security via Codex and UX/readability via Gemini
Execution Flow
The following pseudo-code illustrates the complete workflow implemented by the skill:
// 1. Decompose request into specialized prompts
const codexPrompt = `Analyze backend logic, security risks, and test coverage...`;
const geminiPrompt = `Evaluate UX patterns, accessibility, and documentation clarity...`;
// 2. Execute external advisors via Bash (avoiding skill nesting)
await runBash(`omc ask codex "${codexPrompt}"`);
await runBash(`omc ask gemini "${geminiPrompt}"`);
// 3. Collect latest artifacts from filesystem
const codexResult = readLatest('.omc/artifacts/ask/codex-*.md');
const geminiResult = readLatest('.omc/artifacts/ask/gemini-*.md');
// 4. Synthesize with Claude host model
return synthesizeWithClaude({
codex: codexResult,
gemini: geminiResult,
plan: 'reconcile conflicts and produce final direction'
});
Skill Registry Integration
The framework automatically loads the skill through the builtin-skills registry:
// From src/features/builtin-skills/skills.ts (lines 58-70)
const { metadata, body } = parseFrontmatter(content);
const pipeline = parseSkillPipelineMetadata(metadata);
const renderedBody = rewriteOmcCliInvocations(body.trim());
const template = [
renderedBody,
renderSkillRuntimeGuidance(safePrimaryName),
renderSkillPipelineGuidance(safePrimaryName, pipeline),
renderSkillResourcesGuidance(skillPath),
].filter(Boolean).join('\n\n');
Fallback and Error Handling
If one or both external providers are unavailable, the skill degrades gracefully. When a single provider responds, Claude synthesizes that output with its own analysis. If neither provider is reachable, Claude generates a standalone response with a clear disclaimer about the missing advisor inputs.
Summary
- The /ccg skill implements a tri-model synthesis pipeline combining Claude, Codex, and Gemini expertise.
- Request decomposition creates specialized prompts for backend analysis (Codex) and UX evaluation (Gemini).
- Parallel execution occurs via
omc askCLI commands writing to.omc/artifacts/ask/rather than nested skill calls. - Synthesis reconciles advisor outputs into agreed recommendations, explicit conflicts, and actionable checklists.
- The implementation spans
skills/ccg/SKILL.md,src/hooks/keyword-detector/index.ts, andsrc/features/builtin-skills/skills.ts. - Graceful fallback ensures functionality even when external providers are unavailable.
Frequently Asked Questions
What does the /ccg skill name stand for?
The /ccg abbreviation stands for Claude-Codex-Gemini, representing the three models involved in the synthesis pipeline. Claude acts as the orchestrator and final synthesizer, while Codex and Gemini serve as specialized advisors for distinct aspects of code review.
Why does the skill use Bash CLI calls instead of nested skills?
The skill explicitly uses Bash to run omc ask commands because skill nesting is not supported in Claude Code. As implemented in the source, this architectural constraint requires spawning separate processes to invoke the Codex and Gemini advisors rather than calling them as sub-skills.
Where are the intermediate advisor responses stored?
Both Codex and Gemini responses are written as markdown files to .omc/artifacts/ask/, with filenames following the patterns codex-*.md and gemini-*.md. The synthesis stage reads the most recent files from this directory to produce the final recommendation.
How does the skill handle conflicting advice from Codex and Gemini?
The synthesis stage explicitly surfaces explicit conflicts where the advisors disagree, then provides a final direction with rationale that reconciles these differences. This transparency allows users to understand the trade-offs between technical implementation (Codex) and user experience (Gemini) perspectives.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →