collaborating-with-gemini

GuDaStudio/collaborating-with-gemini

Delegates coding tasks to Gemini CLI for prototyping, debugging, and code review. Use when needing algorithm implementation, bug analysis, or code quality feedback. Supports multi-turn sessions via SESSION_ID.

1 stars
0 forks
Python
31 views

SKILL.md


name: collaborating-with-gemini description: Delegates coding tasks to Gemini CLI for prototyping, debugging, and code review. Use when needing algorithm implementation, bug analysis, or code quality feedback. Supports multi-turn sessions via SESSION_ID.

Quick Start

python scripts/gemini_bridge.py --cd "/path/to/project" --PROMPT "Your task"

Output: JSON with success, SESSION_ID, agent_messages, and optional error.

Parameters

usage: gemini_bridge.py [-h] --PROMPT PROMPT --cd CD [--sandbox] [--SESSION_ID SESSION_ID] [--return-all-messages] [--model MODEL]

Gemini Bridge

options:
  -h, --help            show this help message and exit
  --PROMPT PROMPT       Instruction for the task to send to gemini.
  --cd CD               Set the workspace root for gemini before executing the task.
  --sandbox             Run in sandbox mode. Defaults to `False`.
  --SESSION_ID SESSION_ID
                        Resume the specified session of the gemini. Defaults to empty string, start a new session.
  --return-all-messages
                        Return all messages (e.g. reasoning, tool calls, etc.) from the gemini session. Set to `False` by default, only the agent's final reply message is
                        returned.
  --model MODEL         The model to use for the gemini session. This parameter is strictly prohibited unless explicitly specified by the user.

Multi-turn Sessions

Always capture SESSION_ID from the first response for follow-up:

# Initial task
python scripts/gemini_bridge.py --cd "/project" --PROMPT "Analyze auth in login.py"

# Continue with SESSION_ID
python scripts/gemini_bridge.py --cd "/project" --SESSION_ID "uuid-from-response" --PROMPT "Write unit tests for that"

Common Patterns

Prototyping (request diffs):

python scripts/gemini_bridge.py --cd "/project" --PROMPT "Generate unified diff to add logging"

Debug with full trace:

python scripts/gemini_bridge.py --cd "/project" --PROMPT "Debug this error" --return-all-messages

README

collaborating-with-gemini

A Claude Code Agent Skill that bridges Claude with Google Gemini CLI for multi-model collaboration on coding tasks.

Overview

This Skill enables Claude to delegate coding tasks to Gemini CLI, combining the strengths of multiple AI models. Gemini handles algorithm implementation, debugging, and code analysis while Claude orchestrates the workflow and refines the output.

Features

  • Multi-turn sessions: Maintain conversation context across multiple interactions via SESSION_ID
  • Sandboxed execution: Optional sandbox mode for isolated execution
  • JSON output: Structured responses for easy parsing and integration
  • Cross-platform: Windows path escaping handled automatically

Installation

  1. Ensure Gemini CLI is installed and available in your PATH
  2. Copy this Skill to your Claude Code skills directory:
    • User-level: ~/.claude/skills/collaborating-with-gemini/
    • Project-level: .claude/skills/collaborating-with-gemini/

Usage

Basic

python scripts/gemini_bridge.py --cd "/path/to/project" --PROMPT "Analyze the authentication flow"

Multi-turn Session

# Start a session
python scripts/gemini_bridge.py --cd "/project" --PROMPT "Review login.py for security issues"
# Response includes SESSION_ID

# Continue the session
python scripts/gemini_bridge.py --cd "/project" --SESSION_ID "uuid-from-response" --PROMPT "Suggest fixes for the issues found"

Parameters

Parameter Required Description
--PROMPT Yes Task instruction
--cd Yes Workspace root directory
--sandbox No Run in sandbox mode (default: off)
--SESSION_ID No Resume a previous session
--return-all-messages No Include full reasoning trace in output
--model No Specify model (use only when explicitly requested)

Output Format

{
  "success": true,
  "SESSION_ID": "uuid",
  "agent_messages": "Gemini response text",
  "all_messages": []
}

License

MIT License. See LICENSE for details.