@iamdangavin/claude-skill-vitepress-docs 2.1.0 → 3.0.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.
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: vitepress:docs
3
- description: VitePress documentation suite — setup GitHub Pages deployment, generate docs from a codebase, capture screenshots of any running app, and sync docs as code changes.
4
- argument-hint: [mode: setup|generate|screenshot|sync] or omit to be prompted
2
+ name: vitedocs:init
3
+ description: VitePress documentation suite — prompts for which mode to run and proceeds directly.
4
+ argument-hint: [setup|generate|screenshot|sync|brand|update] or omit to be prompted
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -12,11 +12,11 @@ allowed-tools:
12
12
  - AskUserQuestion
13
13
  ---
14
14
 
15
- # Skill: vitepress:docs
15
+ # vitedocs:init
16
16
 
17
- Four modes for full VitePress documentation lifecycle. If no mode is given as an argument, use AskUserQuestion to prompt for one:
17
+ If a mode was passed as an argument, proceed directly to that mode's instructions below. Otherwise use AskUserQuestion:
18
18
 
19
- - header: "vitepress:docs"
19
+ - header: "vitedocs"
20
20
  - question: "Which mode do you need?"
21
21
  - options:
22
22
  - "setup — Wire up VitePress + GitHub Actions for Pages deployment"
@@ -24,7 +24,9 @@ Four modes for full VitePress documentation lifecycle. If no mode is given as an
24
24
  - "screenshot — Capture real screenshots and replace placeholders"
25
25
  - "sync — Detect code drift and update docs that are out of date"
26
26
  - "brand — Configure colors, fonts, logo, and visual identity"
27
- - "update — Retrofit an existing docs setup with the latest components and dependencies"
27
+ - "update — Retrofit an existing docs setup with the latest components"
28
+
29
+ Once a mode is selected, execute that mode's full instructions inline — do not ask the user to run a different command. The complete instructions for every mode follow below.
28
30
 
29
31
  ---
30
32
 
@@ -161,7 +163,7 @@ Present the relevant checklist as plain text, then use AskUserQuestion to confir
161
163
  - "Not yet — I need more time"
162
164
  - "I have a question"
163
165
 
164
- If "Not yet": tell the user to run `/vitepress:docs setup` again when ready and exit.
166
+ If "Not yet": tell the user to run `/vitedocs:setup` again when ready and exit.
165
167
  If "I have a question": answer it, then re-ask this question.
166
168
 
167
169
  The checklist to present (tailor to their answers):
@@ -673,7 +675,6 @@ const currentSample = computed(() => {
673
675
  return ''
674
676
  })
675
677
 
