skillstore 0.1.0 → 0.1.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
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# skillstore
|
|
2
|
+
|
|
3
|
+
CLI and SDK for installing AI skills from [skillstore.io](https://skillstore.io) - the skills marketplace for Claude Code, Codex, and Claude.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Use directly with npx (recommended)
|
|
9
|
+
npx skillstore install <skill-or-plugin>
|
|
10
|
+
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm install -g skillstore
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## CLI Usage
|
|
16
|
+
|
|
17
|
+
### Install a Single Skill
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx skillstore install <skill-slug>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Example:
|
|
24
|
+
```bash
|
|
25
|
+
npx skillstore install react-component-generator
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Install a Plugin (Skill Collection)
|
|
29
|
+
|
|
30
|
+
Use the `@` prefix to install all skills from a plugin:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx skillstore install @<plugin-slug>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Example:
|
|
37
|
+
```bash
|
|
38
|
+
npx skillstore install @frontend-essentials
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Options
|
|
42
|
+
|
|
43
|
+
| Option | Description |
|
|
44
|
+
|--------|-------------|
|
|
45
|
+
| `--dir <path>` | Installation directory (default: `.claude/skills`) |
|
|
46
|
+
| `--overwrite` | Overwrite existing files |
|
|
47
|
+
| `--skip-verify` | Skip manifest signature verification (plugins only) |
|
|
48
|
+
| `--dry-run` | Preview without writing files |
|
|
49
|
+
|
|
50
|
+
### Plugin Commands
|
|
51
|
+
|
|
52
|
+
#### List Available Plugins
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx skillstore plugin list [options]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Options:
|
|
59
|
+
- `--type <type>` - Filter by type: `curated`, `scenario`, or `user`
|
|
60
|
+
- `--pricing <pricing>` - Filter by pricing: `free` or `paid`
|
|
61
|
+
- `--limit <n>` - Number of plugins to show (default: 10)
|
|
62
|
+
- `--page <n>` - Page number for pagination
|
|
63
|
+
|
|
64
|
+
#### Get Plugin Info
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx skillstore plugin info <slug>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Install Plugin (Alternative)
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx skillstore plugin install <slug> [options]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## SDK Usage
|
|
77
|
+
|
|
78
|
+
Use the SDK to integrate skillstore into your own tools:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import {
|
|
82
|
+
fetchSkillInfo,
|
|
83
|
+
downloadSkillZip,
|
|
84
|
+
fetchManifest,
|
|
85
|
+
fetchPluginList,
|
|
86
|
+
getPluginConfig,
|
|
87
|
+
} from 'skillstore';
|
|
88
|
+
|
|
89
|
+
// Get default configuration
|
|
90
|
+
const config = getPluginConfig({
|
|
91
|
+
installDir: '.claude/skills',
|
|
92
|
+
timeout: 30000,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Fetch skill info
|
|
96
|
+
const skill = await fetchSkillInfo(config, 'my-skill');
|
|
97
|
+
console.log(skill.name, skill.description);
|
|
98
|
+
|
|
99
|
+
// Download skill as ZIP
|
|
100
|
+
const zipBuffer = await downloadSkillZip(config, 'my-skill');
|
|
101
|
+
|
|
102
|
+
// List available plugins
|
|
103
|
+
const plugins = await fetchPluginList(config, {
|
|
104
|
+
type: 'curated',
|
|
105
|
+
pricing: 'free',
|
|
106
|
+
limit: 20,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Fetch plugin manifest for installation
|
|
110
|
+
const manifest = await fetchManifest(config, 'my-plugin');
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### SDK Exports
|
|
114
|
+
|
|
115
|
+
#### Plugin API
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import {
|
|
119
|
+
fetchManifest,
|
|
120
|
+
fetchPluginInfo,
|
|
121
|
+
fetchPluginList,
|
|
122
|
+
downloadSkill,
|
|
123
|
+
reportInstallation,
|
|
124
|
+
reportSkillTelemetry,
|
|
125
|
+
PluginApiError,
|
|
126
|
+
} from 'skillstore';
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Skill API
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import {
|
|
133
|
+
fetchSkillInfo,
|
|
134
|
+
downloadSkillZip,
|
|
135
|
+
SkillApiError,
|
|
136
|
+
} from 'skillstore';
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### Configuration
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import {
|
|
143
|
+
getPluginConfig,
|
|
144
|
+
getSkillPath,
|
|
145
|
+
DEFAULT_INSTALL_DIR,
|
|
146
|
+
API_BASE_URL,
|
|
147
|
+
} from 'skillstore';
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Verification
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import {
|
|
154
|
+
verifyManifest,
|
|
155
|
+
verifyManifestSignature,
|
|
156
|
+
verifyContentHash,
|
|
157
|
+
} from 'skillstore';
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### Download Manager
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import {
|
|
164
|
+
downloadAllSkills,
|
|
165
|
+
printDownloadSummary,
|
|
166
|
+
} from 'skillstore';
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Configuration
|
|
170
|
+
|
|
171
|
+
### Environment Variables
|
|
172
|
+
|
|
173
|
+
| Variable | Description |
|
|
174
|
+
|----------|-------------|
|
|
175
|
+
| `SKILLSTORE_API_URL` | Custom API base URL (default: `https://skillstore.io/api`) |
|
|
176
|
+
| `SKILLSTORE_VERIFY_KEY` | Override built-in manifest verification key (optional) |
|
|
177
|
+
| `DEBUG` | Enable debug logging |
|
|
178
|
+
|
|
179
|
+
> **Note**: Manifest signature verification is enabled by default using a built-in key. You don't need to configure anything for verification to work.
|
|
180
|
+
|
|
181
|
+
## Directory Structure
|
|
182
|
+
|
|
183
|
+
Skills are installed to `.claude/skills/` by default:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
.claude/
|
|
187
|
+
└── skills/
|
|
188
|
+
├── skill-one.md
|
|
189
|
+
├── skill-two.md
|
|
190
|
+
└── ...
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Requirements
|
|
194
|
+
|
|
195
|
+
- Node.js >= 18.0.0
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
MIT
|
|
@@ -10,11 +10,10 @@ export interface VerifyResult {
|
|
|
10
10
|
error?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get the signing key
|
|
14
|
-
*
|
|
15
|
-
* For CLI, we use a shared secret (configured by user or fetched from API)
|
|
13
|
+
* Get the signing key for manifest verification
|
|
14
|
+
* Uses built-in key by default, can be overridden via environment variable
|
|
16
15
|
*/
|
|
17
|
-
export declare function getVerificationKey(): string
|
|
16
|
+
export declare function getVerificationKey(): string;
|
|
18
17
|
/**
|
|
19
18
|
* Verify manifest signature using HMAC-SHA256
|
|
20
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-verify.d.ts","sourceRoot":"","sources":["../../src/lib/plugin-verify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;GAIG;AAEH,0BAA0B;AAC1B,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"plugin-verify.d.ts","sourceRoot":"","sources":["../../src/lib/plugin-verify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;GAIG;AAEH,0BAA0B;AAC1B,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAQD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,MAAM,GACT,YAAY,CA6Bd;AAgBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAMhF;AAED;;GAEG;AACH,wBAAsB,cAAc,CACnC,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GACvC,OAAO,CAAC,YAAY,CAAC,CA+BvB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { createHmac, createHash, timingSafeEqual as cryptoTimingSafeEqual } from 'node:crypto';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
3
|
+
* Built-in verification key for skillstore.io manifests
|
|
4
|
+
* This key is used to verify HMAC-SHA256 signatures on plugin manifests
|
|
5
|
+
*/
|
|
6
|
+
const DEFAULT_VERIFICATION_KEY = '3d2b8f367783854cbdb6f81c9a39d586201c8d898ec8737bfa464162a9177943';
|
|
7
|
+
/**
|
|
8
|
+
* Get the signing key for manifest verification
|
|
9
|
+
* Uses built-in key by default, can be overridden via environment variable
|
|
6
10
|
*/
|
|
7
11
|
export function getVerificationKey() {
|
|
8
|
-
|
|
9
|
-
// In production, this might be fetched from a public endpoint
|
|
10
|
-
return process.env.SKILLSTORE_VERIFY_KEY || null;
|
|
12
|
+
return process.env.SKILLSTORE_VERIFY_KEY || DEFAULT_VERIFICATION_KEY;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Verify manifest signature using HMAC-SHA256
|
|
@@ -85,14 +87,6 @@ export async function verifyManifest(manifest, options = {}) {
|
|
|
85
87
|
// Verify signature unless skipped
|
|
86
88
|
if (!options.skipSignature) {
|
|
87
89
|
const key = getVerificationKey();
|
|
88
|
-
if (!key) {
|
|
89
|
-
// If no key is configured, warn but don't fail
|
|
90
|
-
// This allows installation without signature verification
|
|
91
|
-
return {
|
|
92
|
-
valid: true,
|
|
93
|
-
error: 'Warning: No verification key configured, signature not verified',
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
90
|
const signatureResult = verifyManifestSignature(manifest, key);
|
|
97
91
|
if (!signatureResult.valid) {
|
|
98
92
|
return signatureResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-verify.js","sourceRoot":"","sources":["../../src/lib/plugin-verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAe/F
|
|
1
|
+
{"version":3,"file":"plugin-verify.js","sourceRoot":"","sources":["../../src/lib/plugin-verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAe/F;;;GAGG;AACH,MAAM,wBAAwB,GAAG,kEAAkE,CAAC;AAEpG;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IACjC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,wBAAwB,CAAC;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,U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