Skip to content
/

Gemini CLI Skill for Claude Code

gemini-cli-skill-foray · forayconsulting/gemini_cli_skill · ★ 184 · last commit 2025-11-19

Primitive shape 1 total
Skills 1
00

Summary

Gemini CLI Skill for Claude Code — Summary

A single-skill Claude Code plugin that teaches Claude how to orchestrate Google's Gemini CLI as a powerful auxiliary AI tool. The skill provides detailed instructions, prompt templates, integration patterns, and reference docs so Claude can delegate tasks — code generation, security audits, test writing, web research, and architecture analysis — to Gemini 3 Pro running locally on the user's machine.

The core value proposition is multi-model parallelism without any backend infrastructure: Claude spawns gemini as a subprocess via Bash, the skill guides prompt construction and flag usage, and Claude post-processes the output. The --yolo / -o text pattern is the central primitive, with a JSON output variant for programmatic parsing.

The skill bundles five markdown files: SKILL.md (core instructions), reference.md (CLI flag reference), templates.md (reusable prompts), patterns.md (integration workflows like Generate-Review-Fix), and tools.md (Gemini-specific built-in tools including google_web_search, codebase_investigator, and save_memory).

This is a pure "skills-only behavioral framework" — no commands, no hooks, no MCP server. It extends Claude with awareness of a second AI rather than augmenting Claude's own reasoning. Compared to seeds: closest to superpowers (skills-only, zero commands, zero hooks), but entirely focused on cross-model delegation rather than spec-driven workflow enforcement. Unlike ccmemory (which uses Neo4j MCP for memory), this uses Gemini's native save_memory tool for cross-session persistence.

01

Overview

Gemini CLI Skill — Overview

Origin

Created by Foray Consulting (forayconsulting), published November 2025. No stated prior art or inspiration; the repo description is "A Claude Code skill enabling Claude to use Gemini 3 Pro via Gemini CLI." The README frames the skill as a bridge between two frontier LLMs, not as a workflow methodology.

Philosophy

The central claim: different AI models bring different "mindsets." Claude writing code benefits from a Gemini review pass precisely because it uses a different training data distribution and a different architecture. The skill instantiates this as the "Generate-Review-Fix Cycle" — Claude generates, Gemini critiques, Claude fixes.

A secondary claim: Gemini has unique tools (Google Search grounding, codebase_investigator, save_memory) that Claude Code cannot access natively. The skill is the bridge.

Manifesto-Style Quotes (from SKILL.md)

"When NOT to Use: Simple, quick tasks (overhead not worth it) ... Tasks requiring immediate response (rate limits cause delays) ... When context is already loaded and understood."

"YOLO Mode Behavior: Auto-approves tool calls but does NOT prevent planning prompts. Gemini may still present plans and ask 'Does this plan look good?' Use forceful language: 'Apply now' / 'Start immediately' / 'Do this without asking for confirmation'."

"Gemini's Unique Capabilities: These tools are available only through Gemini: google_web_search — Real-time internet search via Google; codebase_investigator — Deep architectural analysis; save_memory — Cross-session persistent memory."

Scope

5 files, no binary, no server. Installed by copying ~/.claude/skills/gemini-cli/ manually. Designed as a bolt-on capability layer, not a full development methodology.

02

Architecture

Gemini CLI Skill — Architecture

Distribution

standalone-repo — a GitHub repo containing only markdown skill files. No npm package, no CLI, no hooks.

Install

git clone https://github.com/forayconsulting/gemini_cli_skill.git
cp -r gemini_cli_skill ~/.claude/skills/gemini-cli

Manual file copy. Claude Code auto-discovers skills in ~/.claude/skills/.

Prerequisites

  • Gemini CLI installed: npm install -g @google/gemini-cli
  • Gemini API key or OAuth authentication configured (free tier available)

Directory Tree

gemini_cli_skill/
├── SKILL.md         # Core skill definition — when/how to use Gemini CLI
├── reference.md     # Full CLI flag reference (--yolo, -o, -m, -r, etc.)
├── templates.md     # Reusable prompt templates (generation, review, test, docs)
├── patterns.md      # Integration patterns (Generate-Review-Fix, background execution)
└── tools.md         # Gemini built-in tools (google_web_search, codebase_investigator, save_memory)

Runtime Dependencies

  • None server-side; Gemini CLI runs as a subprocess invoked via Claude's Bash tool
  • gemini binary must be on PATH
  • Free tier: 60 requests/min, 1000/day

Target AI Tools

  • Primary: Claude Code (skill discovery and Bash invocation)
  • Other tools that support skills (Gemini CLI itself has skill discovery, but this skill is for Claude to invoke Gemini, not the reverse)

