Skip to content

Commit b89a5d0

Browse files
MVoggeBullitt300
andauthored
COPSPA-57 // Implement CLI tools for finding, installing and updating external skills (#4)
* COPSPA-57 // Implement CLI tools for finding, installing and updating external skills through the database currated at skills.sh * COPSPA-57 // Update README with new functions and bump version * COPSPA-57: Changelog * Update CHANGELOG.md --------- Co-authored-by: Patrick <p.mehringer@techdivision.com> Co-authored-by: Patrick Mehringer <bullitt300@googlemail.com>
1 parent c245f30 commit b89a5d0

8 files changed

Lines changed: 1282 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,36 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.2.0] - 2025-03-04
8+
## [0.3.0] - 2026-03-12
9+
10+
### Added
11+
- **skills.sh Integration**: New CLI tools for managing external skills from the skills.sh database
12+
- `opencode-link external-skills:find [query]` - Search the skills.sh database for available skills
13+
- `opencode-link external-skills:add <owner/repo> <skill-name>` - Add skill to config and install
14+
- `opencode-link external-skills:install` - Install/update external skills
15+
- `opencode-link external-skills:update` - Update external skills to latest version
16+
- `opencode-link external-skills:list` - Show installed external skills
17+
- New modules:
18+
- `lib/external-skills.js` - Core logic for external skills management
19+
- `lib/skills-registry.js` - Skills registry management and search functionality
20+
- JSON schema generation for external skills validation
21+
22+
### Changed
23+
- `bin/opencode-link.js` - Extended with new CLI commands for skills.sh integration
24+
- `README.md` - Updated documentation with new functions
25+
- `package.json` - Updated dependencies and version
26+
27+
### Details
28+
This release introduces full integration with the skills.sh database, enabling users to discover, install, and manage custom skills. The implementation provides seamless interoperability with the OpenCode plugin system.
29+
30+
## [0.2.0] - 2026-03-04
931

1032
### Added
1133
- GitHub Actions workflow for automatic npm publishing on version tags
1234
- `files` array in package.json for explicit publish contents
1335
- npm provenance support for supply chain security
1436

15-
## [0.1.0] - 2025-03-04
37+
## [0.1.0] - 2026-03-04
1638

1739
### Added
1840
- User config directory support (`~/.config/opencode/node_modules/`)

README.md

Lines changed: 104 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,115 @@ opencode-link time-tracking
188188

189189
**Note:** Commands are prefixed with the plugin name to avoid conflicts between plugins.
190190

