guardskills 0.1.0-alpha.4 → 1.1.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.
Files changed (4) hide show
  1. package/README.md +184 -28
  2. package/dist/cli.cjs +791 -28
  3. package/dist/cli.js +791 -28
  4. package/package.json +2 -1
package/README.md CHANGED
@@ -33,14 +33,14 @@ npx guardskills add https://github.com/vercel-labs/skills --skill find-skills
33
33
 
34
34
  ## Current Readiness
35
35
 
36
- - Current stage: **beta-quality**.
37
- - Good for internal use and early adopters.
38
- - Not final production-grade yet; see `PRODUCTION_READINESS.md`.
36
+ - Current stage: **stable (v1.0.0)**.
37
+ - Suitable for production use with standard security review practices.
39
38
 
40
39
  ## Implemented Features
41
40
 
42
41
  - `guardskills add <repo> --skill <name>`
43
42
  - `guardskills scan-local <path>`
43
+ - `guardskills scan-clawhub <identifier>`
44
44
  - GitHub resolver (`owner/repo` and `https://github.com/...`)
45
45
  - Deterministic static scanner with rule matrix in `RULES.md`
46
46
  - Score-based decision engine with hard-block guardrails
@@ -90,61 +90,97 @@ npm run ci
90
90
  npm run audit:prod
91
91
  ```
92
92
 
93
- Local dry-run:
93
+ ## Scan Skills by Source
94
+
95
+ Use this section as the clean reference for supported scan sources.
96
+
97
+ ### 1. Local Skills
98
+
99
+ Scan a skill folder on disk:
94
100
 
95
101
  ```bash
96
- guardskills add https://github.com/vercel-labs/skills --skill find-skills --dry-run
102
+ guardskills scan-local C:\path\to\skill-folder
97
103
  ```
98
104
 
99
- Local folder check:
105
+ If the path contains multiple skills:
100
106
 
101
107
  ```bash
102
- guardskills scan-local C:\path\to\skill-folder
108
+ guardskills scan-local C:\path\to\skills --skill <skill-folder-name>
103
109
  ```
104
110
 
105
- Deterministic CI gate:
111
+ JSON output:
106
112
 
107
113
  ```bash
108
- guardskills add https://github.com/vercel-labs/skills --skill find-skills --ci --json
114
+ guardskills scan-local C:\path\to\skill-folder --json
109
115
  ```
110
116
 
111
- With resolver reliability controls:
117
+ ### 2. GitHub Skills
118
+
119
+ Scan a GitHub-hosted skill without installing:
112
120
 
113
121
  ```bash
114
- guardskills add owner/repo --skill name \
115
- --github-timeout-ms 15000 \
116
- --github-retries 2 \
117
- --github-retry-base-ms 300 \
118
- --max-file-bytes 250000 \
119
- --max-aux-files 40 \
120
- --max-total-files 120
122
+ guardskills add owner/repo --skill <skill-name> --dry-run
121
123
  ```
122
124
 
123
- ## Local Check (Folder on Disk)
125
+ Also supported:
124
126
 
125
- Scan any local skill directory:
127
+ ```bash
128
+ guardskills add https://github.com/owner/repo --skill <skill-name> --dry-run
129
+ ```
130
+
131
+ CI/machine-readable output:
126
132
 
127
133
  ```bash
128
- guardskills scan-local C:\Felix\Skills\x-algo-skills\.github\skills\x-algo-post
134
+ guardskills add owner/repo --skill <skill-name> --ci --json
129
135
  ```
130
136
 
131
- JSON output:
137
+ ### 3. `skills.sh` Skills
138
+
139
+ For `skills.sh` installs, run the same guarded GitHub scan flow first:
140
+
141
+ ```bash
142
+ guardskills add owner/repo --skill <skill-name> --dry-run
143
+ ```
144
+
145
+ Then, only if acceptable, run the guarded install handoff:
146
+
147
+ ```bash
148
+ guardskills add owner/repo --skill <skill-name>
149
+ ```
150
+
151
+ Never run `skills add ...` directly before `guardskills`.
152
+
153
+ ### 4. ClawHub Skills
154
+
155
+ Scan by ClawHub identifier:
132
156
 
133
157
  ```bash
134
- guardskills scan-local C:\Felix\Skills\x-algo-skills\.github\skills\x-algo-post --json
158
+ guardskills scan-clawhub owner/skill-slug
135
159
  ```
136
160
 
137
- If your path contains multiple skills, select one by directory name:
161
+ Scan by full ClawHub link:
138
162
 
139
163
  ```bash