Key Architectural Pattern

Claude Code reads SKILL.md into context when the use-case matches. Claude then constructs shell commands and invokes them through its native Bash tool. Gemini runs as an external process. Output comes back through stdout, parsed by Claude.

User → Claude Code
  → reads SKILL.md (into context)
  → Bash: gemini "[prompt]" --yolo -o text
    → Gemini CLI process (external, Google API call)
    → stdout response
  → Claude processes result
  → User gets answer

This is not an MCP server. There is no persistent connection. Each gemini invocation is a fresh subprocess.

03

Components

Gemini CLI Skill — Components

Skills (1)

Name Purpose
gemini-cli Core skill — teaches Claude when and how to invoke Gemini CLI; includes pattern recognition for ideal use cases (second opinion, web search, architecture analysis, parallel processing)

Supporting Reference Files (4)

File Purpose
reference.md Complete CLI flag reference: --yolo, -y, -o text/json, -m gemini-2.5-flash, -r [index] for session resume, --list-sessions
templates.md Reusable prompt templates for: code generation (single-file, multi-file, components), code review (comprehensive, security, performance), test generation (unit, integration), documentation (JSDoc, README, API)
patterns.md Integration patterns: Generate-Review-Fix Cycle, JSON Output for programmatic processing, Background Execution, Model Selection (Pro vs Flash), Rate Limit Handling
tools.md Documentation for Gemini's three unique built-in tools: google_web_search (real-time internet), codebase_investigator (architecture analysis), save_memory (cross-session persistence)

Commands (0)

None.

Hooks (0)

None.

MCP Servers (0)

None. Gemini CLI is invoked directly via Bash subprocess, not via MCP protocol.

Scripts (0)

None.

Templates (0)

None in the template-as-file sense; templates.md contains prompt text, not file scaffolds.

Model Selection Logic (from SKILL.md)

  • Default: gemini-2.5-pro (not specified = default)
  • Fast/simple tasks: gemini -m gemini-2.5-flash
  • The skill documents the tradeoff but leaves the choice to Claude's judgment
05

Prompts

Gemini CLI Skill — Prompts

Prompt File 1: SKILL.md — Core Skill Definition

Technique: Progressive disclosure + conditional activation. The SKILL.md frontmatter declares the allowed-tools list (Bash, Read, Write, Grep, Glob), which limits what Claude can do when this skill fires. The body uses numbered sections with explicit "When to Use" and "When NOT to Use" guards.

---
name: gemini-cli
description: Wield Google's Gemini CLI as a powerful auxiliary tool for code generation,
  review, analysis, and web research. Use when tasks benefit from a second AI perspective,
  current web information via Google Search, codebase architecture analysis, or parallel
  code generation. Also use when user explicitly requests Gemini operations.
allowed-tools:
  - Bash
  - Read
  - Write
  - Grep
  - Glob
---

Core behavioral instruction section (verbatim):

### 3. Critical Behavioral Notes

**YOLO Mode Behavior**: Auto-approves tool calls but does NOT prevent planning prompts.
Gemini may still present plans and ask "Does this plan look good?" Use forceful language:
- "Apply now"
- "Start immediately"
- "Do this without asking for confirmation"

**Rate Limits**: Free tier has 60 requests/min, 1000/day. CLI auto-retries with backoff.
Expect messages like "quota will reset after Xs".

Prompt File 2: patterns.md — Generate-Review-Fix Cycle

Technique: Concrete workflow prescription with verbatim shell commands. The pattern teaches Claude a repeatable quality assurance loop rather than ad-hoc delegation.

## Pattern 1: Generate-Review-Fix Cycle

The most reliable pattern for quality code generation.

### Why It Works
- Different "mindset" for generation vs review
- Self-correction catches common mistakes
- Security vulnerabilities often caught in review phase

### Example
# Generate
gemini "Create a user authentication module with bcrypt and JWT" --yolo -o text

# Review
gemini "Review auth.js for security vulnerabilities" -o text
# Output: "Found XSS risk, missing input validation, weak JWT secret"

# Fix
gemini "Fix in auth.js: XSS risk, add input validation, use env var for JWT secret.
  Apply now." --yolo -o text

Prompt File 3: templates.md — Standard Templates

Technique: Parameterized prompt templates with [placeholder] syntax that Claude fills in. Templates encode best practices for each use case.

### Code Generation
gemini "Create [description] with [features]. Output complete file content." --yolo -o text

### Code Review (Security-focused)
gemini "Review [file] for: 1) features, 2) bugs/security issues, 3) improvements" -o text

