collaborating-with-gemini-cli

Delegates code review, debugging, and alternative implementation comparisons to Google Gemini CLI (`gemini`) via a JSON bridge script (default model: `gemini-3-pro-preview`). Supports headless one-shot and multi-turn sessions via `SESSION_ID`, with conservative defaults for Gemini effective-context constraints (file-scoped, `--no-full-access` by default) while allowing user override.

16 stars

Best use case

collaborating-with-gemini-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Delegates code review, debugging, and alternative implementation comparisons to Google Gemini CLI (`gemini`) via a JSON bridge script (default model: `gemini-3-pro-preview`). Supports headless one-shot and multi-turn sessions via `SESSION_ID`, with conservative defaults for Gemini effective-context constraints (file-scoped, `--no-full-access` by default) while allowing user override.

Teams using collaborating-with-gemini-cli should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/collaborating-with-gemini-cli/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/collaborating-with-gemini-cli/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/collaborating-with-gemini-cli/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How collaborating-with-gemini-cli Compares

Feature / Agentcollaborating-with-gemini-cliStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Delegates code review, debugging, and alternative implementation comparisons to Google Gemini CLI (`gemini`) via a JSON bridge script (default model: `gemini-3-pro-preview`). Supports headless one-shot and multi-turn sessions via `SESSION_ID`, with conservative defaults for Gemini effective-context constraints (file-scoped, `--no-full-access` by default) while allowing user override.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Collaborating with Gemini CLI

Use this skill when you want a second model (Gemini) to sanity-check a solution, spot edge cases, propose tests, or suggest an alternative implementation approach.

This skill provides a small JSON bridge script that runs `gemini` (Gemini CLI) in non-interactive **headless** mode and returns structured output.

Compared to `collaborating-with-claude-code`, this skill defaults to **read-only** and is optimized for **file-scoped, one-shot** requests to avoid practical effective-context degradation.

## Requirements

- Gemini CLI installed (`gemini --version`).
  - Install via npm: `npm i -g @google/gemini-cli`
- Gemini CLI authenticated (Google account login or API key auth, depending on your local setup).
- Python 3 (to run the bridge script).

## Quick start

```bash
python scripts/gemini_cli_bridge.py --cd "/path/to/repo" --PROMPT "Review src/auth/login.py for bypasses; propose fixes as a unified diff."
```

Recommended (explicit file scope, best for effective context):

```bash
python scripts/gemini_cli_bridge.py --cd "/path/to/repo" --file "src/auth/login.py" --PROMPT "Review this file for bypasses; propose fixes as a unified diff."
```

## Multi-turn sessions

Always capture the returned `SESSION_ID` and pass it back on follow-ups:

```bash
# Start a new session (one-shot by default)
python scripts/gemini_cli_bridge.py --cd "/repo" --file "src/auth/login.py" --PROMPT "Summarize issues and propose a patch."

# Continue the same session
python scripts/gemini_cli_bridge.py --cd "/repo" --SESSION_ID "uuid-from-response" --PROMPT "Now propose 5 targeted tests for the fix."
```

## Access modes

This skill defaults to `--no-full-access` (read-only).

- **Read-only (default)**: `--no-full-access` → maps to `gemini --approval-mode default`
- **Full access (edits allowed)**: `--full-access` → maps to `gemini --approval-mode auto_edit`
- **YOLO (auto-approve everything)**: `--yolo` → maps to `gemini --approval-mode yolo`

Examples:

```bash
# Allow edits (auto-approve edit tools)
python scripts/gemini_cli_bridge.py --full-access --cd "/repo" --file "src/foo.py" --PROMPT "Refactor for clarity; keep behavior; apply edits."
```

```bash
# YOLO mode (dangerous): allow any tool calls without confirmation
python scripts/gemini_cli_bridge.py --yolo --cd "/repo" --PROMPT "Run tests, fix failures, and apply edits."
```

## Effective-context guardrails (default ON)

By default the bridge enables conservative guardrails designed for **practical effective context**:

- Adds a preamble instructing Gemini to **stop and ask** before reading additional files.
- Strongly encourages **file-scoped** runs (use `--file` and keep each call small).
- Uses `--max-files` as a **preference** for “how many files per turn” and as a **cap for auto-extracted files** (only when you did not pass explicit `--file`).

User override options:

- `--file PATH` (repeatable): explicitly decide the focus file set (recommended; not blocked by `--max-files`).
- `--max-files N`: raise the preferred cap / auto-extraction cap.
- `--no-guardrails`: disable guardrails (Gemini may read many files; treat like a normal agent).

### Session rotation guidance (effective context)

The bridge exposes Gemini CLI token stats when available:

- `meta.prompt_tokens`: prompt tokens reported by Gemini CLI
- `meta.over_effective_context_limit`: `true` when `prompt_tokens > --effective-context-tokens`

When `meta.over_effective_context_limit` is `true`, prefer starting a **new session** for the next turn (omit `--SESSION_ID`) and/or reduce the focus scope.

## Parameters (bridge script)

