Skip to content

Commit b81b85e

Browse files
saritaibabakks
andauthored
Add info on "gh skill" to cloud agent docs (#60833)
Co-authored-by: Babak K. Shandiz <babakks@github.com>
1 parent a5dab5e commit b81b85e

4 files changed

Lines changed: 121 additions & 2 deletions

File tree

content/copilot/concepts/agents/about-agent-skills.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ contentType: concepts
1818

1919
Agent skills are folders of instructions, scripts, and resources that {% data variables.product.prodname_copilot_short %} can load when relevant to improve its performance in specialized tasks. The Agent Skills specification is an [open standard](https://github.com/agentskills/agentskills), used by a range of different AI systems.
2020

21-
You can create your own skills to teach {% data variables.product.prodname_copilot_short %} to perform tasks in a specific, repeatable way—or use skills shared online, for example in the [`anthropics/skills`](https://github.com/anthropics/skills) repository or {% data variables.product.company_short %}'s community created [`github/awesome-copilot`](https://github.com/github/awesome-copilot) collection.
21+
You can create your own skills to teach {% data variables.product.prodname_copilot_short %} to perform tasks in a specific, repeatable way—or use skills shared online, for example in the [`anthropics/skills`](https://github.com/anthropics/skills) repository or {% data variables.product.company_short %}'s community-created [`github/awesome-copilot`](https://github.com/github/awesome-copilot) collection.
22+
23+
You can also use `gh skill` in {% data variables.product.prodname_cli %} to discover and install skills from {% data variables.product.github %} repositories. For more information, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/cloud-agent/add-skills#managing-skills-with-github-cli).
2224

2325
{% data variables.product.prodname_copilot_short %} supports:
2426

content/copilot/how-tos/copilot-cli/customize-copilot/add-skills.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Agent skills are folders of instructions, scripts, and resources that {% data va
2525

2626
SKILL-NAME is defined in the SKILL.md file and is typically the same as the name of the skill directory.
2727

28-
2928
## Using agent skills
3029

3130
{% data reusables.copilot.skills-using %}

content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,121 @@ Agent skills are folders of instructions, scripts, and resources that {% data va
2222

2323
{% data reusables.copilot.creating-adding-skills %}
2424

25+
## Managing skills with {% data variables.product.prodname_cli %}
26+
27+
> [!NOTE]
28+
> `gh skill` is in {% data variables.release-phases.public_preview %} and subject to change. To use it, update {% data variables.product.prodname_cli %} to version 2.90.0 or later.
29+
30+
You can use the `gh skill` command in {% data variables.product.prodname_cli %} to discover, install, update, and publish agent skills from {% data variables.product.github %} repositories.
31+
32+
For the full list of `gh skill` subcommands, run `gh skill --help` or see the [`gh skill`](https://cli.github.com/manual/gh_skill) section of the {% data variables.product.prodname_cli %} manual.
33+
34+
### Installing skills
35+
36+
You can search for skills, preview them, and install them from {% data variables.product.github %} repositories.
37+
38+
> [!WARNING]
39+
> Skills are not verified by {% data variables.product.github %} and may contain prompt injections, hidden instructions, or malicious scripts. Always inspect the content of a skill before installation using `gh skill preview`.
40+
41+
1. Search for skills by topic:
42+
43+
```shell
44+
gh skill search TOPIC
45+
```
46+
47+
1. Preview a skill to inspect its contents before installing. This renders the skill's `SKILL.md` and file tree in your terminal without installing anything:
48+
49+
```shell
50+
gh skill preview OWNER/REPOSITORY SKILL
51+
```
52+
53+
1. Install a skill. You can run `gh skill install` with no arguments for a fully interactive flow, or specify a repository to browse its skills interactively:
54+
55+
```shell
56+
gh skill install OWNER/REPOSITORY
57+
```
58+
59+
To install a specific skill directly:
60+
61+
```shell
62+
gh skill install OWNER/REPOSITORY SKILL
63+
```
64+
65+
For example, to install a skill from the [`github/awesome-copilot`](https://github.com/github/awesome-copilot) repository:
66+
67+
```shell copy
68+
gh skill install github/awesome-copilot documentation-writer
69+
```
70+
71+
You can install a specific version using `@TAG` or `@SHA`:
72+
73+
```shell copy
74+
gh skill install github/awesome-copilot documentation-writer@v1.2.0
75+
```
76+
77+
To lock a skill to a specific version (or commit SHA) so it is skipped during updates, use `--pin`:
78+
79+
```shell copy
80+
gh skill install github/awesome-copilot documentation-writer --pin v1.2.0
81+
```
82+
83+
> [!NOTE]
84+
> The `@VERSION` syntax and `--pin` flag are mutually exclusive. Use one or the other, not both.
85+
86+
To install a skill for a specific agent host, use the `--agent` flag. To control the install scope, use `--scope`:
87+
88+
```shell copy
89+
gh skill install github/awesome-copilot documentation-writer --agent claude-code --scope user
90+
```
91+
92+
Skills are automatically installed to the correct directory for your agent host. By default, skills are installed for {% data variables.product.prodname_copilot_short %} at project scope.
93+
94+
### Updating skills
95+
96+
When you install a skill with `gh skill`, provenance metadata is written into the skill's `SKILL.md` frontmatter, including the source repository, ref, and tree SHA. The `gh skill update` command uses this metadata to check for upstream changes.
97+
98+
To check for updates interactively:
99+
100+
```shell
101+
gh skill update
102+
```
103+
104+
To update a specific skill:
105+
106+
```shell
107+
gh skill update SKILL
108+
```
109+
110+
To update all installed skills without prompting:
111+
112+
```shell
113+
gh skill update --all
114+
```
115+
116+
Pinned skills are skipped during updates. To update a pinned skill, reinstall it with a new `--pin` value.
117+
118+
### Publishing skills
119+
120+
If you maintain a skills repository, you can validate and publish your skills using {% data variables.product.prodname_cli %}.
121+
122+
To validate your skills against the [Agent Skills specification](https://agentskills.io/specification) and check remote settings like tag protection, secret scanning, and code scanning, without publishing, use `--dry-run`:
123+
124+
```shell
125+
gh skill publish --dry-run
126+
```
127+
128+
To auto-fix metadata issues in your skill files, use `--fix`. This does not publish your skills:
129+
130+
```shell
131+
gh skill publish --fix
132+
```
133+
134+
To validate and publish your skills:
135+
136+
```shell
137+
gh skill publish
138+
```
139+
25140
## How {% data variables.product.prodname_copilot_short %} uses agent skills
26141

27142
{% data reusables.copilot.skills-using %}

data/reusables/copilot/creating-adding-skills.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ To create a skill that runs a script:
8989

9090
In addition to creating your own skills, you can also add skills that other people have created.
9191

92+
> [!TIP]
93+
> You can also use `gh skill` in {% data variables.product.prodname_cli %} to search for, install, update, and publish agent skills. For more information, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/cloud-agent/add-skills#managing-skills-with-github-cli).
94+
9295
1. Download a skill directory (that is, a directory containing a SKILL.md file and, optionally, other files and subdirectories).
9396

9497
For example, download a skill from the Awesome {% data variables.product.prodname_copilot %} repository: https://awesome-copilot.github.com/skills/.

0 commit comments

Comments
 (0)