Skip to content

Conversation

@joehan
Copy link
Member

@joehan joehan commented Jan 17, 2026

Description

Starting on adding evals for the agent skills. So far, I'm just focusing on the frontmatter and skill activation.

Changes:

  • Added a 'skills' argument that allows us to configure what skills are available to the runner
  • Added a 'enableMCP' argument that turns on or off the MCP server in tests (so we can evaluate skills on their own)
  • Added `expectSkillActivated', which checks telemtry logs for the 'activate_skill' tool
  • Added some simple activation tests for 'firestore_basics' and 'firebase_basics' that check if the skill is activated with a variety of prompts
  • Added a 'skill choice' test, that makes all skills available and then checks that the 'right' skill is chosen for a variety of prompts

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joehan, 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 enhances the agent evaluation framework by introducing the ability to test and verify agent skill activation and selection. It provides new mechanisms for configuring available skills and asserting their usage, laying the groundwork for more comprehensive and targeted evaluations of agent capabilities.

Highlights

  • New Skill Evaluation Capabilities: Introduced a new expectSkillActivated assertion method to the AgentTestRunner interface and its implementation in GeminiCliRunner, allowing tests to verify if a specific agent skill was activated during a run. This also includes a dont.expectSkillActivated for negative assertions.
  • Configurable Skill Loading and MCP Control: The GeminiCliRunner constructor and startAgentTest function now accept skills (an array of skill paths to enable) and enableMcp (a boolean to control the MCP server) arguments, providing greater flexibility for testing agent behaviors.
  • Dynamic Skill Provisioning: Implemented logic within GeminiCliRunner to dynamically copy specified skill files into a temporary .gemini/skills directory for each test run, ensuring isolated and configurable skill environments.
  • Telemetry-Based Skill Activation Checks: The expectSkillActivated method checks telemetry logs for activate_skill or read_file tool calls that include the expected skill name, providing a robust mechanism to confirm skill activation.
  • Comprehensive Skill Activation Tests: Added new test suites (firebase-basics.spec.ts, firestore-basics.spec.ts) to validate the activation of specific skills based on various prompts, including both positive and negative cases, and with MCP enabled/disabled. A skill-choice.spec.ts was also added to test the agent's ability to select the correct skill when multiple are available.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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
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 introduces a solid foundation for evaluating agent skills. The changes are well-structured, adding new arguments for skill configuration, a new expectSkillActivated matcher, and comprehensive tests for skill activation and selection. My feedback focuses on improving code clarity and maintainability by removing a small amount of dead code and refactoring duplicated test logic to make the new test suites easier to manage in the future. Overall, this is a great step forward for agent evaluations.

Comment on lines 100 to 107
const skillPaths: string[] = [];
for (const skillPath of skills) {
const skillName = path.basename(skillPath);
const dest = path.join(skillsDir, skillName);
console.debug(`Copying skill ${skillPath} to ${dest}`);
cpSync(skillPath, dest, { recursive: true });
skillPaths.push(dest);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The skillPaths variable is initialized and populated within the loop, but it's never used. This appears to be dead code and should be removed to improve clarity and maintainability. The CLI seems to correctly pick up skills by convention from the .gemini/skills directory, making this variable unnecessary.

      for (const skillPath of skills) {
        const skillName = path.basename(skillPath);
        const dest = path.join(skillsDir, skillName);
        console.debug(`Copying skill ${skillPath} to ${dest}`);
        cpSync(skillPath, dest, { recursive: true });
      }

Comment on lines 40 to 76
for (const tc of testCases) {
it(`${tc.expectSkillEnabled ? 'should' : 'should not'} activate firebase-basics skill for prompt: ${tc.prompt} ("MCP Enabled")`, async function (this: Mocha.Context) {
if (!process.env.GEMINI_API_KEY) {
this.skip();
}
const run: AgentTestRunner = await startAgentTest(this, {
skills: [FIREBASE_BASICS_PATH],
enableMcp: true,
});

await run.type(tc.prompt);

if (tc.expectSkillEnabled) {
await run.expectSkillActivated("firebase-basics");
} else {
await run.dont.expectSkillActivated("firebase-basics");
}
});

it(`${tc.expectSkillEnabled ? 'should' : 'should not'} activate firebase-basics skill for prompt: ${tc.prompt} ("MCP Disabled")`, async function (this: Mocha.Context) {
if (!process.env.GEMINI_API_KEY) {
this.skip();
}
const run: AgentTestRunner = await startAgentTest(this, {
skills: [FIREBASE_BASICS_PATH],
enableMcp: false,
});

await run.type(tc.prompt);

if (tc.expectSkillEnabled) {
await run.expectSkillActivated("firebase-basics");
} else {
await run.dont.expectSkillActivated("firebase-basics");
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is significant code duplication between the test cases for "MCP Enabled" and "MCP Disabled". To improve maintainability and reduce redundancy, this can be refactored into a single parameterized test that iterates over the enableMcp boolean states.

  for (const tc of testCases) {
    for (const mcpEnabled of [true, false]) {
      const mcpState = mcpEnabled ? "MCP Enabled" : "MCP Disabled";
      it(`${tc.expectSkillEnabled ? 'should' : 'should not'} activate firebase-basics skill for prompt: ${tc.prompt} ("${mcpState}")`, async function (this: Mocha.Context) {
        if (!process.env.GEMINI_API_KEY) {
          this.skip();
        }
        const run: AgentTestRunner = await startAgentTest(this, {
          skills: [FIREBASE_BASICS_PATH],
          enableMcp: mcpEnabled,
        });

        await run.type(tc.prompt);

        if (tc.expectSkillEnabled) {
          await run.expectSkillActivated("firebase-basics");
        } else {
          await run.dont.expectSkillActivated("firebase-basics");
        }
      });
    }
  }

Comment on lines 39 to 75
for (const tc of testCases) {
it(`${tc.expectSkillEnabled ? 'should' : 'should not'} activate firestore-basics skill for prompt: ${tc.prompt} ("MCP Enabled")`, async function (this: Mocha.Context) {
if (!process.env.GEMINI_API_KEY) {
this.skip();
}
const run: AgentTestRunner = await startAgentTest(this, {
skills: [FIRESTORE_BASICS_PATH],
enableMcp: true,
});

await run.type(tc.prompt);

if (tc.expectSkillEnabled) {
await run.expectSkillActivated("firestore-basics");
} else {
await run.dont.expectSkillActivated("firestore-basics");
}
});

it(`${tc.expectSkillEnabled ? 'should' : 'should not'} activate firestore-basics skill for prompt: ${tc.prompt} ("MCP Disabled")`, async function (this: Mocha.Context) {
if (!process.env.GEMINI_API_KEY) {
this.skip();
}
const run: AgentTestRunner = await startAgentTest(this, {
skills: [FIRESTORE_BASICS_PATH],
enableMcp: false,
});

await run.type(tc.prompt);

if (tc.expectSkillEnabled) {
await run.expectSkillActivated("firestore-basics");
} else {
await run.dont.expectSkillActivated("firestore-basics");
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the firebase-basics test file, there is duplicated logic for testing with MCP enabled and disabled. This can be refactored into a more concise, parameterized test to improve readability and maintainability.

  for (const tc of testCases) {
    for (const mcpEnabled of [true, false]) {
      const mcpState = mcpEnabled ? "MCP Enabled" : "MCP Disabled";
      it(`${tc.expectSkillEnabled ? 'should' : 'should not'} activate firestore-basics skill for prompt: ${tc.prompt} ("${mcpState}")`, async function (this: Mocha.Context) {
        if (!process.env.GEMINI_API_KEY) {
          this.skip();
        }
        const run: AgentTestRunner = await startAgentTest(this, {
          skills: [FIRESTORE_BASICS_PATH],
          enableMcp: mcpEnabled,
        });

        await run.type(tc.prompt);

        if (tc.expectSkillEnabled) {
          await run.expectSkillActivated("firestore-basics");
        } else {
          await run.dont.expectSkillActivated("firestore-basics");
        }
      });
    }
  }

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.

1 participant