### Architecture Analysis
gemini "Use codebase_investigator to analyze this project" -o text

### Web Research
gemini "What are the latest [topic]? Use Google Search." -o text

Prompting Technique Classification

  • Tool use gate (frontmatter allowed-tools): restricts what Claude's Bash can do
  • Conditional activation (description field): natural language trigger conditions
  • Workflow prescription (patterns.md): step-by-step repeatable loops
  • Template fill-in (templates.md): Claude fills [placeholder] slots at call time
  • Negative constraint ("When NOT to Use" section): explicit guard rails
09

Uniqueness

Gemini CLI Skill — Uniqueness

differs_from_seeds

Closest seed architecturally is superpowers (skills-only, zero commands, zero hooks, zero MCP). But where superpowers enforces a spec-first/TDD workflow methodology, the Gemini CLI skill enables a single capability: cross-model delegation to Gemini. The fundamental difference is purpose — superpowers changes how Claude reasons, this skill changes which model does the work. The secondary differentiator is that superpowers never routes work to external AI; it treats Claude as the sole reasoning engine and uses subagents only as parallel Claude instances. This skill makes Google's Gemini 3 Pro a first-class peer in the workflow.

Positioning

This is the only framework in the corpus (across all batches) whose primary value is explicit cross-model routing from Claude to Gemini. It occupies a unique niche: "multi-model coordination as a skill" rather than multi-model coordination as an orchestration layer (like Deebo or OpenRouter-based frameworks).

Distinctive Opinion

The framework implicitly argues that different LLMs catch different bugs — Gemini's security review catches things Claude misses, and vice versa. This is a testable but unvalidated claim in the README.

Observable Failure Modes

  1. Rate limit surprise: Free tier (60 req/min, 1000/day) is hit in large projects; no graceful degradation built in
  2. YOLO mode planning prompts: Despite --yolo, Gemini may still ask for confirmation; Claude must use forceful language or the workflow stalls
  3. Output parsing ambiguity: JSON mode works, but text mode output varies; Claude must robustly handle Gemini's variable output formats
  4. Context pollution: When Gemini generates long output (architecture analysis), the gemini stdout goes into Claude's context window, potentially bloating it
  5. No feedback loop: Claude cannot programmatically evaluate Gemini's output quality; it must rely on its own judgment

What Makes It Novel vs. the 11 Seeds

  • Only framework to treat another AI CLI as a tool rather than the user or Claude as agents
  • Only framework with a documented multi-model model-selection heuristic (Pro vs Flash based on task complexity)
  • Only skill that documents rate-limit strategies
04

Workflow

Gemini CLI Skill — Workflow

Execution Flow

There is no prescribed multi-phase workflow. The skill defines when to delegate to Gemini and how to construct the invocation — it's a capability bolt-on, not a development methodology.

Phase Table

Phase Description Artifact
1. Use-case detection Claude identifies request matches ideal Gemini use cases None
2. Verify installation command -v gemini Pass/fail
3. Construct prompt Apply appropriate template from templates.md Shell command string
4. Execute gemini "[prompt]" --yolo -o text stdout response
5. Post-process Claude reads output, applies validation checklist Final answer or code

Ideal Use Cases (from SKILL.md)

  1. Second opinion / cross-validation
  2. Google Search grounding (current internet information)
  3. Codebase architecture analysis (via codebase_investigator)
  4. Parallel processing (offload tasks while continuing other work)
  5. Specialized generation (tests, JSDoc, code translation)

Anti-patterns (when NOT to use)

  • Simple, quick tasks (subprocess overhead not worth it)
  • Tasks needing immediate response (rate limit delays)
  • When context is already loaded and understood
  • Interactive refinement requiring conversation

Approval Gates

None. The skill is invoked autonomously when Claude judges it appropriate. No user confirmation step is specified.

Generate-Review-Fix Pattern (from patterns.md)

Step 1: gemini "Create [code]" --yolo -o text
Step 2: gemini "Review [file] for bugs and security issues" -o text
Step 3: gemini "Fix [issues] in [file]. Apply now." --yolo -o text

Background Execution Pattern

gemini "[long task]" --yolo -o text 2>&1 &
# Monitor with BashOutput tool
06

Memory Context

Gemini CLI Skill — Memory & Context

Claude Code Side

No persistent state. The skill is loaded into Claude's context window when invoked; no files written, no index maintained.

Gemini Side (documented in tools.md)

Gemini CLI has its own cross-session memory via the save_memory built-in tool. The skill documents this as a unique capability:

"save_memory — Cross-session persistent memory"

Usage pattern:

