mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-22 17:53:04 -07:00
docs(skills): add documentation for skill packaging and distribution
This commit is contained in:
@@ -72,9 +72,55 @@ This skill guides the agent in conducting thorough code reviews.
|
||||
- **Local Changes**: If changes are local... ...
|
||||
```
|
||||
|
||||
- **`name`**: A unique identifier for the skill. This should match the directory
|
||||
name.
|
||||
- **`description`**: A description of what the skill does and when Gemini should
|
||||
use it.
|
||||
- **Body**: The Markdown body of the file contains the instructions that guide
|
||||
the agent's behavior when the skill is active.
|
||||
|
||||
## Packaging and Distribution
|
||||
|
||||
To share a skill or distribute it as a standalone archive, you can package the
|
||||
skill directory into a `.skill` file. This is essentially a ZIP archive that
|
||||
the `gemini skills install` command can process.
|
||||
|
||||
### Using the `skill-creator` toolchain
|
||||
|
||||
The built-in `skill-creator` skill includes a packaging script that validates
|
||||
your skill (checking for missing frontmatter, unresolved TODOs, etc.) before
|
||||
creating the archive.
|
||||
|
||||
To package a skill:
|
||||
|
||||
1. **Activate** the `skill-creator` skill in a Gemini session.
|
||||
2. **Ask** the agent to "package my skill located at `./path/to/skill`".
|
||||
|
||||
The agent will run the necessary validation and create a `.skill` file in your
|
||||
specified output directory.
|
||||
|
||||
### Manual Packaging
|
||||
|
||||
If you prefer to package manually, you can simply create a ZIP archive of the
|
||||
skill's root directory (ensuring `SKILL.md` is at the top level) and rename the
|
||||
extension to `.skill`.
|
||||
|
||||
```bash
|
||||
# Example: Package 'my-skill' directory into 'my-skill.skill'
|
||||
zip -r my-skill.skill my-skill/
|
||||
```
|
||||
|
||||
## Installing a Packaged Skill
|
||||
|
||||
Once you have a `.skill` file, you can install it using the `gemini` CLI.
|
||||
|
||||
```bash
|
||||
# Install to the user scope (global)
|
||||
gemini skills install ./my-skill.skill
|
||||
|
||||
# Install to the workspace scope (local repository)
|
||||
gemini skills install ./my-skill.skill --scope workspace
|
||||
```
|
||||
|
||||
After installation, remember to reload your session to pick up the new expertise:
|
||||
|
||||
1. In an interactive session, run `/skills reload`.
|
||||
2. Verify the installation with `/skills list`.
|
||||
|
||||
@@ -106,6 +106,18 @@ gemini skills enable my-expertise
|
||||
gemini skills disable my-expertise --scope workspace
|
||||
```
|
||||
|
||||
### Activation and Reloading
|
||||
|
||||
After installing or linking a new skill, it is not automatically available in
|
||||
currently active sessions. To pick up the new expertise:
|
||||
|
||||
1. **In an interactive session**: Run the `/skills reload` slash command. This
|
||||
refreshes the list of discovered skills from all tiers and scopes.
|
||||
2. **Verify**: Run `/skills list` to confirm the new skill is discovered and
|
||||
enabled.
|
||||
3. **Automatic Discovery**: New sessions will automatically discover all
|
||||
available skills during startup.
|
||||
|
||||
## How it Works
|
||||
|
||||
1. **Discovery**: At the start of a session, Gemini CLI scans the discovery
|
||||
|
||||
Reference in New Issue
Block a user