Skip to content
Agentmart
Submit a tool

gemini

Wraps the Google Gemini CLI for an independent review of your diff, an adversarial challenge of it, or a consult on any question over a 1M+ token context.

Skill by ptrandev

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ptrandev-gemini

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Wraps the Google Gemini CLI for an independent review of your diff, an adversarial challenge of it, or a consult on any question over a 1M+ token context. Use for "gemini review", "gemini challenge", "third opinion", or when context size matters more than reasoning depth.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/gemini

What's inside

Skill name
gemini
Description
Wraps the Google Gemini CLI for an independent review of your diff, an adversarial challenge of it, or a consult on any question over a 1M+ token context. Use for "gemini review", "gemini challenge", "third opinion", or when context size matters more than reasoning depth.
License
MIT
Instructions
464 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • allowed-tools: must be a space-separated string

Files (3)

  • SKILL.md
  • askuserquestion.md · references/
  • setup.md · references/

SKILL.md (first lines)

# /gemini: Multi-AI Second/Third Opinion

---

## Step 0: Check the `gemini` binary

```bash
GEMINI_BIN=$(which gemini 2>/dev/null || echo "")
[ -z "$GEMINI_BIN" ] && echo "NOT_FOUND" || echo "FOUND: $GEMINI_BIN"
```

If `NOT_FOUND`, stop and tell the user:

> Gemini CLI not found. Install it: `npm install -g @google/gemini-cli`
> Docs: https://github.com/google-gemini/gemini-cli

---

## Step 0.5: Auth probe (API-key only)

Auth goes through `$GEMINI_API_KEY` or `$GOOGLE_API_KEY`. **Never** use OAuth or
gcloud ADC.

- **MODELS.** The `-latest` aliases and the full model catalog are served by the
  Generative Language API behind an API key. The OAuth "Code Assist" backend
  serves a smaller model namespace and returns **404 ModelNotFoundError** for
  `gemini-pro-latest` and `gemini-flash-latest`.
- **LIMITS.** OAuth "Gemini Code Assist for individuals" is capped per minute and
  per day. A billing-enabled API key is pay-as-you-go with far higher limits.

Two conditions must both hold:

- `~/.gemini/settings.json` → `security.auth.selectedType` is `"gemini-api-key"`.
  If it is anything else (e.g. `oauth-personal`), the CLI uses *that* method and
  **ignores the key**.
- `GEMINI_API_KEY` (or `GOOGLE_API_KEY`) is set in the environment the skill runs
  in. A non-interactive shell does **not** source `~/.zshrc`, so the export must
  live in `~/.zshenv`.

```bash
GEMINI_SETTINGS="$HOME/.gemini/settings.json"
SELECTED_TYPE=""
if [ -f "$GEMINI_SETTINGS" ]; then
  SELECTED_TYPE=$(python3 -c "
import json
d = json.load(open('$GEMINI_SETTINGS'))
print(d.get('security', {}).get('auth', {}).get('selectedType', ''))
" 2>/dev/null)
fi
echo "selectedType: ${SELECTED_TYPE:-unset}"

GEMINI_AUTH="missing"
[ -n "$GEMINI_API_KEY" ] && GEMINI_AUTH="env:GEMINI_API_KEY"
[ "$GEMINI_AUTH" = "missing" ] && [ -n "$GOOGLE_API_KEY" ] && GEMINI_AUTH="env:GOOGLE_API_KEY"
echo "GEMINI_AUTH: $GEMINI_AUTH"

if [ "$GEMINI_AUTH" = "missing" ]; then
  echo "BLOCKED: no API key in environment"
elif [ "$SELECTED_TYPE" != "gemini-api-key" ]; then
  echo "BLOCKED: selectedType is '${SELECTED_TYPE:-unset}', must be 'gemini-api-key'"
else
  echo "AUTH OK: api-key mode"
fi
```

Stop conditions. **Read [references/setup.md](references/setup.md) to resolve
either block below.** That file owns the one-time per-machine API-key setup.

- **`BLOCKED: no API key`** → No `GEMINI_API_KEY`/`GOOGLE_API_KEY` in the
  environment. The export sits in `~/.zshrc` (not loaded by non-interactive
  shells), or is not set at all. Tell the user:

  > No Gemini API key in the environment. Add `export GEMINI_API_KEY="your-key"`
  > to `~/.zshenv` (not `~/.zshrc`, which non-interactive shells do not source),
  > then open a new shell. Get a key at https://aistudio.google.com/apikey
  > (enable billing on the project for high/unlimited-style limits).

- **`BLOCKED: selectedType ... must be 'gemini-api-key'`** → The CLI is configured
  for OAuth/Vertex and will ignore the key. Tell the user:

  > `~/.gemini/settings.json` has `selectedType: <value>`. This skill needs
  > `gemini-api-key`. Set `security.auth.selectedType` to `"gemini-api-key"`.
  > Run the setup in `references/setup.md`.

---

## Step 0.6: Resolve paths

```bash
PLAN_ROOT="${CLAUDE_PLANS_DIR:-${CODEX_HOME:-$HOME/.claude}/plans}"
TMP_ROOT="${TMPDIR:-/tmp}"
mkdir -p "$PLAN_ROOT" "$TMP_ROOT"
```

---

## Step 1: Detect mode

Parse the user's input:

1. `/gemini review` or `/gemini review <instructions>` → **Review mode** (Step 2A)
2. `/gemini challenge` or `/gemini challenge <focus>` → **Challenge mode** (Step 2B)
3. `/gemini` with no arguments → **Auto-detect:** run the shared invocation
   contract below first, then:
   - Look for a diff against the base branch: `[ -s "$TMPDIFF" ]`.
   - If a diff exists, use the host's structured user-input tool to ask: Review / Challenge / Custom
     prompt. **Read [references/askuserquestion.md](references/askuserquestion.md)
     before that call.** That file owns the decision-brief format.
   - If no diff, check for a plan file scoped to the current project:
     `ls -t "$PLAN_ROOT"/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1`
   - Otherwise ask "What would you like to ask Gemini?"
4. `/gemini <anything else>` → **Consult mode** (Step 2C). The rest is the prompt.

While parsing, extract `--pro` / `--flash` and strip the flag from the prompt
text before forwarding. Extract `<instructions>` for Review and `<focus>` for
Challenge the same way.

---

From ptrandev/agent-skills, MIT.

More from ptrandev/agent-skills

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Sep 16, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ptrandev

Cite this page

gemini skill. Agent Mart. https://agentmart.dev/skills/ptrandev-gemini (last updated 2026-10-24)