[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77WHCJKZ61QNGWTP5VBNNSS":3,"skill-same:01M77WHCJKZ61QNGWTP5VBNNSS":60},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77WHCJKZ61QNGWTP5VBNNSS","stitch-extract-static-html",null,"Extract self-contained static HTML from a built web application or React components by inlining CSS and images. Use this skill whenever you need to capture a specific UI state, share a static version of a page, or prepare assets for Stitch upload, even if the user just asks to 'save the HTML' or 'mock the view'.","Reihantt6\u002Fsns-myagent","Reihantt6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219822095?v=4","01M77KK94PV8B7C2D9XWXNS8DJ","Mohamad Reihan tegar prasetya","01M77KK958QFMTHYXGXFV7KZ79",2,"MIT","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fstitch-extract-static-html\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Extract self-contained static HTML from a built web application or React components by inlining CSS and images. Use this skill whenever you need to capture a specific UI state, share a static version of a page, or prepare assets for Stitch upload, even if the user just asks to 'save the HTML' or 'mock the view'.\"\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","# 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",{"description":7},"main","58843b159d7a4050d6b785a98b908cce505c0b92","agent\u002Fskills\u002Fstitch-extract-static-html",0,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent","https:\u002F\u002Fgithub.com\u002FReihantt6","reihsns.web.id","2026-08-19 20:08:18",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Reihantt6\u002Fsns-myagent --skill stitch-extract-static-html",{"tool":38,"command":39},"bunx","bunx skills add Reihantt6\u002Fsns-myagent --skill stitch-extract-static-html",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Reihantt6\u002Fsns-myagent --skill stitch-extract-static-html","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fstitch-extract-static-html\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Fextract_inline_html.ts","SCRIPT","脚本",34450,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fstitch-extract-static-html\u002Fscripts\u002Fextract_inline_html.ts",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"scripts\u002Fpost_process.ts",14295,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fstitch-extract-static-html\u002Fscripts\u002Fpost_process.ts",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"scripts\u002Fsnapshot.ts",54743,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fstitch-extract-static-html\u002Fscripts\u002Fsnapshot.ts",[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M77XDCYZ407XYMF2T4P6F7VT","youtube-transcript","Extract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com\u002Fwatch?v=, youtu.be\u002F, or similar). Supports output with or without timestamps.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-transcript\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M77XD7PBC98J6MXGJJ2TJ8DX","youtube-thumbnail-design","YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A\u002FB testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-thumbnail-design\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M77XD2541C8HXJ6RHYZP4NGJ","youtube-short-maker","Make YouTube Shorts that hold attention with Pexo — vertical 9:16, fast-paced, hook in the first 3 seconds. Describe your topic and Pexo writes the script, generates the shots, picks the models, and assembles a finished Short with music and captions. Use for YouTube Shorts: \"youtube short\", \"make a youtube short\", \"shorts video\", \"short-form video\". NOT for long-form or landscape video.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-short-maker\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M77XCXKVSYK7KTZ3PQBVVGFD","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fxcode-project-setup\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M77XCR1DV8ZQK2NHWKVY4EWX","x402","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx402\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M77XCMD3R3ZBZQQSW6E0793B","x-twitter-scraper","Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, hosted Apify Actor runs, MCP tools, TweetClaw OpenClaw plugin installs, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx-twitter-scraper\u002FSKILL.md",[],[]]