Skip to content

feat(core): add .agents/skills directory alias for skill discovery#18151

Merged
NTaylorMullen merged 1 commit intomainfrom
feat/agent-skills-alias
Feb 3, 2026
Merged

feat(core): add .agents/skills directory alias for skill discovery#18151
NTaylorMullen merged 1 commit intomainfrom
feat/agent-skills-alias

Conversation

@NTaylorMullen
Copy link
Copy Markdown
Collaborator

@NTaylorMullen NTaylorMullen commented Feb 3, 2026

Summary

This PR adds support for .agents/skills as an alias for .gemini/skills in both user (~/.agents/skills) and workspace (.agents/skills) directories. This provides a more generic and intuitive path for managing agent-specific skills.

Details

  • Added getGlobalAgentsDir, getUserAgentSkillsDir, getAgentsDir, and getProjectAgentSkillsDir to the Storage class in packages/core/src/config/storage.ts.
  • Updated SkillManager.discoverSkills in packages/core/src/skills/skillManager.ts to include these new alias directories in the skill discovery process.
  • .agents directories have precedence over .gemini directories when they exist in the same tier (user or workspace).

Related Issues

None.

How to Validate

  1. Create a skill in ~/.agents/skills/test-user-skill/SKILL.md.
  2. Create a skill in .agents/skills/test-workspace-skill/SKILL.md.
  3. Run gemini skills list or use /skills list in the CLI.
  4. Verify both skills are discovered.

Alternatively, run the new test suite:

npm test -w @google/gemini-cli-core -- src/skills/skillManagerAlias.test.ts

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@NTaylorMullen NTaylorMullen requested a review from a team as a code owner February 3, 2026 00:17
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @NTaylorMullen, 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 enhances the skill discovery mechanism by introducing a new, more flexible directory alias. Users can now store agent-specific skills in .agent/skills directories, which will be prioritized over the existing .gemini/skills paths. This change aims to streamline skill management by offering a more intuitive naming convention and ensuring that the system correctly identifies and loads skills from these new locations.

Highlights

  • New Directory Alias: Introduced support for .agent/skills as an alias for .gemini/skills for skill discovery, providing a more generic and intuitive path for managing agent-specific skills.
  • Scope of Alias: The new alias applies to both user-level (~/.agent/skills) and workspace-level (.agent/skills) directories.
  • Storage Class Updates: Added new methods (getGlobalAgentDir, getUserAgentSkillsDir, getAgentDir, getProjectAgentSkillsDir) to the Storage class to manage these new alias paths.
  • Skill Discovery Enhancement: Updated SkillManager.discoverSkills to include these new alias directories in the skill discovery process.
  • Precedence Rule: When both .agent and .gemini directories exist at the same tier (user or workspace), .agent directories will take precedence.
Changelog
  • packages/core/src/config/storage.ts
    • Added static getGlobalAgentDir() to retrieve the global user-level .agent directory.
    • Added static getUserAgentSkillsDir() to get the user-specific .agent/skills directory.
    • Added getAgentDir() to retrieve the project-level .agent directory.
    • Added getProjectAgentSkillsDir() to get the project-specific .agent/skills directory.
  • packages/core/src/skills/skillManager.ts
    • Modified discoverSkills to include userAgentSkills and projectAgentSkills in the skill discovery process.
    • Ensured that skills found in .agent paths are added with precedence over those in .gemini paths at the same tier.
  • packages/core/src/skills/skillManagerAlias.test.ts
    • Added a new test file to verify the correct discovery of skills from .agent/skills directories.
    • Included tests to confirm that .agent skills take precedence over .gemini skills when both exist for the same skill name.
Activity
  • The author has added new tests to cover the changes introduced in this pull request.
  • The author has validated the changes on MacOS using npm run.
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.

@NTaylorMullen NTaylorMullen changed the title feat(core): add .agent/skills directory alias for skill discovery feat(core): add .agents/skills directory alias for skill discovery Feb 3, 2026
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 introduces support for .agent/skills as an alias for .gemini/skills for skill discovery. While the feature correctly implements the aliasing and precedence logic, a critical security flaw exists in the global agent directory discovery: it falls back to a world-writable temporary directory on multi-user systems when the home directory cannot be determined, potentially enabling cross-user skill injection attacks. Given that skill content and definitions are considered trusted by design, it is paramount to ensure the integrity of skill loading locations. It is recommended to remove this insecure fallback or implement robust ownership and permission checks. Furthermore, consider refactoring Storage.ts to reduce code duplication and use constants for directory paths to enhance maintainability.

@NTaylorMullen NTaylorMullen force-pushed the feat/agent-skills-alias branch 3 times, most recently from c6d9eb1 to 7e0030d Compare February 3, 2026 00:25
@NTaylorMullen NTaylorMullen force-pushed the feat/agent-skills-alias branch from 7e0030d to 28b3413 Compare February 3, 2026 00:27
Copy link
Copy Markdown
Collaborator

@jackwotherspoon jackwotherspoon left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

Size Change: +882 B (0%)

Total Size: 23.6 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 23.6 MB +882 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 3, 2026
@NTaylorMullen NTaylorMullen added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit ad8796b Feb 3, 2026
26 checks passed
@NTaylorMullen NTaylorMullen deleted the feat/agent-skills-alias branch February 3, 2026 06:17
yuvrajangadsingh pushed a commit to yuvrajangadsingh/gemini-cli that referenced this pull request Feb 4, 2026
sidwan02 pushed a commit to sidwan02/gemini-cli-gemma that referenced this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants