@maccesar/aiskills 1.7.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 (73) hide show
  1. package/README.md +531 -0
  2. package/bin/aiskills.js +76 -0
  3. package/lib/cache.js +49 -0
  4. package/lib/cleanup.js +77 -0
  5. package/lib/commands/auto-update.js +131 -0
  6. package/lib/commands/doctor.js +139 -0
  7. package/lib/commands/list.js +77 -0
  8. package/lib/commands/skills.js +263 -0
  9. package/lib/commands/status.js +94 -0
  10. package/lib/commands/uninstall.js +182 -0
  11. package/lib/commands/update.js +149 -0
  12. package/lib/config.js +90 -0
  13. package/lib/downloader.js +110 -0
  14. package/lib/hooks.js +74 -0
  15. package/lib/installer.js +114 -0
  16. package/lib/platform.js +112 -0
  17. package/lib/prompts/checkboxCancel.js +264 -0
  18. package/lib/prompts/selectCancel.js +204 -0
  19. package/lib/symlink.js +154 -0
  20. package/lib/utils.js +49 -0
  21. package/package.json +61 -0
  22. package/skills/humaniza/SKILL.md +51 -0
  23. package/skills/humaniza/agents/openai.yaml +4 -0
  24. package/skills/humaniza/references/ai-patterns-es.md +51 -0
  25. package/skills/humaniza/references/checklist.md +9 -0
  26. package/skills/humaniza/references/examples.md +17 -0
  27. package/skills/humaniza/references/lexicon-es-mx.md +36 -0
  28. package/skills/humaniza/references/modes-es-mx.md +41 -0
  29. package/skills/humaniza/references/voice-es-mx.md +24 -0
  30. package/skills/refactoring-ui/SKILL.md +59 -0
  31. package/skills/refactoring-ui/references/01-design-process.md +72 -0
  32. package/skills/refactoring-ui/references/02-visual-hierarchy.md +84 -0
  33. package/skills/refactoring-ui/references/03-layout-spacing.md +69 -0
  34. package/skills/refactoring-ui/references/04-typography.md +70 -0
  35. package/skills/refactoring-ui/references/05-color.md +96 -0
  36. package/skills/refactoring-ui/references/06-depth-shadows.md +74 -0
  37. package/skills/refactoring-ui/references/07-images.md +75 -0
  38. package/skills/refactoring-ui/references/08-finishing-touches.md +91 -0
  39. package/skills/stitch-showcase/SKILL.md +411 -0
  40. package/skills/stitch-showcase/references/01-navbar.md +52 -0
  41. package/skills/stitch-showcase/references/02-hero.md +56 -0
  42. package/skills/stitch-showcase/references/03-design-system.md +102 -0
  43. package/skills/stitch-showcase/references/04-screen-gallery.md +102 -0
  44. package/skills/stitch-showcase/references/05-viewer-web.md +105 -0
  45. package/skills/stitch-showcase/references/06-viewer-mobile.md +104 -0
  46. package/skills/stitch-showcase/references/07-theme-system.md +77 -0
  47. package/skills/stitch-showcase/references/08-type-detection.md +81 -0
  48. package/skills/stitch-showcase/references/09-quality-standards.md +126 -0
  49. package/skills/stitch-showcase/references/10-component-standardization.md +40 -0
  50. package/skills/stitch-showcase/references/11-component-catalog.md +70 -0
  51. package/skills/stitch-showcase/references/catalog-template.html +841 -0
  52. package/skills/stitch-showcase/references/index.html +299 -0
  53. package/skills/stitch-showcase/references/viewer.html +412 -0
  54. package/skills/stitch-showcase/scripts/__pycache__/build_showcase.cpython-314.pyc +0 -0
  55. package/skills/stitch-showcase/scripts/__pycache__/component_utils.cpython-313.pyc +0 -0
  56. package/skills/stitch-showcase/scripts/__pycache__/detect_components.cpython-313.pyc +0 -0
  57. package/skills/stitch-showcase/scripts/__pycache__/extract_catalog.cpython-313.pyc +0 -0
  58. package/skills/stitch-showcase/scripts/__pycache__/extract_text.cpython-313.pyc +0 -0
  59. package/skills/stitch-showcase/scripts/__pycache__/extract_zips.cpython-313.pyc +0 -0
  60. package/skills/stitch-showcase/scripts/__pycache__/parse_design_md.cpython-313.pyc +0 -0
  61. package/skills/stitch-showcase/scripts/apply_canonical.py +238 -0
  62. package/skills/stitch-showcase/scripts/build_showcase.py +2103 -0
  63. package/skills/stitch-showcase/scripts/component_utils.py +398 -0
  64. package/skills/stitch-showcase/scripts/detect_components.py +284 -0
  65. package/skills/stitch-showcase/scripts/extract_catalog.py +913 -0
  66. package/skills/stitch-showcase/scripts/extract_text.py +268 -0
  67. package/skills/stitch-showcase/scripts/extract_zips.py +178 -0
  68. package/skills/stitch-showcase/scripts/parse_design_md.py +397 -0
  69. package/skills/vscode-extension-dev/SKILL.md +114 -0
  70. package/skills/vscode-extension-dev/references/api-patterns.md +625 -0
  71. package/skills/vscode-extension-dev/references/architecture.md +287 -0
  72. package/skills/vscode-extension-dev/references/package-json-schema.md +345 -0
  73. package/skills/vscode-extension-dev/references/publishing.md +251 -0
