@iamdangavin/claude-skill-vitepress-docs 1.6.0 → 1.9.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 (2) hide show
  1. package/package.json +1 -1
  2. package/skill/SKILL.md +64 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamdangavin/claude-skill-vitepress-docs",
3
- "version": "1.6.0",
3
+ "version": "1.9.0",
4
4
  "description": "Installs the vitepress:docs Claude Code skill — VitePress docs setup, generation, screenshots, and sync.",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -105,6 +105,29 @@ If "Somewhere else": ask as plain text — "What path should I use? (Full path o
105
105
 
106
106
  If custom domain: ask as plain text — "What is the domain? (e.g. `docs.myapp.com`)"
107
107
 
108
+ **Q4b — Search engine visibility:**
109
+ - header: "Search visibility"
110
+ - question: "Should these docs be visible to search engines and bots?"
111
+ - options:
112
+ - "Yes — index these docs publicly"
113
+ - "No — block all search engines and bots"
114
+
115
+ If "No": add the following to the VitePress config's `head` array and write a `robots.txt` to the public folder:
116
+
117
+ `head` entry in `config.mjs`:
118
+ ```js
119
+ head: [
120
+ ['meta', { name: 'robots', content: 'noindex, nofollow' }],
121
+ ]
122
+ ```
123
+ If a `head` array already exists in the config, append to it — do not replace it.
124
+
125
+ `DOCS_FOLDER/public/robots.txt`:
126
+ ```
127
+ User-agent: *
128
+ Disallow: /
129
+ ```
130
+
108
131
  **Q5 — Deploy trigger:**
109
132
  - header: "Deploy trigger"
110
133
  - question: "When should docs deploy?"
@@ -663,21 +686,49 @@ const formattedResponse = computed(() =>
663
686
  </style>
664
687
  ```
665
688
 
666
- **`.vitepress/theme/index.js`** create if it doesn't exist, otherwise merge into existing:
689
+ **Install `medium-zoom`** in the docs folder:
690
+
691
+ ```bash
692
+ cd DOCS_FOLDER && npm install medium-zoom
693
+ ```
694
+
695
+ **`.vitepress/theme/index.css`** — create if it doesn't exist, otherwise append:
696
+
697
+ ```css
698
+ .medium-zoom-overlay {
699
+ z-index: 100;
700
+ }
701
+
702
+ .medium-zoom-image--opened {
703
+ z-index: 101;
704
+ }
705
+ ```
706
+
707
+ **`.vitepress/theme/index.js`** — create if it doesn't exist, otherwise merge into existing. This template includes both `ApiEndpoint` registration and medium-zoom. If `apiBase` was not collected, omit the `ApiEndpoint` lines:
667
708
 
668
709
  ```js
669
710
  import DefaultTheme from 'vitepress/theme'
711
+ import { onMounted, watch, nextTick } from 'vue'
712
+ import { useRoute } from 'vitepress'
713
+ import mediumZoom from 'medium-zoom'
714
+ import './index.css'
670
715
  import ApiEndpoint from '../components/ApiEndpoint.vue'
671
716
 
672
717
  export default {
673
718
  extends: DefaultTheme,
719
+ setup() {
720
+ const route = useRoute()
721
+ const initZoom = () => mediumZoom('.main img', { background: 'var(--vp-c-bg)' })
722
+ onMounted(initZoom)
723
+ watch(() => route.path, () => nextTick(initZoom))
724
+ },
674
725
  enhanceApp({ app }) {
675
726
  app.component('ApiEndpoint', ApiEndpoint)
676
727
  }
677
728
  }
678
729
  ```
679
730
 
680
- If the file already exists, add only the import and `app.component()` line — do not overwrite other registrations.
731
+ If the file already exists, merge only the missing pieces — do not overwrite other registrations or setup logic.
681
732
 
682
733
  ### Step 6b — Update VitePress config sidebar
683
734
 
@@ -843,22 +894,29 @@ Use Playwright via Homebrew for all captures:
843
894
  import { chromium } from '/opt/homebrew/lib/node_modules/playwright/index.mjs';
844
895
  ```
845
896
 
846
- **⛔ Credential rule — NEVER write credentials to any file.** Do not write them to the capture script, a `.env` file, the manifest, a temp file, or anywhere else. Use them only as inline values passed directly to `page.fill()` calls in the script held in memory. Delete the script immediately after running it (`rm /tmp/screenshot.mjs`). 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.
897
+ **⛔ 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.
847
898
 
848
899
  **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.
849
900
 
850
901
  **Standard capture script template:**
851
- ```js
902
+
903
+ Run inline via bash heredoc — no file is ever written to disk:
904
+
905
+ ```bash
906
+ node --input-type=module << 'SCRIPT'
852
907
  import { chromium } from '/opt/homebrew/lib/node_modules/playwright/index.mjs';
853
908
  const browser = await chromium.launch({ channel: 'chrome', args: ['--no-sandbox'] });
854
909
  const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
855
910
  await page.goto('BASE_URL + captureUrl', { waitUntil: 'load', timeout: 60000 });
856
- await page.waitForTimeout(2000); // settle time for SPAs
911
+ await page.waitForTimeout(SETTLE_MS);
857
912
  await page.screenshot({ path: 'OUTPUT_PATH', fullPage: false });
858
913
  await browser.close();
914
+ SCRIPT
859
915
  ```
860
916
 
861
- Adjust settle time based on stack type. For WordPress/non-SPA sites use 500ms. For Next.js/SPA use 2000–4000ms.
917
+ Adjust `SETTLE_MS` based on stack type: WordPress/non-SPA `500`, Next.js/SPA `2000`–`4000`.
918
+
919
+ 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.
862
920
 
863
921
  After each capture, display the image inline with the Read tool so the user can verify it before moving on.
864
922