skilld 2.2.0 → 3.0.0-beta.1

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 (139) hide show
  1. package/README.md +106 -366
  2. package/bin/skilld.mjs +56 -0
  3. package/loader/resolve-artifact.mjs +37 -0
  4. package/package.json +23 -53
  5. package/dist/_chunks/add.mjs +0 -67
  6. package/dist/_chunks/add.mjs.map +0 -1
  7. package/dist/_chunks/agent-prompt.mjs +0 -88
  8. package/dist/_chunks/agent-prompt.mjs.map +0 -1
  9. package/dist/_chunks/agent.mjs +0 -1817
  10. package/dist/_chunks/agent.mjs.map +0 -1
  11. package/dist/_chunks/args.mjs +0 -42
  12. package/dist/_chunks/args.mjs.map +0 -1
  13. package/dist/_chunks/assemble.mjs +0 -126
  14. package/dist/_chunks/assemble.mjs.map +0 -1
  15. package/dist/_chunks/author.mjs +0 -432
  16. package/dist/_chunks/author.mjs.map +0 -1
  17. package/dist/_chunks/cache.mjs +0 -367
  18. package/dist/_chunks/cache.mjs.map +0 -1
  19. package/dist/_chunks/cache2.mjs +0 -151
  20. package/dist/_chunks/cache2.mjs.map +0 -1
  21. package/dist/_chunks/client.mjs +0 -118
  22. package/dist/_chunks/client.mjs.map +0 -1
  23. package/dist/_chunks/core.mjs +0 -13
  24. package/dist/_chunks/detect.mjs +0 -609
  25. package/dist/_chunks/detect.mjs.map +0 -1
  26. package/dist/_chunks/detect2.mjs +0 -2
  27. package/dist/_chunks/eject.mjs +0 -69
  28. package/dist/_chunks/eject.mjs.map +0 -1
  29. package/dist/_chunks/embedding-cache.mjs +0 -2
  30. package/dist/_chunks/embedding-cache2.mjs +0 -61
  31. package/dist/_chunks/embedding-cache2.mjs.map +0 -1
  32. package/dist/_chunks/env.mjs +0 -19
  33. package/dist/_chunks/env.mjs.map +0 -1
  34. package/dist/_chunks/index-identity.mjs +0 -365
  35. package/dist/_chunks/index-identity.mjs.map +0 -1
  36. package/dist/_chunks/index-identity2.mjs +0 -2
  37. package/dist/_chunks/install-many.mjs +0 -378
  38. package/dist/_chunks/install-many.mjs.map +0 -1
  39. package/dist/_chunks/install.mjs +0 -259
  40. package/dist/_chunks/install.mjs.map +0 -1
  41. package/dist/_chunks/intro.mjs +0 -63
  42. package/dist/_chunks/intro.mjs.map +0 -1
  43. package/dist/_chunks/list.mjs +0 -102
  44. package/dist/_chunks/list.mjs.map +0 -1
  45. package/dist/_chunks/lockfile.mjs +0 -174
  46. package/dist/_chunks/lockfile.mjs.map +0 -1
  47. package/dist/_chunks/login.mjs +0 -234
  48. package/dist/_chunks/login.mjs.map +0 -1
  49. package/dist/_chunks/logout.mjs +0 -27
  50. package/dist/_chunks/logout.mjs.map +0 -1
  51. package/dist/_chunks/map.mjs +0 -11
  52. package/dist/_chunks/map.mjs.map +0 -1
  53. package/dist/_chunks/markdown.mjs +0 -101
  54. package/dist/_chunks/markdown.mjs.map +0 -1
  55. package/dist/_chunks/menu.mjs +0 -33
  56. package/dist/_chunks/menu.mjs.map +0 -1
  57. package/dist/_chunks/model-picker.mjs +0 -61
  58. package/dist/_chunks/model-picker.mjs.map +0 -1
  59. package/dist/_chunks/monorepo.mjs +0 -74
  60. package/dist/_chunks/monorepo.mjs.map +0 -1
  61. package/dist/_chunks/package-json.mjs +0 -84
  62. package/dist/_chunks/package-json.mjs.map +0 -1
  63. package/dist/_chunks/paths.mjs +0 -47
  64. package/dist/_chunks/paths.mjs.map +0 -1
  65. package/dist/_chunks/pipeline.mjs +0 -993
  66. package/dist/_chunks/pipeline.mjs.map +0 -1
  67. package/dist/_chunks/pool.mjs +0 -2
  68. package/dist/_chunks/pool2.mjs +0 -121
  69. package/dist/_chunks/pool2.mjs.map +0 -1
  70. package/dist/_chunks/portable.mjs +0 -152
  71. package/dist/_chunks/portable.mjs.map +0 -1
  72. package/dist/_chunks/prepare-hook.mjs +0 -2
  73. package/dist/_chunks/prepare-hook2.mjs +0 -61
  74. package/dist/_chunks/prepare-hook2.mjs.map +0 -1
  75. package/dist/_chunks/prepare.mjs +0 -105
  76. package/dist/_chunks/prepare.mjs.map +0 -1
  77. package/dist/_chunks/prepare2.mjs +0 -80
  78. package/dist/_chunks/prepare2.mjs.map +0 -1
  79. package/dist/_chunks/prompts.mjs +0 -1252
  80. package/dist/_chunks/prompts.mjs.map +0 -1
  81. package/dist/_chunks/pull.mjs +0 -220
  82. package/dist/_chunks/pull.mjs.map +0 -1
  83. package/dist/_chunks/regex.mjs +0 -19
  84. package/dist/_chunks/regex.mjs.map +0 -1
  85. package/dist/_chunks/retriv.mjs +0 -2
  86. package/dist/_chunks/retriv2.mjs +0 -177
  87. package/dist/_chunks/retriv2.mjs.map +0 -1
  88. package/dist/_chunks/sanitize.mjs +0 -260
  89. package/dist/_chunks/sanitize.mjs.map +0 -1
  90. package/dist/_chunks/search-helpers.mjs +0 -100
  91. package/dist/_chunks/search-helpers.mjs.map +0 -1
  92. package/dist/_chunks/search-interactive.mjs +0 -249
  93. package/dist/_chunks/search-interactive.mjs.map +0 -1
  94. package/dist/_chunks/search.mjs +0 -219
  95. package/dist/_chunks/search.mjs.map +0 -1
  96. package/dist/_chunks/semver.mjs +0 -2801
  97. package/dist/_chunks/semver.mjs.map +0 -1
  98. package/dist/_chunks/skill-installer.mjs +0 -2
  99. package/dist/_chunks/skill-installer2.mjs +0 -163
  100. package/dist/_chunks/skill-installer2.mjs.map +0 -1
  101. package/dist/_chunks/skills.mjs +0 -178
  102. package/dist/_chunks/skills.mjs.map +0 -1
  103. package/dist/_chunks/store.mjs +0 -107
  104. package/dist/_chunks/store.mjs.map +0 -1
  105. package/dist/_chunks/sync.mjs +0 -1009
  106. package/dist/_chunks/sync.mjs.map +0 -1
  107. package/dist/_chunks/sync2.mjs +0 -2
  108. package/dist/_chunks/telemetry.mjs +0 -26
  109. package/dist/_chunks/telemetry.mjs.map +0 -1
  110. package/dist/_chunks/uninstall.mjs +0 -214
  111. package/dist/_chunks/uninstall.mjs.map +0 -1
  112. package/dist/_chunks/update.mjs +0 -172
  113. package/dist/_chunks/update.mjs.map +0 -1
  114. package/dist/_chunks/upload.mjs +0 -155
  115. package/dist/_chunks/upload.mjs.map +0 -1
  116. package/dist/_chunks/validate.mjs +0 -60
  117. package/dist/_chunks/validate.mjs.map +0 -1
  118. package/dist/_chunks/version.mjs +0 -19
  119. package/dist/_chunks/version.mjs.map +0 -1
  120. package/dist/_chunks/whoami.mjs +0 -21
  121. package/dist/_chunks/whoami.mjs.map +0 -1
  122. package/dist/_chunks/wizard.mjs +0 -2
  123. package/dist/_chunks/wizard2.mjs +0 -200
  124. package/dist/_chunks/wizard2.mjs.map +0 -1
  125. package/dist/_chunks/yaml.mjs +0 -33
  126. package/dist/_chunks/yaml.mjs.map +0 -1
  127. package/dist/cli-entry.d.mts +0 -1
  128. package/dist/cli-entry.mjs +0 -5
  129. package/dist/cli-entry.mjs.map +0 -1
  130. package/dist/cli.d.mts +0 -1
  131. package/dist/cli.mjs +0 -1314
  132. package/dist/cli.mjs.map +0 -1
  133. package/dist/prepare.d.mts +0 -1
  134. package/dist/prepare.mjs +0 -84
  135. package/dist/prepare.mjs.map +0 -1
  136. package/dist/retriv/worker.d.mts +0 -37
  137. package/dist/retriv/worker.d.mts.map +0 -1
  138. package/dist/retriv/worker.mjs +0 -46
  139. package/dist/retriv/worker.mjs.map +0 -1
