Skip to content

Optimize skills for MCP + Skill combo (96.3% eval pass rate)#24

Merged
treyn-create merged 5 commits intogoogle-gemini:mainfrom
treyn-create:mcp-optimized-skill
Mar 27, 2026
Merged

Optimize skills for MCP + Skill combo (96.3% eval pass rate)#24
treyn-create merged 5 commits intogoogle-gemini:mainfrom
treyn-create:mcp-optimized-skill

Conversation

@treyn-create
Copy link
Copy Markdown
Collaborator

@treyn-create treyn-create commented Mar 19, 2026

  • Add 'Critical Rules' section at top with SDK/model deprecation warnings
  • Add 'Documentation Lookup' section with MCP-first instructions
  • Add 'Behavior Guidelines' section to prevent over-research
  • Restructure for clearer visual hierarchy with dividers

Evaluation results (gemini-3.1-flash-lite):

  • Vanilla: 7.7% pass rate
  • MCP Only: 72.6% pass rate
  • Skill Only: 82.9% pass rate
  • Skill+MCP (optimized): 96.3% pass rate

The key insight: when MCP is available, instruct the model to use it as the ONLY documentation source and generate code immediately.

- Add 'Critical Rules' section at top with SDK/model deprecation warnings
- Add 'Documentation Lookup' section with MCP-first instructions
- Add 'Behavior Guidelines' section to prevent over-research
- Restructure for clearer visual hierarchy with dividers

Evaluation results (gemini-3-flash-preview):
- Vanilla: 7.7% pass rate
- MCP Only: 72.6% pass rate
- Skill Only: 82.9% pass rate
- Skill+MCP (optimized): 96.3% pass rate

The key insight: when MCP is available, instruct the model to use it
as the ONLY documentation source and generate code immediately.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the Gemini API development skills by introducing explicit guidelines and structural improvements. The changes aim to enhance the model's efficiency and accuracy when interacting with Gemini APIs, particularly by enforcing the use of current models and SDKs, streamlining documentation lookup processes, and guiding immediate code generation. This optimization is designed to improve the overall evaluation pass rate of the skills.

Highlights

  • Deprecation Warnings: Introduced 'Critical Rules' sections to explicitly warn about deprecated Gemini models and SDKs, ensuring the use of current versions.
  • Optimized Documentation Lookup: Implemented a 'Documentation Lookup' strategy that prioritizes using the search_documentation tool (MCP) over manual URL fetching for efficiency.
  • Behavioral Guidance: Added 'Behavior Guidelines' to instruct the model to generate code immediately after obtaining SDK syntax and to limit documentation tool calls to prevent over-research.
  • Structural Improvements: Restructured the skill documentation with clear visual dividers for improved readability and hierarchical organization.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors two skill documents, gemini-api-dev/SKILL.md and gemini-interactions-api/SKILL.md, to optimize them for an AI model, particularly when an MCP (Model-in-the-Loop Computing Platform) is available. The changes introduce a standardized structure with 'Critical Rules', 'Documentation Lookup', and 'Behavior Guidelines' sections, which significantly improves clarity and provides more direct instructions. My review focuses on ensuring consistency and actionability of these instructions for the model. I've identified a couple of areas where the instructions could be made more explicit and consistent across the skills, particularly in fallback scenarios and for external dependencies like SDK versions.

Comment on lines +108 to +109
- Latest version: https://central.sonatype.com/artifact/com.google.genai/google-genai/versions
- Gradle: `implementation("com.google.genai:google-genai:${LAST_VERSION}")`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The instruction for finding the latest Java SDK version requires visiting a webpage to find the value for ${LAST_VERSION}. This is ambiguous for a model and not easily actionable. To make this more robust, please provide explicit instructions on how to retrieve this version (e.g., by using a specific tool to fetch and parse the URL). An even better alternative would be to provide the version number directly in this document and keep it updated periodically.


### When MCP is NOT Installed (Fallback Only)

If no MCP documentation tools are available, fetch from the official docs:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fallback documentation lookup instructions are inconsistent with gemini-api-dev/SKILL.md. That skill explicitly mentions the fetch_url tool. To improve consistency and clarity for the model, please explicitly mention the tool to be used for fetching these documentation URLs.

Suggested change
If no MCP documentation tools are available, fetch from the official docs:
If no MCP documentation tools are available, use the `fetch_url` tool to read from the official docs:

@treyn-create treyn-create requested a review from markmcd March 19, 2026 04:51
Comment thread skills/gemini-api-dev/SKILL.md Outdated
Comment thread skills/gemini-api-dev/SKILL.md Outdated
Comment thread skills/gemini-api-dev/SKILL.md Outdated
Comment thread skills/gemini-api-dev/SKILL.md
Comment thread skills/gemini-api-dev/SKILL.md Outdated
Comment thread skills/gemini-interactions-api/SKILL.md Outdated
@treyn-create
Copy link
Copy Markdown
Collaborator Author

@markmcd i addressed feedback in latest commit - and also added mcp usage to live api skill

@treyn-create treyn-create requested a review from markmcd March 20, 2026 16:29
Comment thread skills/gemini-api-dev/SKILL.md Outdated
<version>${LAST_VERSION}</version>
</dependency>
```
- `deep-research-pro-preview-12-2025`: Deep Research agent
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work on the regular API? It makes sense to leave in for the Interactions Skill but if this doesn't work on GC, then we should remove it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point - its not supported by GC, i'm removing

Copy link
Copy Markdown
Member

@markmcd markmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! can we hold off merging until the other blog goes out? just so they match for a few minutes :)

@treyn-create treyn-create merged commit 5b655a4 into google-gemini:main Mar 27, 2026
2 checks passed
Copy link
Copy Markdown

@XavierMP14 XavierMP14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants