@codeflyai/codefly 0.24.1 → 0.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/bundle/builtin/skill-creator/SKILL.md +382 -0
  2. package/bundle/builtin/skill-creator/scripts/init_skill.cjs +235 -0
  3. package/bundle/builtin/skill-creator/scripts/package_skill.cjs +102 -0
  4. package/bundle/builtin/skill-creator/scripts/validate_skill.cjs +127 -0
  5. package/bundle/codefly.js +296592 -296367
  6. package/bundle/docs/architecture.md +3 -3
  7. package/bundle/docs/assets/monitoring-dashboard-logs.png +0 -0
  8. package/bundle/docs/assets/monitoring-dashboard-metrics.png +0 -0
  9. package/bundle/docs/assets/monitoring-dashboard-overview.png +0 -0
  10. package/bundle/docs/changelogs/index.md +134 -0
  11. package/bundle/docs/changelogs/latest.md +355 -210
  12. package/bundle/docs/changelogs/preview.md +318 -115
  13. package/bundle/docs/cli/commands.md +21 -0
  14. package/bundle/docs/cli/custom-commands.md +9 -9
  15. package/bundle/docs/cli/index.md +6 -2
  16. package/bundle/docs/cli/keyboard-shortcuts.md +61 -78
  17. package/bundle/docs/cli/model-routing.md +7 -2
  18. package/bundle/docs/cli/model.md +1 -1
  19. package/bundle/docs/cli/openspec.md +164 -0
  20. package/bundle/docs/cli/sandbox.md +1 -1
  21. package/bundle/docs/cli/settings.md +80 -60
  22. package/bundle/docs/cli/skills.md +188 -0
  23. package/bundle/docs/cli/system-prompt.md +32 -0
  24. package/bundle/docs/cli/telemetry.md +38 -3
  25. package/bundle/docs/cli/themes.md +0 -2
  26. package/bundle/docs/cli/tutorials/skills-getting-started.md +124 -0
  27. package/bundle/docs/cli/tutorials.md +4 -0
  28. package/bundle/docs/core/index.md +4 -0
  29. package/bundle/docs/core/memport.md +2 -0
  30. package/bundle/docs/core/policy-engine.md +3 -2
  31. package/bundle/docs/extensions/getting-started-extensions.md +39 -2
  32. package/bundle/docs/get-started/configuration.md +130 -74
  33. package/bundle/docs/get-started/gemini-3.md +2 -17
  34. package/bundle/docs/hooks/reference.md +245 -116
  35. package/bundle/docs/index.md +2 -0
  36. package/bundle/docs/local-development.md +1 -1
  37. package/bundle/docs/releases.md +1 -1
  38. package/bundle/docs/sidebar.json +5 -5
  39. package/bundle/docs/tools/index.md +3 -0
  40. package/bundle/docs/tools/mcp-server.md +26 -2
  41. package/bundle/docs/tools/shell.md +1 -1
  42. package/bundle/docs/troubleshooting.md +23 -5
  43. package/bundle/policies/agent.toml +1 -1
  44. package/bundle/policies/plan.toml +70 -0
  45. package/bundle/policies/read-only.toml +0 -5
  46. package/bundle/policies/yolo.toml +1 -0
  47. package/package.json +10 -5
  48. package/bundle/docs/get-started/deployment.md +0 -143
@@ -0,0 +1,188 @@
1
+ # Agent Skills
2
+
3
+ _Note: This is an experimental feature enabled via `experimental.skills`. You
4
+ can also search for "Skills" within the `/settings` interactive UI to toggle
5
+ this and manage other skill-related settings._
6
+
7
+ Agent Skills allow you to extend Gemini CLI with specialized expertise,
8
+ procedural workflows, and task-specific resources. Based on the
9
+ [Agent Skills](https://agentskills.io) open standard, a "skill" is a
10
+ self-contained directory that packages instructions and assets into a
11
+ discoverable capability.
12
+
13
+ ## Overview
14
+
15
+ Unlike general context files ([`GEMINI.md`](./gemini-md.md)), which provide
16
+ persistent workspace-wide background, Skills represent **on-demand expertise**.
17
+ This allows Gemini to maintain a vast library of specialized capabilities—such
18
+ as security auditing, cloud deployments, or codebase migrations—without
19
+ cluttering the model's immediate context window.
20
+
21
+ Gemini autonomously decides when to employ a skill based on your request and the
22
+ skill's description. When a relevant skill is identified, the model "pulls in"
23
+ the full instructions and resources required to complete the task using the
24
+ `activate_skill` tool.
25
+
26
+ ## Key Benefits
27
+
28
+ - **Shared Expertise:** Package complex workflows (like a specific team's PR
29
+ review process) into a folder that anyone can use.
30
+ - **Repeatable Workflows:** Ensure complex multi-step tasks are performed
31
+ consistently by providing a procedural framework.
32
+ - **Resource Bundling:** Include scripts, templates, or example data alongside
33
+ instructions so the agent has everything it needs.
34
+ - **Progressive Disclosure:** Only skill metadata (name and description) is
35
+ loaded initially. Detailed instructions and resources are only disclosed when
36
+ the model explicitly activates the skill, saving context tokens.
37
+
38
+ ## Skill Discovery Tiers
39
+
40
+ Gemini CLI discovers skills from three primary locations:
41
+
42
+ 1. **Workspace Skills** (`.gemini/skills/`): Workspace-specific skills that are
43
+ typically committed to version control and shared with the team.
44
+ 2. **User Skills** (`~/.gemini/skills/`): Personal skills available across all
45
+ your workspaces.
46
+ 3. **Extension Skills**: Skills bundled within installed
47
+ [extensions](../extensions/index.md).
48
+
49
+ **Precedence:** If multiple skills share the same name, higher-precedence
50
+ locations override lower ones: **Workspace > User > Extension**.
51
+
52
+ ## Managing Skills
53
+
54
+ ### In an Interactive Session
55
+
56
+ Use the `/skills` slash command to view and manage available expertise:
57
+
58
+ - `/skills list` (default): Shows all discovered skills and their status.
59
+ - `/skills disable <name>`: Prevents a specific skill from being used.
60
+ - `/skills enable <name>`: Re-enables a disabled skill.
61
+ - `/skills reload`: Refreshes the list of discovered skills from all tiers.
62
+
63
+ _Note: `/skills disable` and `/skills enable` default to the `user` scope. Use
64
+ `--scope workspace` to manage workspace-specific settings._
65
+
66
+ ### From the Terminal
67
+
68
+ The `gemini skills` command provides management utilities:
69
+
70
+ ```bash
71
+ # List all discovered skills
72
+ gemini skills list
73
+
74
+ # Install a skill from a Git repository, local directory, or zipped skill file (.skill)
75
+ # Uses the user scope by default (~/.gemini/skills)
76
+ gemini skills install https://github.com/user/repo.git
77
+ gemini skills install /path/to/local/skill
78
+ gemini skills install /path/to/local/my-expertise.skill
79
+
80
+ # Install a specific skill from a monorepo or subdirectory using --path
81
+ gemini skills install https://github.com/my-org/my-skills.git --path skills/frontend-design
82
+
83
+ # Install to the workspace scope (.gemini/skills)
84
+ gemini skills install /path/to/skill --scope workspace
85
+
86
+ # Uninstall a skill by name
87
+ gemini skills uninstall my-expertise --scope workspace
88
+
89
+ # Enable a skill (globally)
90
+ gemini skills enable my-expertise
91
+
92
+ # Disable a skill. Can use --scope to specify workspace or user (defaults to workspace)
93
+ gemini skills disable my-expertise --scope workspace
94
+ ```
95
+
96
+ ## Creating a Skill
97
+
98
+ A skill is a directory containing a `SKILL.md` file at its root. This file uses
99
+ YAML frontmatter for metadata and Markdown for instructions.
100
+
101
+ ### Folder Structure
102
+
103
+ Skills are self-contained directories. At a minimum, a skill requires a
104
+ `SKILL.md` file, but can include other resources:
105
+
106
+ ```text
107
+ my-skill/
108
+ ├── SKILL.md (Required) Instructions and metadata
109
+ ├── scripts/ (Optional) Executable scripts/tools
110
+ ├── references/ (Optional) Static documentation and examples
111
+ └── assets/ (Optional) Templates and binary resources
112
+ ```
113
+
114
+ ### Basic Structure (SKILL.md)
115
+
116
+ ```markdown
117
+ ---
118
+ name: <unique-name>
119
+ description: <what the skill does and when Gemini should use it>
120
+ ---
121
+
122
+ <your instructions for how the agent should behave / use the skill>
123
+ ```
124
+
125
+ - **`name`**: A unique identifier (lowercase, alphanumeric, and dashes).
126
+ - **`description`**: The most critical field. Gemini uses this to decide when
127
+ the skill is relevant. Be specific about the expertise provided.
128
+ - **Body**: Everything below the second `---` is injected as expert procedural
129
+ guidance for the model.
130
+
131
+ ### Example: Team Code Reviewer
132
+
133
+ Create `~/.gemini/skills/code-reviewer/SKILL.md`:
134
+
135
+ ```markdown
136
+ ---
137
+ name: code-reviewer
138
+ description:
139
+ Expertise in reviewing code for style, security, and performance. Use when the
140
+ user asks for "feedback," a "review," or to "check" their changes.
141
+ ---
142
+
143
+ # Code Reviewer
144
+
145
+ You are an expert code reviewer. When reviewing code, follow this workflow:
146
+
147
+ 1. **Analyze**: Review the staged changes or specific files provided. Ensure
148
+ that the changes are scoped properly and represent minimal changes required
149
+ to address the issue.
150
+ 2. **Style**: Ensure code follows the workspace's conventions and idiomatic
151
+ patterns as described in the `GEMINI.md` file.
152
+ 3. **Security**: Flag any potential security vulnerabilities.
153
+ 4. **Tests**: Verify that new logic has corresponding test coverage and that
154
+ the test coverage adequately validates the changes.
155
+
156
+ Provide your feedback as a concise bulleted list of "Strengths" and
157
+ "Opportunities."
158
+ ```
159
+
160
+ ### Resource Conventions
161
+
162
+ While you can structure your skill directory however you like, the Agent Skills
163
+ standard encourages these conventions:
164
+
165
+ - **`scripts/`**: Executable scripts (bash, python, node) the agent can run.
166
+ - **`references/`**: Static documentation, schemas, or example data for the
167
+ agent to consult.
168
+ - **`assets/`**: Code templates, boilerplate, or binary resources.
169
+
170
+ When a skill is activated, Gemini CLI provides the model with a tree view of the
171
+ entire skill directory, allowing it to discover and utilize these assets.
172
+
173
+ ## How it Works (Security & Privacy)
174
+
175
+ 1. **Discovery**: At the start of a session, Gemini CLI scans the discovery
176
+ tiers and injects the name and description of all enabled skills into the
177
+ system prompt.
178
+ 2. **Activation**: When Gemini identifies a task matching a skill's
179
+ description, it calls the `activate_skill` tool.
180
+ 3. **Consent**: You will see a confirmation prompt in the UI detailing the
181
+ skill's name, purpose, and the directory path it will gain access to.
182
+ 4. **Injection**: Upon your approval:
183
+ - The `SKILL.md` body and folder structure is added to the conversation
184
+ history.
185
+ - The skill's directory is added to the agent's allowed file paths, granting
186
+ it permission to read any bundled assets.
187
+ 5. **Execution**: The model proceeds with the specialized expertise active. It
188
+ is instructed to prioritize the skill's procedural guidance within reason.
@@ -56,6 +56,38 @@ error with: `missing system prompt file '<path>'`.
56
56
  When `GEMINI_SYSTEM_MD` is active, the CLI shows a `|⌐■_■|` indicator in the UI
57
57
  to signal custom system‑prompt mode.
58
58
 
59
+ ## Variable Substitution
60
+
61
+ When using a custom system prompt file, you can use the following variables to
62
+ dynamically include built-in content:
63
+
64
+ - `${AgentSkills}`: Injects a complete section (including header) of all
65
+ available agent skills.
66
+ - `${SubAgents}`: Injects a complete section (including header) of available
67
+ sub-agents.
68
+ - `${AvailableTools}`: Injects a bulleted list of all currently enabled tool
69
+ names.
70
+ - Tool Name Variables: Injects the actual name of a tool using the pattern:
71
+ `${toolName}_ToolName` (e.g., `${write_file_ToolName}`,
72
+ `${run_shell_command_ToolName}`).
73
+
74
+ This pattern is generated dynamically for all available tools.
75
+
76
+ ### Example
77
+
78
+ ```markdown
79
+ # Custom System Prompt
80
+
81
+ You are a helpful assistant. ${AgentSkills}
82
+ ${SubAgents}
83
+
84
+ ## Tooling
85
+
86
+ The following tools are available to you: ${AvailableTools}
87
+
88
+ You can use ${write_file_ToolName} to save logs.
89
+ ```
90
+
59
91
  ## Export the default prompt (recommended)
60
92
 
61
93
  Before overriding, export the current default prompt so you can review required
@@ -8,14 +8,17 @@ Learn how to enable and setup OpenTelemetry for Gemini CLI.
8
8
  - [Configuration](#configuration)
9
9
  - [Google Cloud telemetry](#google-cloud-telemetry)
10
10
  - [Prerequisites](#prerequisites)
11
+ - [Authenticating with CLI Credentials](#authenticating-with-cli-credentials)
11
12
  - [Direct export (recommended)](#direct-export-recommended)
12
13
  - [Collector-based export (advanced)](#collector-based-export-advanced)
14
+ - [Monitoring Dashboards](#monitoring-dashboards)
13
15
  - [Local telemetry](#local-telemetry)
14
16
  - [File-based output (recommended)](#file-based-output-recommended)
15
17
  - [Collector-based export (advanced)](#collector-based-export-advanced-1)
16
18
  - [Logs and metrics](#logs-and-metrics)
17
19
  - [Logs](#logs)
18
20
  - [Sessions](#sessions)
21
+ - [Approval Mode](#approval-mode)
19
22
  - [Tools](#tools)
20
23
  - [Files](#files)
21
24
  - [API](#api)
@@ -214,6 +217,24 @@ forward data to Google Cloud.
214
217
  - Open `~/.codefly/tmp/<projectHash>/otel/collector-gcp.log` to view local
215
218
  collector logs.
216
219
 
220
+ ### Monitoring Dashboards
221
+
222
+ Gemini CLI provides a pre-configured
223
+ [Google Cloud Monitoring](https://cloud.google.com/monitoring) dashboard to
224
+ visualize your telemetry.
225
+
226
+ This dashboard can be found under **Google Cloud Monitoring Dashboard
227
+ Templates** as "**Gemini CLI Monitoring**".
228
+
229
+ ![Gemini CLI Monitoring Dashboard Overview](/docs/assets/monitoring-dashboard-overview.png)
230
+
231
+ ![Gemini CLI Monitoring Dashboard Metrics](/docs/assets/monitoring-dashboard-metrics.png)
232
+
233
+ ![Gemini CLI Monitoring Dashboard Logs](/docs/assets/monitoring-dashboard-logs.png)
234
+
235
+ To learn more, check out this blog post:
236
+ [Instant insights: Gemini CLI’s new pre-configured monitoring dashboards](https://cloud.google.com/blog/topics/developers-practitioners/instant-insights-gemini-clis-new-pre-configured-monitoring-dashboards/).
237
+
217
238
  ## Local telemetry
218
239
 
219
240
  For local development and debugging, you can capture telemetry data locally:
@@ -296,9 +317,23 @@ Captures startup configuration and user prompt submissions.
296
317
  - `prompt` (string; excluded if `telemetry.logPrompts` is `false`)
297
318
  - `auth_type` (string)
298
319
 
320
+ #### Approval Mode
321
+
322
+ Tracks changes and duration of approval modes.
323
+
324
+ - `approval_mode_switch`: Approval mode was changed.
325
+ - **Attributes**:
326
+ - `from_mode` (string)
327
+ - `to_mode` (string)
328
+
329
+ - `approval_mode_duration`: Duration spent in an approval mode.
330
+ - **Attributes**:
331
+ - `mode` (string)
332
+ - `duration_ms` (int)
333
+
299
334
  #### Tools
300
335
 
301
- Captures tool executions, output truncation, and Smart Edit behavior.
336
+ Captures tool executions, output truncation, and Edit behavior.
302
337
 
303
338
  - `gemini_cli.tool_call`: Emitted for each tool (function) call.
304
339
  - **Attributes**:
@@ -326,11 +361,11 @@ Captures tool executions, output truncation, and Smart Edit behavior.
326
361
  - `lines` (int)
327
362
  - `prompt_id` (string)
328
363
 
329
- - `gemini_cli.smart_edit_strategy`: Smart Edit strategy chosen.
364
+ - `gemini_cli.edit_strategy`: Edit strategy chosen.
330
365
  - **Attributes**:
331
366
  - `strategy` (string)
332
367
 
333
- - `gemini_cli.smart_edit_correction`: Smart Edit correction result.
368
+ - `gemini_cli.edit_correction`: Edit correction result.
334
369
  - **Attributes**:
335
370
  - `correction` ("success" | "failure")
336
371
 
@@ -86,7 +86,6 @@ color keys. For example:
86
86
  - `Gray`
87
87
  - `DiffAdded` (optional, for added lines in diffs)
88
88
  - `DiffRemoved` (optional, for removed lines in diffs)
89
- - `DiffModified` (optional, for modified lines in diffs)
90
89
 
91
90
  You can also override individual UI text roles by adding a nested `text` object.
92
91
  This object supports the keys `primary`, `secondary`, `link`, `accent`, and
@@ -157,7 +156,6 @@ custom theme defined in `settings.json`.
157
156
  "Gray": "#ABB2BF",
158
157
  "DiffAdded": "#A6E3A1",
159
158
  "DiffRemoved": "#F38BA8",
160
- "DiffModified": "#89B4FA",
161
159
  "GradientColors": ["#4796E4", "#847ACE", "#C3677F"]
162
160
  }
163
161
  ```
@@ -0,0 +1,124 @@
1
+ # Getting Started with Agent Skills
2
+
3
+ Agent Skills allow you to extend Gemini CLI with specialized expertise. This
4
+ tutorial will guide you through creating your first skill, enabling it, and
5
+ using it in a session.
6
+
7
+ ## 1. Enable Agent Skills
8
+
9
+ Agent Skills are currently an experimental feature and must be enabled in your
10
+ settings.
11
+
12
+ ### Via the interactive UI
13
+
14
+ 1. Start a Gemini CLI session by running `gemini`.
15
+ 2. Type `/settings` to open the interactive settings dialog.
16
+ 3. Search for "Skills".
17
+ 4. Toggle **Agent Skills** to `true`.
18
+ 5. Press `Esc` to save and exit. You may need to restart the CLI for the
19
+ changes to take effect.
20
+
21
+ ### Via `settings.json`
22
+
23
+ Alternatively, you can manually edit your global settings file at
24
+ `~/.gemini/settings.json` (create it if it doesn't exist):
25
+
26
+ ```json
27
+ {
28
+ "experimental": {
29
+ "skills": true
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## 2. Create Your First Skill
35
+
36
+ A skill is a directory containing a `SKILL.md` file. Let's create an **API
37
+ Auditor** skill that helps you verify if local or remote endpoints are
38
+ responding correctly.
39
+
40
+ 1. **Create the skill directory structure:**
41
+
42
+ ```bash
43
+ mkdir -p .gemini/skills/api-auditor/scripts
44
+ ```
45
+
46
+ 2. **Create the `SKILL.md` file:** Create a file at
47
+ `.gemini/skills/api-auditor/SKILL.md` with the following content:
48
+
49
+ ```markdown
50
+ ---
51
+ name: api-auditor
52
+ description:
53
+ Expertise in auditing and testing API endpoints. Use when the user asks to
54
+ "check", "test", or "audit" a URL or API.
55
+ ---
56
+
57
+ # API Auditor Instructions
58
+
59
+ You act as a QA engineer specialized in API reliability. When this skill is
60
+ active, you MUST:
61
+
62
+ 1. **Audit**: Use the bundled `scripts/audit.js` utility to check the
63
+ status of the provided URL.
64
+ 2. **Report**: Analyze the output (status codes, latency) and explain any
65
+ failures in plain English.
66
+ 3. **Secure**: Remind the user if they are testing a sensitive endpoint
67
+ without an `https://` protocol.
68
+ ```
69
+
70
+ 3. **Create the bundled Node.js script:** Create a file at
71
+ `.gemini/skills/api-auditor/scripts/audit.js`. This script will be used by
72
+ the agent to perform the actual check:
73
+
74
+ ```javascript
75
+ // .gemini/skills/api-auditor/scripts/audit.js
76
+ const url = process.argv[2];
77
+
78
+ if (!url) {
79
+ console.error('Usage: node audit.js <url>');
80
+ process.exit(1);
81
+ }
82
+
83
+ console.log(`Auditing ${url}...`);
84
+ fetch(url, { method: 'HEAD' })
85
+ .then((r) => console.log(`Result: Success (Status ${r.status})`))
86
+ .catch((e) => console.error(`Result: Failed (${e.message})`));
87
+ ```
88
+
89
+ ## 3. Verify the Skill is Discovered
90
+
91
+ Use the `/skills` slash command (or `gemini skills list` from your terminal) to
92
+ see if Gemini CLI has found your new skill.
93
+
94
+ In a Gemini CLI session:
95
+
96
+ ```
97
+ /skills list
98
+ ```
99
+
100
+ You should see `api-auditor` in the list of available skills.
101
+
102
+ ## 4. Use the Skill in a Chat
103
+
104
+ Now, let's see the skill in action. Start a new session and ask a question about
105
+ an endpoint.
106
+
107
+ **User:** "Can you audit http://geminili.com"
108
+
109
+ Gemini will recognize the request matches the `api-auditor` description and will
110
+ ask for your permission to activate it.
111
+
112
+ **Model:** (After calling `activate_skill`) "I've activated the **api-auditor**
113
+ skill. I'll run the audit script now..."
114
+
115
+ Gemini will then use the `run_shell_command` tool to execute your bundled Node
116
+ script:
117
+
118
+ `node .gemini/skills/api-auditor/scripts/audit.js http://geminili.com`
119
+
120
+ ## Next Steps
121
+
122
+ - Explore [Agent Skills Authoring Guide](../skills.md#creating-a-skill) to learn
123
+ about more advanced skill features.
124
+ - Learn how to share skills via [Extensions](../../extensions/index.md).
@@ -2,6 +2,10 @@
2
2
 
3
3
  This page contains tutorials for interacting with Gemini CLI.
4
4
 
5
+ ## Agent Skills
6
+
7
+ - [Getting Started with Agent Skills](./tutorials/skills-getting-started.md)
8
+
5
9
  ## Setting up a Model Context Protocol (MCP) server
6
10
 
7
11
  > [!CAUTION] Before using a third-party MCP server, ensure you trust its source
@@ -68,6 +68,10 @@ If you are using the default "pro" model and the CLI detects that you are being
68
68
  rate-limited, it automatically switches to the "flash" model for the current
69
69
  session. This allows you to continue working without interruption.
70
70
 
71
+ Internal utility calls that use `gemini-2.5-flash-lite` (for example, prompt
72
+ completion and classification) silently fall back to `gemini-2.5-flash` and
73
+ `gemini-2.5-pro` when quota is exhausted, without changing the configured model.
74
+
71
75
  ## File discovery service
72
76
 
73
77
  The file discovery service is responsible for finding files in the project that
@@ -83,7 +83,9 @@ The processor automatically detects and prevents circular imports:
83
83
  # file-a.md
84
84
 
85
85
  @./file-b.md
86
+ ```
86
87
 
88
+ ```markdown
87
89
  # file-b.md
88
90
 
89
91
  @./file-a.md <!-- This will be detected and prevented -->
@@ -258,8 +258,9 @@ The Gemini CLI ships with a set of default policies to provide a safe
258
258
  out-of-the-box experience.
259
259
 
260
260
  - **Read-only tools** (like `read_file`, `glob`) are generally **allowed**.
261
- - **Agent delegation** (like `delegate_to_agent`) is **allowed** (sub-agent
262
- actions are checked individually).
261
+ - **Agent delegation** (like `delegate_to_agent`) defaults to **`ask_user`** to
262
+ ensure remote agents can prompt for confirmation, but local sub-agent actions
263
+ are executed silently and checked individually.
263
264
  - **Write tools** (like `write_file`, `run_shell_command`) default to
264
265
  **`ask_user`**.
265
266
  - In **`yolo`** mode, a high-priority rule allows all tools.
@@ -222,9 +222,45 @@ need this for extensions built to expose commands and prompts.
222
222
  Restart the CLI again. The model will now have the context from your
223
223
  `CODEFLY.md` file in every session where the extension is active.
224
224
 
225
- ## Step 6: Releasing your extension
225
+ ## (Optional) Step 6: Add an Agent Skill
226
226
 
227
- Once you are happy with your extension, you can share it with others. The two
227
+ _Note: This is an experimental feature enabled via `experimental.skills`._
228
+
229
+ [Agent Skills](../cli/skills.md) let you bundle specialized expertise and
230
+ procedural workflows. Unlike `GEMINI.md`, which provides persistent context,
231
+ skills are activated only when needed, saving context tokens.
232
+
233
+ 1. Create a `skills` directory and a subdirectory for your skill:
234
+
235
+ ```bash
236
+ mkdir -p skills/security-audit
237
+ ```
238
+
239
+ 2. Create a `skills/security-audit/SKILL.md` file:
240
+
241
+ ```markdown
242
+ ---
243
+ name: security-audit
244
+ description:
245
+ Expertise in auditing code for security vulnerabilities. Use when the user
246
+ asks to "check for security issues" or "audit" their changes.
247
+ ---
248
+
249
+ # Security Auditor
250
+
251
+ You are an expert security researcher. When auditing code:
252
+
253
+ 1. Look for common vulnerabilities (OWASP Top 10).
254
+ 2. Check for hardcoded secrets or API keys.
255
+ 3. Suggest remediation steps for any findings.
256
+ ```
257
+
258
+ Skills bundled with your extension are automatically discovered and can be
259
+ activated by the model during a session when it identifies a relevant task.
260
+
261
+ ## Step 7: Release your extension
262
+
263
+ Once you're happy with your extension, you can share it with others. The two
228
264
  primary ways of releasing extensions are via a Git repository or through GitHub
229
265
  Releases. Using a public Git repository is the simplest method.
230
266
 
@@ -239,6 +275,7 @@ You've successfully created a Gemini CLI extension! You learned how to:
239
275
  - Add custom tools with an MCP server.
240
276
  - Create convenient custom commands.
241
277
  - Provide persistent context to the model.
278
+ - Bundle specialized Agent Skills.
242
279
  - Link your extension for local development.
243
280
 
244
281
  From here, you can explore more advanced features and build powerful new