- `--PROMPT` (required): Instruction to send to Gemini.
- `--cd` (required): Working directory to run Gemini CLI in (typically repo root).
- `--SESSION_ID` (optional): Resume an existing Gemini CLI session (uuid).
- `--model` (optional): Defaults to `gemini-3-pro-preview`.
- `--full-access` / `--no-full-access` (optional): Defaults to `--no-full-access`.
- `--yolo` (optional): YOLO approval mode (implies full access).
- `--sandbox` (optional): Run Gemini CLI in sandbox mode (requires Docker). Default: off.
- `--return-all-messages` (optional): Return the full streamed event list (debugging).
- `--file PATH` (repeatable): Focus files to prepend as `@PATH` (recommended).
- `--max-files` / `--no-guardrails` / `--effective-context-tokens`: Guardrail controls (`--max-files` is a preference + auto-extraction cap; it does not block explicit `--file`).
- `--timeout-s` (optional): Defaults to 1800 seconds.

## Output format

The bridge prints JSON:

```json
{
  "success": true,
  "SESSION_ID": "uuid",
  "agent_messages": "…Gemini output…",
  "all_messages": [],
  "meta": {}
}
```

`meta` includes the normalized focus file list and (when available) token stats extracted from Gemini CLI output.

Related Skills

gemini-vision

16
from diegosouzapw/awesome-omni-skill

Use Gemini to interpret a screenshot or mockup and produce implementation guidance. Use when the user provides an image or asks to build UI from a visual.

gemini-automation

16
from diegosouzapw/awesome-omni-skill

Automate Gemini tasks via Rube MCP (Composio). Always search tools first for current schemas.

gemini

16
from diegosouzapw/awesome-omni-skill

Google Gemini AI integration

querying-gemini

16
from diegosouzapw/awesome-omni-skill

Queries Gemini 3 Flash for high-speed code analysis, generation, and complex coding questions. Provides P0-P3 prioritized analysis reports, architecture audits, and code generation with configurable thinking levels (minimal/low/medium/high). 1M context, 64K output. Pro-level intelligence at Flash pricing.

gemini-frontend-design

16
from diegosouzapw/awesome-omni-skill

Create distinctive, production-grade frontend interfaces using Gemini 3 Pro for design ideation. Use this skill when you want Gemini's creative perspective on web components, pages, or applications. Generates bold, polished code that avoids generic AI aesthetics.

gemini-api

16
from diegosouzapw/awesome-omni-skill

Google Gemini API integration for building AI-powered applications. Use when working with Google's Gemini API, Python SDK (google-genai), TypeScript SDK (@google/genai), multimodal inputs (image, video, audio, PDF), thinking/reasoning features, streaming responses, structured outputs with JSON schemas, multi-turn chat, system instructions, image generation (Nano Banana), video generation (Veo), music generation (Lyria), embeddings, document/PDF processing, or any Gemini API integration task. Triggers on mentions of Gemini, Gemini 3, Gemini 2.5, Google AI, Nano Banana, Veo, Lyria, google-genai, or @google/genai SDK usage.

gemini-api-dev

16
from diegosouzapw/awesome-omni-skill

Use this skill when building applications with Gemini models, Gemini API, working with multimodal content (text, images, audio, video), implementing function calling, using structured outputs, or needing current model specifications. Covers SDK usage (google-genai for Python, @google/genai for JavaScript/TypeScript, com.google.genai:google-genai for Java, google.golang.org/genai for Go), model selection, and API capabilities.

darpan-gemini

16
from diegosouzapw/awesome-omni-skill

Use when coding or reviewing the Moqui-based Darpan component to follow local conventions, documentation practices, and verification steps; keep work inside runtime/component/darpan/** and apply both AGENTS files.

asking-gemini

16
from diegosouzapw/awesome-omni-skill

Architecture advice, design trade-offs, brainstorming, comparing approaches via Gemini. Use when user asks about architecture decisions, system design, design patterns, trade-offs analysis, brainstorming ideas, comparing options, or creative problem-solving. Supports SCAMPER, design thinking, divergent/convergent thinking methodologies. Do not use for web searches or shell commands.

nerdzao-elite-gemini-high

16
from diegosouzapw/awesome-omni-skill

Modo Elite Coder + UX Pixel-Perfect otimizado especificamente para Gemini 3.1 Pro High. Workflow completo com foco em qualidade máxima e eficiência de tokens.

simple-gemini

16
from diegosouzapw/awesome-omni-skill

Collaborative documentation and test code writing workflow using zen mcp's clink to launch gemini CLI session in WSL (via 'gemini' command) where all writing operations are executed. Use this skill when the user requests "use gemini to write test files", "use gemini to write documentation", "generate related test files", "generate an explanatory document", or similar document/test writing tasks. The gemini CLI session acts as the specialist writer, working with the main Claude model for context gathering, outline approval, and final review. For test code, codex CLI (also launched via clink) validates quality after gemini completes writing.

imagegen-gemini

16
from diegosouzapw/awesome-omni-skill

Generate/edit images via Gemini API (Nano Banana). Triggers: generate image, create picture, AI art, edit image, make illustration.