opencode-skills-collection 1.0.210 → 2.0.0-beta.2

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.
Files changed (38) hide show
  1. package/README.md +89 -41
  2. package/bundled-skills/.antigravity-install-manifest.json +1 -12
  3. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  4. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  5. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  6. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  7. package/bundled-skills/docs/users/bundles.md +1 -1
  8. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  9. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  10. package/bundled-skills/docs/users/getting-started.md +1 -1
  11. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  12. package/bundled-skills/docs/users/usage.md +4 -4
  13. package/bundled-skills/docs/users/visual-guide.md +4 -4
  14. package/dist/constants/constants.d.ts +14 -0
  15. package/dist/constants/constants.js +14 -0
  16. package/dist/index.d.ts +10 -0
  17. package/dist/index.js +24 -60
  18. package/dist/skill-pointer/index.d.ts +23 -0
  19. package/dist/skill-pointer/index.js +28 -0
  20. package/dist/skill-pointer/pointer-generator.d.ts +10 -0
  21. package/dist/skill-pointer/pointer-generator.js +69 -0
  22. package/dist/skill-pointer/vault-installer.d.ts +17 -0
  23. package/dist/skill-pointer/vault-installer.js +86 -0
  24. package/dist/utils/fs.utils.d.ts +8 -0
  25. package/dist/utils/fs.utils.js +21 -0
  26. package/package.json +9 -7
  27. package/skills_index.json +30359 -0
  28. package/bundled-skills/ui-a11y/SKILL.md +0 -77
  29. package/bundled-skills/ui-component/SKILL.md +0 -100
  30. package/bundled-skills/ui-page/SKILL.md +0 -96
  31. package/bundled-skills/ui-pattern/SKILL.md +0 -88
  32. package/bundled-skills/ui-review/SKILL.md +0 -86
  33. package/bundled-skills/ui-setup/SKILL.md +0 -100
  34. package/bundled-skills/ui-tokens/SKILL.md +0 -69
  35. package/bundled-skills/ux-audit/SKILL.md +0 -62
  36. package/bundled-skills/ux-copy/SKILL.md +0 -79
  37. package/bundled-skills/ux-feedback/SKILL.md +0 -64
  38. package/bundled-skills/ux-flow/SKILL.md +0 -68
package/README.md CHANGED
@@ -14,42 +14,87 @@
14
14
 
15
15
  # OpenCode Skills Collection
16
16
 
