opencode-skills-collection 4.0.77 → 4.1.0
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.
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ bundled-skills/ (npm package)
|
|
|
61
61
|
|
|
62
62
|
**2. On-demand skill loading**
|
|
63
63
|
|
|
64
|
-
Each pointer file tells the AI: *"there are N skills for this category in the vault — use `
|
|
64
|
+
Each pointer file tells the AI: *"there are N skills for this category in the vault — use `read` to
|
|
65
65
|
retrieve them when needed."*
|
|
66
66
|
The full skill content is only injected into context when the AI actually needs it.
|
|
67
67
|
|
|
@@ -104,8 +104,20 @@ After the first startup, your `~/.config/opencode/` directory looks like this:
|
|
|
104
104
|
|
|
105
105
|
Add the plugin to your global OpenCode configuration file at `~/.config/opencode/opencode.json`:
|
|
106
106
|
|
|
107
|
-
```
|
|
107
|
+
```jsonc
|
|
108
|
+
{
|
|
109
|
+
// OpenCode V2
|
|
110
|
+
"plugins": [
|
|
111
|
+
"opencode-skills-collection@latest"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
For OpenCode V1 (>= 1.18.29), use the `plugin` key instead (older V1 releases expect a function entrypoint and cannot load this version):
|
|
117
|
+
|
|
118
|
+
```jsonc
|
|
108
119
|
{
|
|
120
|
+
// OpenCode V1
|
|
109
121
|
"plugin": [
|
|
110
122
|
"opencode-skills-collection@latest"
|
|
111
123
|
]
|
|
@@ -249,8 +261,20 @@ Beta versions are published from the `develop` branch for testing before officia
|
|
|
249
261
|
|
|
250
262
|
To use the latest beta version, update your `~/.config/opencode/opencode.json`:
|
|
251
263
|
|
|
252
|
-
```
|
|
264
|
+
```jsonc
|
|
265
|
+
{
|
|
266
|
+
// OpenCode V2
|
|
267
|
+
"plugins": [
|
|
268
|
+
"opencode-skills-collection@beta"
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
For OpenCode V1 (>= 1.18.29):
|
|
274
|
+
|
|
275
|
+
```jsonc
|
|
253
276
|
{
|
|
277
|
+
// OpenCode V1
|
|
254
278
|
"plugin": [
|
|
255
279
|
"opencode-skills-collection@beta"
|
|
256
280
|
]
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* 2. Generates lightweight category pointer SKILL.md files in
|
|
10
|
-
* ~/.config/opencode/skills/ without touching user custom skills.
|
|
11
|
-
*/
|
|
12
|
-
declare const OpenCodeSkillsCollection: Plugin;
|
|
13
|
-
export default OpenCodeSkillsCollection;
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import { Plugin } from "@opencode/plugin";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
id: string;
|
|
5
|
+
setup: (context: Plugin.Context) => Promise<Plugin.Cleanup | void> | Plugin.Cleanup | void;
|
|
6
|
+
server(ctx: PluginInput): Promise<import("@opencode-ai/plugin").Hooks>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Plugin } from "@opencode/plugin";
|
|
1
2
|
import os from "os";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import { fileURLToPath } from "url";
|
|
@@ -11,8 +12,14 @@ function resolveBundledSkillsPath() {
|
|
|
11
12
|
function resolveActiveSkillsDir() {
|
|
12
13
|
return path.join(os.homedir(), ...ACTIVE_SKILLS_PATH_SEGMENTS);
|
|
13
14
|
}
|
|
15
|
+
function runStartupPipeline() {
|
|
16
|
+
const bundledSkillsPath = resolveBundledSkillsPath();
|
|
17
|
+
const activeSkillsDir = resolveActiveSkillsDir();
|
|
18
|
+
ensureDir(activeSkillsDir);
|
|
19
|
+
runSkillPointer({ bundledSkillsPath, activeSkillsDir });
|
|
20
|
+
}
|
|
14
21
|
/**
|
|
15
|
-
* OpenCode Skills Collection plugin.
|
|
22
|
+
* OpenCode Skills Collection plugin (V1 + V2 from a single entrypoint).
|
|
16
23
|
*
|
|
17
24
|
* On every OpenCode startup:
|
|
18
25
|
* 1. Copies bundled skills directly into the vault
|
|
@@ -21,16 +28,28 @@ function resolveActiveSkillsDir() {
|
|
|
21
28
|
* 2. Generates lightweight category pointer SKILL.md files in
|
|
22
29
|
* ~/.config/opencode/skills/ without touching user custom skills.
|
|
23
30
|
*/
|
|
24
|
-
const
|
|
31
|
+
const OpenCodeSkillsCollectionV1 = async (_ctx) => {
|
|
25
32
|
try {
|
|
26
|
-
|
|
27
|
-
const activeSkillsDir = resolveActiveSkillsDir();
|
|
28
|
-
ensureDir(activeSkillsDir);
|
|
29
|
-
runSkillPointer({ bundledSkillsPath, activeSkillsDir });
|
|
33
|
+
runStartupPipeline();
|
|
30
34
|
}
|
|
31
35
|
catch (error) {
|
|
32
36
|
process.stderr.write(`[opencode-skills-collection] ${error}\n`);
|
|
33
37
|
}
|
|
34
38
|
return {};
|
|
35
39
|
};
|
|
36
|
-
export default
|
|
40
|
+
export default {
|
|
41
|
+
...Plugin.define({
|
|
42
|
+
id: "opencode-skills-collection",
|
|
43
|
+
async setup(_ctx) {
|
|
44
|
+
try {
|
|
45
|
+
runStartupPipeline();
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
process.stderr.write(`[opencode-skills-collection] ${error}\n`);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
async server(ctx) {
|
|
53
|
+
return OpenCodeSkillsCollectionV1(ctx);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -4,7 +4,6 @@ import type { SkillIndexEntry } from "./vault-installer.js";
|
|
|
4
4
|
* a lightweight pointer SKILL.md into the active skills directory.
|
|
5
5
|
*
|
|
6
6
|
* Each pointer includes the full list of skill names + descriptions
|
|
7
|
-
* so
|
|
8
|
-
* via get_available_skills without loading every SKILL.md.
|
|
7
|
+
* so the agent can match tasks to skills without loading every SKILL.md.
|
|
9
8
|
*/
|
|
10
9
|
export declare function generatePointers(activeSkillsDir: string, vaultDir: string, index?: SkillIndexEntry[]): void;
|
|
@@ -28,7 +28,7 @@ ${skillList}
|
|
|
28
28
|
## How to load a skill
|
|
29
29
|
|
|
30
30
|
1. Identify the skill name above matching your task.
|
|
31
|
-
2. Use \`
|
|
31
|
+
2. Use \`read\` to load its \`SKILL.md\` from the vault:
|
|
32
32
|
\`${normalizedPath}/<skill-name>/SKILL.md\`
|
|
33
33
|
3. Follow those instructions to complete the request.
|
|
34
34
|
|
|
@@ -44,8 +44,7 @@ ${skillList}
|
|
|
44
44
|
* a lightweight pointer SKILL.md into the active skills directory.
|
|
45
45
|
*
|
|
46
46
|
* Each pointer includes the full list of skill names + descriptions
|
|
47
|
-
* so
|
|
48
|
-
* via get_available_skills without loading every SKILL.md.
|
|
47
|
+
* so the agent can match tasks to skills without loading every SKILL.md.
|
|
49
48
|
*/
|
|
50
49
|
export function generatePointers(activeSkillsDir, vaultDir, index = []) {
|
|
51
50
|
const byCategory = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-skills-collection",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "OpenCode CLI plugin that automatically downloads and keeps skills up to date.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
],
|
|
34
34
|
"author": "Davide Ladisa <info@davideladisa.it>",
|
|
35
35
|
"license": "MIT",
|
|
36
|
-
"packageManager": "bun@1.
|
|
36
|
+
"packageManager": "bun@1.4.2",
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public",
|
|
39
39
|
"provenance": true
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@opencode-ai/plugin": "^1.15.5",
|
|
43
|
+
"@opencode/plugin": "^2.0.18",
|
|
43
44
|
"strip-json-comments": "^5.0.3"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@opencode-ai/sdk": "^1.15.5",
|
|
47
47
|
"@types/bun": "*",
|
|
48
48
|
"@types/node": "^26.0.0",
|
|
49
49
|
"@types/strip-json-comments": "^3.0.0",
|