Feature: /skills add <org/repo> with local-by-default and --global option
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
### 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_
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.