17
- > An [OpenCode CLI](https://opencode.ai/) plugin that bundles and auto-syncs the [Antigravity Awesome Skills](https://github.com/sickn33/antigravity-awesome-skills) collection delivered instantly, with zero network latency at startup.
17
+ > An [OpenCode CLI](https://opencode.ai/) plugin that bundles and auto-syncs a universal collection of AI skills
18
+ > delivered instantly, with zero network latency at startup.
18
19
 
19
- > ⚠️ **Previously published as [`opencode-skills-antigravity`](https://www.npmjs.com/package/opencode-skills-antigravity)** — that package is now deprecated and points to this one.
20
+ > ⚠️ **Previously published
21
+ as [`opencode-skills-antigravity`](https://www.npmjs.com/package/opencode-skills-antigravity)** — that package is now
22
+ > deprecated and points to this one.
20
23
 
21
24
  ---
22
25
 
23
26
  ## Overview
24
27
 
25
- **OpenCode Skills Collection** bridges the OpenCode CLI with the Antigravity Awesome Skills repository. Instead of fetching skills on every startup, this plugin ships with a pre-bundled snapshot that gets copied directly to your local machine the moment OpenCode launches.
28
+ **OpenCode Skills Collection** ships a pre-bundled snapshot of 800+ universal skills for the OpenCode CLI.
26
29
 
27
- The result: skills are always fresh (synced hourly via GitHub Actions), always available (even offline), and always instant.
30
+ Instead of loading every skill into the AI context at startup which would consume ~80k tokens and cause compaction
31
+ loops — the plugin uses a **SkillPointer** architecture: skills are organized into categories inside a hidden vault and
32
+ only loaded into context on demand.
28
33
 
29
34
  ---
30
35
 
31
36
  ## How It Works
32
37
 
33
- The plugin operates in two phases:
38
+ The plugin operates in three phases:
34
39
 
35
- **1. Automated upstream sync (CI)**
40
+ **1. Local deployment (startup)**
36
41
 
37
- A GitHub Actions workflow runs every hour, checking the [Antigravity Awesome Skills](https://github.com/sickn33/antigravity-awesome-skills) repository for changes. When new or updated skills are detected, the workflow:
42
+ When OpenCode starts, the plugin copies the pre-bundled skills from the npm package and runs the **SkillPointer pipeline
43
+ **:
38
44
 
39
- - Re-bundles the skill files into `bundled-skills/`
40
- - Bumps the package version (`patch`)
41
- - Creates a tagged GitHub Release
42
- - Publishes the new version to npm
45
+ ```
46
+ bundled-skills/ (npm package)
47
+
48
+
49
+ ~/.config/opencode/skills/ ← OpenCode reads this
50
+
51
+ └── SkillPointer pipeline
52
+
53
+ ├─ vault-manager → moves 800+ raw skills to the vault
54
+ └─ pointer-generator → writes ~35 lightweight pointer files
55
+ ```
56
+
57
+ **2. On-demand skill loading**
58
+
59
+ Each pointer file tells the AI: *"there are N skills for this category in the vault — use `list_dir` / `view_file` to
60
+ retrieve them when needed."*
61
+ The full skill content is only injected into context when the AI actually needs it.
43
62
 
44
- **2. Local deployment (startup)**
63
+ ---
64
+
65
+ ## Disk Layout
45
66
 
46
- When OpenCode starts, the plugin runs and copies the pre-bundled skills from the npm package to:
67
+ After the first startup, your `~/.config/opencode/` directory looks like this:
47
68
 
48
69
  ```
49
- ~/.config/opencode/skills/
70
+ ~/.config/opencode/
71
+ ├── opencode.json
72
+ ├── skills/ ← ~35 pointer folders (active, read by OpenCode)
73
+ │ ├── backend-dev-category-pointer/
74
+ │ │ └── SKILL.md
75
+ │ ├── devops-category-pointer/
76
+ │ │ └── SKILL.md
77
+ │ └── ...
78
+ └── skill-libraries/ ← vault with all raw skills (hidden from startup context)
79
+ ├── backend-dev/
80
+ │ ├── laravel-expert/
81
+ │ │ └── SKILL.md
82
+ │ └── wordpress-core/
83
+ │ └── SKILL.md
84
+ ├── devops/
85
+ └── ...
50
86
  ```
51
87
 
52
- No network calls, no latency, no failures. If the copy somehow fails, a silent fallback attempts to fetch via `npx antigravity-awesome-skills` in the background.
88
+ ---
89
+
90
+ ## Context Usage
91
+
92
+ | | Without SkillPointer | With SkillPointer |
93
+ |----------------------|----------------------|---------------------|
94
+ | Folders in `skills/` | ~800 | ~35 |
95
+ | Tokens at startup | ~80,000 | ~255 |
96
+ | Skills available | All injected upfront | On-demand via vault |
97
+ | Compaction loops | ✗ frequent | ✓ none |
53
98
 
54
99
  ---
55
100
 
@@ -65,21 +110,24 @@ Add the plugin to your global OpenCode configuration file at `~/.config/opencode
65
110
  }
66
111
  ```
67
112
 
68
- That's it. OpenCode will automatically download the npm package on next startup via Bun — no manual `npm install` needed.
113
+ That's it. OpenCode will automatically download the npm package on next startup via Bun — no manual `npm install`
114
+ needed.
69
115
 
70
116
  ---
71
117
 
72
118
  ## Usage
73
119
 
74
- Once installed, all bundled skills are available in three ways:
120
+ Once installed, all skills are available in three ways:
75
121
 
76
122
  **Explicit invocation via CLI:**
123
+
77
124
  ```bash
78
125
  opencode run /brainstorming help me plan a new feature
79
126
  opencode run /refactor clean up this function
80
127
  ```
81
128
 
82
129
  **Slash commands in the OpenCode chat:**
130
+
83
131
  ```
84
132
  /brainstorming
85
133
  /refactor
@@ -87,6 +135,7 @@ opencode run /refactor clean up this function
87
135
  ```
88
136
 
89
137
  **Natural language — OpenCode picks the right skill automatically:**
138
+
90
139
  ```
91
140
  "Help me brainstorm ideas for a REST API design"
92
141
  "Refactor this function to be more readable"
@@ -94,26 +143,6 @@ opencode run /refactor clean up this function
94
143
 
95
144
  ---
96
145
 
97
- ## Project Structure
98
-
99
- ```
100
- opencode-skills-collection/
101
- ├── src/
102
- │ └── index.ts # Plugin entry point — copies bundled skills on startup
103
- ├── bundled-skills/ # Pre-bundled skills snapshot (auto-updated by CI)
104
- ├── dist/ # Compiled TypeScript output
105
- ├── .github/
106
- │ └── workflows/
107
- │ ├── sync-skills.yml # Hourly skill sync + auto-publish
108
- │ ├── release.yml # Manual version bump + GitHub Release
109
- │ ├── publish.yml # npm publish on new release
110
- │ └── merge-branch.yml # Keeps develop in sync with main
111
- ├── package.json
112
- └── tsconfig.json
113
- ```
114
-
115
- ---
116
-
117
146
  ## Development
118
147
 
119
148
  **Requirements:** Node.js ≥ 20, TypeScript ≥ 5
@@ -128,7 +157,8 @@ npm run build
128
157
  # Output is in dist/
129
158
  ```
130
159
 
131
- The plugin is written in TypeScript and compiled to ESNext with full type declarations. It targets ES2022 and uses ESM module resolution.
160
+ The plugin is written in TypeScript and compiled to ESNext with full type declarations. It targets ES2022 and uses ESM
161
+ module resolution.
132
162
 
133
163
  ---
134
164
 
@@ -150,12 +180,30 @@ The old `opencode-skills-antigravity` package on npm is deprecated and re-export
150
180
 
151
181
  ## Contributing
152
182
 
153
- Issues and pull requests are welcome at [github.com/FrancoStino/opencode-skills-collection](https://github.com/FrancoStino/opencode-skills-collection/issues).
183
+ Issues and pull requests are welcome
184
+ at [github.com/FrancoStino/opencode-skills-collection](https://github.com/FrancoStino/opencode-skills-collection/issues).
154
185
 
155
- If you'd like to contribute new skills to the upstream collection, head over to [antigravity-awesome-skills](https://github.com/sickn33/antigravity-awesome-skills) they'll be automatically picked up and bundled here within the hour.
186
+ If you'd like to contribute new skills to the collection, open a PR adding a new folder inside `bundled-skills/` it
187
+ will be automatically picked up on next sync.
156
188
 
157
189
  ---
158
190
 
191
+ ## Beta Releases
192
+
193
+ Beta versions are published from the `develop` branch for testing before official releases.
194
+
195
+ ### Installing Beta Versions
196
+
197
+ To use the latest beta version, update your `~/.config/opencode/opencode.json`:
198
+
199
+ ```json
200
+ {
201
+ "plugin": [
202
+ "opencode-skills-collection@beta"
203
+ ]
204
+ }
205
+ ```
206
+
159
207
  ## License
160
208
 
161
- MIT © [Davide Ladisa](https://www.davideladisa.it/)
209
+ [MIT ©](./LICENSE)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "updatedAt": "2026-04-09T09:09:48.777Z",
3
+ "updatedAt": "2026-04-08T09:03:21.581Z",
4
4
  "entries": [
5
5
  "00-andruia-consultant",
6
6
  "007",
@@ -1288,14 +1288,7 @@
1288
1288
  "typescript-advanced-types",
1289
1289
  "typescript-expert",
1290
1290
  "typescript-pro",
1291
- "ui-a11y",
1292
- "ui-component",
1293
- "ui-page",
1294
- "ui-pattern",
1295
- "ui-review",
1296
- "ui-setup",
1297
1291
  "ui-skills",
1298
- "ui-tokens",
1299
1292
  "ui-ux-designer",
1300
1293
  "ui-ux-pro-max",
1301
1294
  "ui-visual-validator",
@@ -1312,10 +1305,6 @@
1312
1305
  "using-neon",
1313
1306
  "using-superpowers",
1314
1307
  "uv-package-manager",
1315
- "ux-audit",
1316
- "ux-copy",
1317
- "ux-feedback",
1318
- "ux-flow",
1319
1308
  "ux-persuasion-engineer",
1320
1309
  "uxui-principles",
1321
1310
  "variant-analysis",
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  title: Jetski/Cortex + Gemini Integration Guide
3
- description: "Use antigravity-awesome-skills with Jetski/Cortex without hitting context-window overflow with 1.392+ skills."
3
+ description: "Use antigravity-awesome-skills with Jetski/Cortex without hitting context-window overflow with 1.381+ skills."
4
4
  ---
5
5
 
6
- # Jetski/Cortex + Gemini: safe integration with 1,1.392+ skills
6
+ # Jetski/Cortex + Gemini: safe integration with 1,1.381+ skills
7
7
 
8
8
  This guide shows how to integrate the `antigravity-awesome-skills` repository with an agent based on **Jetski/Cortex + Gemini** (or similar frameworks) **without exceeding the model context window**.
9
9
 
@@ -23,7 +23,7 @@ Never do:
23
23
  - concatenate all `SKILL.md` content into a single system prompt;
24
24
  - re-inject the entire library for **every** request.
25
25
 
26
- With over 1,1.392 skills, this approach fills the context window before user messages are even added, causing truncation.
26
+ With over 1,1.381 skills, this approach fills the context window before user messages are even added, causing truncation.
27
27
 
28
28
  ---
29
29
 
@@ -20,7 +20,7 @@ This example shows one way to integrate **antigravity-awesome-skills** with a Je
20
20
  - How to enforce a **maximum number of skills per turn** via `maxSkillsPerTurn`.
21
21
  - How to choose whether to **truncate or error** when too many skills are requested via `overflowBehavior`.
22
22
 
23
- This pattern avoids context overflow when you have 1,392+ skills installed.
23
+ This pattern avoids context overflow when you have 1,381+ skills installed.
24
24
 
25
25
  ---
26
26
 
@@ -6,7 +6,7 @@ This document keeps the repository's GitHub-facing discovery copy aligned with t
6
6
 
7
7
  Preferred positioning:
8
8
 
9
- > Installable GitHub library of 1,392+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and other AI coding assistants.
9
+ > Installable GitHub library of 1,381+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and other AI coding assistants.
10
10
 
11
11
  Key framing:
12
12
 
@@ -20,7 +20,7 @@ Key framing:
20
20
 
21
21
  Preferred description:
22
22
 
23
- > Installable GitHub library of 1,392+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
23
+ > Installable GitHub library of 1,381+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
24
24
 
25
25
  Preferred homepage:
26
26
 
@@ -28,7 +28,7 @@ Preferred homepage:
28
28
 
29
29
  Preferred social preview:
30
30
 
31
- - use a clean preview image that says `1,392+ Agentic Skills`;
31
+ - use a clean preview image that says `1,381+ Agentic Skills`;
32
32
  - mention Claude Code, Cursor, Codex CLI, and Gemini CLI;
33
33
  - avoid dense text and tiny logos that disappear in social cards.
34
34
 
@@ -69,7 +69,7 @@ For manual updates, you need:
69
69
  The update process refreshes:
70
70
  - Skills index (`skills_index.json`)
71
71
  - Web app skills data (`apps\web-app\public\skills.json`)
72
- - All 1,392+ skills from the skills directory
72
+ - All 1,381+ skills from the skills directory
73
73
 
74
74
  ## When to Update
75
75
 
@@ -673,4 +673,4 @@ Found a skill that should be in a bundle? Or want to create a new bundle? [Open
673
673
 
674
674
  ---
675
675
 
676
- _Last updated: March 2026 | Total Skills: 1,392+ | Total Bundles: 37_
676
+ _Last updated: March 2026 | Total Skills: 1,381+ | Total Bundles: 37_
@@ -12,7 +12,7 @@ Install the library into Claude Code, then invoke focused skills directly in the
12
12
 
13
13
  ## Why use this repo for Claude Code
14
14
 
15
- - It includes 1,392+ skills instead of a narrow single-domain starter pack.
15
+ - It includes 1,381+ skills instead of a narrow single-domain starter pack.
16
16
  - It supports the standard `.claude/skills/` path and the Claude Code plugin marketplace flow.
17
17
  - It also ships generated bundle plugins so teams can install focused packs like `Essentials` or `Security Developer` from the marketplace metadata.
18
18
  - It includes onboarding docs, bundles, and workflows so new users do not need to guess where to begin.
@@ -12,7 +12,7 @@ Install into the Gemini skills path, then ask Gemini to apply one skill at a tim
12
12
 
13
13
  - It installs directly into the expected Gemini skills path.
14
14
  - It includes both core software engineering skills and deeper agent/LLM-oriented skills.
15
- - It helps new users get started with bundles and workflows rather than forcing a cold start from 1,392+ files.
15
+ - It helps new users get started with bundles and workflows rather than forcing a cold start from 1,381+ files.
16
16
  - It is useful whether you want a broad internal skill library or a single repo to test many workflows quickly.
17
17
 
18
18
  ## Install Gemini CLI Skills
@@ -1,4 +1,4 @@
1
- # Getting Started with Antigravity Awesome Skills (V9.10.0)
1
+ # Getting Started with Antigravity Awesome Skills (V9.9.0)
2
2
 
3
3
  **New here? This guide will help you supercharge your AI Agent in 5 minutes.**
4
4
 
@@ -18,7 +18,7 @@ Kiro is AWS's agentic AI IDE that combines:
18
18
 
19
19
  Kiro's agentic capabilities are enhanced by skills that provide:
20
20
 
21
- - **Domain expertise** across 1,392+ specialized areas
21
+ - **Domain expertise** across 1,381+ specialized areas
22
22
  - **Best practices** from Anthropic, OpenAI, Google, Microsoft, and AWS
23
23
  - **Workflow automation** for common development tasks
24
24
  - **AWS-specific patterns** for serverless, infrastructure, and cloud architecture
@@ -14,7 +14,7 @@ If you came in through a **Claude Code** or **Codex** plugin instead of a full l
14
14
 
15
15
  When you ran `npx antigravity-awesome-skills` or cloned the repository, you:
16
16
 
17
- ✅ **Downloaded 1,392+ skill files** to your computer (default: `~/.gemini/antigravity/skills/`; or a custom path like `~/.agent/skills/` if you used `--path`)
17
+ ✅ **Downloaded 1,381+ skill files** to your computer (default: `~/.gemini/antigravity/skills/`; or a custom path like `~/.agent/skills/` if you used `--path`)
18
18
  ✅ **Made them available** to your AI assistant
19
19
  ❌ **Did NOT enable them all automatically** (they're just sitting there, waiting)
20
20
 
@@ -34,7 +34,7 @@ Bundles are **curated groups** of skills organized by role. They help you decide
34
34
 
35
35
  **Analogy:**
36
36
 
37
- - You installed a toolbox with 1,392+ tools (✅ done)
37
+ - You installed a toolbox with 1,381+ tools (✅ done)
38
38
  - Bundles are like **labeled organizer trays** saying: "If you're a carpenter, start with these 10 tools"
39
39
  - You can either **pick skills from the tray** or install that tray as a focused marketplace bundle plugin
40
40
 
@@ -212,7 +212,7 @@ Let's actually use a skill right now. Follow these steps:
212
212
 
213
213
  ## Step 5: Picking Your First Skills (Practical Advice)
214
214
 
215
- Don't try to use all 1,392+ skills at once. Here's a sensible approach:
215
+ Don't try to use all 1,381+ skills at once. Here's a sensible approach:
216
216
 
217
217
  If you want a tool-specific starting point before choosing skills, use:
218
218
 
@@ -343,7 +343,7 @@ Usually no, but if your AI doesn't recognize a skill:
343
343
 
344
344
  ### "Can I load all skills into the model at once?"
345
345
 
346
- No. Even though you have 1,392+ skills installed locally, you should **not** concatenate every `SKILL.md` into a single system prompt or context block.
346
+ No. Even though you have 1,381+ skills installed locally, you should **not** concatenate every `SKILL.md` into a single system prompt or context block.
347
347
 
348
348
  The intended pattern is:
349
349
 
@@ -34,7 +34,7 @@ antigravity-awesome-skills/
34
34
  ├── 📄 CONTRIBUTING.md ← Contributor workflow
35
35
  ├── 📄 CATALOG.md ← Full generated catalog
36
36
 
37
- ├── 📁 skills/ ← 1,392+ skills live here
37
+ ├── 📁 skills/ ← 1,381+ skills live here
38
38
  │ │
39
39
  │ ├── 📁 brainstorming/
40
40
  │ │ └── 📄 SKILL.md ← Skill definition
@@ -47,7 +47,7 @@ antigravity-awesome-skills/
47
47
  │ │ └── 📁 2d-games/
48
48
  │ │ └── 📄 SKILL.md ← Nested skills also supported
49
49
  │ │
50
- │ └── ... (1,392+ total)
50
+ │ └── ... (1,381+ total)
51
51
 
52
52
  ├── 📁 apps/
53
53
  │ └── 📁 web-app/ ← Interactive browser
@@ -100,7 +100,7 @@ antigravity-awesome-skills/
100
100
 
101
101
  ```
102
102
  ┌─────────────────────────┐
103
- │ 1,392+ SKILLS │
103
+ │ 1,381+ SKILLS │
104
104
  └────────────┬────────────┘
105
105
 
106
106
  ┌────────────────────────┼────────────────────────┐
@@ -201,7 +201,7 @@ If you want a workspace-style manual install instead, cloning into `.agent/skill
201
201
  │ ├── 📁 brainstorming/ │
202
202
  │ ├── 📁 stripe-integration/ │
203
203
  │ ├── 📁 react-best-practices/ │
204
- │ └── ... (1,392+ total) │
204
+ │ └── ... (1,381+ total) │
205
205
  └─────────────────────────────────────────┘
206
206
  ```
207
207
 
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared constants used across the plugin.
3
+ */
4
+ /** Suffix appended to every category pointer folder name. */
5
+ export declare const POINTER_SUFFIX: "-category-pointer";
6
+ /** Expected filename for every skill definition. */
7
+ export declare const SKILL_FILENAME: "SKILL.md";
8
+ /**
9
+ * Name of the vault directory that stores raw skills, co-located
10
+ * with the rest of OpenCode config under ~/.config/opencode/
11
+ */
12
+ export declare const VAULT_DIR_NAME: "skill-libraries";
13
+ /** Fallback category slug for skills not present in skills_index.json. */
14
+ export declare const UNCATEGORIZED_CATEGORY: "uncategorized";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared constants used across the plugin.
3
+ */
4
+ /** Suffix appended to every category pointer folder name. */
5
+ export const POINTER_SUFFIX = "-category-pointer";
6
+ /** Expected filename for every skill definition. */
7
+ export const SKILL_FILENAME = "SKILL.md";
8
+ /**
9
+ * Name of the vault directory that stores raw skills, co-located
10
+ * with the rest of OpenCode config under ~/.config/opencode/
11
+ */
12
+ export const VAULT_DIR_NAME = "skill-libraries";
13
+ /** Fallback category slug for skills not present in skills_index.json. */
14
+ export const UNCATEGORIZED_CATEGORY = "uncategorized";
package/dist/index.d.ts CHANGED
@@ -1,3 +1,13 @@
1
1
  import type { Plugin } from "@opencode-ai/plugin";
2
+ /**
3
+ * OpenCode Skills Collection plugin.
4
+ *
5
+ * On every OpenCode startup:
6
+ * 1. Copies bundled skills directly into the vault
7
+ * (~/.config/opencode/skill-libraries/) organised by category.
8
+ * The active skills directory is never used as staging.
9
+ * 2. Generates lightweight category pointer SKILL.md files in
10
+ * ~/.config/opencode/skills/ without touching user custom skills.
11
+ */
2
12
  declare const OpenCodeSkillsCollection: Plugin;
3
13
  export default OpenCodeSkillsCollection;
package/dist/index.js CHANGED
@@ -1,71 +1,35 @@
1
- import fs from "fs";
2
- import path from "path";
3
1
  import os from "os";
2
+ import path from "path";
4
3
  import { fileURLToPath } from "url";
5
- const LOG_FILE = path.join(os.homedir(), ".config", "opencode", "antigravity-debug.log");
6
- function log(msg) {
7
- const line = `[${new Date().toISOString()}] ${msg}\n`;
8
- try {
9
- fs.appendFileSync(LOG_FILE, line);
10
- }
11
- catch (_) { }
12
- process.stderr.write(line);
13
- }
14
- function copyDirContents(srcDir, destDir) {
15
- fs.mkdirSync(destDir, { recursive: true });
16
- for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
17
- const srcEntry = path.join(srcDir, entry.name);
18
- const destEntry = path.join(destDir, entry.name);
19
- if (entry.isDirectory()) {
20
- copyDirContents(srcEntry, destEntry);
21
- }
22
- else {
23
- fs.copyFileSync(srcEntry, destEntry);
24
- }
25
- }
26
- }
4
+ import { ensureDir } from "./utils/fs.utils.js";
5
+ import { runSkillPointer } from "./skill-pointer/index.js";
6
+ const ACTIVE_SKILLS_PATH_SEGMENTS = [".config", "opencode", "skills"];
27
7
  function resolveBundledSkillsPath() {
28
- const fromFile = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "bundled-skills");
29
- if (fs.existsSync(fromFile))
30
- return fromFile;
31
- let dir = path.dirname(fileURLToPath(import.meta.url));
32
- for (let i = 0; i < 5; i++) {
33
- const candidate = path.join(dir, "bundled-skills");
34
- if (fs.existsSync(candidate))
35
- return candidate;
36
- const parent = path.dirname(dir);
37
- if (parent === dir)
38
- break;
39
- dir = parent;
40
- }
41
- throw new Error(`bundled-skills not found. import.meta.url=${import.meta.url}`);
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+ return path.join(__dirname, "..", "bundled-skills");
10
+ }
11
+ function resolveActiveSkillsDir() {
12
+ return path.join(os.homedir(), ...ACTIVE_SKILLS_PATH_SEGMENTS);
42
13
  }
14
+ /**
15
+ * OpenCode Skills Collection plugin.
16
+ *
17
+ * On every OpenCode startup:
18
+ * 1. Copies bundled skills directly into the vault
19
+ * (~/.config/opencode/skill-libraries/) organised by category.
20
+ * The active skills directory is never used as staging.
21
+ * 2. Generates lightweight category pointer SKILL.md files in
22
+ * ~/.config/opencode/skills/ without touching user custom skills.
23
+ */
43
24
  const OpenCodeSkillsCollection = async (_ctx) => {
44
- log("plugin start");
45
25
  try {
46
26
  const bundledSkillsPath = resolveBundledSkillsPath();
47
- const skillsPath = path.join(os.homedir(), ".config", "opencode", "skills");
48
- log(`bundled-skills path: ${bundledSkillsPath}`);
49
- log(`skills dest: ${skillsPath}`);
50
- fs.mkdirSync(skillsPath, { recursive: true });
51
- const entries = fs.readdirSync(bundledSkillsPath, { withFileTypes: true });
52
- log(`entries in bundled-skills: ${entries.length}`);
53
- let installed = 0;
54
- for (const entry of entries) {
55
- if (!entry.isDirectory())
56
- continue;
57
- if (entry.name.startsWith("."))
58
- continue;
59
- const src = path.join(bundledSkillsPath, entry.name);
60
- if (!fs.existsSync(path.join(src, "SKILL.md")))
61
- continue;
62
- copyDirContents(src, path.join(skillsPath, entry.name));
63
- installed++;
64
- }
65
- log(`done — installed ${installed} skills`);
27
+ const activeSkillsDir = resolveActiveSkillsDir();
28
+ ensureDir(activeSkillsDir);
29
+ runSkillPointer({ bundledSkillsPath, activeSkillsDir });
66
30
  }
67
- catch (error) {
68
- log(`ERROR: ${String(error)}`);
31
+ catch {
32
+ // Plugin errors must never crash OpenCode.
69
33
  }
70
34
  return {};
71
35
  };
@@ -0,0 +1,23 @@
1
+ export interface SkillPointerOptions {
2
+ /** Absolute path where OpenCode looks for active skills. */
3
+ activeSkillsDir: string;
4
+ /** Absolute path to the bundled-skills snapshot inside the npm package. */
5
+ bundledSkillsPath: string;
6
+ /**
7
+ * Absolute path of the hidden vault where raw skills are stored.
8
+ * Defaults to ~/.config/opencode/skill-libraries
9
+ */
10
+ vaultDir?: string;
11
+ }
12
+ /**
13
+ * Orchestrates the full SkillPointer pipeline:
14
+ *
15
+ * 1. Reads skills_index.json bundled alongside the skills snapshot.
16
+ * 2. Copies bundled skills directly into the vault, categorised by the index.
17
+ * 3. Generates pointer SKILL.md files in activeSkillsDir with full skill
18
+ * listings so keyword searches (e.g. "laravel") resolve out of the box.
19
+ *
20
+ * The activeSkillsDir is never used as a staging area — user custom
21
+ * skills already present there are never moved or overwritten.
22
+ */
23
+ export declare function runSkillPointer(options: SkillPointerOptions): void;
@@ -0,0 +1,28 @@
1
+ import os from "os";
2
+ import path from "path";
3
+ import { VAULT_DIR_NAME } from "../constants/constants.js";
4
+ import { ensureDir } from "../utils/fs.utils.js";
5
+ import { generatePointers } from "./pointer-generator.js";
6
+ import { installSkillsToVault, loadSkillsIndex } from "./vault-installer.js";
7
+ function resolveDefaultVaultDir() {
8
+ return path.join(os.homedir(), ".config", "opencode", VAULT_DIR_NAME);
9
+ }
10
+ /**
11
+ * Orchestrates the full SkillPointer pipeline:
12
+ *
13
+ * 1. Reads skills_index.json bundled alongside the skills snapshot.
14
+ * 2. Copies bundled skills directly into the vault, categorised by the index.
15
+ * 3. Generates pointer SKILL.md files in activeSkillsDir with full skill
16
+ * listings so keyword searches (e.g. "laravel") resolve out of the box.
17
+ *
18
+ * The activeSkillsDir is never used as a staging area — user custom
19
+ * skills already present there are never moved or overwritten.
20
+ */
21
+ export function runSkillPointer(options) {
22
+ const vaultDir = options.vaultDir ?? resolveDefaultVaultDir();
23
+ ensureDir(options.activeSkillsDir);
24
+ ensureDir(vaultDir);
25
+ const index = loadSkillsIndex(options.bundledSkillsPath);
26
+ installSkillsToVault(options.bundledSkillsPath, vaultDir, index);
27
+ generatePointers(options.activeSkillsDir, vaultDir, index);
28
+ }
@@ -0,0 +1,10 @@
1
+ import type { SkillIndexEntry } from "./vault-installer.js";
2
+ /**
3
+ * Scans every category directory in the vault and writes
4
+ * a lightweight pointer SKILL.md into the active skills directory.
5
+ *
6
+ * Each pointer includes the full list of skill names + descriptions
7
+ * so keyword searches (e.g. "laravel", "wordpress") resolve correctly
8
+ * via get_available_skills without loading every SKILL.md.
9
+ */
10
+ export declare function generatePointers(activeSkillsDir: string, vaultDir: string, index?: SkillIndexEntry[]): void;