feat(skills): implement linking for agent skills#18295
feat(skills): implement linking for agent skills#18295NTaylorMullen merged 6 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @MushuEE, 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 skill management capabilities by introducing a new 'link' feature. This allows developers to easily integrate locally developed agent skills into the Gemini CLI and interactive environment using symbolic links. The change focuses on improving the developer workflow by enabling direct iteration on skills without requiring repeated installation steps, while also incorporating necessary safety checks and clear user consent for linking external code. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe 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
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 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
|
34704cc to
eefd5d2
Compare
- Added support for recursive skill discovery in loadSkillsFromDir. - Implemented centralized linkSkill utility in skillUtils. - Added 'skills link' command to yargs CLI. - Added '/skills link' action to interactive slash commands. - Implemented skill name sanitization for filesystem safety. - Added duplicate skill name detection during linking. - Updated consent messaging to reflect linking vs installing. - Updated documentation in docs/cli/skills.md and docs/cli/cli-reference.md.
eefd5d2 to
f4ccb4f
Compare
|
Different ways to implement "linking" for agent skills in Gemini CLI, comparing the native symlink approach with alternative "pointer" methods. 1. Native Filesystem Symlinks (Current Implementation)The CLI creates an OS-level symbolic link in the target skills directory ( Pros
Cons
2. Metadata "Pointer" Stubs (Extension Style)Instead of a symlink, the CLI creates a small metadata file (e.g., Pros
Cons
3. Global Config RegistryThe paths to linked skills are stored in the user's global Pros
Cons
Conclusion: Why Symlinks for Phase 1?The native symlink approach was chosen for the initial implementation because it provides the cleanest integration with the existing codebase. It treats "linked" skills as "first-class citizens" without requiring any logic changes to how the model activates, reads, or validates skill content. If future telemetry indicates that Windows users are frequently hitting permission errors, the implementation can be migrated to the Metadata Stub approach with minimal changes to the user-facing CLI command. |
|
Spoke off line, the recursive pattern is not broadly supported by other AI interfaces and I will revert that to only keep |
|
Also, I do not have access to update the title to remove the "recursive" element now that it is reverted. Please make that change for me if anyone has access. |
Head branch was pushed to by a user without write access
The project now builds successfully with npm run build --workspaces, and all unit tests are passing. /retest |
Summary
This PR implements the
gemini skills link <path>command (and its interactive/skills linkcounterpart) to allow users to symlink agent skills from local directories. It also introduces automatic name sanitization to ensure skills with special characters (like:) can be safely managed on all filesystems.Details
Key implementation details:
:with-) during discovery. This ensures that skills defined with names likefoo:barcan be stored as valid directory/link names (foo-bar) without causing filesystem errors.linkSkillutility detects internal name collisions within the source path to prevent non-deterministic behavior during linking.skillUtils.tsto be used by both the yargs CLI and the interactive REPL.docs/cli/skills.mdanddocs/cli/cli-reference.mdto include the new command.Related Issues
Fixes #18294
How to Validate
Terminal
gemini skills link /path/to/my-skills.~/.gemini/skills/:skill-a->my-skills/skill-afoo-bar->my-skills/foo:bar(sanitized)Interactive
gemini./skills link /path/to/my-skills./skills listand verify the skills appear correctly.Pre-Merge Checklist