[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73AXJVYZA88225SC4C0QV7Y":3,"skill-same:01M73AXJVYZA88225SC4C0QV7Y":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M73AXJVYZA88225SC4C0QV7Y","stitch-extract-static-html",null,"Capture a self-contained static HTML snapshot from a running app or mock component so it can be reviewed or uploaded to Stitch.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fagent-skills\u002Fstitch-extract-static-html\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fagent-skills\u002Fstitch-extract-static-html\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: stitch-extract-static-html\nversion: \"2.0\"\nlast_updated: 2026-09-08\ntags: [stitch, html, frontend, snapshot, assets]\ndescription: \"Capture a self-contained static HTML snapshot from a running app or mock component so it can be reviewed or uploaded to Stitch.\"\nlicense: \"Apache-2.0\"\n---\n# Extract Static HTML\n\nExtract a self-contained static HTML file from any web application.\n\n## Which Strategy to Use\n\nYou MUST ask the user to choose which strategy to use before proceeding. Present the options clearly, **recommend Strategy A** as the preferred default, and **provide a brief pros\u002Fcons summary** for each option to help them make an informed decision.\n\n| | Strategy A (Puppeteer) | Strategy B (Browser Subagent) |\n| :--- | :--- | :--- |\n| **When** | App runs locally, no auth wall | Need to interact with page first (click, fill forms) |\n| **Fidelity** | **Highest — computed styles resolved** | High — rendered DOM |\n| **Setup** | **Zero — no mock needed** | Zero — no mock needed |\n| **Framework** | **Any** | Any |\n| **Output** | **Writes to file — no size limit** | May truncate in agent context |\n\n> [!WARNING]\n> **Checkpoint — User Confirmation Required.**\n> You **MUST** ask the user which strategy they prefer before proceeding.\n> Present the comparison table above, recommend Strategy A as the default, and\n> wait for explicit approval. Do **NOT** make the decision yourself or proceed\n> until the user confirms.\n\n***\n\n## Strategy A: Puppeteer Snapshot (Recommended)\n\nLaunches headless Chrome, captures the fully rendered DOM, and produces a self-contained HTML file with all CSS inlined and images as base64. Works with **any framework** — no MockPage.jsx needed.\n\n### Prerequisites\n\n- App running locally (e.g., `npm run dev`)\n- Node.js with `puppeteer` available (check: `node -e \"require('puppeteer')\"`)\n\n### Workflow\n\n1.  **Start the App** and note the port.\n\n    > [!WARNING]\n    > **Checkpoint — User Confirmation Required.**\n    > After starting the local server, you **MUST** pause and ask the user for\n    > confirmation before running the snapshot script or launching a browser\n    > subagent. Report the URL and port to the user so they can verify the app\n    > is running and rendering correctly. Do **NOT** proceed to the snapshot\n    > step until the user confirms.\n\n2.  **Run the Snapshot Script**:\n    ```bash\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173 \\\n      --output .stitch\u002Fhome.html \\\n      --wait 2000\n    ```\n\n3.  **Multiple pages** — run once per route:\n    ```bash\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173 --output .stitch\u002Fhome.html --wait 2000\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173\u002Fpricing --output .stitch\u002Fpricing.html --wait 2000\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173\u002Fdashboard --output .stitch\u002Fdashboard.html --wait 2000 --html-class dark\n    ```\n\n4.  **Clean Up Dev Server**:\n    If a local dev server was started specifically for snapshot extraction, make sure to stop the server process or terminate the background task once extraction is completed.\n\n\n### Script Flags\n\n| Flag | Default | Description |\n| :--- | :--- | :--- |\n| `--url` | *(required)* | URL to capture |\n| `--output` | *(required)* | Output file path |\n| `--wait` | `1000` | Extra wait (ms) after network idle. Increase for lazy-loading apps. |\n| `--viewport` | `1280x800` | Viewport size as `WIDTHxHEIGHT` |\n| `--html-class` | — | Class(es) for `\u003Chtml>` element (e.g., `dark`) |\n| `--remove-fixed` | `false` | Remove fixed\u002Fsticky elements (cookie banners, chat widgets) |\n| `--full-height` | `false` | Resize viewport to full scroll height |\n| `--title` | — | Override page title (set to the route path, e.g. `\u002Fdashboard` or `\u002Fsettings\u002Fprofile`) |\n| `--auth-script` | — | Path to a JS\u002FTS module that exports a default `async (page) => void` function for authentication |\n| `--inline-canvas` | `false` | Convert `\u003Ccanvas>` elements (ECharts, Chart.js, D3) to base64 `\u003Cimg>` tags |\n\n### What It Does Automatically\n\n- Captures all CSSOM rules from `document.styleSheets` (preserves dynamic Vite\u002FTailwind dev styles and CSS-in-JS)\n- Inlines all `\u003Clink rel=\"stylesheet\">` → `\u003Cstyle>` blocks\n- Converts `\u003Cimg>` `src` **and `srcset`** → base64 data URIs (skips external fonts)\n- Inlines same-origin and relative icon font files (`@font-face`) as base64 data URIs so ligatures never render as ASCII text\n- Inlines `\u003Csource srcset>` URLs as base64\n- Removes failed\u002Fdead `srcset` entries so the browser falls back to the inlined `src`\n- Removes `\u003Cscript>` tags, Vite HMR dev style blocks (`createHotContext`, `import.meta.hot`), and dev overlays\n- Resolves relative CSS `url()` paths before inlining\n\n### Framework Notes\n\n| Framework | Notes |\n| :--- | :--- |\n| **React + Vite** | Works out of the box. `--wait 1000`. |\n| **Next.js** | `--wait 3000` for SSR hydration. URL: `http:\u002F\u002Flocalhost:3000`. `\u003Cimg srcset>` from `\u002F_next\u002Fimage` is auto-inlined as base64. |\n| **Angular (@angular\u002Fcli \u002F v17+)** | Works out of the box with `ng serve` (default URL: `http:\u002F\u002Flocalhost:4200`). `--wait 2000` for Angular Material \u002F PrimeNG animation hydration and lazy-loaded routes. |\n| **Vue \u002F Nuxt** | Works out of the box. |\n| **Svelte \u002F SvelteKit** | Works out of the box. |\n| **Storybook** | Use story URL: `--url http:\u002F\u002Flocalhost:6006\u002F?path=\u002Fstory\u002F...` |\n| **SSR (Webpack)** | May need longer `--wait`. |\n\n### Troubleshooting\n\n| Issue | Solution |\n| :--- | :--- |\n| Images missing | Increase `--wait` |\n| Images show as broken after server stops | Verify `srcset` was inlined — check log for \"Inlined N images\". If `srcset` URLs failed, they are auto-removed so `src` (inlined) is used. |\n| Icons display as text \u002F Serif unstyled font | Ensure `snapshot.ts` captures CSSOM from `document.styleSheets` (step 0) and same-origin icon fonts (`@font-face`) are inlined as base64 data URIs. |\n| Next.js `\u002F_next\u002Fimage` not inlined | Ensure the dev server is running when snapshot runs — the script fetches optimized images from the running server. |\n| Dark mode not applied | `--html-class dark` |\n| Cookie banner in output | `--remove-fixed` |\n| Page requires login | Use `--auth-script .\u002Fauth.ts` (see Auth-Gated Pages below) |\n| Charts\u002Fgraphs show as blank boxes | Use `--inline-canvas` to serialize `\u003Ccanvas>` to base64 `\u003Cimg>` |\n| `Cannot find module 'puppeteer'` | `npm install -g puppeteer` |\n\n### Auth-Gated Pages\n\nFor apps with login guards (Vue Router `beforeEach`, React `ProtectedRoute`, etc.), create a small auth script that runs in the Puppeteer session:\n\n```ts\n\u002F\u002F auth-myapp.ts\nimport type { Page } from 'puppeteer';\n\nexport default async function authenticate(page: Page) {\n  \u002F\u002F Example 1: Fill and submit a login form\n  await page.type('#username', 'admin');\n  await page.type('#password', 'password123');\n  await page.click('#login-button');\n  await page.waitForNavigation({ waitUntil: 'networkidle2' });\n\n  \u002F\u002F Example 2: Inject cookies\u002FlocalStorage directly\n  \u002F\u002F await page.evaluate(() => {\n  \u002F\u002F   localStorage.setItem('token', 'mock-jwt-token');\n  \u002F\u002F });\n\n  \u002F\u002F Example 3: Call the app's own login API via module injection (Vue\u002FVite)\n  \u002F\u002F await page.evaluate(() => {\n  \u002F\u002F   return new Promise((resolve) => {\n  \u002F\u002F     const script = document.createElement('script');\n  \u002F\u002F     script.type = 'module';\n  \u002F\u002F     script.textContent = `\n  \u002F\u002F       import { useUserStore } from '\u002Fsrc\u002Fstore\u002Fmodules\u002Fuser.ts';\n  \u002F\u002F       import { fetchLogin } from '\u002Fsrc\u002Fapi\u002Fauth.ts';\n  \u002F\u002F       const res = await fetchLogin({ userName: 'Admin', password: '123456' });\n  \u002F\u002F       useUserStore().setToken(res.token, res.refreshToken);\n  \u002F\u002F       window.dispatchEvent(new CustomEvent('auth-done'));\n  \u002F\u002F     `;\n  \u002F\u002F     document.head.appendChild(script);\n  \u002F\u002F     window.addEventListener('auth-done', () => resolve(true), { once: true });\n  \u002F\u002F   });\n  \u002F\u002F });\n}\n```\n\nThen use it:\n```bash\nnpx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n  --url http:\u002F\u002Flocalhost:5173\u002F#\u002Fdashboard \\\n  --output .stitch\u002Fdashboard.html \\\n  --auth-script .\u002Fauth-myapp.ts \\\n  --inline-canvas \\\n  --wait 5000\n```\n\nThe script navigates to the `--url` first (which may redirect to login), runs your auth function, then **re-navigates** to the original `--url` with the authenticated session.\n\n***\n\n## Strategy B: Browser Subagent Capture\n\nUse when you need to **interact with the page** (click buttons, fill forms, navigate tabs) before capturing. The browser subagent gives you full control but output may truncate for large pages.\n\n### Workflow\n\n1.  **Start the App** locally.\n2.  **Navigate** using a browser subagent.\n3.  **Interact** as needed (click, scroll, fill forms).\n4.  **Extract DOM**: `document.documentElement.outerHTML`\n\n    > [!WARNING]\n    > Large pages may truncate. To handle this:\n    > - Remove `\u003Cstyle>` tags before extraction: `document.querySelectorAll('style').forEach(el => el.remove())`\n    > - Re-add styles statically (Tailwind CDN link, source CSS)\n5.  **Save** to file.\n\n***\n\n## Appendix: Static Fallback (MockPage.jsx)\n\n> [!NOTE]\n> This method is a **last resort** for when the app cannot run locally (broken deps, missing backend, auth walls with no bypass). It requires manually flattening React components into a single JSX file. **Prefer Strategy A whenever possible.**\n\n### When to Use\n\n- App can't run locally at all\n- Page requires auth with no mock\u002Fbypass\n- You need a specific UI state that's impossible to reach by navigation (error screens, empty states)\n\n### Quick Reference\n\n```bash\nnpx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fextract_inline_html.ts \\\n  --index-css src\u002Fcss\u002FApp.css \\\n  --extra-css index.html \\\n  --outdir .stitch \\\n  --page src\u002FMockPage.jsx:Page.html:\"Page Title\"\n```\n\n**Key flags**: `--no-tailwind` (non-Tailwind apps), `--html-class dark` (dark mode), `--css-files` (extra CSS files).\n\n**Auto-detection**: Tailwind config is auto-detected. `@apply` directives automatically use `\u003Cstyle type=\"text\u002Ftailwindcss\">`.\n\n### MockPage.jsx Rules\n\n1. **Include the full layout** — header, sidebar, footer (read `App.js` first)\n2. **Flatten all conditionals** — pick one state, remove all ternaries and `&&` guards\n3. **Hardcode all data** — replace `{variable}` with concrete values, unroll `.map()` loops\n4. **Preserve logos** — use `\u003Cimg>` with local paths (post-process will inline them)\n5. **Remove floating elements** — cookie banners, chat widgets, feedback buttons\n\n### Post-Processing\n\nInline local images:\n```bash\nnpx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fpost_process.ts \\\n  .stitch\u002FPage.html --base-dir \u003Capp-directory>\n```\n\n\u003C!-- MCP:START -->\n\n\u003C!-- PORTABILITY:START -->\n## Cross-Client Portability\n\nThis skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.\n\n- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the\n  workflow in project instructions when folder discovery is unavailable.\n- Claude Code: keep the folder in a local skills directory or a compatible plugin source.\n- Codex: install or sync the folder into\n  `$CODEX_HOME\u002Fskills\u002Fstitch-extract-static-html` and restart Codex after major changes.\n\n\u003C!-- PORTABILITY:END -->\n\n## MCP Availability And Fallback\n\nPreferred MCP Server: Stitch MCP\n\n- Fallback prompt: \"Use the Extract Static HTML skill without MCP. Follow the documented local or manual fallback, show the selected tool surface, and report the verification evidence.\"\n- Use local `.stitch\u002F` artifacts, exported HTML or screenshots, bundled scripts, and the Stitch web UI when the host does not expose the needed Stitch MCP operation.\n- Do not claim screen lookup, generation, editing, or variant MCP calls unless those tools are present in the active host tool list.\n- Do not claim an MCP operation was used when the active host does not expose it.\n\n\u003C!-- MCP:END -->\n\n## Anti-Patterns\n\n- Claiming a Stitch screen-generation, screen-editing, or screen-retrieval MCP call succeeded when the active host does not expose that tool.\n- Uploading files, screenshots, HTML, markdown, or design assets to Stitch without user-approved destination and artifact details.\n- Reading, printing, storing, or committing Stitch API keys, MCP config secrets, cookies, or credential-bearing files.\n- Treating generated design or code as final without local render, syntax, or artifact verification.\n- Collapsing this workflow into a broader frontend\u002Fdesign skill when Stitch-specific files, project IDs, or design-system assets matter.\n\n## Verification Protocol\n\nBefore claiming this skill was applied successfully:\n\n1. Pass\u002Ffail: The output HTML exists under `.stitch\u002F`.\n2. Pass\u002Ffail: Capture route, viewport, wait time, and special flags are recorded.\n3. Pass\u002Ffail: Important images are inlined or intentionally left as stable external URLs.\n4. Pass\u002Ffail: No authenticated personal content, cookies, tokens, or private user data were captured.\n5. Pressure-test scenario: Repeat the workflow with Stitch MCP screen tools unavailable and confirm the fallback path remains honest and actionable.\n6. Success metric: The user can identify the exact artifact, project\u002Fdesign-system target, and verification evidence without relying on unstated MCP behavior.\n\n## Related Skills\n\n- [stitch-code-to-design](..\u002Fstitch-code-to-design\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n- [stitch-upload-to-stitch](..\u002Fstitch-upload-to-stitch\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n- [web-testing](..\u002Fweb-testing\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n- [vite-development](..\u002Fvite-development\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n","# Extract Static HTML\n\nExtract a self-contained static HTML file from any web application.\n\n## Which Strategy to Use\n\nYou MUST ask the user to choose which strategy to use before proceeding. Present the options clearly, **recommend Strategy A** as the preferred default, and **provide a brief pros\u002Fcons summary** for each option to help them make an informed decision.\n\n| | Strategy A (Puppeteer) | Strategy B (Browser Subagent) |\n| :--- | :--- | :--- |\n| **When** | App runs locally, no auth wall | Need to interact with page first (click, fill forms) |\n| **Fidelity** | **Highest — computed styles resolved** | High — rendered DOM |\n| **Setup** | **Zero — no mock needed** | Zero — no mock needed |\n| **Framework** | **Any** | Any |\n| **Output** | **Writes to file — no size limit** | May truncate in agent context |\n\n> [!WARNING]\n> **Checkpoint — User Confirmation Required.**\n> You **MUST** ask the user which strategy they prefer before proceeding.\n> Present the comparison table above, recommend Strategy A as the default, and\n> wait for explicit approval. Do **NOT** make the decision yourself or proceed\n> until the user confirms.\n\n***\n\n## Strategy A: Puppeteer Snapshot (Recommended)\n\nLaunches headless Chrome, captures the fully rendered DOM, and produces a self-contained HTML file with all CSS inlined and images as base64. Works with **any framework** — no MockPage.jsx needed.\n\n### Prerequisites\n\n- App running locally (e.g., `npm run dev`)\n- Node.js with `puppeteer` available (check: `node -e \"require('puppeteer')\"`)\n\n### Workflow\n\n1.  **Start the App** and note the port.\n\n    > [!WARNING]\n    > **Checkpoint — User Confirmation Required.**\n    > After starting the local server, you **MUST** pause and ask the user for\n    > confirmation before running the snapshot script or launching a browser\n    > subagent. Report the URL and port to the user so they can verify the app\n    > is running and rendering correctly. Do **NOT** proceed to the snapshot\n    > step until the user confirms.\n\n2.  **Run the Snapshot Script**:\n    ```bash\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173 \\\n      --output .stitch\u002Fhome.html \\\n      --wait 2000\n    ```\n\n3.  **Multiple pages** — run once per route:\n    ```bash\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173 --output .stitch\u002Fhome.html --wait 2000\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173\u002Fpricing --output .stitch\u002Fpricing.html --wait 2000\n    npx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n      --url http:\u002F\u002Flocalhost:5173\u002Fdashboard --output .stitch\u002Fdashboard.html --wait 2000 --html-class dark\n    ```\n\n4.  **Clean Up Dev Server**:\n    If a local dev server was started specifically for snapshot extraction, make sure to stop the server process or terminate the background task once extraction is completed.\n\n\n### Script Flags\n\n| Flag | Default | Description |\n| :--- | :--- | :--- |\n| `--url` | *(required)* | URL to capture |\n| `--output` | *(required)* | Output file path |\n| `--wait` | `1000` | Extra wait (ms) after network idle. Increase for lazy-loading apps. |\n| `--viewport` | `1280x800` | Viewport size as `WIDTHxHEIGHT` |\n| `--html-class` | — | Class(es) for `\u003Chtml>` element (e.g., `dark`) |\n| `--remove-fixed` | `false` | Remove fixed\u002Fsticky elements (cookie banners, chat widgets) |\n| `--full-height` | `false` | Resize viewport to full scroll height |\n| `--title` | — | Override page title (set to the route path, e.g. `\u002Fdashboard` or `\u002Fsettings\u002Fprofile`) |\n| `--auth-script` | — | Path to a JS\u002FTS module that exports a default `async (page) => void` function for authentication |\n| `--inline-canvas` | `false` | Convert `\u003Ccanvas>` elements (ECharts, Chart.js, D3) to base64 `\u003Cimg>` tags |\n\n### What It Does Automatically\n\n- Captures all CSSOM rules from `document.styleSheets` (preserves dynamic Vite\u002FTailwind dev styles and CSS-in-JS)\n- Inlines all `\u003Clink rel=\"stylesheet\">` → `\u003Cstyle>` blocks\n- Converts `\u003Cimg>` `src` **and `srcset`** → base64 data URIs (skips external fonts)\n- Inlines same-origin and relative icon font files (`@font-face`) as base64 data URIs so ligatures never render as ASCII text\n- Inlines `\u003Csource srcset>` URLs as base64\n- Removes failed\u002Fdead `srcset` entries so the browser falls back to the inlined `src`\n- Removes `\u003Cscript>` tags, Vite HMR dev style blocks (`createHotContext`, `import.meta.hot`), and dev overlays\n- Resolves relative CSS `url()` paths before inlining\n\n### Framework Notes\n\n| Framework | Notes |\n| :--- | :--- |\n| **React + Vite** | Works out of the box. `--wait 1000`. |\n| **Next.js** | `--wait 3000` for SSR hydration. URL: `http:\u002F\u002Flocalhost:3000`. `\u003Cimg srcset>` from `\u002F_next\u002Fimage` is auto-inlined as base64. |\n| **Angular (@angular\u002Fcli \u002F v17+)** | Works out of the box with `ng serve` (default URL: `http:\u002F\u002Flocalhost:4200`). `--wait 2000` for Angular Material \u002F PrimeNG animation hydration and lazy-loaded routes. |\n| **Vue \u002F Nuxt** | Works out of the box. |\n| **Svelte \u002F SvelteKit** | Works out of the box. |\n| **Storybook** | Use story URL: `--url http:\u002F\u002Flocalhost:6006\u002F?path=\u002Fstory\u002F...` |\n| **SSR (Webpack)** | May need longer `--wait`. |\n\n### Troubleshooting\n\n| Issue | Solution |\n| :--- | :--- |\n| Images missing | Increase `--wait` |\n| Images show as broken after server stops | Verify `srcset` was inlined — check log for \"Inlined N images\". If `srcset` URLs failed, they are auto-removed so `src` (inlined) is used. |\n| Icons display as text \u002F Serif unstyled font | Ensure `snapshot.ts` captures CSSOM from `document.styleSheets` (step 0) and same-origin icon fonts (`@font-face`) are inlined as base64 data URIs. |\n| Next.js `\u002F_next\u002Fimage` not inlined | Ensure the dev server is running when snapshot runs — the script fetches optimized images from the running server. |\n| Dark mode not applied | `--html-class dark` |\n| Cookie banner in output | `--remove-fixed` |\n| Page requires login | Use `--auth-script .\u002Fauth.ts` (see Auth-Gated Pages below) |\n| Charts\u002Fgraphs show as blank boxes | Use `--inline-canvas` to serialize `\u003Ccanvas>` to base64 `\u003Cimg>` |\n| `Cannot find module 'puppeteer'` | `npm install -g puppeteer` |\n\n### Auth-Gated Pages\n\nFor apps with login guards (Vue Router `beforeEach`, React `ProtectedRoute`, etc.), create a small auth script that runs in the Puppeteer session:\n\n```ts\n\u002F\u002F auth-myapp.ts\nimport type { Page } from 'puppeteer';\n\nexport default async function authenticate(page: Page) {\n  \u002F\u002F Example 1: Fill and submit a login form\n  await page.type('#username', 'admin');\n  await page.type('#password', 'password123');\n  await page.click('#login-button');\n  await page.waitForNavigation({ waitUntil: 'networkidle2' });\n\n  \u002F\u002F Example 2: Inject cookies\u002FlocalStorage directly\n  \u002F\u002F await page.evaluate(() => {\n  \u002F\u002F   localStorage.setItem('token', 'mock-jwt-token');\n  \u002F\u002F });\n\n  \u002F\u002F Example 3: Call the app's own login API via module injection (Vue\u002FVite)\n  \u002F\u002F await page.evaluate(() => {\n  \u002F\u002F   return new Promise((resolve) => {\n  \u002F\u002F     const script = document.createElement('script');\n  \u002F\u002F     script.type = 'module';\n  \u002F\u002F     script.textContent = `\n  \u002F\u002F       import { useUserStore } from '\u002Fsrc\u002Fstore\u002Fmodules\u002Fuser.ts';\n  \u002F\u002F       import { fetchLogin } from '\u002Fsrc\u002Fapi\u002Fauth.ts';\n  \u002F\u002F       const res = await fetchLogin({ userName: 'Admin', password: '123456' });\n  \u002F\u002F       useUserStore().setToken(res.token, res.refreshToken);\n  \u002F\u002F       window.dispatchEvent(new CustomEvent('auth-done'));\n  \u002F\u002F     `;\n  \u002F\u002F     document.head.appendChild(script);\n  \u002F\u002F     window.addEventListener('auth-done', () => resolve(true), { once: true });\n  \u002F\u002F   });\n  \u002F\u002F });\n}\n```\n\nThen use it:\n```bash\nnpx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fsnapshot.ts \\\n  --url http:\u002F\u002Flocalhost:5173\u002F#\u002Fdashboard \\\n  --output .stitch\u002Fdashboard.html \\\n  --auth-script .\u002Fauth-myapp.ts \\\n  --inline-canvas \\\n  --wait 5000\n```\n\nThe script navigates to the `--url` first (which may redirect to login), runs your auth function, then **re-navigates** to the original `--url` with the authenticated session.\n\n***\n\n## Strategy B: Browser Subagent Capture\n\nUse when you need to **interact with the page** (click buttons, fill forms, navigate tabs) before capturing. The browser subagent gives you full control but output may truncate for large pages.\n\n### Workflow\n\n1.  **Start the App** locally.\n2.  **Navigate** using a browser subagent.\n3.  **Interact** as needed (click, scroll, fill forms).\n4.  **Extract DOM**: `document.documentElement.outerHTML`\n\n    > [!WARNING]\n    > Large pages may truncate. To handle this:\n    > - Remove `\u003Cstyle>` tags before extraction: `document.querySelectorAll('style').forEach(el => el.remove())`\n    > - Re-add styles statically (Tailwind CDN link, source CSS)\n5.  **Save** to file.\n\n***\n\n## Appendix: Static Fallback (MockPage.jsx)\n\n> [!NOTE]\n> This method is a **last resort** for when the app cannot run locally (broken deps, missing backend, auth walls with no bypass). It requires manually flattening React components into a single JSX file. **Prefer Strategy A whenever possible.**\n\n### When to Use\n\n- App can't run locally at all\n- Page requires auth with no mock\u002Fbypass\n- You need a specific UI state that's impossible to reach by navigation (error screens, empty states)\n\n### Quick Reference\n\n```bash\nnpx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fextract_inline_html.ts \\\n  --index-css src\u002Fcss\u002FApp.css \\\n  --extra-css index.html \\\n  --outdir .stitch \\\n  --page src\u002FMockPage.jsx:Page.html:\"Page Title\"\n```\n\n**Key flags**: `--no-tailwind` (non-Tailwind apps), `--html-class dark` (dark mode), `--css-files` (extra CSS files).\n\n**Auto-detection**: Tailwind config is auto-detected. `@apply` directives automatically use `\u003Cstyle type=\"text\u002Ftailwindcss\">`.\n\n### MockPage.jsx Rules\n\n1. **Include the full layout** — header, sidebar, footer (read `App.js` first)\n2. **Flatten all conditionals** — pick one state, remove all ternaries and `&&` guards\n3. **Hardcode all data** — replace `{variable}` with concrete values, unroll `.map()` loops\n4. **Preserve logos** — use `\u003Cimg>` with local paths (post-process will inline them)\n5. **Remove floating elements** — cookie banners, chat widgets, feedback buttons\n\n### Post-Processing\n\nInline local images:\n```bash\nnpx tsx \u003CSKILL_DIR>\u002Fscripts\u002Fpost_process.ts \\\n  .stitch\u002FPage.html --base-dir \u003Capp-directory>\n```\n\n\u003C!-- MCP:START -->\n\n\u003C!-- PORTABILITY:START -->\n## Cross-Client Portability\n\nThis skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.\n\n- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the\n  workflow in project instructions when folder discovery is unavailable.\n- Claude Code: keep the folder in a local skills directory or a compatible plugin source.\n- Codex: install or sync the folder into\n  `$CODEX_HOME\u002Fskills\u002Fstitch-extract-static-html` and restart Codex after major changes.\n\n\u003C!-- PORTABILITY:END -->\n\n## MCP Availability And Fallback\n\nPreferred MCP Server: Stitch MCP\n\n- Fallback prompt: \"Use the Extract Static HTML skill without MCP. Follow the documented local or manual fallback, show the selected tool surface, and report the verification evidence.\"\n- Use local `.stitch\u002F` artifacts, exported HTML or screenshots, bundled scripts, and the Stitch web UI when the host does not expose the needed Stitch MCP operation.\n- Do not claim screen lookup, generation, editing, or variant MCP calls unless those tools are present in the active host tool list.\n- Do not claim an MCP operation was used when the active host does not expose it.\n\n\u003C!-- MCP:END -->\n\n## Anti-Patterns\n\n- Claiming a Stitch screen-generation, screen-editing, or screen-retrieval MCP call succeeded when the active host does not expose that tool.\n- Uploading files, screenshots, HTML, markdown, or design assets to Stitch without user-approved destination and artifact details.\n- Reading, printing, storing, or committing Stitch API keys, MCP config secrets, cookies, or credential-bearing files.\n- Treating generated design or code as final without local render, syntax, or artifact verification.\n- Collapsing this workflow into a broader frontend\u002Fdesign skill when Stitch-specific files, project IDs, or design-system assets matter.\n\n## Verification Protocol\n\nBefore claiming this skill was applied successfully:\n\n1. Pass\u002Ffail: The output HTML exists under `.stitch\u002F`.\n2. Pass\u002Ffail: Capture route, viewport, wait time, and special flags are recorded.\n3. Pass\u002Ffail: Important images are inlined or intentionally left as stable external URLs.\n4. Pass\u002Ffail: No authenticated personal content, cookies, tokens, or private user data were captured.\n5. Pressure-test scenario: Repeat the workflow with Stitch MCP screen tools unavailable and confirm the fallback path remains honest and actionable.\n6. Success metric: The user can identify the exact artifact, project\u002Fdesign-system target, and verification evidence without relying on unstated MCP behavior.\n\n## Related Skills\n\n- [stitch-code-to-design](..\u002Fstitch-code-to-design\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n- [stitch-upload-to-stitch](..\u002Fstitch-upload-to-stitch\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n- [web-testing](..\u002Fweb-testing\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n- [vite-development](..\u002Fvite-development\u002FSKILL.md): Use when the task also needs this adjacent Stitch workflow.\n",{"name":5,"tags":25,"license":15,"version":31,"description":7,"last_updated":32},[26,27,28,29,30],"stitch","html","frontend","snapshot","assets","2.0",1788825600000,"master","fd76f882a04e445e899d5cfb2732f2105ea054ee","skills\u002Fagent-skills\u002Fstitch-extract-static-html",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill stitch-extract-static-html",{"tool":49,"command":50},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill stitch-extract-static-html",{"tool":52,"command":53},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill stitch-extract-static-html","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fagent-skills\u002Fstitch-extract-static-html\u002FSKILL.md",true,[57,63],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"CHANGELOG.md","REFERENCE","参考文档",6217,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fagent-skills\u002Fstitch-extract-static-html\u002FCHANGELOG.md",{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":16},"LICENSE.txt","LICENSE","许可证",11273,[69,78,85,92,99,106],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":77},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":77},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":77},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":77},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":77},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]