Commit 3a09ddd
committed
feat: minify skill scripts and strip console output at build time
Inspired by https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/
— skill scripts are now generated agent-first: no human-readable console
output, no comments, minimal token footprint.
- generate-skills.js now calls terser instead of copyFileSync
- drop_console: true removes all console.* calls
- mangle + no comments produces a single minified line per script
- fallback to raw copy if minification fails (never breaks the build)
- Each generated script gets a one-line header:
// snippets/<Category>/<file>.js | sha256:<16-char> | <github-url>
SHA-256 is computed from the original source, allowing verification
that the minified script corresponds to a specific snippet version
- terser added as devDependency1 parent 0b55131 commit 3a09ddd
2 files changed
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
51 | 77 | | |
52 | 78 | | |
53 | 79 | | |
| |||
185 | 211 | | |
186 | 212 | | |
187 | 213 | | |
188 | | - | |
| 214 | + | |
189 | 215 | | |
190 | 216 | | |
191 | 217 | | |
| |||
200 | 226 | | |
201 | 227 | | |
202 | 228 | | |
203 | | - | |
| 229 | + | |
204 | 230 | | |
205 | | - | |
| 231 | + | |
206 | 232 | | |
207 | 233 | | |
208 | 234 | | |
| |||
357 | 383 | | |
358 | 384 | | |
359 | 385 | | |
360 | | - | |
| 386 | + | |
361 | 387 | | |
362 | 388 | | |
363 | 389 | | |
| |||
378 | 404 | | |
379 | 405 | | |
380 | 406 | | |
381 | | - | |
| 407 | + | |
382 | 408 | | |
383 | 409 | | |
384 | 410 | | |
| |||
410 | 436 | | |
411 | 437 | | |
412 | 438 | | |
413 | | - | |
| 439 | + | |
0 commit comments