Index of every page on this site: llms.txt
All skills
genericservice avatar

/claude-use-gemini-acp

@b07f28f
Run it yourself

Delegate a sub-task to Gemini CLI via the Agent Client Protocol (ACP). Use this skill whenever you want to hand off work to Gemini — large-context summarization, Google Search grounding, tasks that exceed Claude's context window, or anything where Gemini's 1M-token window or real-time search gives an advantage. Also invoke when the user asks you to "ask Gemini", "check with Gemini", or "run this through Gemini". The script handles subprocess lifecycle and ACP session setup; you just provide the prompt and read stdout.

Use this Skill: https://skilld.dev/gh/genericservice/claude-skills/claude-use-gemini-acp

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈137 tokens for metadata: the name and description. ≈653 when used: this file. ≈246 more on demand in 2 files.

Description uses 6.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈547 characters, or 6.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Claude → Gemini via ACP

Spawn a Gemini CLI subprocess in ACP mode, send a prompt, stream the response to stdout, and terminate cleanly. No persistent session — one prompt, one response.

When to use

  • The task requires more context than fits in Claude's window
  • You want real-time Google Search grounding
  • You want a second opinion from a different model
  • The user says "ask Gemini", "use Gemini for this", etc.

Setup (first use only)

cd ~/.claude/skills/claude-use-gemini-acp/scripts
pnpm install

This installs @agentclientprotocol/sdk into the local node_modules/. Subsequent runs skip this step — pnpm caches the result.

Usage

GEMINI_MODEL=gemini-2.5-pro \
TARGET_CWD=/path/to/project \
node ~/.claude/skills/claude-use-gemini-acp/scripts/gemini-delegate.mjs \
  "Summarize the architecture in ARCHITECTURE.md and list the top 3 risks"

The response streams to stdout as Gemini generates it. Capture it for use in your response:

response=$(node ~/.claude/skills/claude-use-gemini-acp/scripts/gemini-delegate.mjs "your prompt")

Environment variables

Variable Default Description
GEMINI_MODEL gemini-2.5-pro Model to use
GEMINI_CLI_VERSION nightly gemini-cli package version (nightly or a specific semver)
TARGET_CWD current working dir Working directory passed to the Gemini session

How it works

  1. Spawns pnpm dlx @google/gemini-cli@<version> --acp --yolo --model <model>
  2. Connects via @agentclientprotocol/sdk's ClientSideConnection + ndJsonStream
  3. Sends initialize → newSession → prompt over the ACP session
  4. Streams agent_message_chunk deltas to stdout as they arrive
  5. Terminates the subprocess once the prompt response completes

The --yolo flag (-y) auto-approves all tool calls inside Gemini's session.

Prompt construction tips

  • Include all relevant context in the prompt string — this is a fresh session with no prior history
  • Reference files by absolute path if you want Gemini to read them (it can use its filesystem tools)
  • Keep prompts focused: one clear task per invocation
  • For multi-step work, do multiple sequential invocations rather than one sprawling prompt

Error handling

If the script exits non-zero, check stderr for:

  • pnpm dlx download failures (network, auth)
  • Gemini auth errors (gemini auth login may be needed)
  • ACP initialization failures (version mismatch)

The script does not retry — if something fails, surface the error to the user and suggest re-running after fixing the root cause.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill enables delegating tasks to Google's Gemini model by downloading and executing a CLI tool from a well-known service. It passes user-provided prompts directly to the model, which creates a surface for indirect prompt injection. The risk is slightly elevated because the delegated session is configured to auto-approve tool calls like filesystem access.

  • Socket3mo

    2 alerts: gptAnomaly

  • Snyk3mo

    Risk: CRITICAL · 3 issues

Signed by skilld at b07f28f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 7 months ago
version
1.0.0

README badge

README badge for genericservice/claude-skills/claude-use-gemini-acp