package/README.md CHANGED
@@ -4,433 +4,173 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/skilld?color=yellow)](https://npm.chart.dev/skilld)
5
5
  [![license](https://img.shields.io/npm/l/skilld?color=yellow)](https://github.com/skilld-dev/skilld/blob/main/LICENSE)
6
6
 
7
- > Generate AI agent skills from your NPM dependencies.
7
+ Search, install, and keep Agent Skills current.
8
8
 
9
- ## Why?
9
+ skilld v3 has two products:
10
10
 
11
- When using new packages or migrating to new versions, agents often struggle to use the appropriate best practices. This is because
12
- agents have [knowledge cutoffs](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison) and
13
- predict based on existing patterns.
11
+ - The native `skilld` CLI manages Skills.
12
+ - The JavaScript [`skilld-harness`](./packages/harness) package runs visible Skill generation and review instructions.
14
13
 
15
- Methods of getting the right context to your agent require either manual curation, author opt-in, external servers or vendor lock-in. See [the landscape](#the-landscape)
16
- for more details.
14
+ The skilld CLI contains no Skill generation logic or Agent runtime.
17
15
 
18
- Skilld generates [agent skills](https://agentskills.io/home) from the references maintainers already create: docs, release notes and GitHub issues. With these we can create version-aware, local-first, and optimized skills.
16
+ ## Install the skilld CLI
19
17
 
20
- <p align="center">
21
- <table>
22
- <tbody>
23
- <td align="center">
24
- <sub>Made possible by my <a href="https://github.com/sponsors/harlan-zw">Sponsor Program 💖</a><br> Follow me <a href="https://twitter.com/harlan_zw">@harlan_zw</a> 🐦 - Join <a href="https://discord.gg/275MBUBvgP">Discord</a> for help</sub><br>
25
- </td>
26
- </tbody>
27
- </table>
28
- </p>
29
-
30
- ## Features
31
-
32
- - 🌍 **Any Source: Opt-in** - Any NPM dependency or GitHub source, docs auto-resolved
33
- - 📦 **Bleeding Edge Context** - Latest issues, discussions, and releases. Always use the latest best practices and avoid deprecated patterns.
34
- - 📚 **Opt-in LLM Sections** - Enhance skills with LLM-generated `Best Practices`, `API Changes`, or your own custom prompts
35
- - 🧩 **Use Any Agent** - Choose your agent: CLI , [pi](https://github.com/badlogic/pi-mono/tree/main/packages/ai) agents or no agent at all.
36
- - 🔍 **Semantic Search** - Query indexed docs across all skills via [retriv](https://github.com/harlan-zw/retriv) embeddings
37
- - 🧠 **Context-Aware** - Follows [Claude Code skill best practices](https://code.claude.com/docs/en/skills#add-supporting-files): SKILL.md stays under 500 lines, references are separate files the agent discovers on-demand - not inlined into context
38
- - 🎯 **Safe & Versioned** - Prompt injection sanitization, version-aware caching, auto-updates on new releases
39
- - 🤝 **Ecosystem** - Compatible with [`npx skills`](https://skills.sh/) and [skills-npm](https://github.com/antfu/skills-npm). Skilld auto-detects and uses skills-npm packages when available.
40
-
41
- ## Quick Start
42
-
43
- Run skilld in a project to generate skills for your dependencies through a simple interactive wizard:
44
-
45
- ```bash
46
- npx -y skilld
47
- ```
48
-
49
- __Requires Node 22.6.0 or higher.__
50
-
51
- Or add a specific package directly:
52
-
53
- ```bash
54
- npx -y skilld add npm:vue
55
- ```
56
-
57
- If you need to re-configure skilld, just run `npx -y skilld config` to update your agent, model, or preferences.
58
-
59
- **No agent CLI?** No problem - choose "No agent" when prompted. You get a base skill immediately, plus portable prompts you can run in any LLM:
60
-
61
- ```bash
62
- npx -y skilld add npm:vue
63
- # Choose "No agent" -> base skill + prompts exported
64
- # Paste prompts into ChatGPT/Claude web, save outputs, then:
65
- npx -y skilld author assemble
66
- ```
67
-
68
- ### Tips
69
-
70
- - **Be selective** - Only add skills for packages your agent struggles with. Not every dependency needs one.
71
- - **LLM is optional** - Skills work without any LLM, but enhancing with one makes them significantly better.
72
- - **Multi-agent** - Run `skilld install --agent gemini-cli` to sync skills to another agent. The doc cache is shared.
73
-
74
- ## Installation
75
-
76
- ### Global
77
-
78
- Install globally to use `skilld` across all projects without `npx`:
79
-
80
- ```bash
81
- npm install -g skilld
82
- # or
83
- pnpm add -g skilld
18
+ ```sh
19
+ npm install --global skilld
84
20
  ```
85
21
 
86
- Then run `skilld` in any project directory.
22
+ The npm package selects a native executable for the current system.
23
+ It has no JavaScript CLI engine or JavaScript fallback.
87
24
 
88
- ### Per-Project
25
+ Install the skilld-maintained Skill for your Agent:
89
26
 
90
- If you'd like to install skilld and track the lock file references, add it as a dev dependency:
91
-
92
- ```bash
93
- npm install -D skilld
94
- # or
95
- yarn add -D skilld
96
- # or
97
- pnpm add -D skilld
98
- ```
99
-
100
- ### Automatic Updates
101
-
102
- Add to `package.json` to restore references and sync shipped skills on install:
103
-
104
- ```json
105
- {
106
- "scripts": {
107
- "prepare": "skilld prepare"
108
- }
109
- }
27
+ ```sh
28
+ skilld install skilld --global
110
29
  ```
111
30
 
112
- This restores symlinks, auto-installs shipped skills from your deps, and notifies you when packages have new features or breaking changes. Run `skilld update` to regenerate LLM enhancements.
31
+ Use `--agent` when you want an explicit Agent target:
113
32
 
114
- ## FAQ
115
-
116
- ### Why don't the skills run?
117
-
118
- Try this in your project/user prompt:
119
-
120
- ```md
121
- Before modifying code, evaluate each installed skill against the current task.
122
- For each skill, determine YES/NO relevance and invoke all YES skills before proceeding.
33
+ ```sh
34
+ skilld install skilld --global --agent codex
123
35
  ```
124
36
 
125
- ### How is this different from Context7?
126
-
127
- Context7 is an MCP that fetches raw doc chunks at query time. You get different results each prompt, no curation, and it requires their server. Skilld is local-first: it generates a SKILL.md that lives in your project, tied to your actual package versions. No MCP dependency, no per-prompt latency, and it goes further with LLM-enhanced sections, prompt injection sanitization, and semantic search.
128
-
129
- ### Will I be prompt injected?
130
-
131
- Skilld pulls issues from GitHub which could be abused for potential prompt injection.
132
-
133
- Skilld treats all data as untrusted, running in permissioned environments and using best practices to avoid injections.
134
- However, always be cautious when using skills from untrusted sources.
135
-
136
- ### Do skills update when my deps update?
137
-
138
- Yes. Add `skilld prepare` to your prepare script. It restores references, auto-installs shipped skills, and tells you when packages are outdated. Run `skilld update` to regenerate LLM enhancements.
139
-
140
- ## CLI Usage
141
-
142
- ```bash
143
- # Interactive mode - auto-discover from package.json
144
- skilld
145
-
146
- # Add skills for specific package(s) — npm: prefix for registry packages
147
- skilld add npm:vue npm:nuxt npm:pinia
148
-
149
- # Add a pre-authored skill from a GitHub repo
150
- skilld add gh:vercel-labs/agent-skills
151
-
152
- # Add a skill for a Rust crate (crates.io)
153
- skilld add crate:serde
154
-
155
- # Update outdated skills
156
- skilld update
157
- skilld update tailwindcss
37
+ ## Use the skilld CLI
158
38
 
159
- # Search docs across installed skills
160
- skilld search "useFetch options" -p nuxt
161
- skilld search "error" -p nuxt --filter '{"type":"issue"}'
162
- skilld search --guide -p nuxt
39
+ ```sh
40
+ # Find a Skill
41
+ skilld search vue
163
42
 
164
- # Target a specific agent
165
- skilld add npm:react --agent cursor
43
+ # Install a Skill in the current project
44
+ skilld install skilld:skilld-dev/skills/vue
166
45
 
167
- # Install globally to ~/.claude/skills
168
- skilld add npm:zod --global
169
-
170
- # Skip prompts
171
- skilld add npm:drizzle-orm --yes
172
-
173
- # Check skill info
174
- skilld info
175
-
176
- # List installed skills
46
+ # Inspect installed Skills
177
47
  skilld list
178
- skilld list --json
179
-
180
- # Manage settings
181
- skilld config
182
- ```
183
-
184
- ### Commands
185
-
186
- | Command | Description |
187
- |---------|-------------|
188
- | `skilld` | Interactive wizard (first run) or status menu (existing skills) |
189
- | `skilld add <source...>` | Add skills. Sources: `npm:<pkg>`, `crate:<name>`, `gh:<owner/repo>`, or bare names (deprecated) |
190
- | `skilld update [pkg]` | Update outdated skills (all or specific) |
191
- | `skilld search [query]` | Search indexed docs (`-p` package, `--filter` JSON, `--limit`, `--guide`) |
192
- | `skilld list` | List installed skills (`--json` for machine-readable output) |
193
- | `skilld info` | Show skill info and config |
194
- | `skilld config` | Configure agent, model, preferences |
195
- | `skilld install` | Restore references from lockfile |
196
- | `skilld remove` | Remove installed skills |
197
- | `skilld uninstall` | Remove all skilld data |
198
- | `skilld cache` | Cache management (clean expired LLM cache entries) |
199
- | `skilld author package <pkg>` | Generate a portable package skill from docs |
200
- | `skilld author publish` | Publish skills to skilld.dev |
201
- | `skilld author eject <pkg>` | Eject skill as portable directory (no symlinks) |
202
- | `skilld author validate <file>`| Validate a skill section |
203
- | `skilld author assemble [dir]` | Merge LLM output files back into SKILL.md (auto-discovers) |
204
-
205
- ### Works Without an Agent CLI
206
-
207
- No Claude, Gemini, or Codex CLI? Choose "No agent" when prompted. You get a base skill immediately, plus portable prompts you can run in any LLM to enhance it:
208
-
209
- ```bash
210
- skilld add npm:vue
211
- # Choose "No agent" -> installs to .claude/skills/vue-skilld/
212
-
213
- # What you get:
214
- # SKILL.md <- base skill (works immediately)
215
- # PROMPT_*.md <- prompts to enhance it with any LLM
216
- # references/ <- docs, issues, releases as real files
217
-
218
- # Run each PROMPT_*.md in ChatGPT/Claude web/any LLM
219
- # Save outputs as _BEST_PRACTICES.md, _API_CHANGES.md, then:
220
- skilld author assemble
221
- ```
222
-
223
- `skilld author assemble` auto-discovers skills with pending output files. `skilld update` re-exports prompts for outdated packages.
224
-
225
- ### Local Models (Ollama)
226
-
227
- If [Ollama](https://ollama.com) is running, skilld auto-detects your locally-pulled text models and lists them in `skilld config` (and `-m ollama:<name>`):
228
-
229
- ```bash
230
- skilld add npm:vue -m ollama:qwen2.5:14b-instruct
231
- ```
232
-
233
- Generation runs locally: free, offline, no API key. Unlike the CLI and API backends, the Ollama path is one-shot (it does not explore reference files with tools), so all source material is inlined into a single prompt. Best paired with a capable instruct model.
234
-
235
- | Env var | Default | Purpose |
236
- |---------|---------|---------|
237
- | `OLLAMA_HOST` | `http://localhost:11434` | Ollama daemon address |
238
- | `OLLAMA_NUM_CTX` | `32768` | Context window; sized to fit the full prompt + output |
239
-
240
- The large default context can exceed memory for big models on constrained hardware (Ollama returns a 500). Lower `OLLAMA_NUM_CTX` or pick a smaller model if generation fails to load.
241
-
242
- ### Embedding Model
243
-
244
- `skilld search` is powered by a local embedding model. It runs offline through transformers.js. It needs no API key or network traffic after the first download. Pick one under **Embedding model** in `skilld config`:
245
-
246
- | Model | Dimensions | Notes |
247
- |-------|-----------:|-------|
248
- | `bge-small-en-v1.5` | 384 | Default. Fastest to index, smallest download. |
249
- | `bge-base-en-v1.5` | 768 | Balanced accuracy and speed. |
250
- | `Xenova/bge-large-en-v1.5` | 1024 | Most accurate English retrieval, slowest to index. |
251
- | `bge-m3` | 1024 | Multilingual, 8192-token context. |
252
-
253
- Larger models retrieve more accurately but cost more time and memory when indexing. Locally-pulled [Ollama](#ollama-embedding-models) models can be used too. Export `SKILLD_EMBED_MODEL` to override the saved setting for every index and search command in the current shell:
254
-
255
- ```bash
256
- export SKILLD_EMBED_MODEL=bge-m3
257
- skilld update
258
- ```
48
+ skilld view vue
259
49
 
260
- Search indexes must use one embedding model and device. Rebuild them after switching either setting:
50
+ # Keep Skills current
51
+ skilld verify vue
52
+ skilld upgrade vue
261
53
 
262
- ```bash
263
- skilld update
54
+ # Remove a Skill
55
+ skilld remove vue
264
56
  ```
265
57
 
266
- ### Ollama Embedding Models
58
+ Project installs update `.skills/skilld-lock.yaml` and the selected Agent targets.
59
+ Use `--global` for account level Agent targets.
60
+ Use `--mode copy` or `--mode symlink` to control target writes.
267
61
 
268
- If [Ollama](https://ollama.com) is running, locally-pulled embedding models appear in the **Embedding model** picker alongside the built-in ones. They are addressed as `ollama:<name>`, matching the `-m ollama:<name>` syntax used for enhancement models:
62
+ Run `skilld install` without a source to restore the lockfile state.
269
63
 
270
- ```bash
271
- ollama pull qwen3-embedding
272
- SKILLD_EMBED_MODEL=ollama:qwen3-embedding skilld add npm:vue
273
- ```
64
+ ## Artifact delivery
274
65
 
275
- Only models that advertise the `embedding` capability are listed, so chat models cannot be selected by mistake. Dimensions and context length are read from Ollama. skilld validates each vector before indexing.
66
+ The skilld CLI resolves remote Skills through the skilld.dev API.
67
+ GitHub remains the source of truth.
276
68
 
277
- This talks to Ollama's HTTP API directly. It needs no additional dependency or API key. Set `OLLAMA_HOST` to point at a non-default daemon. If Ollama is not running, the picker simply shows the built-in models.
69
+ skilld.dev builds an immutable Artifact from an exact Git commit.
70
+ The CLI checks its digest, Artifact attestation, check results, and archive before installation.
278
71
 
279
- Ollama manages its own execution device, so **Embedding device** does not apply to `ollama:` models.
72
+ Private Repository delivery requires both:
280
73
 
281
- ### Embedding Device
74
+ - `skilld auth login` for a skilld.dev account
75
+ - Access through the skilld GitHub App installation
282
76
 
283
- The embedding model runs on the CPU by default. **Embedding device** in `skilld config` moves it onto a GPU backend, which can be substantially faster:
77
+ Private Artifact responses use short lived, one time grants.
78
+ The API does not expose private storage addresses.
284
79
 
285
- | Device | Notes |
286
- |--------|-------|
287
- | `auto` | Default. Lets transformers.js choose; CPU under Node. |
288
- | `cpu` | Always available, predictable. |
289
- | `webgpu` | Fastest on Apple Silicon in testing. |
290
- | `coreml` | Apple Neural Engine. Measured slower than CPU for these models. |
80
+ ### Direct mode
291
81
 
292
- Measured on an Apple M5 Max, 120 documents, best of 3 after warm-up (docs/sec):
82
+ `--direct` fetches a public GitHub Repository without the skilld.dev API.
83
+ The installed Skill receives the `unverified` source status.
84
+ The user reviews the Skill before use.
293
85
 
294
- | Model | `cpu` | `coreml` | `webgpu` |
295
- |-------|------:|---------:|---------:|
296
- | `bge-small-en-v1.5` | 664 | 198 | **1713** |
297
- | `bge-base-en-v1.5` | 198 | 68 | **580** |
298
- | `Xenova/bge-large-en-v1.5` | 71 | 9 | **201** |
86
+ Direct mode never handles private Repositories.
87
+ It never falls back to skilld.dev.
299
88
 
300
- WebGPU was 2.6 to 2.9 times faster than CPU at every size. On WebGPU, `bge-large` indexed faster than `bge-base` on CPU and improved retrieval. CoreML was consistently slower.
89
+ ## Source status
301
90
 
302
- The ranking is hardware-specific, so benchmark before trusting a device on other machines. Export `SKILLD_EMBED_DEVICE` to override the saved setting in the current shell:
91
+ - `verified`: skilld checked a skilld.dev Artifact and its attestation.
92
+ - `local`: the Skill came from a local directory or a bundled skilld-maintained Skill.
93
+ - `unverified`: direct mode fetched the Skill from public GitHub.
303
94
 
304
- ```bash
305
- export SKILLD_EMBED_DEVICE=cpu
306
- skilld update
307
- ```
95
+ `verified` describes provenance checks.
96
+ It does not endorse the instructions inside a Skill.
308
97
 
309
- If a backend is unavailable, indexing fails to start. Switch back to `auto`.
98
+ ## Account and configuration
310
99
 
311
- ### Eject
100
+ ```sh
101
+ skilld auth login
102
+ skilld auth status
103
+ skilld auth logout
312
104
 
313
- Export a skill as a portable, self-contained directory for sharing via git repos:
314
-
315
- ```bash
316
- skilld author eject vue # Default skill directory
317
- skilld author eject vue --name vue # Custom directory name
318
- skilld author eject vue --out ./skills/ # Custom path
319
- skilld author eject vue --from 2025-07-01 # Only recent releases/issues
105
+ skilld config get agent.targets
106
+ skilld config set agent.targets codex,claude-code
107
+ skilld config list
320
108
  ```
321
109
 
322
- Share via `skilld add gh:owner/repo` - consumers get fully functional skills with no LLM cost.
323
-
324
- ### CLI Options
110
+ Native builds store account credentials in the operating system keychain.
111
+ The CLI does not store tokens in environment variables or plain text files.
325
112
 
326
- | Option | Alias | Default | Description |
327
- |--------|-------|---------|-------------|
328
- | `--global` | `-g` | `false` | Install globally to `~/<agent>/skills` |
329
- | `--agent` | `-a` | auto-detect | Target specific agent (claude-code, cursor, etc.) |
330
- | `--yes` | `-y` | `false` | Skip prompts, use defaults |
331
- | `--force` | `-f` | `false` | Ignore all caches, re-fetch docs and regenerate |
332
- | `--model` | `-m` | config default | LLM model for skill generation (sonnet, haiku, opus, etc.) |
333
- | `--name` | `-n` | | Custom skill directory name (eject only) |
334
- | `--out` | `-o` | | Output directory path override (eject only) |
335
- | `--from` | | | Collect releases/issues/discussions from this date (YYYY-MM-DD, eject only) |
336
- | `--debug` | | `false` | Save raw LLM output to logs/ for each section |
113
+ ## Generate or review a Skill
337
114
 
338
- ## For Maintainers
115
+ Skill generation lives outside the skilld CLI.
339
116
 
340
- Ship skills with your npm package so consumers get them automatically. No LLM needed on their end.
117
+ Use these skilld-maintained Skills directly with your Agent:
341
118
 
342
- Install the official publication workflow for authoring, validation, packaging, and postpublish verification:
119
+ - [`generate-package-skill`](./skills/generate-package-skill)
120
+ - [`generate-project-skill`](./skills/generate-project-skill)
121
+ - [`review-skill`](./skills/review-skill)
122
+ - [`skilld`](./skills/skilld)
343
123
 
344
- ```bash
345
- npx skilld add gh:skilld-dev/skills --skill publish-skill --yes
346
- ```
347
-
348
- The skill orchestrates publication. `skilld author package` remains the deterministic package documentation generator it invokes.
349
-
350
- ### Generate a skill
124
+ Direct Skill runs remain user reviewed.
125
+ The instructions and changes stay visible to the user.
351
126
 
352
- From your package root (or monorepo root):
127
+ Use [`skilld-harness`](./packages/harness) when an application or CI needs strict output checks.
128
+ The Harness runs the same visible Skill files through an AI SDK Harness.
353
129
 
354
- ```bash
355
- npx skilld author
130
+ ```sh
131
+ pnpm add skilld-harness @ai-sdk/harness ws zod
356
132
  ```
357
133
 
358
- In a monorepo, skilld auto-detects workspaces and prompts which packages to generate for. Docs are resolved from: package `docs/`, monorepo `docs/content/`, `llms.txt`, or `README.md`.
359
-
360
- This creates a `skills/<your-package>/` directory with a `SKILL.md` and ejected reference files. It also adds `"skills"` to your `package.json` `files` array.
361
-
362
- ### How consumers get it
134
+ ```ts
135
+ import { createSkillHarness } from 'skilld-harness'
363
136
 
364
- Once published, consumers run:
137
+ const skillHarness = createSkillHarness({ harness, sandbox })
365
138
 
366
- ```bash
367
- npx skilld prepare
139
+ const result = await skillHarness.run({
140
+ _tag: 'PackageSkill',
141
+ source: { _tag: 'NpmPackage', spec: 'vue' },
142
+ destination: { rootDir: '.agents/skills', name: 'vue' },
143
+ })
368
144
  ```
369
145
 
370
- Or add it to their `package.json` so it runs on every install:
371
-
372
- ```json
373
- {
374
- "scripts": {
375
- "prepare": "skilld prepare"
376
- }
377
- }
378
- ```
379
-
380
- `skilld prepare` auto-detects shipped skills in `node_modules` and symlinks them into the agent's skill directory. Compatible with [skills-npm](https://github.com/antfu/skills-npm).
381
-
382
- ### Options
383
-
384
- | Flag | Alias | Default | Description |
385
- |:----------|:-----:|:-------:|:------------|
386
- | `--model` | `-m` | | LLM model for enhancement |
387
- | `--out` | `-o` | | Output directory (single package only) |
388
- | `--force` | `-f` | `false` | Clear cache and regenerate |
389
- | `--yes` | `-y` | `false` | Skip prompts, use defaults |
390
- | `--debug` | | `false` | Save raw LLM output to logs/ |
391
-
392
- ## The Landscape
393
-
394
- Several approaches exist for steering agent knowledge. Each fills a different niche:
395
-
396
- | Approach | Versioned | Curated | No Opt-in | Local | Any LLM |
397
- |:---------|:---------:|:-------:|:---------:|:-----:|:-------:|
398
- | **Manual rules** | - | yes | yes | yes | yes |
399
- | **llms.txt** | ~ | - | - | - | yes |
400
- | **MCP servers** | yes | - | - | - | - |
401
- | **skills.sh** | - | ~ | yes | - | - |
402
- | **skills-npm** | yes | yes | - | yes | - |
403
- | **skilld** | yes | yes | yes | yes | yes |
404
-
405
- > **Versioned** - tied to your installed package version. **Curated** - distilled best practices, not raw docs. **No Opt-in** - works without the package author doing anything. **Local** - runs on your machine, no external service dependency. **Any LLM** - works with any LLM, not just agent CLIs.
406
-
407
- - **Manual rules** (CLAUDE.md, .cursorrules): full control, but you need to already know the best practices and maintain them across every dep.
408
- - **[llms.txt](https://llmstxt.org/)**: standard convention for exposing docs to LLMs, but it's full docs not curated guidance and requires author adoption.
409
- - **MCP servers** (Context7, etc.): live, version-aware responses, but adds per-request latency and the maintainer has to build and maintain a server.
410
- - **[skills.sh](https://skills.sh/)**: easy skill sharing with a growing ecosystem, but community-sourced without version-awareness or author oversight.
411
- - **[skills-npm](https://github.com/antfu/skills-npm)**: the ideal end-state: zero-token skills shipped by the package author, but requires every maintainer to opt in. Skilld auto-detects and uses skills-npm packages when available.
412
- - **skilld**: generates version-aware skills from existing docs, changelogs, issues, and discussions. Works for any package without author opt-in.
146
+ See the [`skilld-harness` guide](./packages/harness/README.md) for its full contract.
413
147
 
414
- ## Telemetry
148
+ ## Upgrade from v2
415
149
 
416
- Skilld sends anonymous install events to [skills.sh](https://skills.sh/) so skills can be discovered and ranked. No personal information is collected.
150
+ v3 does not import v2 configuration or lockfiles.
151
+ Back up v2 state before replacing the CLI.
417
152
 
418
- Telemetry is automatically disabled in CI environments.
153
+ Follow the [v2 to v3 migration guide](./docs/migrate-v2-to-v3.md).
154
+ It maps removed commands and explains rollback limits.
419
155
 
420
- To opt out, set either environment variable:
156
+ ## v3 development
421
157
 
422
- ```bash
423
- DISABLE_TELEMETRY=1
424
- DO_NOT_TRACK=1
158
+ ```sh
159
+ pnpm install
160
+ pnpm test:run
161
+ pnpm lint
162
+ pnpm typecheck
163
+ pnpm build
425
164
  ```
426
165
 
427
- ## Related
166
+ The Rust workspace owns the skilld CLI.
167
+ `packages/harness` owns generation and review execution.
168
+ `packages/protocol` owns the skilld.dev wire contract.
169
+ `skills` owns the visible skilld-maintained Skills.
428
170
 
429
- - [skills-npm](https://github.com/antfu/skills-npm) - Convention for shipping agent skills in npm packages
430
- - [agentskills.io](https://agentskills.io) - Agent skills specification
431
- - [mdream](https://github.com/harlan-zw/mdream) - HTML to Markdown converter
432
- - [retriv](https://github.com/harlan-zw/retriv) - Vector search with sqlite-vec
171
+ The WASIp2 build remains an internal proof.
172
+ Published packages use native executables only.
433
173
 
434
174
  ## License
435
175
 
436
- Licensed under the [MIT license](https://github.com/skilld-dev/skilld/blob/main/LICENSE).
176
+ [MIT](./LICENSE)
package/bin/skilld.mjs ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'node:child_process'
3
+ import { createRequire } from 'node:module'
4
+ import { constants } from 'node:os'
5
+ import { dirname, join } from 'node:path'
6
+
7
+ import { detectLibc, selectArtifact } from '../loader/resolve-artifact.mjs'
8
+
9
+ const require = createRequire(import.meta.url)
10
+
11
+ function resolvePackage(packageName, file) {
12
+ return Promise.resolve()
13
+ .then(() => join(dirname(require.resolve(`${packageName}/package.json`)), file))
14
+ .catch((error) => {
15
+ if (error?.code === 'MODULE_NOT_FOUND' || error?.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED')
16
+ return undefined
17
+ throw error
18
+ })
19
+ }
20
+
21
+ async function main() {
22
+ const artifact = await selectArtifact({
23
+ arch: process.arch,
24
+ libc: process.platform === 'linux' ? detectLibc() : undefined,
25
+ platform: process.platform,
26
+ }, resolvePackage)
27
+
28
+ if (artifact._tag === 'Unavailable') {
29
+ process.stderr.write(`${artifact.message}\n`)
30
+ process.exitCode = 2
31
+ return
32
+ }
33
+
34
+ const child = spawn(artifact.executable, process.argv.slice(2), {
35
+ cwd: process.cwd(),
36
+ env: process.env,
37
+ shell: false,
38
+ stdio: 'inherit',
39
+ })
40
+
41
+ for (const signal of ['SIGINT', 'SIGTERM'])
42
+ process.on(signal, () => child.kill(signal))
43
+
44
+ child.on('error', (error) => {
45
+ process.stderr.write(`SERVICE_UNAVAILABLE: ${error.message}\n`)
46
+ process.exitCode = 2
47
+ })
48
+ child.on('exit', (code, signal) => {
49
+ process.exitCode = code ?? 128 + (constants.signals[signal] ?? 0)
50
+ })
51
+ }
52
+
53
+ main().catch((error) => {
54
+ process.stderr.write(`SERVICE_UNAVAILABLE: ${error.message}\n`)
55
+ process.exitCode = 2
56
+ })
@@ -0,0 +1,37 @@
1
+ const nativePackages = new Map([
2
+ ['darwin:arm64', 'skilld-cli-darwin-arm64'],
3
+ ['darwin:x64', 'skilld-cli-darwin-x64'],
4
+ ['linux:arm64:gnu', 'skilld-cli-linux-arm64-gnu'],
5
+ ['linux:arm64:musl', 'skilld-cli-linux-arm64-musl'],
6
+ ['linux:x64:gnu', 'skilld-cli-linux-x64-gnu'],
7
+ ['linux:x64:musl', 'skilld-cli-linux-x64-musl'],
8
+ ['win32:arm64', 'skilld-cli-win32-arm64-msvc'],
9
+ ['win32:x64', 'skilld-cli-win32-x64-msvc'],
10
+ ])
11
+
12
+ export function detectLibc(report = process.report) {
13
+ const header = report?.getReport?.().header
14
+ return header?.glibcVersionRuntime ? 'gnu' : 'musl'
15
+ }
16
+
17
+ export function nativePackage(runtime) {
18
+ const key = runtime.platform === 'linux'
19
+ ? `${runtime.platform}:${runtime.arch}:${runtime.libc}`
20
+ : `${runtime.platform}:${runtime.arch}`
21
+ return nativePackages.get(key)
22
+ }
23
+
24
+ export async function selectArtifact(runtime, resolvePackage) {
25
+ const packageName = nativePackage(runtime)
26
+ if (packageName) {
27
+ const file = runtime.platform === 'win32' ? 'bin/skilld.exe' : 'bin/skilld'
28
+ const executable = await resolvePackage(packageName, file)
29
+ if (executable)
30
+ return { _tag: 'Native', executable }
31
+ }
32
+
33
+ return {
34
+ _tag: 'Unavailable',
35
+ message: `UNSUPPORTED_HOST: no skilld CLI artifact is installed for ${runtime.platform} ${runtime.arch}`,
36
+ }
37
+ }