github / github/copilot-cli

Feature: /skills add <org/repo> with local-by-default and --global option

未关闭
#1,619 0 条评论 8 个 reaction 已指派 0 人 在 GitHub 查看
area:plugins
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

install skills using the command /skills add and passing a repo (org/repo) to add the skill either local or global.

### Proposed solution

## Summary

Add a new option to the `/skills add` command that accepts a GitHub repository in `org/repo` format (e.g., `spboyer/sensei`) and installs the skill with its related resources to the appropriate Copilot folder. Skills should be **local to the project by default** with a `--global` flag for user-wide installation.

## Motivation

Currently there's no streamlined way to install a skill from a GitHub repo directly into the Copilot CLI skills system. Users have to manually clone repos and copy files into `~/.copilot/skills/` or `.github/skills/`. This friction slows skill adoption and sharing.

The Anthropic/Claude Code ecosystem uses `npx skills add org/repo` which demonstrates demand for this pattern. Copilot CLI should have a native equivalent via the `/skills` command. `npx skills add` installs to ~/.agents, Copilot cli does not look there, VS Code can be configured for that. `/add-dir` does not solve either.

## Proposed Behavior

### Basic usage (local to project):
```
/skills add spboyer/sensei
```
- Clones/downloads the skill from `github.com/spboyer/sensei`
- Copies `SKILL.md` and related resources (`references/`, `scripts/`, `assets/`) to `.github/skills//` in the current project
- Skill is available only in this project context

### Global installation:
```
/skills add spboyer/sensei --global
```
- Copies to `~/.copilot/skills//`
- Skill is available across all projects

### Expected behavior:
1. **Resolve repo** — Fetch from `github.com//`
2. **Detect skill structure** — Find `SKILL.md` at repo root or in `skills/` subdirectories
3. **Copy resources** — Copy `SKILL.md` + bundled resources (`references/`, `scripts/`, `assets/`) to the target folder
4. **Auto-reload** — Skills should be immediately available without restarting the session
5. **Lock file** — Track installed skills with source, version/SHA, and install timestamp

### Scope options:
| Flag | Target Directory | Scope |
|------|-----------------|-------|
| *(default)* | `.github/skills//` | Project-local |
| `--global` | `~/.copilot/skills//` | All projects |

## Additional Considerations

- Should validate the skill using frontmatter checks (`name`, `description` required) before installing
- Should warn if a skill with the same name already exists and offer to update/overwrite
- Could support `org/repo@ref` syntax for pinning to a branch/tag/commit
- Should exclude `.git/`, `node_modules/`, and other non-skill files from the copy
- A `/skills remove ` and `/skills update ` would complement this feature

## Example Workflow

```
> /skills add spboyer/repo-issue-triage
✅ Installed skill 'repo-issue-triage' to .github/skills/repo-issue-triage/
Source: github.com/spboyer/repo-issue-triage (SHA: abc123)
Files: SKILL.md, references/classification-rules.md, references/report-template.md

> /skills add spboyer/sensei --global
✅ Installed skill 'sensei' to ~/.copilot/skills/sensei/
Source: github.com/spboyer/sensei (SHA: def456)
Files: SKILL.md + 7 reference files + 3 scripts
```

### Example prompts or workflows

## Summary

Add a new option to the `/skills add` command that accepts a GitHub repository in `org/repo` format (e.g., `spboyer/sensei`) and installs the skill with its related resources to the appropriate Copilot folder. Skills should be **local to the project by default** with a `--global` flag for user-wide installation.

## Motivation

Currently there's no streamlined way to install a skill from a GitHub repo directly into the Copilot CLI skills system. Users have to manually clone repos and copy files into `~/.copilot/skills/` or `.github/skills/`. This friction slows skill adoption and sharing.

The Anthropic/Claude Code ecosystem uses `npx skills add org/repo` which demonstrates demand for this pattern. Copilot CLI should have a native equivalent via the `/skills` command.

`npx skills add` installs by default to ~/.agents/ - Copilot does not use this folder by default, adding directory does not solve (in cli, vscode works)

## Proposed Behavior

### Basic usage (local to project):
```
/skills add spboyer/sensei
```
- Clones/downloads the skill from `github.com/spboyer/sensei`
- Copies `SKILL.md` and related resources (`references/`, `scripts/`, `assets/`) to `.github/skills//` in the current project
- Skill is available only in this project context

### Global installation:
```
/skills add spboyer/sensei --global
```
- Copies to `~/.copilot/skills//`
- Skill is available across all projects

### Expected behavior:
1. **Resolve repo** — Fetch from `github.com//`
2. **Detect skill structure** — Find `SKILL.md` at repo root or in `skills/` subdirectories
3. **Copy resources** — Copy `SKILL.md` + bundled resources (`references/`, `scripts/`, `assets/`) to the target folder
4. **Auto-reload** — Skills should be immediately available without restarting the session
5. **Lock file** — Track installed skills with source, version/SHA, and install timestamp

### Scope options:
| Flag | Target Directory | Scope |
|------|-----------------|-------|
| *(default)* | `.github/skills//` | Project-local |
| `--global` | `~/.copilot/skills//` | All projects |

## Additional Considerations

- Should validate the skill using frontmatter checks (`name`, `description` required) before installing
- Should warn if a skill with the same name already exists and offer to update/overwrite
- Could support `org/repo@ref` syntax for pinning to a branch/tag/commit
- Should exclude `.git/`, `node_modules/`, and other non-skill files from the copy
- A `/skills remove ` and `/skills update ` would complement this feature

## Example Workflow

```
> /skills add spboyer/repo-issue-triage
✅ Installed skill 'repo-issue-triage' to .github/skills/repo-issue-triage/
Source: github.com/spboyer/repo-issue-triage (SHA: abc123)
Files: SKILL.md, references/classification-rules.md, references/report-template.md

> /skills add spboyer/sensei --global
✅ Installed skill 'sensei' to ~/.copilot/skills/sensei/
Source: github.com/spboyer/sensei (SHA: def456)
Files: SKILL.md + 7 reference files + 3 scripts
```

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。