skilld 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -2,25 +2,25 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/skilld?color=yellow)](https://npmjs.com/package/skilld)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/skilld?color=yellow)](https://npm.chart.dev/skilld)
5
- [![license](https://img.shields.io/github/license/harlan-zw/skilld?color=yellow)](https://github.com/harlan-zw/skilld/blob/main/LICENSE)
5
+ [![license](https://img.shields.io/npm/l/skilld?color=yellow)](https://github.com/harlan-zw/skilld/blob/main/LICENSE)
6
6
 
7
- > Skilld gives your AI agent skills for your npm dependencies, generated from versioned docs, dist files and GitHub data.
7
+ > Expert SKILL.md knowledge for your NPM dependencies.
8
8
 
9
9
  ## Why?
10
10
 
11
- Agents already know how most packages work from training data. Skills should focus on what they *don't* know and push them to follow best practices. Without this:
11
+ Agents suck at following latest conventions beyond their [reliable knowledge cut-off](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison). They shoot themselves in the foot
12
+ with new APIs and conventions, and they don't know what they don't know.
12
13
 
13
- - **Generic patterns** - AI uses common approaches instead of package-specific conventions
14
- - **Missed best practices** - Optimal patterns go unused because the AI defaults to "good enough"
15
- - **Version drift** - Training data lags behind latest APIs and deprecations
14
+ [Agent Skills](https://agentskills.io/home) help us solve this by distilling the most important patterns and conventions for a package into a single SKILL.md file.
15
+ Getting skills for our packages either involves the maintainer (or ourselves) taking on the maintenance burden and surfacing them or using skill sharing
16
+ sites like [skills.sh](https://skills.sh/).
16
17
 
17
- skilld generates skills from the package's *actual* documentation using your existing agent. Works with any public npm package, no author opt-in needed.
18
+ While these are great for generic skills, they aren't good for NPM skills:
19
+ - No version-awareness, high maintenance burden to keep up with new releases and deprecations
20
+ - Non-optimized context windows, prompt injection risks
21
+ - Community-sourced skills leak personal opinions and biases. Maintainers are out of the loop, and may not even know about them.
18
22
 
19
- ```
20
- npm install vueuse → skilld add vueuse → AI knows current vueuse API
21
- ```
22
-
23
- Compatible with [skills-npm](https://github.com/antfu/skills-npm)—if a package ships a `skills/` directory, skilld uses it directly. Generation is the fallback.
23
+ Skilld leverages maintainers existing effort. Maintainers write great docs for us, we generate our own local skills optimized for our models and codebase from them.
24
24
 
25
25
  <p align="center">
26
26
  <table>
@@ -34,20 +34,36 @@ Compatible with [skills-npm](https://github.com/antfu/skills-npm)—if a package
34
34
 
35
35
  ## Features
36
36
 
37
- - 🤖 **Agent-powered** - Uses your existing LLM to generate SKILL.md for your key dependencies; works with any coding agent
38
- - 🎯 **Best practices first** - Token-optimized output focused on non-obvious patterns and conventions, not generic knowledge
39
- - 🔗 **Context-aware** - Generation adapts to your preferences and accepts custom prompts
40
- - ✏️ **You own it** - Skills live in your project, easy to customize; sync new package versions with zero config
41
- - 🛡️ **Sanitized content** - All fetched markdown is sanitized against known injection patterns (zero-width chars, HTML injection, entity encoding, directive lines) before reaching your agent
42
- - 🚀 **Zero friction** - Works with any public npm package, no author opt-in; respects `llms.txt` and shipped `skills/` when available
37
+ - 🌍 **Any NPM Package** - Repo, docs, releases, issues, discussions
38
+ - 🤖 **BYO Agent** - Generate SKILL.md with or without an LLM
39
+ - 📚 **Customizable** - `Best practices`, `LLM Gaps`, `Doc Map` or your own prompts
40
+ - 🔍 **Semantic Search** - Token-optimized search via [retriv](https://github.com/harlan-zw/retriv)
41
+ - 🎯 **Safe** - Prompt injection sanitization, version-aware output
42
+ - 🤝 **Ecosystem** - [skills-npm](https://github.com/antfu/skills-npm) and `/llms.txt` support
43
+
44
+ ## Quick Start
45
+
46
+ Run skilld in a project to generate skills for your dependencies through a simple interactive wizard:
47
+
48
+ ```bash
49
+ npx skilld
50
+ ```
51
+
52
+ If you need to re-configure skilld, just run `npx skilld config` to update your agent, model, or preferences.
43
53
 
44
54
  ## Installation
45
55
 
56
+ If you'd like to install skilld and track the lock file references, add it as a dev dependency:
57
+
46
58
  ```bash
47
- pnpm add -g skilld
59
+ npm install -D skilld
60
+ # or
61
+ yarn add -D skilld
62
+ # or
63
+ pnpm add -D skilld
48
64
  ```
49
65
 
50
- ## Automatic Updates
66
+ ### Automatic Updates
51
67
 
52
68
  Add to `package.json` to keep skills fresh on install:
53
69
 
@@ -59,8 +75,6 @@ Add to `package.json` to keep skills fresh on install:
59
75
  }
60
76
  ```
61
77
 
62
- skilld fast-paths unchanged versions—only regenerates when minor/major versions bump.
63
-
64
78
  ## CLI Usage
65
79
 
66
80
  ```bash
@@ -87,8 +101,12 @@ skilld add vueuse --global
87
101
  # Skip prompts
88
102
  skilld add vueuse --yes
89
103
 
90
- # Check skill status
91
- skilld status
104
+ # Check skill info
105
+ skilld info
106
+
107
+ # List installed skills
108
+ skilld list
109
+ skilld list --json
92
110
 
93
111
  # Manage settings
94
112
  skilld config
@@ -102,11 +120,13 @@ skilld config
102
120
  | `skilld add <pkg...>` | Add skills for package(s), space or comma-separated |
103
121
  | `skilld update [pkg]` | Update outdated skills (all or specific) |
104
122
  | `skilld search <query>` | Search indexed docs (`-p` to filter by package) |
105
- | `skilld status` | Show skill status across agents |
106
- | `skilld config` | Configure agent, model, preferences |
107
- | `skilld install` | Restore references from lockfile |
108
- | `skilld remove` | Remove installed skills |
109
- | `skilld uninstall` | Remove all skilld data |
123
+ | `skilld list` | List installed skills (`--json` for machine-readable output) |
124
+ | `skilld info` | Show skill info and config |
125
+ | `skilld config` | Configure agent, model, preferences |
126
+ | `skilld install` | Restore references from lockfile |
127
+ | `skilld remove` | Remove installed skills |
128
+ | `skilld uninstall` | Remove all skilld data |
129
+ | `skilld cache` | Cache management (clean expired LLM cache entries) |
110
130
 
111
131
  ### CLI Options
112
132
 
@@ -116,87 +136,16 @@ skilld config
116
136
  | `--agent` | `-a` | auto-detect | Target specific agent (claude-code, cursor, etc.) |
117
137
  | `--yes` | `-y` | `false` | Skip prompts, use defaults |
118
138
  | `--force` | `-f` | `false` | Ignore all caches, re-fetch docs and regenerate |
119
- | `--prepare` | | `false` | Non-interactive sync for prepare hook (outdated only) |
120
- | `--background` | `-b` | `false` | Run `--prepare` in a detached background process |
121
-
122
- ## How It Works
123
-
124
- ```
125
- Package name → Resolve docs → Fetch → Generate → Install
126
- ```
127
-
128
- 1. **Resolve** - Looks up npm registry for homepage, repository URL
129
- 2. **Fetch** - Tries versioned git docs → GitHub README → llms.txt (via ungh)
130
- 3. **Generate** - Your agent creates SKILL.md from fetched docs
131
- 4. **Cache** - References stored in `~/.skilld/` (shared across projects)
132
- 5. **Install** - Writes SKILL.md to `./<agent>/skills/<package>/` (e.g. `.claude/skills/vueuse/`)
133
-
134
- Supported agents: Claude Code, Cursor, Windsurf, Cline, Codex, GitHub Copilot, Gemini CLI, Goose, Amp, OpenCode, Roo Code
135
-
136
- ## Output Structure
137
-
138
- Skills install to each detected agent's skill directory. References are cached globally and shared across projects:
139
-
140
- ```
141
- .claude/skills/vueuse/
142
- ├── SKILL.md # Project-specific, adapts to your conventions
143
- └── .skilld/ # Gitignored, recreated by `skilld install`
144
- ├── pkg -> node_modules/vueuse
145
- └── docs -> ~/.skilld/references/vueuse@10.9.0/docs
146
-
147
- ~/.skilld/references/
148
- └── vueuse@10.9.0/ # Global cache, static docs
149
- ├── docs/
150
- ├── issues/
151
- └── discussions/
152
- ```
153
-
154
- SKILL.md is regenerated per-project (different conventions), but references stay static (same package docs). Version frontmatter enables sync:
155
-
156
- ```yaml
157
- ---
158
- name: vueuse
159
- version: 10.9.0
160
- description: Collection of Vue Composition Utilities
161
- ---
162
- ```
163
-
164
- ## Package.json Auto-Discovery
165
-
166
- Run `skilld` without arguments to interactively generate skills for your dependencies:
167
-
168
- ```bash
169
- cd my-project
170
- pnpx skilld
171
- ```
172
-
173
- On first run, skilld launches a wizard to configure your agent and model, then lets you choose packages from:
174
- - **Source imports** — scans your code for actually used packages
175
- - **package.json** — all dependencies and devDependencies
176
- - **Manual entry** — comma-separated package names
177
-
178
- Skips `@types/*` and common dev tools (typescript, eslint, vitest, etc).
179
-
180
- ## Shipped Skills (skills-npm)
181
-
182
- skilld supports the [skills-npm](https://github.com/antfu/skills-npm) convention. If a package ships a `skills/` directory, skilld symlinks it directly — no doc fetching, no caching, no LLM generation, no tokens spent.
183
-
184
- ```
185
- node_modules/@slidev/cli/skills/
186
- slidev/
187
- SKILL.md
188
- references/
189
-
190
- → .claude/skills/slidev -> node_modules/@slidev/cli/skills/slidev
191
- ```
192
-
193
- Package authors can ship skills alongside their code. skilld detects and links them automatically during sync. Generation is the fallback for packages that haven't adopted the convention yet.
139
+ | `--model` | `-m` | config default | LLM model for skill generation (sonnet, haiku, opus, etc.) |
140
+ | `--debug` | | `false` | Save raw LLM output to logs/ for each section |
141
+ | `--prepare` | | `false` | Non-interactive sync for prepare hook (outdated only) |
142
+ | `--background` | `-b` | `false` | Run `--prepare` in a detached background process |
194
143
 
195
144
  ## Related
196
145
 
197
146
  - [skills-npm](https://github.com/antfu/skills-npm) - Convention for shipping agent skills in npm packages
198
- - [mdream](https://github.com/harlan-zw/mdream) - HTML to Markdown converter used for crawling
199
- - [retriv](https://github.com/harlan-zw/retriv) - Vector database abstraction layer
147
+ - [mdream](https://github.com/harlan-zw/mdream) - HTML to Markdown converter
148
+ - [retriv](https://github.com/harlan-zw/retriv) - Vector search with sqlite-vec
200
149
 
201
150
  ## License
202
151
 
package/dist/cli.mjs CHANGED
@@ -3193,7 +3193,13 @@ runMain(defineCommand({
3193
3193
  message: "Enter package names (space or comma-separated)",
3194
3194
  placeholder: "vue nuxt pinia"
3195
3195
  });
3196
- if (p.isCancel(input)) continue;
3196
+ if (p.isCancel(input)) {
3197
+ if (!hasPkgJson) {
3198
+ p.cancel("Setup cancelled");
3199
+ return;
3200
+ }
3201
+ continue;
3202
+ }
3197
3203
  if (!input) {
3198
3204
  p.log.warn("No packages entered");
3199
3205
  continue;