feat(cli): improve /skill-name activation prompt and document manual activation by lostmartian · Pull Request #29818 · google-gemini/gemini-cli · GitHub
Skip to content

feat(cli): improve /skill-name activation prompt and document manual activation - #29818

Open
lostmartian wants to merge 1 commit into
google-gemini:mainfrom
lostmartian:feat/skill-slash-activation
Open

lostmartian wants to merge 1 commit into
google-gemini:mainfrom
lostmartian:feat/skill-slash-activation

Conversation

@lostmartian

@lostmartian lostmartian commented Oct 18, 2026 •

Copy link
Copy Markdown

Summary

Skills can already be activated manually by typing /<skill-name> in the interactive UI (via SkillCommandLoader), but two things made it hard to rely on:

  1. Weak default prompt. When a skill is activated with no arguments, the model received only 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.
  2. Undocumented. The skills docs never mentioned /<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

  • Added an exported getSkillPostSubmitPrompt(skillName, args) helper in SkillCommandLoader.ts. Explicit arguments (/<skill-name> <task>) are still passed through unchanged; whitespace-only arguments count as no arguments.
  • Docs: added an "Activating a skill manually" section to docs/cli/skills.md, a pointer from the "How it works" activation step, and an entry in docs/cli/using-agent-skills.md. The docs note that built-in skills aren't exposed as slash commands (getDisplayableSkills() filters them out).
  • This doesn't overlap with feat(cli): support skill activation via /skill-name in non-interactive mode #29546, which covers non-interactive (-p) support and the [Skill] autocomplete tag. The two PRs can be reviewed and merged independently.

Related Issues

Fixes #21165

How to Validate

  1. Create a workspace skill, e.g. .gemini/skills/release-notes/SKILL.md with a name and description.
  2. Run npm run build && npm start, then type / and confirm release-notes appears in the completion menu.
  3. Type /release-notes with 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").
  4. Type /release-notes draft notes for the latest changes and confirm that text is sent as the prompt.
  5. Unit tests: npx vitest run src/services/SkillCommandLoader.test.ts (from packages/cli).

Pre-Merge Checklist

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

…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
@lostmartian
lostmartian requested review from a team as code owners October 18, 2026 21:09
@github-actions github-actions Bot added the size/m A medium sized PR label Oct 18, 2026
@github-actions

Copy link
Copy Markdown

@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 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

  • Improved Skill Activation Prompt: Updated the post-activation prompt logic to provide clearer instructions to the model when a skill is activated without specific arguments, ensuring it either continues the current task or prompts the user for intent.
  • Documentation Updates: Added comprehensive documentation on how to manually activate skills using slash commands in both 'skills.md' and 'using-agent-skills.md'.
  • Refactored Logic: Extracted the prompt generation logic into a reusable helper function 'getSkillPostSubmitPrompt' in 'SkillCommandLoader.ts' and added corresponding unit tests.
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 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 .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 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

  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. ↩

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

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.

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.

Comment on lines +62 to +66
export function getSkillPostSubmitPrompt(
skillName: string,
args: string,
): string {
const task = args.trim();

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.

high

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.

Suggested change
References
  1. 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.

@gemini-cli gemini-cli Bot added priority/p2 Important but can be addressed in a future release. area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Oct 18, 2026

This branch has not been deployed

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

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow skills to be activated manually like /commands

1 participant