140
- guardskills scan-local C:\Felix\Skills\x-algo-skills\.github\skills --skill x-algo-post
164
+ guardskills scan-clawhub https://clawhub.ai/owner/skill-slug
141
165
  ```
142
166
 
143
- Path handling:
167
+ JSON output:
144
168
 
145
- - missing path: fails with clear error and nearby suggestions
146
- - folder with one discovered `SKILL.md`: auto-selects it
147
- - folder with multiple discovered `SKILL.md`: asks for `--skill <name>`
169
+ ```bash
170
+ guardskills scan-clawhub https://clawhub.ai/owner/skill-slug --json
171
+ ```
172
+
173
+ ## Resolver Controls
174
+
175
+ ```bash
176
+ guardskills add owner/repo --skill name \
177
+ --github-timeout-ms 15000 \
178
+ --github-retries 2 \
179
+ --github-retry-base-ms 300 \
180
+ --max-file-bytes 250000 \
181
+ --max-aux-files 40 \
182
+ --max-total-files 120
183
+ ```
148
184
 
149
185
  ## Configuration File
150
186
 
@@ -191,6 +227,126 @@ Template files are included as:
191
227
  - `guardskills.config.json` (baseline default)
192
228
  - `guardskills.config.example.json` (copy/reference template)
193
229
 
230
+ ## OpenClaw Bot Instructions
231
+
232
+ Use this section as instructions for OpenClaw so it runs `guardskills` before installing any skill.
233
+
234
+ ### Purpose
235
+
236
+ `guardskills` is a security gate for skill installs. It scans skill content first, then decides if install should proceed.
237
+
238
+ ### Rule for OpenClaw
239
+
240
+ Before any skill install, always run a `guardskills` scan first.
241
+
242
+ ### 1. Local Skills
243
+
244
+ ```bash
245
+ guardskills scan-local <path-to-skill-folder>
246
+ ```
247
+
248
+ If multiple skills are found:
249
+
250
+ ```bash
251
+ guardskills scan-local <path-to-skills-root> --skill <skill-folder-name>
252
+ ```
253
+
254
+ ### 2. GitHub Skills
255
+
256
+ ```bash
257
+ guardskills add owner/repo --skill <skill-name> --dry-run
258
+ ```
259
+
260
+ Also supported:
261
+
262
+ ```bash
263
+ guardskills add https://github.com/owner/repo --skill <skill-name> --dry-run
264
+ ```
265
+
266
+ ### 3. `skills.sh` Skills
267
+
268
+ Use the same guarded GitHub flow before install:
269
+
270
+ ```bash
271
+ guardskills add owner/repo --skill <skill-name> --dry-run
272
+ ```
273
+
274
+ If allowed:
275
+
276
+ ```bash
277
+ guardskills add owner/repo --skill <skill-name>
278
+ ```
279
+
280
+ ### 4. ClawHub Skills
281
+
282
+ Use `scan-clawhub` with either identifier or full URL:
283
+
284
+ ```bash
285
+ guardskills scan-clawhub owner/skill-slug
286
+ ```
287
+
288
+ ```bash
289
+ guardskills scan-clawhub https://clawhub.ai/owner/skill-slug
290
+ ```
291
+
292
+ For machine output:
293
+
294
+ ```bash
295
+ guardskills scan-clawhub https://clawhub.ai/owner/skill-slug --json
296
+ ```
297
+
298
+ If the ClawHub API does not expose GitHub source metadata, `guardskills` falls back to scanning the downloadable ClawHub archive payload.
299
+
300
+ ### How OpenClaw Should Interpret Results
301
+
302
+ - `SAFE`: proceed.
303
+ - `WARNING`: require confirmation before proceed (or explicit `--yes` behavior).
304
+ - `UNSAFE`: block unless user explicitly asks for override (`--force`).
305
+ - `CRITICAL`: block.
306
+ - `UNVERIFIABLE`: block unless user explicitly allows override (`--allow-unverifiable`).
307
+
308
+ ### Recommended Install Workflow
309
+
310
+ 1. Run scan for source type:
311
+
312
+ ```bash
313
+ guardskills add owner/repo --skill <skill-name> --dry-run
314
+ ```
315
+
316
+ or
317
+
318
+ ```bash
319
+ guardskills scan-local <path>
320
+ ```
321
+
322
+ or
323
+
324
+ ```bash
325
+ guardskills scan-clawhub https://clawhub.ai/owner/skill-slug
326
+ ```
327
+
328
+ 2. Only if decision is acceptable, run install through guardskills (GitHub/skills.sh flow):
329
+
330
+ ```bash
331
+ guardskills add owner/repo --skill <skill-name>
332
+ ```
333
+
334
+ Do not run `skills add` directly first.
335
+
336
+ ### Copy/Paste Bot Instruction Block
337
+
338
+ ```text
339
+ Before installing any skill, always run guardskills first.
340
+ For local skills, run: guardskills scan-local <path>
341
+ For GitHub or skills.sh skills, run: guardskills add owner/repo --skill <skill-name> --dry-run
342
+ For ClawHub skills, run: guardskills scan-clawhub <owner/slug-or-full-url>
343
+ If SAFE, proceed.
344
+ If WARNING, ask for confirmation.
345
+ If UNSAFE/CRITICAL, block.
346
+ If UNVERIFIABLE, block unless user explicitly requests override.
347
+ Never run skills add directly before a guardskills check.
348
+ ```
349
+
194
350
  ## Exit Codes
195
351
 
196
352
  - `0`: allowed/success