package/README.md ADDED
@@ -0,0 +1,531 @@
1
+ # aiskills - AI Skills CLI
2
+
3
+ <div align="center">
4
+
5
+ ![npm](https://img.shields.io/npm/dm/aiskills)
6
+ ![npm](https://img.shields.io/npm/v/aiskills)
7
+ ![NPM](https://img.shields.io/npm/l/aiskills)
8
+
9
+ </div>
10
+
11
+ `aiskills` is a CLI for installing curated skills for AI coding assistants. It installs the skill files and links them to Claude Code, Gemini CLI, or Codex CLI.
12
+
13
+ Each skill is a small knowledge package: a `SKILL.md` file with YAML frontmatter plus a set of reference files. When a prompt matches the skill, the assistant reads those files and answers from the source material.
14
+
15
+ ---
16
+
17
+ ## Quick setup
18
+
19
+ ```bash
20
+ # 1) Install the CLI
21
+ npm install -g @maccesar/aiskills
22
+
23
+ # 2) Install skills globally
24
+ aiskills install
25
+
26
+ # 3) Start your AI coding assistant
27
+ claude # or gemini, or codex
28
+
29
+ # 4) Ask a question that matches a skill
30
+ ```
31
+
32
+ Installed files:
33
+ - All skills to `~/.agents/skills/`
34
+ - Platform symlinks in `~/.claude/skills/`, `~/.gemini/skills/`, or `~/.codex/skills/`
35
+
36
+ Why install with npm?
37
+ - Cross-platform (macOS, Linux, Windows)
38
+ - No sudo required
39
+ - Simple updates with `aiskills update`
40
+
41
+ ---
42
+
43
+ ## Compatible platforms
44
+
45
+ | Platform | Status | Installation Path |
46
+ | --------------------------------------------------------- | --------- | ------------------- |
47
+ | [Claude Code](https://claude.ai/claude-code) | Supported | `~/.claude/skills/` |
48
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | Supported | `~/.gemini/skills/` |
49
+ | [Codex CLI](https://developers.openai.com/codex/cli/) | Supported | `~/.codex/skills/` |
50
+
51
+ All three platforms use the same Agent Skills format: a `SKILL.md` file with YAML frontmatter that tells the assistant when to use the skill and what to do.
52
+
53
+ ---
54
+
55
+ ## Available skills
56
+
57
+ | Skill | Domain | Source | Reference Files |
58
+ | -------------------- | ------------ | ------------------------------------ | --------------- |
59
+ | refactoring-ui | Design | "Refactoring UI" by Wathan & Schoger | 8 files |
60
+ | humaniza | Writing (es) | Curated Spanish/es-MX style rules | 6 files |
61
+ | vscode-extension-dev | VS Code | VS Code Extension API docs | 4 files |
62
+ | stitch-showcase | Design Tools | Google Stitch export workflow | 14 files |
63
+
64
+ Use `aiskills list` to see available skills from the command line. Pull requests are welcome.
65
+
66
+ ---
67
+
68
+ ## How skills work
69
+
70
+ Skills activate based on what you ask. You can write prompts normally:
71
+
72
+ ```
73
+ "How do I create better visual hierarchy in this UI?"
74
+ "What's the best way to build a color palette from scratch?"
75
+ "This interface feels too dense. How do I fix the spacing?"
76
+ ```
77
+
78
+ The assistant reads the skill's `SKILL.md`, checks whether the request fits, and then loads the reference files for that skill. That keeps the answer tied to the source material.
79
+
80
+ You do not need to name a skill explicitly, though you still can if you want to force a specific one.
81
+
82
+ ---
83
+
84
+ ## Skill details
85
+
86
+ ### refactoring-ui
87
+
88
+ A design skill based only on *Refactoring UI* by Adam Wathan and Steve Schoger.
89
+
90
+ When it activates:
91
+ - Asking how to improve a UI's appearance
92
+ - Building or refining a color system
93
+ - Choosing typography scales and line lengths
94
+ - Designing layout and spacing systems
95
+ - Creating depth with shadows
96
+ - Handling images in interfaces
97
+ - Adding finishing touches (empty states, borders, icons, backgrounds)
98
+ - Design reviews and critiques
99
+
100
+ Example prompts:
101
+ ```
102
+ "How do I make this dashboard feel less cluttered?"
103
+ "What's the right way to build a 9-shade color palette in HSL?"
104
+ "My text hierarchy looks flat, how do I fix it without changing font sizes?"
105
+ "What's the rule for line-height on large headlines?"
106
+ "How do I handle text over a photo background?"
107
+ "My empty state looks like a broken page. How should I design it?"
108
+ ```
109
+
110
+ Reference files:
111
+ | File | Topics |
112
+ | ----------------------- | ---------------------------------------------------------------------- |
113
+ | 01-design-process.md | Feature-first workflow, low-fidelity, personality, pre-defined systems |
114
+ | 02-visual-hierarchy.md | Weight, color, size hierarchy; labels; icons; button tiers |
115
+ | 03-layout-spacing.md | White space, spacing scale, columns, law of proximity |
116
+ | 04-typography.md | Type scale, line length, alignment, line-height, letter-spacing |
117
+ | 05-color.md | HSL, shade systems, WCAG contrast, color signals |
118
+ | 06-depth-shadows.md | Light source, raised/inset elements, shadow elevation |
119
+ | 07-images.md | Stock photos, text over images, icons at scale, favicons |
120
+ | 08-finishing-touches.md | Icons, borders, backgrounds, empty states, leveling up |
121
+
122
+ ---
123
+
124
+ ### humaniza
125
+
126
+ An editor for Spanish text (es-MX). It removes common AI writing patterns and rewrites the text so it sounds natural without changing the meaning.
127
+
128
+ When it activates:
129
+ - User asks to "humanize" a text in Spanish
130
+ - User says the text "sounds like AI" or wants it removed
131
+ - User wants something to "sound more natural" or "more human"
132
+ - Editing emails, documentation, marketing, support, or technical texts in Spanish
133
+
134
+ Example prompts:
135
+ ```
136
+ "Humaniza este email de bienvenida"
137
+ "Este texto suena muy robótico, cámbialo"
138
+ "Hazlo sonar más natural, en español de México"
139
+ "Quítale el tono de IA a esta documentación"
140
+ "Reescríbelo en tono de soporte al cliente"
141
+ ```
142
+
143
+ Available modes:
144
+ | Mode | Description |
145
+ | ------------- | ------------------------------------ |
146
+ | Marketing | Persuasive, direct, no filler |
147
+ | Technical | Precise, no decoration |
148
+ | Support | Empathetic, clear, action-oriented |
149
+ | Emails | Natural tone, appropriate to context |
150
+ | Documentation | Clear, scannable, no redundancy |
151
+ | Posts / Essay | Personal voice, varied rhythm |
152
+
153
+ Reference files:
154
+ | File | Topics |
155
+ | ----------------- | --------------------------------------------------------------- |
156
+ | ai-patterns-es.md | AI writing tics in Spanish: inflated phrases, filler, templates |
157
+ | lexicon-es-mx.md | Preferred es-MX vocabulary vs. Spain Spanish |
158
+ | modes-es-mx.md | Rules per mode (marketing, technical, support, etc.) |
159
+ | voice-es-mx.md | How to add human voice: rhythm, concreteness, variety |
160
+ | checklist.md | Final QA before delivering the text |
161
+ | examples.md | Before/after examples by text type |
162
+
163
+ Scope:
164
+ - Preserves meaning, data, and general structure
165
+ - Respects the original register (tú/usted) unless asked to change
166
+ - Keeps technical terms, brands, code, and proper names intact
167
+ - Prefers es-MX: avoids Spain-specific words like "vosotros", "ordenador", "móvil"
168
+ - Returns only the final text, no explanation (unless requested)
169
+
170
+ ---
171
+
172
+ ### vscode-extension-dev
173
+
174
+ A guide for building VS Code extensions from scaffolding to publishing. Based on the official VS Code Extension API docs.
175
+
176
+ When it activates:
177
+ - Creating or scaffolding a new VS Code extension
178
+ - Working with VS Code APIs (TreeView, Webview, QuickPick, StatusBar)
179
+ - Configuring package.json contributes, activationEvents, or keybindings
180
+ - Debugging extension activation, disposables, or memory leaks
181
+ - Bundling with esbuild or webpack
182
+ - Publishing to the VS Code Marketplace or Open VSX
183
+ - Setting up Webview CSP, nonce, or postMessage communication
184
+ - Using SecretStorage for credential management
185
+ - Writing extension tests with @vscode/test-electron
186
+
187
+ Example prompts:
188
+ ```
189
+ "Create a VS Code extension with a tree view in the sidebar"
190
+ "How do I set up CSP and nonce for a Webview panel?"
191
+ "What's the right way to handle disposables in activate()?"
192
+ "How do I publish my extension to the Marketplace?"
193
+ "Set up esbuild bundling for my VS Code extension"
194
+ "How do I use SecretStorage to save API tokens?"
195
+ ```
196
+
197
+ Reference files:
198
+ | File | Topics |
199
+ | ---------------------- | -------------------------------------------------------------------- |
200
+ | package-json-schema.md | contributes, activationEvents, engines, scripts, devDependencies |
201
+ | api-patterns.md | TreeView, Webview, QuickPick, StatusBar, SecretStorage, withProgress |
202
+ | architecture.md | Project structure, layered architecture, testing strategy |
203
+ | publishing.md | vsce, .vscodeignore, CI/CD, Open VSX, versioning |
204
+
205
+ ---
206
+
207
+ ### stitch-showcase
208
+
209
+ A workflow skill for processing Google Stitch design exports. It handles the full lifecycle: from raw zips to a navigable showcase, component standardization, and a visual component catalog.
210
+
211
+ When it activates:
212
+ - User has Stitch export zips and wants to browse them as a gallery
213
+ - User asks to "organize", "build the showcase", or "process" Stitch designs
214
+ - User has a folder of `code.html` + `screen.png` pairs from Stitch
215
+ - User wants to standardize shared components or extract a component catalog
216
+
217
+ #### What you can ask it to do
218
+
219
+ **Build a showcase** — the core feature (instant, ~3 seconds):
220
+ ```
221
+ "Organize my Stitch designs in ~/Downloads/snap-exports"
222
+ "Build the showcase from these Stitch zips"
223
+ "I have the Stitch zips in /Users/me/designs, generate the index"
224
+ "Process this design folder into a showcase"
225
+ ```
226
+ Runs the Python build script directly — no pre-flight questions, no AI pre-processing. Generates a static site with a searchable thumbnail grid, section filter tabs, grid/list toggle, and a per-screen viewer with prev/next navigation, keyboard shortcuts, and fullscreen mode. Supports mobile (phone frame) and web (browser chrome) layouts.
227
+
228
+ **Enrich titles and descriptions** — optional, on-demand:
229
+ ```
230
+ "Optimize the showcase titles and descriptions"
231
+ "Enrich the showcase descriptions"
232
+ "Improve the hero section text"
233
+ "Fix the mangled screen names in the showcase"
234
+ ```
235
+ After the initial build, you can ask the AI to improve DESIGN.md: de-mangle Stitch slugs into proper titles, write meaningful descriptions from extracted screen text, update the hero section, and verify colors/fonts. Then rebuilds with enriched data.
236
+
237
+ **Add new screens to an existing showcase:**
238
+ ```
239
+ "Add these new zips to the project"
240
+ "I exported 5 more screens from Stitch, add them"
241
+ "The client requested a new screen, include it in the showcase"
242
+ ```
243
+ The skill detects which screens are new, adds them to DESIGN.md, and rebuilds the showcase.
244
+
245
+ **Standardize shared components** — fix Stitch's inconsistencies:
246
+ ```
247
+ "Standardize the navbars across all screens"
248
+ "Make all footers the same"
249
+ "The bottom tab bar is different in each screen, fix it"
250
+ "Use the navbar from the home screen everywhere"
251
+ "Unify the navigation across all screens"
252
+ ```
253
+ Google Stitch generates slight variations of navbars, footers, and tabbars across screens in the same session. This feature detects all shared components, shows you the variants with their differences, and lets you choose which version to apply everywhere. You can pick the best one, or mix pieces from different variants.
254
+
255
+ **Generate a component catalog** — extract reusable UI pieces:
256
+ ```
257
+ "Extract all the components from the designs"
258
+ "Make a component catalog"
259
+ "Show me all the buttons and cards in the project"
260
+ "Generate a visual component library from the designs"
261
+ "Extract the atomic components (buttons, inputs, badges)"
262
+ "Extract composite components (cards, CTAs, price tables)"
263
+ ```
264
+ Scans all screen HTMLs and extracts:
265
+ - **Atomic components**: buttons (with variant detection: primary/secondary/danger), headings, form inputs, badges/pills, standalone links, icons (Material Symbols + SVGs)
266
+ - **Composite components**: cards, price tables, CTAs, testimonials, hero sections
267
+ - **Design tokens**: colors (sorted by frequency), fonts, border-radius values
268
+
269
+ Generates a visual catalog page (`components-catalog.html`) with tabs per component type, inline previews, CSS properties, copyable code snippets, dark/light toggle, and search. Also outputs `component_catalog.json` for programmatic use.
270
+
271
+ #### Output structure
272
+
273
+ ```
274
+ showcase/ ← single output dir with view mode toggle
275
+ ├── index.html ← searchable grid with section tabs + mobile/web view toggle
276
+ ├── viewer.html ← per-screen viewer with prev/next + fullscreen + view toggle
277
+ ├── components-catalog.html ← visual component catalog (when requested)
278
+ ├── shared_components.json ← component standardization data (when requested)
279
+ ├── component_catalog.json ← machine-readable catalog (when requested)
280
+ ├── DESIGN.md
281
+ └── assets/
282
+ ├── splash_screen.html
283
+ ├── splash_screen.png
284
+ └── ...
285
+ ```
286
+
287
+ ---
288
+
289
+ Anti-patterns `refactoring-ui` guards against:
290
+ - Designing shell/nav/layout before the actual feature
291
+ - Using font size as the only hierarchy tool
292
+ - Using grey text on colored backgrounds by lowering opacity
293
+ - Using `em` units for type scales
294
+ - Using color as the only way to communicate status
295
+ - Using preprocessor `lighten()`/`darken()` to generate color shades
296
+
297
+ ---
298
+
299
+ ## CLI reference
300
+
301
+ ### aiskills list
302
+
303
+ Lists all available skills with their descriptions.
304
+
305
+ ```bash
306
+ aiskills list
307
+ ```
308
+
309
+ ---
310
+
311
+ ### aiskills install
312
+
313
+ Installs skills and creates symlinks for supported platforms.
314
+
315
+ ```bash
316
+ aiskills install [options]
317
+ ```
318
+
319
+ Options:
320
+ | Option | Description |
321
+ | --------------- | ------------------------------------------------------------------- |
322
+ | `-l, --local` | Install skills locally in the current project (`./.agents/skills/`) |
323
+ | `-a, --all` | Install to all detected platforms without prompting |
324
+ | `--path <path>` | Install to a custom path (skips symlink setup) |
325
+
326
+ What it does:
327
+ - Copies all skills to `~/.agents/skills/` (or a local directory if you use `--local`)
328
+ - Detects installed AI platforms such as Claude Code, Gemini CLI, and Codex CLI
329
+ - Prompts you to choose which platforms to link
330
+ - Creates symlinks from each platform's skills directory to the central install
331
+ - Removes legacy artifacts from older versions
332
+
333
+ ### aiskills auto-update
334
+
335
+ Checks for updates and applies them silently. Designed to run from the Claude Code SessionStart hook, but can also be used manually.
336
+
337
+ ```bash
338
+ aiskills auto-update # Show progress
339
+ aiskills auto-update --silent # No output (for hooks)
340
+ ```
341
+
342
+ Options:
343
+ | Option | Description |
344
+ | ------------- | ------------------------------------ |
345
+ | `-s, --silent` | Suppress all output except errors |
346
+
347
+ What it does:
348
+ 1. Checks a local cache (`~/.aiskills/last-check.json`) — if already checked today, exits immediately
349
+ 2. Queries npm for the latest version
350
+ 3. If a new version is available, runs `npm update -g @maccesar/aiskills`
351
+ 4. Syncs skills and refreshes platform symlinks
352
+ 5. Writes the cache so it won't check again for 24 hours
353
+
354
+ The hook is installed automatically by `aiskills install` when Claude Code is selected. It runs `aiskills auto-update --silent` at the start of every Claude Code session.
355
+
356
+ ---
357
+
358
+ ### aiskills status
359
+
360
+ Shows a quick overview of your installation.
361
+
362
+ ```bash
363
+ aiskills status
364
+ ```
365
+
366
+ Displays: version, skills count, hook status, last update check, and platform symlink status.
367
+
368
+ ---
369
+
370
+ ### aiskills doctor
371
+
372
+ Diagnoses installation health.
373
+
374
+ ```bash
375
+ aiskills doctor
376
+ ```
377
+
378
+ Checks: skill directories exist, symlinks are valid (not broken), hook is configured, cache is readable. Reports issues with fix suggestions.
379
+
380
+ ---
381
+
382
+ ### aiskills update
383
+
384
+ Checks npm for a newer `aiskills` CLI version, then syncs skills from the package you already have installed.
385
+
386
+ ```bash
387
+ aiskills update [options]
388
+ ```
389
+
390
+ Options:
391
+ | Option | Description |
392
+ | ------------- | ------------------------------------------ |
393
+ | `-l, --local` | Update local skills in the current project |
394
+
395
+ What it does:
396
+ 1. Checks npm for the latest CLI version
397
+ 2. If a newer version exists, shows the update command: `npm update -g @maccesar/aiskills`
398
+ 3. Exits without changing skills until the CLI is updated
399
+ 4. If the CLI is current, syncs skills from the installed package (no download needed)
400
+ 5. Updates platform symlinks only for platforms that already have them
401
+
402
+ Note: `aiskills update` only syncs the skill files from your installed CLI. To get newer skills, first run `npm update -g @maccesar/aiskills`, then run `aiskills update` again.
403
+
404
+ ### aiskills remove
405
+
406
+ Removes installed skills and platform symlinks.
407
+
408
+ ```bash
409
+ aiskills remove [options]
410
+ ```
411
+
412
+ Options:
413
+ | Option | Description |
414
+ | ------------- | -------------------------------------------- |
415
+ | `-l, --local` | Remove local skills from the current project |
416
+
417
+ What it does:
418
+ - Detects all installed components (skills and symlinks)
419
+ - Prompts you to select what to remove:
420
+ - Skills from global (`~/.agents/skills/`) or project directory
421
+ - Platform symlinks from global or project directory
422
+
423
+ ### Verify installation
424
+
425
+ ```bash
426
+ aiskills status # Quick overview of everything
427
+ aiskills doctor # Diagnose any issues
428
+ aiskills --version # CLI version only
429
+ ```
430
+
431
+ ---
432
+
433
+ ## Local vs global installation
434
+
435
+ By default, skills install globally to `~/.agents/skills/`, and symlinks are created in `~/.claude/skills/` plus any other detected platform. That makes the same skills available across all your projects.
436
+
437
+ If you want to pin skills to one project, for example to commit them with a repo, use `--local`:
438
+
439
+ ```bash
440
+ cd /path/to/your/project
441
+ aiskills install --local
442
+ ```
443
+
444
+ This installs to `./.agents/skills/` inside your project. Local skills override global skills for that project.
445
+
446
+ ---
447
+
448
+ ## Troubleshooting
449
+
450
+ ### Skill not activating?
451
+
452
+ If the assistant does not seem to use skill knowledge:
453
+ 1. Mention the domain explicitly: "Use the refactoring-ui skill"
454
+ 2. Be more specific about what you're working on
455
+ 3. Reference the topic area: "I need help with color hierarchy"
456
+
457
+ ### aiskills command not found?
458
+
459
+ ```bash
460
+ # Verify installation
461
+ npm list -g @maccesar/aiskills
462
+
463
+ # Re-install
464
+ npm install -g @maccesar/aiskills
465
+ ```
466
+
467
+ ### Skill gives wrong or generic advice?
468
+
469
+ Each skill only covers what is in its source material. If the topic is missing from the reference files, the answer will stay generic. Check the reference file list to see what the skill actually covers.
470
+
471
+ ---
472
+
473
+ ## Uninstall
474
+
475
+ ```bash
476
+ # Remove skills and symlinks
477
+ aiskills remove
478
+
479
+ # Remove the CLI
480
+ npm uninstall -g @maccesar/aiskills
481
+ ```
482
+
483
+ ---
484
+
485
+ ## Contributing
486
+
487
+ Skills are plain Markdown files. To add a new one:
488
+ 1. Create a folder under `skills/<skill-name>/`
489
+ 2. Add a `SKILL.md` with YAML frontmatter
490
+ 3. Put the reference files under `skills/<skill-name>/references/`
491
+
492
+ ### Skill frontmatter format
493
+
494
+ ```yaml
495
+ ---
496
+ name: skill-name
497
+ description: >
498
+ One paragraph describing what this skill does and when to use it.
499
+ when_to_use: >
500
+ - Bullet list of trigger conditions
501
+ source: "Book title, documentation name, or other authoritative source"
502
+ anti_hallucination_note: >
503
+ What the AI should NOT do (invent, supplement, guess).
504
+ ---
505
+ ```
506
+
507
+ ### Guidelines
508
+ - Every skill must cite a specific source (book, official docs, specification)
509
+ - No invented numbers, rules, or advice not found in the source
510
+ - Keep `SKILL.md` under 500 lines
511
+ - Put detail in reference files, not in `SKILL.md`
512
+ - Test with real sessions before submitting
513
+
514
+ ---
515
+
516
+ ## Credits
517
+
518
+ Created by César Estrada ([@macCesar](https://github.com/macCesar)), who also made [TiTools](https://github.com/macCesar/titools) and [PurgeTSS](https://github.com/macCesar/purgeTSS).
519
+
520
+ ## License
521
+
522
+ MIT License. Free to use, modify, and distribute.
523
+
524
+ ---
525
+
526
+ ## Resources
527
+
528
+ - [Claude Code Skills](https://docs.anthropic.com/en/docs/claude-code)
529
+ - [Gemini CLI Skills](https://geminicli.com/docs/cli/skills/)
530
+ - [Codex CLI Skills](https://developers.openai.com/codex/skills/)
531
+ - [Refactoring UI](https://refactoringui.com/)
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * aiskills - AI Skills CLI Tool
5
+ * Main entry point for the NPM package
6
+ */
7
+
8
+ import { Command } from 'commander';
9
+ import { PACKAGE_VERSION } from '../lib/config.js';
10
+ import { skillsCommand } from '../lib/commands/skills.js';
11
+ import { listCommand } from '../lib/commands/list.js';
12
+ import { updateCommand } from '../lib/commands/update.js';
13
+ import { uninstallCommand } from '../lib/commands/uninstall.js';
14
+ import { autoUpdateCommand } from '../lib/commands/auto-update.js';
15
+ import { statusCommand } from '../lib/commands/status.js';
16
+ import { doctorCommand } from '../lib/commands/doctor.js';
17
+
18
+ const program = new Command();
19
+
20
+ program
21
+ .name('aiskills')
22
+ .description('AI Skills CLI - Manage skills for AI coding assistants (Claude Code, Gemini CLI, Codex CLI)')
23
+ .version(PACKAGE_VERSION);
24
+
25
+ // List command
26
+ program
27
+ .command('list')
28
+ .description('List available AI skills')
29
+ .action(listCommand);
30
+
31
+ // Install command
32
+ program
33
+ .command('install')
34
+ .description('Install AI skills and link them to your AI coding assistants')
35
+ .option('-l, --local', 'Install skills locally in the current project')
36
+ .option('-a, --all', 'Install to all detected platforms without prompting')
37
+ .option('--path <path>', 'Install to a custom path (skips symlink setup)')
38
+ .action(skillsCommand);
39
+
40
+ // Update command
41
+ program
42
+ .command('update')
43
+ .description('Check for newer CLI versions, then sync installed skills')
44
+ .option('-l, --local', 'Update local skills in the current project')
45
+ .action(updateCommand);
46
+
47
+ // Remove command
48
+ program
49
+ .command('remove')
50
+ .description('Remove installed AI skills and symlinks')
51
+ .option('-l, --local', 'Remove local skills from the current project')
52
+ .action(uninstallCommand);
53
+
54
+ // Auto-update command (used by SessionStart hook)
55
+ program
56
+ .command('auto-update')
57
+ .description('Check for updates and sync skills (runs from SessionStart hook)')
58
+ .option('-s, --silent', 'Run silently without output')
59
+ .action(autoUpdateCommand);
60
+
61
+ // Status command
62
+ program
63
+ .command('status')
64
+ .description('Show installation status overview')
65
+ .action(statusCommand);
66
+
67
+ // Doctor command
68
+ program
69
+ .command('doctor')
70
+ .description('Diagnose installation health')
71
+ .action(doctorCommand);
72
+
73
+ // Parse arguments
74
+ program.parse();
75
+
76
+ export { program };
package/lib/cache.js ADDED
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Cache for update checks
3
+ * Stores last check timestamp to avoid hitting npm registry on every run
4
+ */
5
+
6
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
7
+ import { join } from 'path';
8
+
9
+ const CACHE_FILE = 'last-check.json';
10
+ const DEFAULT_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours
11
+
12
+ function getTtl() {
13
+ const envTtl = process.env.TITOOLS_CACHE_TTL_MS;
14
+ return envTtl ? parseInt(envTtl, 10) : DEFAULT_TTL_MS;
15
+ }
16
+
17
+ export function readLastCheck(cacheDir) {
18
+ const filePath = join(cacheDir, CACHE_FILE);
19
+ if (!existsSync(filePath)) return null;
20
+
21
+ try {
22
+ const data = JSON.parse(readFileSync(filePath, 'utf8'));
23
+ if (typeof data.lastCheck !== 'number' || typeof data.latestVersion !== 'string') {
24
+ return null;
25
+ }
26
+ return data;
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+
32
+ export function writeLastCheck(cacheDir, latestVersion) {
33
+ if (!existsSync(cacheDir)) {
34
+ mkdirSync(cacheDir, { recursive: true });
35
+ }
36
+ writeFileSync(
37
+ join(cacheDir, CACHE_FILE),
38
+ JSON.stringify({ lastCheck: Date.now(), latestVersion }),
39
+ 'utf8'
40
+ );
41
+ }
42
+
43
+ export function shouldCheckForUpdate(cacheDir) {
44
+ const data = readLastCheck(cacheDir);
45
+ if (!data) return true;
46
+ return (Date.now() - data.lastCheck) >= getTtl();
47
+ }
48
+
49
+ export default { readLastCheck, writeLastCheck, shouldCheckForUpdate };