191+
## External Skills
192+
193+
External skills are agent skills sourced directly from GitHub repositories, curated via [skills.sh](https://skills.sh). They are downloaded and symlinked automatically — no npm install required.
194+
195+
### Quick Start
196+
197+
```bash
198+
# Search for skills
199+
opencode-link external-skills:find react
200+
201+
# Add a skill to your project (updates opencode-project.json + installs immediately)
202+
opencode-link external-skills:add vercel-labs/agent-skills vercel-react-best-practices
203+
204+
# Show installed external skills
205+
opencode-link external-skills:list
206+
```
207+
208+
### How It Works
209+
210+
1. Skills are configured in `.opencode/opencode-project.json` under `externalSkills`
211+
2. `opencode-link` (default run) detects the config and downloads/links them automatically
212+
3. Files land in `.opencode/.external-skills/<skill-name>/SKILL.md` (gitignored)
213+
4. Symlinks are created in `.opencode/skills/<skill-name>/`
214+
215+
### Configuration (`opencode-project.json`)
216+
217+
```json
218+
{
219+
"externalSkills": [
220+
{
221+
"source": "vercel-labs/agent-skills",
222+
"skills": ["vercel-react-best-practices", "vercel-nextjs-app-router"],
223+
"branch": "main",
224+
"category": "optional"
225+
},
226+
{
227+
"source": "some-org/all-their-skills"
228+
}
229+
]
230+
}
231+
```
232+
233+
| Field | Required | Default | Description |
234+
|-------|----------|---------|-------------|
235+
| `source` | yes || GitHub `owner/repo` |
236+
| `skills` | no | all | Skill names to install. Omit to install all skills in the repo. |
237+
| `branch` | no | `main` | Git branch to download from |
238+
| `category` | no | `optional` | `standard` or `optional` |
239+
240+
### Security Checks
241+
242+
Before downloading, each skill is audited via three security partners (ATH, Socket, Snyk):
243+
244+
| Risk level | Behaviour |
245+
|------------|-----------|
246+
| `safe` / `low` | Installed automatically |
247+
| `medium` | Installed with a warning |
248+
| `high` | Interactive confirmation required (non-interactive: aborted) |
249+
| `critical` | Always skipped |
250+
251+
Use `--force` to bypass high-risk prompts or to force reinstall an up-to-date skill.
252+
253+
> **Note:** Security data is fetched from `add-skill.vercel.sh`. If the service is unavailable, installation continues with a warning — it never blocks.
254+
255+
### Update Detection
256+
257+
Skills store a SHA fingerprint (`.skill-meta.json`) after download. Subsequent runs skip skills whose SHA hasn't changed. Use `external-skills:update` to explicitly pull the latest version.
258+
259+
```bash
260+
# Re-download skills where the upstream SHA changed
261+
opencode-link external-skills:update
262+
263+
# Force-reinstall all skills regardless of SHA
264+
opencode-link --force external-skills:install
265+
```
266+
267+
### GitHub Rate Limits
268+
269+
The GitHub API is used to fetch file SHAs. Set `GITHUB_TOKEN` to increase the rate limit:
270+
271+
```bash
272+
export GITHUB_TOKEN=ghp_...
273+
opencode-link external-skills:install
274+
```
275+
191276
## Commands
192277

193278
| Command | Description |
194279
|---------|-------------|
195-
| `opencode-link` | Link all standard plugins |
280+
| `opencode-link` | Link all standard plugins + install configured external skills |
196281
| `opencode-link all` | Link ALL plugins (standard + optional) |
197282
| `opencode-link <plugin>` | Link a specific plugin |
198-
| `opencode-link list` | List available plugins |
283+
| `opencode-link list` | List available plugins and configured external skills |
199284
| `opencode-link status` | Show current links |
200-
| `opencode-link clean` | Remove all symlinks |
285+
| `opencode-link clean` | Remove all symlinks and `.external-skills/` directory |
201286
| `opencode-link schema` | Regenerate schema |
287+
| `opencode-link external-skills:find <query>` | Search skills.sh for skills |
288+
| `opencode-link external-skills:add <owner/repo> <skill>` | Add skill to config and install |
289+
| `opencode-link external-skills:install` | Install/update all configured external skills |
290+
| `opencode-link external-skills:update` | Re-download skills with upstream changes |
291+
| `opencode-link external-skills:list` | Show installed external skills with security status |
202292

203293
## Options
204294

205295
| Flag | Description |
206296
|------|-------------|
207297
| `--target-dir=<path>` | Override target directory |
208298
| `--singular` | Use singular directory names (agent/ instead of agents/) |
299+
| `--force` | Force reinstall even if up to date; bypass high-risk security prompt |
209300

210301
## Programmatic Usage
211302

@@ -215,14 +306,21 @@ You can also use the CLI modules programmatically:
215306
import { discoverPlugins, getContentTypes } from '@techdivision/opencode-cli/discovery';
216307
import { createSymlink, getItemsToLink } from '@techdivision/opencode-cli/linker';
217308
import { generateCombinedSchema } from '@techdivision/opencode-cli/schema';
309+
import { searchSkills, fetchAuditData } from '@techdivision/opencode-cli/skills-registry';
310+
import { installExternalSkills, listInstalledExternalSkills } from '@techdivision/opencode-cli/external-skills';
218311

219312
// Discover plugins
220313
const plugins = discoverPlugins('/path/to/.opencode');
221314
console.log(`Found ${plugins.size} plugins`);
222315

223-
// Get all content types
224-
const types = getContentTypes(plugins);
225-
console.log(`Content types: ${types.join(', ')}`);
316+
// Search skills.sh
317+
const results = await searchSkills('react');
318+
319+
// Install configured external skills
320+
await installExternalSkills('/path/to/.opencode', { force: false });
321+
322+
// List installed external skills
323+
const installed = listInstalledExternalSkills('/path/to/.opencode');
226324
```
227325

228326
## License

0 commit comments

Comments
 (0)