From b7254bc42069a6040348ecfd1780e257a4a9f783 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:19:01 +0200 Subject: [PATCH 01/12] test: add MCP namespace regression guard (red) --- tests/mcp-namespace.bats | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/mcp-namespace.bats diff --git a/tests/mcp-namespace.bats b/tests/mcp-namespace.bats new file mode 100644 index 0000000..3662697 --- /dev/null +++ b/tests/mcp-namespace.bats @@ -0,0 +1,48 @@ +#!/usr/bin/env bats + +AGENTS_DIR="agents" +SKILLS_DIR="skills" + +extract_frontmatter() { + sed -n '/^---$/,/^---$/p' "$1" | sed '1d;$d' +} + +AGENTS=(gemini-validator gemini-challenger gemini-researcher gemini-summarizer gemini-reviewer) + +@test "no agent frontmatter declares a tools: key (agents inherit session tools incl. MCP)" { + for agent in "${AGENTS[@]}"; do + FM=$(extract_frontmatter "$AGENTS_DIR/${agent}.md") + if echo "$FM" | grep -qE "^tools:"; then + echo "FAIL: $agent still declares tools: in frontmatter (would exclude MCP tools)" + return 1 + fi + done +} + +@test "no agent file contains a hardcoded mcp__ full path" { + for agent in "${AGENTS[@]}"; do + if grep -qE "mcp__gemini__|mcp__plugin_" "$AGENTS_DIR/${agent}.md"; then + echo "FAIL: $agent contains a hardcoded mcp__ path; use short tool names" + return 1 + fi + done +} + +@test "no skill file contains a hardcoded mcp__ full path" { + for f in "$SKILLS_DIR"/*/SKILL.md; do + if grep -qE "mcp__gemini__|mcp__plugin_" "$f"; then + echo "FAIL: $f contains a hardcoded mcp__ path; use short tool names" + return 1 + fi + done +} + +@test "hook scripts contain no hardcoded mcp__ namespace" { + for f in hooks/*.sh hooks/lib/*.sh; do + [ -f "$f" ] || continue + if grep -qE "mcp__gemini__|mcp__plugin_" "$f"; then + echo "FAIL: $f contains a hardcoded mcp__ namespace" + return 1 + fi + done +} From e3f578fe39371a4f26ba485fba0b1721135512ce Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:19:56 +0200 Subject: [PATCH 02/12] fix: gemini-researcher inherits session MCP tools, fails loud when absent --- agents/gemini-researcher.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/agents/gemini-researcher.md b/agents/gemini-researcher.md index d633786..1cf0928 100644 --- a/agents/gemini-researcher.md +++ b/agents/gemini-researcher.md @@ -5,11 +5,6 @@ description: | live API docs, recent CVEs, library releases, or any claim that needs a primary source. Performs search-grounded research and deep research via Gemini. Never opines without a citation. Returns answer + citations. -tools: - - mcp__gemini__gemini_search_grounded - - mcp__gemini__gemini_start_research - - mcp__gemini__gemini_get_research_report - - Read model: sonnet color: green maxTurns: 12 @@ -25,18 +20,24 @@ You are gemini-researcher, a fact-finding agent powered by Google Gemini. Your r Never opine without a citation. Every claim in your answer must be traceable to a source URL. +## Tool availability (fail loud) + +Your search capability comes from a Gemini MCP tool inherited from the session (gemini_search_grounded, gemini_start_research, gemini_get_research_report). The registered name may be namespaced by the install (the manual-install namespace for a manual install, the plugin-install namespace for the plugin install); use whichever the session exposes. + +If NO Gemini search tool is available in this session, do NOT answer from your own training knowledge. Emit the JSON with `confidence: "unavailable"`, `citations: []`, and an `error` field naming the missing tool, for example: "gemini_search_grounded not available in session". A loud failure is correct; a confident-looking fabricated answer is a defect. + ## Workflow ### Quick Lookups (API docs, CVEs, recent releases) -1. Use mcp__gemini__gemini_search_grounded to search Google in real-time +1. Use the gemini_search_grounded MCP tool to search Google in real-time 2. Synthesize answer from returned snippets and citations 3. Return immediately with freshness = today's date ### Deep Synthesis (complex topics, 2+ sources) -1. Use mcp__gemini__gemini_start_research to trigger async deep research -2. Poll mcp__gemini__gemini_get_research_report until DONE +1. Use the gemini_start_research MCP tool to trigger async deep research +2. Poll gemini_get_research_report until DONE 3. Extract citations from the report 4. Return answer + citations + confidence level @@ -63,9 +64,10 @@ surrounding text, no code fences, no preamble, and no explanatory prose.** } ], "freshness": "YYYY-MM-DD", - "confidence": "high|medium|low", + "confidence": "high|medium|low|unavailable", "model": "search_grounded|deep_research", "method": "quick_lookup|deep_synthesis", + "error": "", "reasoning": "brief explanation of how the answer was derived" } ``` From b76e5119e58e5283dbda03d926b9d437d6fc718e Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:20:21 +0200 Subject: [PATCH 03/12] fix: gemini-validator inherits session MCP tools, fails loud when absent --- agents/gemini-validator.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/agents/gemini-validator.md b/agents/gemini-validator.md index 7a6a23f..1ed983a 100644 --- a/agents/gemini-validator.md +++ b/agents/gemini-validator.md @@ -5,12 +5,6 @@ description: | or before a destructive change. Validates the artifact against the original ask and flags gaps, hallucinations, and missed acceptance criteria. Returns structured JSON {verdict, gaps, hallucinations, next_actions}. -tools: - - mcp__gemini__gemini_generate - - mcp__gemini__gemini_search_grounded - - Read - - Grep - - Glob model: sonnet color: blue maxTurns: 6 @@ -26,10 +20,16 @@ You are gemini-validator, a precise skeptical reviewer powered by Google Gemini. 1. **Read the artifact**: Use Read/Grep/Glob to examine the proposed plan, diff, or claim 2. **Extract acceptance criteria**: Review the original ask for must-haves, scope boundaries, and non-goals -3. **Call Gemini for validation**: Use mcp__gemini__gemini_generate with a system instruction asking Gemini to act as a skeptical reviewer -4. **Verify claims**: For post-training-cutoff facts (e.g., "this API endpoint exists"), call mcp__gemini__gemini_search_grounded to validate +3. **Call Gemini for validation**: Use the gemini_generate MCP tool with a system instruction asking Gemini to act as a skeptical reviewer +4. **Verify claims**: For post-training-cutoff facts (e.g., "this API endpoint exists"), call gemini_search_grounded to validate 5. **Output structured JSON**: Return ONLY the validation result, never editorial commentary +## Tool availability (fail loud) + +Your validation capability uses Gemini MCP tools inherited from the session (gemini_generate, gemini_search_grounded). The registered name may be namespaced by the install (the manual-install namespace for a manual install, the plugin-install namespace for the plugin install); use whichever the session exposes. + +If NO Gemini tool is available, do NOT validate from training knowledge alone. Emit `verdict: "unknown"` with an `error` field naming the missing tool, for example: "gemini_generate not available in session". A loud failure is correct; a confident fabricated verdict is a defect. + ## Validation Rules - **verdict**: pass | fail | unknown @@ -59,7 +59,8 @@ is the verdict:" before the JSON. Do not wrap it in ```json fences. "verdict": "pass|fail|unknown", "gaps": [], "hallucinations": [], - "next_actions": [] + "next_actions": [], + "error": "" } ``` From 03abe2aa0efa2917e753a9cae01aa2798408480e Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:20:40 +0200 Subject: [PATCH 04/12] fix: gemini-challenger inherits session MCP tools, fails loud when absent --- agents/gemini-challenger.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/agents/gemini-challenger.md b/agents/gemini-challenger.md index 52409bd..de8fcdd 100644 --- a/agents/gemini-challenger.md +++ b/agents/gemini-challenger.md @@ -5,10 +5,6 @@ description: | choices, or when the main agent appears stuck in a pattern. Devil's advocate that argues at least 2 alternative approaches and 1 reason the current path is wrong. Returns structured JSON {alternatives, objections, must_address}. -tools: - - mcp__gemini__gemini_generate - - mcp__gemini__gemini_chat - - Read model: opus color: red maxTurns: 8 @@ -22,11 +18,17 @@ You are gemini-challenger, a constructive devil's advocate powered by Claude Son ## Workflow 1. **Understand the proposed approach**: Read the plan, architecture diagram, or destructive operation being considered -2. **Brainstorm alternatives**: Use mcp__gemini__gemini_generate to ask Gemini to brainstorm at least 2 fundamentally different approaches that achieve the same goal +2. **Brainstorm alternatives**: Use the gemini_generate MCP tool to ask Gemini to brainstorm at least 2 fundamentally different approaches that achieve the same goal 3. **Articulate objections**: Identify 1-3 reasons the current path may be wrong: unforeseen maintenance burden, scalability cliff, security flaw, over-engineering, tech-debt accumulation 4. **Assess risk of status quo**: Determine if the current approach is risky enough to warrant blocking (only for destructive ops with clearly safer alternatives) 5. **Output structured JSON**: Return verdict + alternatives + objections, no editorializing +## Tool availability (fail loud) + +Your challenge capability uses Gemini MCP tools inherited from the session (gemini_generate, gemini_chat). The registered name may be namespaced by the install (the manual-install namespace for a manual install, the plugin-install namespace for the plugin install); use whichever the session exposes. + +If NO Gemini tool is available, do NOT invent alternatives from training knowledge. Emit `verdict: "pass"` (non-blocking) with a single `must_address` entry "Gemini was unavailable; challenge not performed" and an `error` field naming the missing tool. A loud failure is correct; a fabricated challenge is a defect. + ## Verdict Rules - **pass**: current approach is reasonable; alternatives exist but carry their own trade-offs @@ -63,7 +65,8 @@ so any non-JSON content breaks the contract. "must_address": [ "question the main agent must answer before proceeding", "assumption that needs validation" - ] + ], + "error": "" } ``` From a5ead5c2c7a81a627a95be4ed53158b9b173d758 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:20:56 +0200 Subject: [PATCH 05/12] fix: gemini-summarizer inherits session MCP tools, fails loud when absent --- agents/gemini-summarizer.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/agents/gemini-summarizer.md b/agents/gemini-summarizer.md index 0b3c0b3..97e9c9f 100644 --- a/agents/gemini-summarizer.md +++ b/agents/gemini-summarizer.md @@ -5,10 +5,6 @@ description: | compaction (SUMMARIZE_SESSION_STATE). Compresses session history into structured summaries preserving decisions, discarded alternatives, and unresolved debt. Writes risk maps for new repositories. -tools: - - mcp__gemini__gemini_generate - - Read - - Glob model: opus color: purple maxTurns: 4 @@ -22,6 +18,12 @@ You are gemini-summarizer, a session compression and risk analysis agent powered ## Two Modes +## Tool availability (fail loud) + +Your synthesis uses the gemini_generate MCP tool inherited from the session. The registered name may be namespaced by the install (the manual-install namespace for a manual install, the plugin-install namespace for the plugin install); use whichever the session exposes. + +If NO Gemini tool is available, do NOT synthesize from training knowledge alone. Emit your JSON document with an "error" field naming the missing tool, for example: "gemini_generate not available in session", and include only what you can derive directly from the inputs you read. A loud failure is correct; a fabricated summary is a defect. + ### Mode 1: BUILD_RISK_MAP Called at project initialization. Analyzes repository structure and codebase to identify zones of high fragility, missing test coverage, and complex state management. @@ -34,7 +36,7 @@ Called at project initialization. Analyzes repository structure and codebase to 1. Use Glob to catalog directory structure 2. Use Read on package.json, go.mod, requirements.txt, or equivalent to understand dependencies 3. Use Read on key source files to identify circular dependencies, state machines, or complex logic -4. Call mcp__gemini__gemini_generate to analyze fragility patterns +4. Call the gemini_generate MCP tool to analyze fragility patterns 5. Output risk map **Output (JSON only):** @@ -80,7 +82,7 @@ Called before context compaction or session end. Compresses session transcript i 2. Identify paths explored but abandoned (why rejected) 3. Catalog unresolved work, tech debt, or follow-ups 4. Identify modified files and categorize by risk -5. Call mcp__gemini__gemini_generate to synthesize next-session implications +5. Call gemini_generate to synthesize next-session implications **Output (JSON only):** From e25039f34a8f1cd3a4990db26415cbf0190b0ea0 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:21:24 +0200 Subject: [PATCH 06/12] fix: gemini-reviewer inherits session MCP tools, fails loud when absent --- agents/gemini-reviewer.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/agents/gemini-reviewer.md b/agents/gemini-reviewer.md index d17ee14..5ecbb59 100644 --- a/agents/gemini-reviewer.md +++ b/agents/gemini-reviewer.md @@ -7,13 +7,6 @@ description: | research (use gemini-researcher), claim validation (use gemini-validator), or devil's-advocate brainstorming (use gemini-challenger). Returns structured JSON {verdict, strengths, issues, next_actions}. -tools: - - mcp__gemini__gemini_chat - - mcp__gemini__gemini_search_grounded - - Read - - Grep - - Glob - - Bash model: sonnet color: cyan maxTurns: 10 @@ -37,15 +30,21 @@ You have 10 turns. Budget them: names files or a path instead, Read those directly. 2. **Turn 3-4: Read for context.** Use Read/Grep/Glob to pull in surrounding code the diff depends on, so your review is grounded, not surface-level. -3. **Turn 5-7: Call Gemini once.** Call mcp__gemini__gemini_chat with the diff +3. **Turn 5-7: Call Gemini once.** Call the gemini_chat MCP tool with the diff content and ask for a review focused ONLY on: security, threading correctness, library/version drift, doc accuracy, dead code, complexity. 4. **Turn 8 (optional): Verify a version fact.** If and only if a finding hinges on a version-specific or post-cutoff fact, call - mcp__gemini__gemini_search_grounded ONCE to confirm it. + gemini_search_grounded ONCE to confirm it. 5. **Turn 9: Synthesize.** Draft the JSON verdict. 6. **Turn 10: Emit ONLY the JSON** (no other content in this turn). +## Tool availability (fail loud) + +Your review capability uses Gemini MCP tools inherited from the session (gemini_chat, gemini_search_grounded). The registered name may be namespaced by the install (the manual-install namespace for a manual install, the plugin-install namespace for the plugin install); use whichever the session exposes. + +If NO Gemini tool is available, do NOT review from training knowledge alone. Emit `verdict: "unknown"` with an `error` field naming the missing tool, for example: "gemini_chat not available in session". A loud failure is correct; a fabricated review is a defect. + ## What you are NOT - You are NOT gemini-validator. You do not validate a plan or a done-claim @@ -68,8 +67,8 @@ more concrete, recent (post-2024) citation. ## Cap -At most ONE mcp__gemini__gemini_chat call and at most ONE -mcp__gemini__gemini_search_grounded call per dispatch, unless the brief +At most ONE gemini_chat call and at most ONE +gemini_search_grounded call per dispatch, unless the brief explicitly authorizes more. Latency and token cost matter. ## Output Format @@ -90,7 +89,8 @@ the JSON. Do not wrap it in ```json fences. "important": [], "minor": [] }, - "next_actions": [] + "next_actions": [], + "error": "" } - **approved**: no critical or important issues; merge is safe. From e85bb74fa2a21ad0fa8a6a84ff380fa737ce2bbd Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:21:36 +0200 Subject: [PATCH 07/12] test: drop frontmatter MCP-tool assertions after tools: removal --- tests/agents.bats | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/agents.bats b/tests/agents.bats index 8e50268..c1e4082 100755 --- a/tests/agents.bats +++ b/tests/agents.bats @@ -21,7 +21,6 @@ extract_frontmatter() { echo "$FM" | grep -q "^model: sonnet" echo "$FM" | grep -q "^color: blue" echo "$FM" | grep -q "^maxTurns: 6" - echo "$FM" | grep -q "mcp__gemini__gemini_generate" } @test "gemini-challenger has required frontmatter fields" { @@ -57,7 +56,6 @@ extract_frontmatter() { echo "$FM" | grep -q "^model: sonnet" echo "$FM" | grep -q "^color: cyan" echo "$FM" | grep -q "^maxTurns: 10" - echo "$FM" | grep -q "mcp__gemini__gemini_chat" } @test "all agents preload gemini-when-to-use skill" { From d6b33ab6b5705f1ab120ac697f91f97da6d67e4d Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:24:44 +0200 Subject: [PATCH 08/12] fix: use namespace-agnostic short tool names in capability skills --- skills/gemini-audio-tts-music/SKILL.md | 14 +++++++------- skills/gemini-chat-and-reason/SKILL.md | 14 +++++++------- skills/gemini-code-exec/SKILL.md | 8 ++++---- skills/gemini-file-analysis/SKILL.md | 10 +++++----- skills/gemini-image-gen/SKILL.md | 12 ++++++------ skills/gemini-research-grounded/SKILL.md | 16 ++++++++-------- skills/gemini-video-gen/SKILL.md | 12 ++++++------ 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/skills/gemini-audio-tts-music/SKILL.md b/skills/gemini-audio-tts-music/SKILL.md index 8ceb4ad..bff46a5 100644 --- a/skills/gemini-audio-tts-music/SKILL.md +++ b/skills/gemini-audio-tts-music/SKILL.md @@ -19,15 +19,15 @@ Use this skill to generate audio assets: background music via Lyria 3 or synthes | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_generate_music` | Generate music using Lyria 3 | -| `mcp__gemini__gemini_tts` | Synthesize speech (single or multi-speaker) using Gemini TTS | +| `gemini_generate_music` | Generate music using Lyria 3 | +| `gemini_tts` | Synthesize speech (single or multi-speaker) using Gemini TTS | ## Choosing between music and TTS | Need | Tool | |---|---| -| Background music, jingle, ambient track, sound effect | `mcp__gemini__gemini_generate_music` | -| Narration, voiceover, spoken explanation, dialogue | `mcp__gemini__gemini_tts` | +| Background music, jingle, ambient track, sound effect | `gemini_generate_music` | +| Narration, voiceover, spoken explanation, dialogue | `gemini_tts` | ## Usage pattern @@ -35,7 +35,7 @@ Use this skill to generate audio assets: background music via Lyria 3 or synthes ```json { - "tool": "mcp__gemini__gemini_generate_music", + "tool": "gemini_generate_music", "arguments": { "prompt": "Upbeat, modern corporate background music. Light percussion, synthesizer melody, energetic but not distracting. Suitable for a product demo video.", "duration_seconds": 30 @@ -47,7 +47,7 @@ Use this skill to generate audio assets: background music via Lyria 3 or synthes ```json { - "tool": "mcp__gemini__gemini_tts", + "tool": "gemini_tts", "arguments": { "text": "Welcome to the Gemini plugin for Claude Code. This tool gives Claude the ability to consult Google's Gemini models for research, code review, image generation, and more.", "voice": "en-US-Standard-D", @@ -60,7 +60,7 @@ Use this skill to generate audio assets: background music via Lyria 3 or synthes ```json { - "tool": "mcp__gemini__gemini_tts", + "tool": "gemini_tts", "arguments": { "turns": [ { "speaker": "Host", "voice": "en-US-Standard-F", "text": "So, what makes this plugin different from just calling the Gemini API directly?" }, diff --git a/skills/gemini-chat-and-reason/SKILL.md b/skills/gemini-chat-and-reason/SKILL.md index 30a8669..60e5f2a 100644 --- a/skills/gemini-chat-and-reason/SKILL.md +++ b/skills/gemini-chat-and-reason/SKILL.md @@ -18,8 +18,8 @@ Use this skill when you want Gemini to serve as a reasoning partner: reviewing c | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_generate` | Single-shot text generation, best for one-off questions or reviews | -| `mcp__gemini__gemini_chat` | Multi-turn conversation, best for iterative critique or dialogue | +| `gemini_generate` | Single-shot text generation, best for one-off questions or reviews | +| `gemini_chat` | Multi-turn conversation, best for iterative critique or dialogue | ## Model selection guidance @@ -29,11 +29,11 @@ Use this skill when you want Gemini to serve as a reasoning partner: reviewing c ## Usage pattern -### Single-shot review with `mcp__gemini__gemini_generate` +### Single-shot review with `gemini_generate` ```json { - "tool": "mcp__gemini__gemini_generate", + "tool": "gemini_generate", "arguments": { "prompt": "Review the following Go function for correctness, error handling, and idiomatic style:\n\n```go\n\n```", "model": "gemini-2.5-flash" @@ -41,13 +41,13 @@ Use this skill when you want Gemini to serve as a reasoning partner: reviewing c } ``` -### Multi-turn design critique with `mcp__gemini__gemini_chat` +### Multi-turn design critique with `gemini_chat` Start a session, then send follow-up messages in the same `session_id`: ```json { - "tool": "mcp__gemini__gemini_chat", + "tool": "gemini_chat", "arguments": { "message": "I am designing a REST API for a payment service. Here is the proposed endpoint structure:
. What are the biggest risks?", "session_id": "payment-api-review" @@ -59,7 +59,7 @@ Follow-up turn: ```json { - "tool": "mcp__gemini__gemini_chat", + "tool": "gemini_chat", "arguments": { "message": "Good points. If we add idempotency keys, does that address the double-charge risk?", "session_id": "payment-api-review" diff --git a/skills/gemini-code-exec/SKILL.md b/skills/gemini-code-exec/SKILL.md index 12e7646..903598e 100644 --- a/skills/gemini-code-exec/SKILL.md +++ b/skills/gemini-code-exec/SKILL.md @@ -19,7 +19,7 @@ Use this skill to run Python code inside Gemini's isolated sandbox. This gives y | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_code_execute` | Submit Python code for execution in Gemini's sandbox and receive stdout, stderr, and the return value | +| `gemini_code_execute` | Submit Python code for execution in Gemini's sandbox and receive stdout, stderr, and the return value | ## Usage pattern @@ -27,7 +27,7 @@ Use this skill to run Python code inside Gemini's isolated sandbox. This gives y ```json { - "tool": "mcp__gemini__gemini_code_execute", + "tool": "gemini_code_execute", "arguments": { "code": "import math\n\ndef compound_interest(principal, rate, periods):\n return principal * (1 + rate) ** periods\n\nresult = compound_interest(1000, 0.05, 10)\nprint(f'After 10 years: {result:.2f}')" } @@ -38,7 +38,7 @@ Use this skill to run Python code inside Gemini's isolated sandbox. This gives y ```json { - "tool": "mcp__gemini__gemini_code_execute", + "tool": "gemini_code_execute", "arguments": { "code": "import re\n\npattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$'\ntest_cases = ['user@example.com', 'bad-email', 'user@.com', 'a@b.co']\nfor case in test_cases:\n match = bool(re.match(pattern, case))\n print(f'{case!r}: {match}')" } @@ -49,7 +49,7 @@ Use this skill to run Python code inside Gemini's isolated sandbox. This gives y ```json { - "tool": "mcp__gemini__gemini_code_execute", + "tool": "gemini_code_execute", "arguments": { "code": "def longest_common_subsequence(s1, s2):\n m, n = len(s1), len(s2)\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n if s1[i-1] == s2[j-1]:\n dp[i][j] = dp[i-1][j-1] + 1\n else:\n dp[i][j] = max(dp[i-1][j], dp[i][j-1])\n return dp[m][n]\n\nprint(longest_common_subsequence('ABCBDAB', 'BDCAB')) # Expected: 4" } diff --git a/skills/gemini-file-analysis/SKILL.md b/skills/gemini-file-analysis/SKILL.md index 30ca052..fef452d 100644 --- a/skills/gemini-file-analysis/SKILL.md +++ b/skills/gemini-file-analysis/SKILL.md @@ -19,7 +19,7 @@ Use this skill to send files to Gemini for multi-modal analysis. Gemini can read | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_analyze_file` | Upload a file and run a prompt against its contents | +| `gemini_analyze_file` | Upload a file and run a prompt against its contents | ## Usage pattern @@ -27,7 +27,7 @@ Use this skill to send files to Gemini for multi-modal analysis. Gemini can read ```json { - "tool": "mcp__gemini__gemini_analyze_file", + "tool": "gemini_analyze_file", "arguments": { "file_path": "/path/to/architecture-decision-record.pdf", "prompt": "Summarize the key architectural decisions and list any open questions." @@ -39,7 +39,7 @@ Use this skill to send files to Gemini for multi-modal analysis. Gemini can read ```json { - "tool": "mcp__gemini__gemini_analyze_file", + "tool": "gemini_analyze_file", "arguments": { "file_path": "/path/to/error-screenshot.png", "prompt": "What error is shown and what are the most likely root causes?" @@ -51,7 +51,7 @@ Use this skill to send files to Gemini for multi-modal analysis. Gemini can read ```json { - "tool": "mcp__gemini__gemini_analyze_file", + "tool": "gemini_analyze_file", "arguments": { "file_path": "/path/to/meeting-recording.mp3", "prompt": "Transcribe the key action items and decisions from this meeting." @@ -63,7 +63,7 @@ Use this skill to send files to Gemini for multi-modal analysis. Gemini can read ```json { - "tool": "mcp__gemini__gemini_analyze_file", + "tool": "gemini_analyze_file", "arguments": { "file_path": "/path/to/large-codebase.tar.gz", "prompt": "Identify the main modules, entry points, and any obvious code quality issues." diff --git a/skills/gemini-image-gen/SKILL.md b/skills/gemini-image-gen/SKILL.md index 2974926..0f84dce 100644 --- a/skills/gemini-image-gen/SKILL.md +++ b/skills/gemini-image-gen/SKILL.md @@ -19,15 +19,15 @@ Use this skill to generate images via Gemini's native image generation capabilit | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_generate_image` | Gemini native image generation (Nano Banana model, fast, conversational quality) | -| `mcp__gemini__gemini_generate_image_imagen` | Imagen 4 (higher fidelity, better photorealism and typography, slightly slower) | +| `gemini_generate_image` | Gemini native image generation (Nano Banana model, fast, conversational quality) | +| `gemini_generate_image_imagen` | Imagen 4 (higher fidelity, better photorealism and typography, slightly slower) | ## Choosing between the two tools | Need | Tool | |---|---| -| Quick prototyping, iterative concepts, low cost | `mcp__gemini__gemini_generate_image` | -| High-fidelity output, photorealistic, sharp text in image | `mcp__gemini__gemini_generate_image_imagen` | +| Quick prototyping, iterative concepts, low cost | `gemini_generate_image` | +| High-fidelity output, photorealistic, sharp text in image | `gemini_generate_image_imagen` | ## Usage pattern @@ -35,7 +35,7 @@ Use this skill to generate images via Gemini's native image generation capabilit ```json { - "tool": "mcp__gemini__gemini_generate_image", + "tool": "gemini_generate_image", "arguments": { "prompt": "A minimal dashboard UI showing a line chart, three KPI cards, and a sidebar navigation. Clean, modern, dark mode, flat design.", "aspect_ratio": "16:9" @@ -47,7 +47,7 @@ Use this skill to generate images via Gemini's native image generation capabilit ```json { - "tool": "mcp__gemini__gemini_generate_image_imagen", + "tool": "gemini_generate_image_imagen", "arguments": { "prompt": "A sleek mobile app screenshot showing a fitness tracking screen with a circular progress ring, step count, and heart rate graph. iOS-style, white background, soft shadows.", "aspect_ratio": "9:16", diff --git a/skills/gemini-research-grounded/SKILL.md b/skills/gemini-research-grounded/SKILL.md index faf7452..f8cfcac 100644 --- a/skills/gemini-research-grounded/SKILL.md +++ b/skills/gemini-research-grounded/SKILL.md @@ -20,16 +20,16 @@ Use this skill whenever the answer depends on information that may have changed | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_search_grounded` | Fast, single-shot search-grounded answer with citations | -| `mcp__gemini__gemini_start_research` | Kick off an async deep research job (returns a job ID) | -| `mcp__gemini__gemini_get_research_report` | Poll for and retrieve the completed deep research report | +| `gemini_search_grounded` | Fast, single-shot search-grounded answer with citations | +| `gemini_start_research` | Kick off an async deep research job (returns a job ID) | +| `gemini_get_research_report` | Poll for and retrieve the completed deep research report | ## Choosing between fast search and deep research | Scenario | Tool | |---|---| -| A single fact, version, or advisory | `mcp__gemini__gemini_search_grounded` | -| A broad technical survey or multi-source synthesis | `mcp__gemini__gemini_start_research` + `mcp__gemini__gemini_get_research_report` | +| A single fact, version, or advisory | `gemini_search_grounded` | +| A broad technical survey or multi-source synthesis | `gemini_start_research` + `gemini_get_research_report` | Deep research is asynchronous and may take 30-120 seconds. Use it only when breadth and synthesis matter more than speed. @@ -39,7 +39,7 @@ Deep research is asynchronous and may take 30-120 seconds. Use it only when brea ```json { - "tool": "mcp__gemini__gemini_search_grounded", + "tool": "gemini_search_grounded", "arguments": { "query": "Latest stable release of Kubernetes and its release date", "model": "gemini-2.5-flash" @@ -55,7 +55,7 @@ Step 1: start the job. ```json { - "tool": "mcp__gemini__gemini_start_research", + "tool": "gemini_start_research", "arguments": { "topic": "Best practices for zero-downtime database migrations in PostgreSQL 16", "depth": "comprehensive" @@ -67,7 +67,7 @@ Step 2: retrieve the report once the job is complete (poll until status is `done ```json { - "tool": "mcp__gemini__gemini_get_research_report", + "tool": "gemini_get_research_report", "arguments": { "job_id": "" } diff --git a/skills/gemini-video-gen/SKILL.md b/skills/gemini-video-gen/SKILL.md index 99c633b..c1deb21 100644 --- a/skills/gemini-video-gen/SKILL.md +++ b/skills/gemini-video-gen/SKILL.md @@ -18,16 +18,16 @@ Use this skill to generate short video clips powered by Google Veo 3.1. Video ge | Tool | Purpose | |---|---| -| `mcp__gemini__gemini_start_video` | Submit a video generation request; returns a job ID | -| `mcp__gemini__gemini_get_video` | Poll for job status and retrieve the completed MP4 when done | +| `gemini_start_video` | Submit a video generation request; returns a job ID | +| `gemini_get_video` | Poll for job status and retrieve the completed MP4 when done | ## Async start+poll pattern Video generation with Veo 3.1 is not instant. The typical workflow is: -1. Call `mcp__gemini__gemini_start_video` with a prompt. Receive a `job_id`. +1. Call `gemini_start_video` with a prompt. Receive a `job_id`. 2. Wait a few seconds (Veo 3.1 typically takes 20-90 seconds for short clips). -3. Call `mcp__gemini__gemini_get_video` with the `job_id`. If status is `processing`, wait and retry. If status is `done`, retrieve the output file path. +3. Call `gemini_get_video` with the `job_id`. If status is `processing`, wait and retry. If status is `done`, retrieve the output file path. Do NOT spin-poll aggressively. Wait at least 10 seconds between poll attempts. @@ -37,7 +37,7 @@ Do NOT spin-poll aggressively. Wait at least 10 seconds between poll attempts. ```json { - "tool": "mcp__gemini__gemini_start_video", + "tool": "gemini_start_video", "arguments": { "prompt": "A mobile phone screen showing a recipe app. The user scrolls through a list of recipes, taps on 'Spaghetti Bolognese', and the detail screen slides in smoothly. Clean, modern UI, soft lighting.", "duration_seconds": 5, @@ -52,7 +52,7 @@ Response example: `{ "job_id": "veo-abc123", "status": "processing" }` ```json { - "tool": "mcp__gemini__gemini_get_video", + "tool": "gemini_get_video", "arguments": { "job_id": "veo-abc123" } From d39c62938858a3eed101fdc567717c7d4a489ed7 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:25:07 +0200 Subject: [PATCH 09/12] test: assert capability skills reference tools by short name --- tests/skills.bats | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/skills.bats b/tests/skills.bats index 8ae99a2..53fd3f2 100644 --- a/tests/skills.bats +++ b/tests/skills.bats @@ -37,14 +37,14 @@ EXPECTED_SKILLS=( grep -q "Master router" "$SKILLS_DIR/gemini-when-to-use/SKILL.md" } -@test "capability skills reference specific MCP tools" { - grep -q "mcp__gemini__gemini_generate" "$SKILLS_DIR/gemini-chat-and-reason/SKILL.md" - grep -q "mcp__gemini__gemini_search_grounded" "$SKILLS_DIR/gemini-research-grounded/SKILL.md" - grep -q "mcp__gemini__gemini_analyze_file" "$SKILLS_DIR/gemini-file-analysis/SKILL.md" - grep -q "mcp__gemini__gemini_code_execute" "$SKILLS_DIR/gemini-code-exec/SKILL.md" - grep -q "mcp__gemini__gemini_generate_image" "$SKILLS_DIR/gemini-image-gen/SKILL.md" - grep -q "mcp__gemini__gemini_start_video" "$SKILLS_DIR/gemini-video-gen/SKILL.md" - grep -q "mcp__gemini__gemini_generate_music" "$SKILLS_DIR/gemini-audio-tts-music/SKILL.md" +@test "capability skills reference specific MCP tools (by short name)" { + grep -q "gemini_generate" "$SKILLS_DIR/gemini-chat-and-reason/SKILL.md" + grep -q "gemini_search_grounded" "$SKILLS_DIR/gemini-research-grounded/SKILL.md" + grep -q "gemini_analyze_file" "$SKILLS_DIR/gemini-file-analysis/SKILL.md" + grep -q "gemini_code_execute" "$SKILLS_DIR/gemini-code-exec/SKILL.md" + grep -q "gemini_generate_image" "$SKILLS_DIR/gemini-image-gen/SKILL.md" + grep -q "gemini_start_video" "$SKILLS_DIR/gemini-video-gen/SKILL.md" + grep -q "gemini_generate_music" "$SKILLS_DIR/gemini-audio-tts-music/SKILL.md" } @test "no skill has disallowed frontmatter fields for plugin skills" { From 3e4ec8eb8979d76ccb56d1cad7f39f61c1a21ca6 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:25:27 +0200 Subject: [PATCH 10/12] docs: namespace-agnostic tool names and inheritance/fail-loud note --- docs/reference/skills.md | 26 +++++++++++++------------- docs/reference/subagents.md | 22 ++++++++++++---------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/docs/reference/skills.md b/docs/reference/skills.md index 1710a4e..c359ab7 100644 --- a/docs/reference/skills.md +++ b/docs/reference/skills.md @@ -41,8 +41,8 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Get a second opinion from Gemini via text generation or multi-turn chat. **MCP tools:** -- `mcp__gemini__gemini_generate` (single-turn, stateless, cheapest) -- `mcp__gemini__gemini_chat` (multi-turn, retains session context) +- `gemini_generate` (single-turn, stateless, cheapest) +- `gemini_chat` (multi-turn, retains session context) **Use for:** Code review, design critique, sanity-checking before commit, architectural debates. @@ -53,9 +53,9 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Live-web research with citations for post-training-cutoff information. **MCP tools:** -- `mcp__gemini__gemini_search_grounded` (quick, 2-5s) -- `mcp__gemini__gemini_start_research` (deep, 30-120s) -- `mcp__gemini__gemini_get_research_report` (polls deep research) +- `gemini_search_grounded` (quick, 2-5s) +- `gemini_start_research` (deep, 30-120s) +- `gemini_get_research_report` (polls deep research) **Use for:** Library versions, API docs, CVEs, pricing, current best practices. @@ -66,7 +66,7 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Multi-modal file Q&A for PDFs, images, audio, video, and large source files. **MCP tools:** -- `mcp__gemini__gemini_analyze_file` +- `gemini_analyze_file` **Use for:** Files too large for Claude's context, non-text formats (PDFs, screenshots, audio recordings, video demos). @@ -77,7 +77,7 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Run Python in Gemini's sandbox for computational verification. **MCP tools:** -- `mcp__gemini__gemini_code_execute` +- `gemini_code_execute` **Use for:** Verifying math, testing regex patterns, validating algorithms, checking date calculations. @@ -88,8 +88,8 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Generate images using native Gemini generation or Imagen 4. **MCP tools:** -- `mcp__gemini__gemini_generate_image` (Nano Banana, fast iteration) -- `mcp__gemini__gemini_generate_image_imagen` (Imagen 4, premium quality) +- `gemini_generate_image` (Nano Banana, fast iteration) +- `gemini_generate_image_imagen` (Imagen 4, premium quality) **Use for:** UI mockups, hero images, product shots, infographic frames. @@ -100,8 +100,8 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Async video generation using Veo 3.1 (start + poll pattern). **MCP tools:** -- `mcp__gemini__gemini_start_video` (returns operation_id) -- `mcp__gemini__gemini_get_video` (polls until done, returns MP4 path) +- `gemini_start_video` (returns operation_id) +- `gemini_get_video` (polls until done, returns MP4 path) **Use for:** Product demos, B-roll, short animations. Takes 30s to a few minutes. @@ -112,7 +112,7 @@ The plugin ships 9 task-oriented skills. Skills tell Claude WHEN to reach for Ge **Description:** Music generation (Lyria 3) and text-to-speech (single or multi-speaker). **MCP tools:** -- `mcp__gemini__gemini_generate_music` (Lyria 3) -- `mcp__gemini__gemini_tts` (Gemini TTS, multi-speaker capable) +- `gemini_generate_music` (Lyria 3) +- `gemini_tts` (Gemini TTS, multi-speaker capable) **Use for:** Soundtracks, voiceovers, narration, notification sounds, audio branding. diff --git a/docs/reference/subagents.md b/docs/reference/subagents.md index 7367351..5e629a1 100644 --- a/docs/reference/subagents.md +++ b/docs/reference/subagents.md @@ -12,6 +12,8 @@ The plugin ships 5 specialized subagents. Each has a focused role, restricted to | gemini-summarizer | opus | high | 4 | project | purple | false | | gemini-reviewer | sonnet | medium | 10 | (none) | cyan | false | +Subagents do not declare a `tools:` allowlist; they inherit the session's tools, including the Gemini MCP tools, under whatever namespace the install registers (the manual-install namespace or the plugin-install namespace). If no Gemini tool is present, each agent fails loud (verdict `unknown` or, for the researcher, confidence `unavailable`) with an `error` field, rather than answering from training data. + All subagents preload the `gemini-when-to-use` skill via the `skills:` frontmatter field. ## gemini-validator @@ -19,8 +21,8 @@ All subagents preload the `gemini-when-to-use` skill via the `skills:` frontmatt **Role:** Validates plans, diffs, and "done" claims against the original ask. Flags gaps, hallucinations, and missed acceptance criteria. **Tools:** -- `mcp__gemini__gemini_generate` -- `mcp__gemini__gemini_search_grounded` +- `gemini_generate` +- `gemini_search_grounded` - Read, Grep, Glob **Output schema:** @@ -46,8 +48,8 @@ All subagents preload the `gemini-when-to-use` skill via the `skills:` frontmatt **Role:** Devil's advocate. Argues at least 2 alternative approaches and 1 reason the current path is wrong. **Tools:** -- `mcp__gemini__gemini_generate` -- `mcp__gemini__gemini_chat` +- `gemini_generate` +- `gemini_chat` - Read **Output schema:** @@ -77,9 +79,9 @@ All subagents preload the `gemini-when-to-use` skill via the `skills:` frontmatt **Role:** Fact-finding with citations. Never asserts a fact without a URL source. **Tools:** -- `mcp__gemini__gemini_search_grounded` -- `mcp__gemini__gemini_start_research` -- `mcp__gemini__gemini_get_research_report` +- `gemini_search_grounded` +- `gemini_start_research` +- `gemini_get_research_report` - Read **Output schema:** @@ -112,7 +114,7 @@ All subagents preload the `gemini-when-to-use` skill via the `skills:` frontmatt **Role:** Compresses session state and writes risk maps. Two task modes. **Tools:** -- `mcp__gemini__gemini_generate` +- `gemini_generate` - Read, Glob **Task: BUILD_RISK_MAP** @@ -159,8 +161,8 @@ Output schema: **Role:** Generalist third-reviewer for diffs/PRs: security, threading correctness, library/version drift, doc accuracy, dead code, complexity. Covers concerns the other four agents do not own. **Tools:** -- `mcp__gemini__gemini_chat` -- `mcp__gemini__gemini_search_grounded` +- `gemini_chat` +- `gemini_search_grounded` - Read, Grep, Glob, Bash **Output schema:** From 3e7fb2eae545b1367af7d8eae8a29081850c8ee9 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:25:51 +0200 Subject: [PATCH 11/12] chore: release v0.4.1 (MCP namespace fix + fail-loud agents) --- .claude-plugin/plugin.json | 2 +- CHANGELOG.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 34d51b3..4ee3f5a 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "gemini-plugin", "displayName": "Gemini Plugin", - "version": "0.4.0", + "version": "0.4.1", "description": "Wraps gemini-mcp into a Claude Code plugin so Gemini acts as a second opinion: validator/challenger/researcher/summarizer/reviewer subagents, auto-trigger hooks, and 9 task-oriented skills.", "author": { "name": "azmym" }, "homepage": "https://github.com/azmym/gemini-plugin", diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f0899..42bdd4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to gemini-plugin are documented here. The format follows [Ke ## [Unreleased] +## [0.4.1] - 2026-05-29 + +### Fixed + +- **Agents could not call Gemini when installed as a plugin.** Plugin-registered MCP servers are namespaced under the plugin (the tool names carry a plugin prefix), but every agent's `tools:` allowlist named the bare un-prefixed form, which does not exist in a plugin session. An agent whose allowlist names only nonexistent tools gets zero Gemini tools and silently falls back to training data (observed: gemini-researcher returned empty citations, low confidence, and a wrong answer). Fixed by removing the `tools:` block from all five agents so they inherit the session's Gemini tools under whatever namespace is registered (works for both plugin and manual installs). Prose and reference docs now use namespace-agnostic short tool names. +- **Agents no longer fabricate when Gemini is unavailable.** Each agent now fails loud: if no Gemini MCP tool is present in the session, it returns `verdict: "unknown"` (researcher: `confidence: "unavailable"`) with an `error` field naming the missing tool, instead of answering from training knowledge. + +### Added + +- `tests/mcp-namespace.bats` regression guard: forbids a `tools:` key in agent frontmatter and any hardcoded plugin/server MCP namespace path in agents, skills, and hook scripts. + ## [0.4.0] - 2026-05-29 ### Added From d9c11726f54747a822fc175f3c27a1419ceca819 Mon Sep 17 00:00:00 2001 From: azmym Date: Fri, 29 May 2026 17:29:00 +0200 Subject: [PATCH 12/12] docs: place summarizer fail-loud section above Two Modes --- agents/gemini-summarizer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/gemini-summarizer.md b/agents/gemini-summarizer.md index 97e9c9f..0434f05 100644 --- a/agents/gemini-summarizer.md +++ b/agents/gemini-summarizer.md @@ -16,14 +16,14 @@ skills: You are gemini-summarizer, a session compression and risk analysis agent powered by Claude Sonnet. Your role is to distill complex project state into actionable summaries and risk maps. -## Two Modes - ## Tool availability (fail loud) Your synthesis uses the gemini_generate MCP tool inherited from the session. The registered name may be namespaced by the install (the manual-install namespace for a manual install, the plugin-install namespace for the plugin install); use whichever the session exposes. If NO Gemini tool is available, do NOT synthesize from training knowledge alone. Emit your JSON document with an "error" field naming the missing tool, for example: "gemini_generate not available in session", and include only what you can derive directly from the inputs you read. A loud failure is correct; a fabricated summary is a defect. +## Two Modes + ### Mode 1: BUILD_RISK_MAP Called at project initialization. Analyzes repository structure and codebase to identify zones of high fragility, missing test coverage, and complex state management.