gemini "Use save_memory to record: [important context]" -o text

Sessions can be resumed:

gemini --list-sessions        # list past sessions
echo "follow-up" | gemini -r [index] -o text   # resume specific session

Project Context (Optional)

A .gemini/GEMINI.md file in the project root provides persistent context that Gemini reads automatically on every invocation. The skill documents this as "Session Management" configuration.

Context Compaction

Not applicable — each gemini invocation is a fresh subprocess. Context is not shared between invocations unless a session is explicitly resumed with -r.

Cross-Session Handoff

Via Gemini's save_memory tool only. Claude Code itself has no memory of Gemini session state between Claude sessions.

State Files

None written by the skill itself. Optional:

  • .gemini/GEMINI.md (project-level Gemini context, user-created)
  • ~/.gemini/settings.json (Gemini CLI config, managed by Gemini CLI)
07

Orchestration

Gemini CLI Skill — Orchestration

Multi-Agent Pattern

The skill enables a two-model coordination pattern: Claude as the primary agent orchestrating Gemini as a specialized subagent for specific tasks. This is not peer-to-peer multi-agent — Claude always directs and Gemini always executes.

Pattern: hierarchical (Claude = orchestrator, Gemini = worker)

Isolation Mechanism

None. Both models edit the same working directory. The skill doesn't prescribe git worktrees or containers.

Concurrency

The patterns.md Background Execution pattern (gemini ... &) enables parallel Gemini jobs. Multiple gemini processes can run simultaneously. Max concurrent agents: unbounded (limited only by rate limits and system resources).

Execution Mode

one-shot per skill invocation. Each gemini call is a discrete subprocess invocation.

Multi-Model Configuration

Role Model
Primary orchestrator Claude (via Claude Code)
Code generation / review / research gemini-2.5-pro (default)
Fast/simple tasks gemini-2.5-flash (explicit -m flag)

This is the only framework in this batch that treats multi-model routing as its primary purpose rather than a secondary concern.

Consensus Mechanism

None. Claude decides whether Gemini's output is acceptable; no formal consensus protocol.

Prompt Chaining

Yes. The Generate-Review-Fix cycle explicitly chains: Gemini's review output (bug list) becomes input to the fix prompt. This is explicit prompt chaining prescribed by patterns.md.

Auto-Validators

The skill prescribes a manual validation checklist after Gemini output:

  • Check for security vulnerabilities (XSS, injection)
  • Test functionality matches requirements
  • Review code style consistency
  • Verify dependencies are appropriate

These are not automated — Claude is instructed to perform them.

Crash Recovery

None. Rate limit errors are handled by Gemini CLI's built-in retry with backoff.

08

Ui Cli Surface

Gemini CLI Skill — UI & CLI Surface

Dedicated CLI Binary

None. The skill itself ships no binary. gemini is an external binary installed separately.

Local UI / Dashboard

None.

IDE Integration

Claude Code skill auto-discovery (drops files into ~/.claude/skills/gemini-cli/). No other IDE integration.

Observability

  • Gemini CLI logs to stdout/stderr; captured by Claude's Bash tool
  • JSON output mode (-o json) includes token usage stats in stats.models
  • Tool call success/failure in stats.tools.byName

Developer Experience Notes

Installation is fully manual (git clone + cp). No setup wizard or install script. The README provides a direct copy-paste prompt for Claude Code to do the installation automatically — an interesting self-referential pattern where Claude installs its own skill.

Cross-Tool Portability

Low — specifically designed for Claude Code's skill discovery. Not portable to Cursor, VS Code, or other IDEs without adaptation.

Related frameworks

same archetype · same primary tool · same memory type

Claude-Flow / Ruflo ★ 55k

Eliminates single-agent context limits and sequential bottlenecks by orchestrating fault-tolerant swarms of specialized AI agents…

Hermes Agent (NousResearch) ★ 168k

Self-improving personal AI agent with closed learning loop, 7 terminal backends, and messaging gateway — not tied to any AI…

OpenCode ★ 165k

Terminal-first AI coding agent with multi-model routing, native desktop app, and a typed .opencode/ configuration system for…

OpenHands ★ 75k

Open-source AI software development platform (open-source Devin alternative) with Docker sandbox isolation, 77.6% SWE-bench…

DeerFlow ★ 70k

Long-horizon superagent that researches, codes, and creates by orchestrating parallel sub-agents with isolated contexts in Docker…

oh-my-openagent (omo) ★ 60k

Multi-provider AI agent orchestration for OpenCode: escape vendor lock-in by routing Sisyphus (Claude/Kimi/GLM) and Hephaestus…