Repository navigation
feat(cli): improve /skill-name activation prompt and document manual activation - #29818
lostmartian wants to merge 1 commit into
Conversation
…activation When a skill is activated with `/<skill-name>` and no arguments, the model previously received only "Use the skill <name>", which often left it without a clear task. It is now told to continue the task already in progress using the skill, or to ask the user what to use it for. Explicit arguments are still passed through unchanged. Also documents manual skill activation via `/<skill-name>` in the skills docs, which previously did not mention it. Fixes google-gemini#21165
Summary of ChangesHello, 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 manual skill activation experience in the CLI by improving the model's response when a skill is triggered without arguments and by documenting the slash command functionality. These changes ensure that users have a more intuitive interaction flow and better visibility into available features. Highlights
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 the 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 counterproductive. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to manually activate agent skills via slash commands (e.g., /<skill-name>), updating both the user documentation and the CLI implementation. The prompt generation logic has been refactored into a new helper function getSkillPostSubmitPrompt with accompanying unit tests. Feedback on the changes suggests making the args parameter optional in getSkillPostSubmitPrompt to prevent potential runtime TypeError crashes if args is undefined.
| export function getSkillPostSubmitPrompt( | ||
| skillName: string, | ||
| args: string, | ||
| ): string { | ||
| const task = args.trim(); |
There was a problem hiding this comment.
If args is not provided or is undefined at runtime, calling args.trim() will throw a TypeError and crash the CLI. To prevent this, we should make args optional. Additionally, when using an optional string with a fallback value, we should trim the optional string first and use the fallback if the result is empty to avoid uninformative messages from whitespace-only strings.
References
- When using an optional string with a fallback value, trim the optional string and use the fallback if the result is empty to avoid uninformative messages from whitespace-only strings.

Summary
Skills can already be activated manually by typing
/<skill-name>in the interactive UI (viaSkillCommandLoader), but two things made it hard to rely on:Use the skill <name>. That often left it with no clear task, so users had to send a follow-up prompt. Now the model is told to continue the task already in progress using the skill, or to ask the user what they want to use it for./<skill-name>. That's why users like the author of Allow skills to be activated manually like /commands #21165 didn't know they could activate a skill directly instead of tuning skill descriptions.Details
getSkillPostSubmitPrompt(skillName, args)helper inSkillCommandLoader.ts. Explicit arguments (/<skill-name> <task>) are still passed through unchanged; whitespace-only arguments count as no arguments.docs/cli/skills.md, a pointer from the "How it works" activation step, and an entry indocs/cli/using-agent-skills.md. The docs note that built-in skills aren't exposed as slash commands (getDisplayableSkills()filters them out).-p) support and the[Skill]autocomplete tag. The two PRs can be reviewed and merged independently.Related Issues
Fixes #21165
How to Validate
.gemini/skills/release-notes/SKILL.mdwith anameanddescription.npm run build && npm start, then type/and confirmrelease-notesappears in the completion menu./release-noteswith no arguments, approve activation, and confirm the model either continues the current task using the skill or asks what to use it for (instead of acting on a bare "Use the skill release-notes")./release-notes draft notes for the latest changesand confirm that text is sent as the prompt.npx vitest run src/services/SkillCommandLoader.test.ts(frompackages/cli).Pre-Merge Checklist