skilldb 0.2.0 → 0.3.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 +280 -280
- package/dist/cli.js +15 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +49 -49
package/README.md
CHANGED
|
@@ -1,280 +1,280 @@
|
|
|
1
|
-
# skilldb
|
|
2
|
-
|
|
3
|
-
CLI and TypeScript SDK for [SkillDB](https://skilldb.dev) — discover, install, and manage AI agent skills from the terminal.
|
|
4
|
-
|
|
5
|
-
5,000+ expert skills for Claude Code, Cursor, OpenClaw, and Codex. Search, install, and activate exactly what your agent needs.
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Search for skills (with inline preview)
|
|
11
|
-
npx skilldb search "code review"
|
|
12
|
-
|
|
13
|
-
# Install a skill pack
|
|
14
|
-
npx skilldb add software-skills
|
|
15
|
-
|
|
16
|
-
# Activate a smart profile (only loads what you need)
|
|
17
|
-
npx skilldb use frontend
|
|
18
|
-
|
|
19
|
-
# Or auto-detect from your project
|
|
20
|
-
npx skilldb use auto
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Install
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install -g skilldb
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Or use `npx skilldb` without installing.
|
|
30
|
-
|
|
31
|
-
## The Memory Problem (And How We Solve It)
|
|
32
|
-
|
|
33
|
-
Loading 500 skills into your agent's context is worse than loading the right 5. SkillDB uses a **3-layer architecture** to manage this:
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
.skilldb/
|
|
37
|
-
├── skills/ ← Full cache (everything downloaded)
|
|
38
|
-
├── active/ ← Active profile (what your agent sees — 5-15 focused skills)
|
|
39
|
-
├── slim/ ← Compressed cheat sheets (10x smaller)
|
|
40
|
-
├── config.json ← Profile + budget settings
|
|
41
|
-
└── manifest.json ← What's installed
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Your CLAUDE.md or .cursorrules points at `.skilldb/active/`, not the full cache. The agent gets focused, relevant skills — not noise.
|
|
45
|
-
|
|
46
|
-
## CLI Commands
|
|
47
|
-
|
|
48
|
-
### Core
|
|
49
|
-
|
|
50
|
-
#### `skilldb init`
|
|
51
|
-
|
|
52
|
-
Detect your IDE (Claude Code, Cursor, Codex CLI, OpenClaw), create `.skilldb/`, and add integration config.
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
skilldb init
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
#### `skilldb search <query>`
|
|
59
|
-
|
|
60
|
-
Search skills by keyword. Shows inline slim preview so you know what you're getting before downloading.
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
skilldb search "debugging"
|
|
64
|
-
skilldb search "api design" --category "Technology & Engineering"
|
|
65
|
-
skilldb search "testing" --limit 10
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
#### `skilldb add <pack>`
|
|
69
|
-
|
|
70
|
-
Download a skill pack to local cache. Idempotent — skips already-cached skills.
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
skilldb add software-skills
|
|
74
|
-
skilldb add autonomous-agent-skills
|
|
75
|
-
skilldb add vibe-coding-security-skills
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
#### `skilldb get <id>`
|
|
79
|
-
|
|
80
|
-
Download a single skill.
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
skilldb get software-skills/code-review
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
#### `skilldb info <id>`
|
|
87
|
-
|
|
88
|
-
Show metadata, slim summary, and full preview for a skill.
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
skilldb info software-skills/code-review
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
#### `skilldb list`
|
|
95
|
-
|
|
96
|
-
List available categories, packs, and skills.
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
skilldb list
|
|
100
|
-
skilldb list --category "Autonomous Agents"
|
|
101
|
-
skilldb list --pack software-skills
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
#### `skilldb login`
|
|
105
|
-
|
|
106
|
-
Save your API key for authenticated access.
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
skilldb login
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Smart Loading
|
|
113
|
-
|
|
114
|
-
#### `skilldb use <profile>`
|
|
115
|
-
|
|
116
|
-
Activate a focused profile — only loads relevant skills into `.skilldb/active/`.
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
skilldb use frontend # React, testing, web-polish, accessibility
|
|
120
|
-
skilldb use backend # API design, databases, security, performance
|
|
121
|
-
skilldb use devops # Kubernetes, Docker, CI/CD, monitoring
|
|
122
|
-
skilldb use security # Trust audit, input validation, credentials
|
|
123
|
-
skilldb use data # SQL, pipelines, analytics, visualization
|
|
124
|
-
skilldb use fullstack # Frontend + backend combined
|
|
125
|
-
skilldb use ai-agent # Autonomous agent meta-skills
|
|
126
|
-
skilldb use auto # Auto-detect from your project files
|
|
127
|
-
skilldb use --list # Show available profiles
|
|
128
|
-
skilldb use --current # Show active profile
|
|
129
|
-
skilldb use none # Deactivate (clear active/)
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
`auto` mode scans your `package.json`, file extensions, and imports to recommend the right profile.
|
|
133
|
-
|
|
134
|
-
#### `skilldb budget`
|
|
135
|
-
|
|
136
|
-
Set a maximum context budget so your agent doesn't get overloaded.
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
skilldb budget # Show current usage
|
|
140
|
-
skilldb budget set 5000 # Max 5,000 lines
|
|
141
|
-
skilldb budget set 50k # Max 50,000 tokens
|
|
142
|
-
skilldb budget optimize # Re-rank and trim active skills to fit
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
#### `skilldb slim`
|
|
146
|
-
|
|
147
|
-
Generate compressed cheat-sheet versions of skills (~30 lines instead of 300).
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
skilldb slim # Slim all active skills
|
|
151
|
-
skilldb slim software-skills # Slim a specific pack
|
|
152
|
-
skilldb slim --ratio 0.3 # Keep 30% of content
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### Management
|
|
156
|
-
|
|
157
|
-
#### `skilldb update`
|
|
158
|
-
|
|
159
|
-
Check for newer versions of installed skills and update them.
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
skilldb update # Update everything
|
|
163
|
-
skilldb update software-skills # Update one pack
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
#### `skilldb remove`
|
|
167
|
-
|
|
168
|
-
Uninstall skills from local cache.
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
skilldb remove software-skills/code-review # Remove single skill
|
|
172
|
-
skilldb remove software-skills # Remove entire pack
|
|
173
|
-
skilldb remove --unused # Remove skills not in active profile
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
#### `skilldb doctor`
|
|
177
|
-
|
|
178
|
-
Health check and audit of your skill setup.
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
skilldb doctor
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Shows: outdated skills, unused skills, missing dependencies, budget status, coverage gaps.
|
|
185
|
-
|
|
186
|
-
#### `skilldb stats`
|
|
187
|
-
|
|
188
|
-
Local statistics dashboard.
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
skilldb stats
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Shows: installed count, total lines, tokens, active profile, categories covered.
|
|
195
|
-
|
|
196
|
-
#### `skilldb diff <id>`
|
|
197
|
-
|
|
198
|
-
Compare your local (possibly customized) version with the latest remote.
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
skilldb diff software-skills/code-review
|
|
202
|
-
skilldb diff # Diff all installed
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Sharing & Export
|
|
206
|
-
|
|
207
|
-
#### `skilldb export`
|
|
208
|
-
|
|
209
|
-
Export your setup for sharing or IDE integration.
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
skilldb export claude # CLAUDE.md snippet with skill references
|
|
213
|
-
skilldb export cursor # .cursorrules block
|
|
214
|
-
skilldb export profile # Shareable .skilldb-profile.json
|
|
215
|
-
skilldb export inject <id> # Print skill to stdout (for piping)
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
#### `skilldb recommend`
|
|
219
|
-
|
|
220
|
-
Scan your project and get personalized skill recommendations.
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
skilldb recommend # Analyze project and suggest
|
|
224
|
-
skilldb recommend --install # Auto-install recommendations
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## SDK Usage
|
|
228
|
-
|
|
229
|
-
```typescript
|
|
230
|
-
import { createClient } from 'skilldb';
|
|
231
|
-
|
|
232
|
-
const db = createClient(); // auto-loads key from env/config
|
|
233
|
-
|
|
234
|
-
// Search with slim previews
|
|
235
|
-
const results = await db.search('code review');
|
|
236
|
-
for (const skill of results.skills) {
|
|
237
|
-
console.log(skill.title);
|
|
238
|
-
console.log(skill.slim); // Quick summary
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// Get full skill content
|
|
242
|
-
const skill = await db.get('software-skills/code-review.md');
|
|
243
|
-
console.log(skill.content);
|
|
244
|
-
|
|
245
|
-
// List with filters
|
|
246
|
-
const listing = await db.list({ category: 'Autonomous Agents', limit: 10 });
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## Authentication
|
|
250
|
-
|
|
251
|
-
The SDK and CLI resolve your API key in order:
|
|
252
|
-
|
|
253
|
-
1. `SKILLDB_API_KEY` environment variable (CI-friendly)
|
|
254
|
-
2. `.skilldbrc` in project root (project-specific)
|
|
255
|
-
3. `~/.skilldbrc` in home directory (user-wide)
|
|
256
|
-
|
|
257
|
-
Browsing and searching works without authentication. Full skill content requires a Pro or Studio key.
|
|
258
|
-
|
|
259
|
-
## Profiles
|
|
260
|
-
|
|
261
|
-
Built-in profiles map to curated skill sets:
|
|
262
|
-
|
|
263
|
-
| Profile | Skills loaded | Best for |
|
|
264
|
-
|---------|--------------|----------|
|
|
265
|
-
| `frontend` | react-patterns, web-polish, testing, accessibility | React/Vue/Angular apps |
|
|
266
|
-
| `backend` | api-design, databases, security, performance | Node/Python/Go services |
|
|
267
|
-
| `devops` | kubernetes, docker, ci-cd, monitoring, cloud | Infrastructure & deployment |
|
|
268
|
-
| `security` | trust-audit, input-validation, credentials, hardening | Security review & hardening |
|
|
269
|
-
| `data` | sql, pipelines, analytics, visualization | Data engineering & analysis |
|
|
270
|
-
| `fullstack` | frontend + backend combined | Full-stack applications |
|
|
271
|
-
| `ai-agent` | autonomous-agent-skills, task-decomposition, planning | Building AI agents |
|
|
272
|
-
| `auto` | Detected from project | Any project |
|
|
273
|
-
|
|
274
|
-
## Requirements
|
|
275
|
-
|
|
276
|
-
- Node.js >= 18
|
|
277
|
-
|
|
278
|
-
## License
|
|
279
|
-
|
|
280
|
-
MIT
|
|
1
|
+
# skilldb
|
|
2
|
+
|
|
3
|
+
CLI and TypeScript SDK for [SkillDB](https://skilldb.dev) — discover, install, and manage AI agent skills from the terminal.
|
|
4
|
+
|
|
5
|
+
5,000+ expert skills for Claude Code, Cursor, OpenClaw, and Codex. Search, install, and activate exactly what your agent needs.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Search for skills (with inline preview)
|
|
11
|
+
npx skilldb search "code review"
|
|
12
|
+
|
|
13
|
+
# Install a skill pack
|
|
14
|
+
npx skilldb add software-skills
|
|
15
|
+
|
|
16
|
+
# Activate a smart profile (only loads what you need)
|
|
17
|
+
npx skilldb use frontend
|
|
18
|
+
|
|
19
|
+
# Or auto-detect from your project
|
|
20
|
+
npx skilldb use auto
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g skilldb
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or use `npx skilldb` without installing.
|
|
30
|
+
|
|
31
|
+
## The Memory Problem (And How We Solve It)
|
|
32
|
+
|
|
33
|
+
Loading 500 skills into your agent's context is worse than loading the right 5. SkillDB uses a **3-layer architecture** to manage this:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
.skilldb/
|
|
37
|
+
├── skills/ ← Full cache (everything downloaded)
|
|
38
|
+
├── active/ ← Active profile (what your agent sees — 5-15 focused skills)
|
|
39
|
+
├── slim/ ← Compressed cheat sheets (10x smaller)
|
|
40
|
+
├── config.json ← Profile + budget settings
|
|
41
|
+
└── manifest.json ← What's installed
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Your CLAUDE.md or .cursorrules points at `.skilldb/active/`, not the full cache. The agent gets focused, relevant skills — not noise.
|
|
45
|
+
|
|
46
|
+
## CLI Commands
|
|
47
|
+
|
|
48
|
+
### Core
|
|
49
|
+
|
|
50
|
+
#### `skilldb init`
|
|
51
|
+
|
|
52
|
+
Detect your IDE (Claude Code, Cursor, Codex CLI, OpenClaw), create `.skilldb/`, and add integration config.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
skilldb init
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### `skilldb search <query>`
|
|
59
|
+
|
|
60
|
+
Search skills by keyword. Shows inline slim preview so you know what you're getting before downloading.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
skilldb search "debugging"
|
|
64
|
+
skilldb search "api design" --category "Technology & Engineering"
|
|
65
|
+
skilldb search "testing" --limit 10
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### `skilldb add <pack>`
|
|
69
|
+
|
|
70
|
+
Download a skill pack to local cache. Idempotent — skips already-cached skills.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
skilldb add software-skills
|
|
74
|
+
skilldb add autonomous-agent-skills
|
|
75
|
+
skilldb add vibe-coding-security-skills
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### `skilldb get <id>`
|
|
79
|
+
|
|
80
|
+
Download a single skill.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
skilldb get software-skills/code-review
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### `skilldb info <id>`
|
|
87
|
+
|
|
88
|
+
Show metadata, slim summary, and full preview for a skill.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
skilldb info software-skills/code-review
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### `skilldb list`
|
|
95
|
+
|
|
96
|
+
List available categories, packs, and skills.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
skilldb list
|
|
100
|
+
skilldb list --category "Autonomous Agents"
|
|
101
|
+
skilldb list --pack software-skills
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### `skilldb login`
|
|
105
|
+
|
|
106
|
+
Save your API key for authenticated access.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
skilldb login
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Smart Loading
|
|
113
|
+
|
|
114
|
+
#### `skilldb use <profile>`
|
|
115
|
+
|
|
116
|
+
Activate a focused profile — only loads relevant skills into `.skilldb/active/`.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
skilldb use frontend # React, testing, web-polish, accessibility
|
|
120
|
+
skilldb use backend # API design, databases, security, performance
|
|
121
|
+
skilldb use devops # Kubernetes, Docker, CI/CD, monitoring
|
|
122
|
+
skilldb use security # Trust audit, input validation, credentials
|
|
123
|
+
skilldb use data # SQL, pipelines, analytics, visualization
|
|
124
|
+
skilldb use fullstack # Frontend + backend combined
|
|
125
|
+
skilldb use ai-agent # Autonomous agent meta-skills
|
|
126
|
+
skilldb use auto # Auto-detect from your project files
|
|
127
|
+
skilldb use --list # Show available profiles
|
|
128
|
+
skilldb use --current # Show active profile
|
|
129
|
+
skilldb use none # Deactivate (clear active/)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`auto` mode scans your `package.json`, file extensions, and imports to recommend the right profile.
|
|
133
|
+
|
|
134
|
+
#### `skilldb budget`
|
|
135
|
+
|
|
136
|
+
Set a maximum context budget so your agent doesn't get overloaded.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
skilldb budget # Show current usage
|
|
140
|
+
skilldb budget set 5000 # Max 5,000 lines
|
|
141
|
+
skilldb budget set 50k # Max 50,000 tokens
|
|
142
|
+
skilldb budget optimize # Re-rank and trim active skills to fit
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### `skilldb slim`
|
|
146
|
+
|
|
147
|
+
Generate compressed cheat-sheet versions of skills (~30 lines instead of 300).
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
skilldb slim # Slim all active skills
|
|
151
|
+
skilldb slim software-skills # Slim a specific pack
|
|
152
|
+
skilldb slim --ratio 0.3 # Keep 30% of content
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Management
|
|
156
|
+
|
|
157
|
+
#### `skilldb update`
|
|
158
|
+
|
|
159
|
+
Check for newer versions of installed skills and update them.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
skilldb update # Update everything
|
|
163
|
+
skilldb update software-skills # Update one pack
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### `skilldb remove`
|
|
167
|
+
|
|
168
|
+
Uninstall skills from local cache.
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
skilldb remove software-skills/code-review # Remove single skill
|
|
172
|
+
skilldb remove software-skills # Remove entire pack
|
|
173
|
+
skilldb remove --unused # Remove skills not in active profile
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### `skilldb doctor`
|
|
177
|
+
|
|
178
|
+
Health check and audit of your skill setup.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
skilldb doctor
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Shows: outdated skills, unused skills, missing dependencies, budget status, coverage gaps.
|
|
185
|
+
|
|
186
|
+
#### `skilldb stats`
|
|
187
|
+
|
|
188
|
+
Local statistics dashboard.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
skilldb stats
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Shows: installed count, total lines, tokens, active profile, categories covered.
|
|
195
|
+
|
|
196
|
+
#### `skilldb diff <id>`
|
|
197
|
+
|
|
198
|
+
Compare your local (possibly customized) version with the latest remote.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
skilldb diff software-skills/code-review
|
|
202
|
+
skilldb diff # Diff all installed
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Sharing & Export
|
|
206
|
+
|
|
207
|
+
#### `skilldb export`
|
|
208
|
+
|
|
209
|
+
Export your setup for sharing or IDE integration.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
skilldb export claude # CLAUDE.md snippet with skill references
|
|
213
|
+
skilldb export cursor # .cursorrules block
|
|
214
|
+
skilldb export profile # Shareable .skilldb-profile.json
|
|
215
|
+
skilldb export inject <id> # Print skill to stdout (for piping)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### `skilldb recommend`
|
|
219
|
+
|
|
220
|
+
Scan your project and get personalized skill recommendations.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
skilldb recommend # Analyze project and suggest
|
|
224
|
+
skilldb recommend --install # Auto-install recommendations
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## SDK Usage
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
import { createClient } from 'skilldb';
|
|
231
|
+
|
|
232
|
+
const db = createClient(); // auto-loads key from env/config
|
|
233
|
+
|
|
234
|
+
// Search with slim previews
|
|
235
|
+
const results = await db.search('code review');
|
|
236
|
+
for (const skill of results.skills) {
|
|
237
|
+
console.log(skill.title);
|
|
238
|
+
console.log(skill.slim); // Quick summary
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Get full skill content
|
|
242
|
+
const skill = await db.get('software-skills/code-review.md');
|
|
243
|
+
console.log(skill.content);
|
|
244
|
+
|
|
245
|
+
// List with filters
|
|
246
|
+
const listing = await db.list({ category: 'Autonomous Agents', limit: 10 });
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Authentication
|
|
250
|
+
|
|
251
|
+
The SDK and CLI resolve your API key in order:
|
|
252
|
+
|
|
253
|
+
1. `SKILLDB_API_KEY` environment variable (CI-friendly)
|
|
254
|
+
2. `.skilldbrc` in project root (project-specific)
|
|
255
|
+
3. `~/.skilldbrc` in home directory (user-wide)
|
|
256
|
+
|
|
257
|
+
Browsing and searching works without authentication. Full skill content requires a Pro or Studio key.
|
|
258
|
+
|
|
259
|
+
## Profiles
|
|
260
|
+
|
|
261
|
+
Built-in profiles map to curated skill sets:
|
|
262
|
+
|
|
263
|
+
| Profile | Skills loaded | Best for |
|
|
264
|
+
|---------|--------------|----------|
|
|
265
|
+
| `frontend` | react-patterns, web-polish, testing, accessibility | React/Vue/Angular apps |
|
|
266
|
+
| `backend` | api-design, databases, security, performance | Node/Python/Go services |
|
|
267
|
+
| `devops` | kubernetes, docker, ci-cd, monitoring, cloud | Infrastructure & deployment |
|
|
268
|
+
| `security` | trust-audit, input-validation, credentials, hardening | Security review & hardening |
|
|
269
|
+
| `data` | sql, pipelines, analytics, visualization | Data engineering & analysis |
|
|
270
|
+
| `fullstack` | frontend + backend combined | Full-stack applications |
|
|
271
|
+
| `ai-agent` | autonomous-agent-skills, task-decomposition, planning | Building AI agents |
|
|
272
|
+
| `auto` | Detected from project | Any project |
|
|
273
|
+
|
|
274
|
+
## Requirements
|
|
275
|
+
|
|
276
|
+
- Node.js >= 18
|
|
277
|
+
|
|
278
|
+
## License
|
|
279
|
+
|
|
280
|
+
MIT
|
package/dist/cli.js
CHANGED
|
@@ -78,17 +78,19 @@ var SkillDBClient = class {
|
|
|
78
78
|
search: query,
|
|
79
79
|
category: options?.category ?? "",
|
|
80
80
|
pack: options?.pack ?? "",
|
|
81
|
+
sort: options?.sort ?? "",
|
|
81
82
|
limit: String(options?.limit ?? 20),
|
|
82
83
|
offset: String(options?.offset ?? 0),
|
|
83
84
|
include_content: options?.includeContent ? "true" : ""
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
/** List skills with optional filters. */
|
|
87
|
+
/** List skills with optional filters and sorting. */
|
|
87
88
|
async list(options) {
|
|
88
89
|
return this.request("/skills", {
|
|
89
90
|
category: options?.category ?? "",
|
|
90
91
|
pack: options?.pack ?? "",
|
|
91
92
|
search: options?.search ?? "",
|
|
93
|
+
sort: options?.sort ?? "",
|
|
92
94
|
limit: String(options?.limit ?? 50),
|
|
93
95
|
offset: String(options?.offset ?? 0),
|
|
94
96
|
include_content: options?.includeContent ? "true" : ""
|
|
@@ -102,6 +104,17 @@ var SkillDBClient = class {
|
|
|
102
104
|
});
|
|
103
105
|
return "skill" in res ? res.skill : res;
|
|
104
106
|
}
|
|
107
|
+
/** Batch retrieve multiple skills by IDs (max 50). */
|
|
108
|
+
async batch(ids) {
|
|
109
|
+
return this.request("/skills", {
|
|
110
|
+
ids: ids.slice(0, 50).join(","),
|
|
111
|
+
include_content: "true"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/** Get search autocomplete suggestions. */
|
|
115
|
+
async suggest(query) {
|
|
116
|
+
return this.request("/skills/suggest", { q: query });
|
|
117
|
+
}
|
|
105
118
|
/** Validate that the configured API key works. */
|
|
106
119
|
async validate() {
|
|
107
120
|
try {
|
|
@@ -1618,7 +1631,7 @@ ${pc17.green(`${upToDate} up to date`)}` + (changed > 0 ? pc17.yellow(`, ${chang
|
|
|
1618
1631
|
|
|
1619
1632
|
// src/cli.ts
|
|
1620
1633
|
var program = new Command();
|
|
1621
|
-
program.name("skilldb").description("SkillDB CLI \u2014 discover, install, and manage AI agent skills").version("0.
|
|
1634
|
+
program.name("skilldb").description("SkillDB CLI \u2014 discover, install, and manage AI agent skills").version("0.3.0");
|
|
1622
1635
|
program.command("init").description("Initialize SkillDB in this project (detect IDE, create .skilldb/)").action(initCommand);
|
|
1623
1636
|
program.command("login").description("Save your SkillDB API key").action(loginCommand);
|
|
1624
1637
|
program.command("search <query...>").description("Search skills by keyword(s)").option("-c, --category <name>", "Filter by category").option("-l, --limit <n>", "Max results", "20").action((queryParts, options) => {
|