676
- // Map tab names to highlight.js language identifiers
677
678
  const tabLang = {
678
679
  'Fetch': 'javascript',
679
680
  'Axios': 'javascript',
@@ -792,7 +793,7 @@ Add `docs-manifest.json` to `.vitepress/` entry in `.gitignore`.
792
793
 
793
794
  ```
794
795
  Generated X pages (Y user-facing, Z developer).
795
- Created N placeholder screenshots — run /vitepress:docs screenshot when ready to capture real images.
796
+ Created N placeholder screenshots — run /vitedocs:screenshot when ready to capture real images.
796
797
  Filled M of P gaps — X remaining gap comments left in files for manual review.
797
798
  ```
798
799
 
@@ -824,8 +825,8 @@ const OUTPUT = 'FILL_IN_OUTPUT_PATH';
824
825
  const scanlines = [];
825
826
  for (let y = 0; y < H; y++) {
826
827
  const row = Buffer.alloc(1 + W * 3);
827
- row[0] = 0; // filter type: None
828
- row.fill(0x88, 1); // grey RGB pixels
828
+ row[0] = 0;
829
+ row.fill(0x88, 1);
829
830
  scanlines.push(row);
830
831
  }
831
832
  const raw = Buffer.concat(scanlines);
@@ -852,7 +853,7 @@ function makeChunk(type, data) {
852
853
  const sig = Buffer.from([137,80,78,71,13,10,26,10]);
853
854
  const ihdr = Buffer.alloc(13);
854
855
  ihdr.writeUInt32BE(W, 0); ihdr.writeUInt32BE(H, 4);
855
- ihdr[8] = 8; ihdr[9] = 2; // 8-bit RGB
856
+ ihdr[8] = 8; ihdr[9] = 2;
856
857
 
857
858
  mkdirSync(dirname(OUTPUT), { recursive: true });
858
859
  writeFileSync(OUTPUT, Buffer.concat([
@@ -935,7 +936,7 @@ import { chromium } from '/opt/homebrew/lib/node_modules/playwright/index.mjs';
935
936
 
936
937
  **⛔ Credential rule — NEVER write credentials to any file.** Do not write them to a script file, `.env`, the manifest, or anywhere on disk. All Playwright scripts run as inline bash heredocs — credentials are passed directly as inline values to `page.fill()` calls within the heredoc and exist only in memory for the duration of the command. If Playwright needs credentials in a reusable way, use a saved storage state file — but prompt the user for credentials fresh each time rather than caching them.
937
938
 
938
- **For pages requiring auth:** if credentials were provided, drive a login flow before navigating to the target URL. If no credentials were given, skip auth-gated pages and list them in the final summary so the user can run screenshot mode again with credentials.
939
+ **For pages requiring auth:** if credentials were provided, drive a login flow before navigating to the target URL. If no credentials were given, skip auth-gated pages and list them in the final summary so the user can run `/vitedocs:screenshot` again with credentials.
939
940
 
940
941
  **Standard capture script template:**
941
942
 
@@ -955,9 +956,7 @@ SCRIPT
955
956
 
956
957
  Adjust `SETTLE_MS` based on stack type: WordPress/non-SPA → `500`, Next.js/SPA → `2000`–`4000`.
957
958
 
958
- Never write the script to a file — always use the heredoc form above. This applies to auth flows too: inline all credential usage directly in the heredoc, never in a file.
959
-
960
- After each capture, display the image inline with the Read tool so the user can verify it before moving on.
959
+ Never write the script to a file — always use the heredoc form above.
961
960
 
962
961
  ### Step 4 — Rewrite prose around captured images
963
962
 
@@ -977,7 +976,7 @@ Captured X of Y screenshots.
977
976
 
978
977
  Rewrote prose in X doc pages.
979
978
 
980
- Run /vitepress:docs sync after future code changes to keep docs current.
979
+ Run /vitedocs:sync after future code changes to keep docs current.
981
980
  ```
982
981
 
983
982
  ---
@@ -1060,7 +1059,7 @@ Update `lastSynced` and `syncHash` for all updated pages. Update the top-level `
1060
1059
  ```
1061
1060
  Updated X of N drifted pages.
1062
1061
  X gap comments added for manual review.
1063
- Y screenshots flagged for recapture — run /vitepress:docs screenshot when ready.
1062
+ Y screenshots flagged for recapture — run /vitedocs:screenshot when ready.
1064
1063
  ```
1065
1064
 
1066
1065
  ---
@@ -1215,17 +1214,17 @@ Run the local dev server to preview: npm run dev
1215
1214
 
1216
1215
  ## Mode: update
1217
1216
 
1218
- Retrofits an existing VitePress docs setup with the latest components, dependencies, and theme wiring from this skill. Does not re-run setup or regenerate pages.
1217
+ Retrofits an existing VitePress docs setup with the latest components, dependencies, and theme wiring. Does not re-run setup or regenerate pages.
1219
1218
 
1220
1219
  ### Step 1 — Locate docs paths
1221
1220
 
1222
- Scan the current working directory and any known focus paths for `.vitepress/config.mjs` (or `.ts`) files. List what was found and ask the user to confirm which paths to upgrade.
1221
+ Scan the current working directory and any known focus paths for `.vitepress/config.mjs` (or `.ts`) files. List what was found and ask the user to confirm which paths to update.
1223
1222
 
1224
1223
  ### Step 2 — Inventory current state
1225
1224
 
1226
1225
  For each confirmed docs path, check what is already present:
1227
1226
 
1228
- - `.vitepress/components/ApiEndpoint.vue` — exists? version detectable?
1227
+ - `.vitepress/components/ApiEndpoint.vue` — exists?
1229
1228
  - `.vitepress/theme/index.js` — exists? includes `medium-zoom`? includes `ApiEndpoint`?
1230
1229
  - `.vitepress/theme/index.css` — exists? includes `.medium-zoom-overlay` z-index rules?
1231
1230
  - `package.json` — are `medium-zoom` and `highlight.js` listed in dependencies?
@@ -1267,7 +1266,7 @@ If `ApiEndpoint.vue` is being written or updated and no existing `apiBase` is in
1267
1266
 
1268
1267
  Skip U-Q1 and U-Q2 if `apiBase` already exists in `.vitepress/config.mjs` `themeConfig` — infer `apiBase` and existing tabs from the config and the current `ApiEndpoint.vue`.
1269
1268
 
1270
- ### Step 4 — Apply upgrades
1269
+ ### Step 4 — Apply updates
1271
1270
 
1272
1271
  Apply only the items selected (or all missing/outdated items if "Everything" was chosen). Always read existing files before editing — never overwrite unrelated content.
1273
1272
 
@@ -1295,7 +1294,7 @@ Do not remove or overwrite existing entries.
1295
1294
  - If `ApiEndpoint` registration is absent (and `apiBase` is configured), add the import and `app.component()` call
1296
1295
  - Never remove existing registrations or setup logic
1297
1296
 
1298
- Use this as the reference template for the full correct state of `index.js`:
1297
+ Reference template for the full correct state:
1299
1298
  ```js
1300
1299
  import DefaultTheme from 'vitepress/theme'
1301
1300
  import { onMounted, watch, nextTick } from 'vue'
@@ -1318,27 +1317,18 @@ export default {
1318
1317
  }
1319
1318
  ```
1320
1319
 
1321
- **`.vitepress/config.mjs`** — if `apiBase` was collected and is not already in `themeConfig`, add it:
1322
- ```js
1323
- themeConfig: {
1324
- apiBase: 'API_BASE_URL',
1325
- // ...existing themeConfig
1326
- }
1327
- ```
1320
+ **`.vitepress/config.mjs`** — if `apiBase` was collected and is not already in `themeConfig`, add it.
1328
1321
 
1329
1322
  ### Step 5 — Summary
1330
1323
 
1331
1324
  ```
1332
- Upgraded X of Y docs path(s).
1325
+ Updated X of Y docs path(s).
1333
1326
 
1334
1327
  Changes applied:
1335
- PATH/.vitepress/components/ApiEndpoint.vue — written (tabs: Fetch, cURL, PHP)
1328
+ PATH/.vitepress/components/ApiEndpoint.vue — written
1336
1329
  PATH/.vitepress/theme/index.js — merged medium-zoom + ApiEndpoint
1337
1330
  PATH/.vitepress/theme/index.css — added z-index rules
1338
1331
  PATH/package.json — installed medium-zoom, highlight.js
1339
-
1340
- No changes needed:
1341
- PATH/.vitepress/config.mjs — apiBase already present
1342
1332
  ```
1343
1333
 
1344
1334
  ---
package/install.js CHANGED
@@ -1,17 +1,30 @@
1
1
  #!/usr/bin/env node
2
- import { mkdirSync, copyFileSync } from 'fs';
2
+ import { mkdirSync, copyFileSync, readdirSync, rmSync, existsSync } from 'fs';
3
3
  import { join, dirname } from 'path';
4
4
  import { homedir } from 'os';
5
5
  import { fileURLToPath } from 'url';
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const home = homedir();
8
9
 
9
- const skillName = 'vitepress-docs';
10
- const dest = join(homedir(), '.claude', 'skills', skillName);
10
+ // Remove old skill location if it exists
11
+ const oldSkill = join(home, '.claude', 'skills', 'vitepress-docs');
12
+ if (existsSync(oldSkill)) {
13
+ rmSync(oldSkill, { recursive: true });
14
+ console.log(` ✓ Removed old skill at ${oldSkill}`);
15
+ }
16
+
17
+ // Install new commands
18
+ const src = join(__dirname, 'commands', 'vitedocs');
19
+ const dest = join(home, '.claude', 'commands', 'vitedocs');
11
20
 
12
21
  mkdirSync(dest, { recursive: true });
13
- copyFileSync(join(__dirname, 'skill', 'SKILL.md'), join(dest, 'SKILL.md'));
22
+
23
+ const files = readdirSync(src).filter(f => f.endsWith('.md'));
24
+ for (const file of files) {
25
+ copyFileSync(join(src, file), join(dest, file));
26
+ }
14
27
 
15
28
  console.log(`✓ Installed @iamdangavin/claude-skill-vitepress-docs`);
16
- console.log(` → ${dest}/SKILL.md`);
17
- console.log(` Invoke with: /vitepress-docs in Claude Code`);
29
+ console.log(` → ${dest}/`);
30
+ console.log(` Invoke with: /vitedocs:init in Claude Code`);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@iamdangavin/claude-skill-vitepress-docs",
3
- "version": "2.1.0",
4
- "description": "Installs the vitepress:docs Claude Code skill — VitePress docs setup, generation, screenshots, and sync.",
3
+ "version": "3.0.1",
4
+ "description": "Installs the vitedocs: Claude Code skill suite — VitePress docs setup, generate, screenshot, sync, brand, and update.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "claude-skill-vitepress-docs": "./install.js"
8
8
  },
9
9
  "files": [
10
10
  "install.js",
11
- "skill/"
11
+ "commands/"
12
12
  ],
13
13
  "keywords": [
14
14
  "claude",