मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)8.7k · #12343

stitch::extract-static-html

यह क्या करती है

यह स्किल रेंडर हुए वेब पेज को एक ऐसी single HTML फ़ाइल में कैप्चर करती है जो अपने-आप खुलती है। यह उन डिज़ाइनरों और डेवलपर्स के लिए है जिन्हें किसी स्क्रीन की स्थिर कॉपी चाहिए।

कब इस्तेमाल करें

  • ✓जब आप किसी पेज की एक HTML कॉपी साझा करने या समीक्षा के लिए चाहते हैं।
  • ✓जब Stitch पर अपलोड करने से पहले आपको कोई खास स्क्रीन स्थिति सहेजनी हो।
  • ✓जब लाइव ऐप चलाए बिना किसी व्यू का स्थिर मॉक चाहिए।

Skill का लिंक

https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-design/skills/extract-static-html/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-design/skills/extract-static-html/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे लोकल ऐप का मौजूदा checkout पेज एक स्वतंत्र HTML फ़ाइल के रूप में सहेजिए, जिसे मैं साझा कर सकूं।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह पेज को headless ब्राउज़र में लोड करती है, स्टाइल और इमेज फ़ाइल के अंदर डालती है, और उसे लिख देती है, पहले यह पूछकर कि कौन सा तरीका इस्तेमाल करना है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Extract Static HTML

Extract a self-contained static HTML file from any web application.

Which Strategy to Use

You 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/cons summary for each option to help them make an informed decision.

Strategy A (Puppeteer) Strategy B (Browser Subagent)
When App runs locally, no auth wall Need to interact with page first (click, fill forms)
Fidelity Highest — computed styles resolved High — rendered DOM
Setup Zero — no mock needed Zero — no mock needed
Framework Any Any
Output Writes to file — no size limit May truncate in agent context

[!WARNING] Checkpoint — User Confirmation Required. You MUST ask the user which strategy they prefer before proceeding. Present the comparison table above, recommend Strategy A as the default, and wait for explicit approval. Do NOT make the decision yourself or proceed until the user confirms.


Strategy A: Puppeteer Snapshot (Recommended)

Launches 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.

Prerequisites

  • App running locally (e.g., npm run dev)
  • Node.js with puppeteer available (check: node -e "require('puppeteer')")

Workflow

  1. Start the App and note the port.

    [!WARNING] Checkpoint — User Confirmation Required. After starting the local server, you MUST pause and ask the user for confirmation before running the snapshot script or launching a browser subagent. Report the URL and port to the user so they can verify the app is running and rendering correctly. Do NOT proceed to the snapshot step until the user confirms.

  2. Run the Snapshot Script:

    npx tsx <SKILL_DIR>/scripts/snapshot.ts \
      --url http://localhost:5173 \
      --output .stitch/home.html \
      --wait 2000
    
  3. Multiple pages — run once per route:

    npx tsx <SKILL_DIR>/scripts/snapshot.ts \
      --url http://localhost:5173 --output .stitch/home.html --wait 2000
    npx tsx <SKILL_DIR>/scripts/snapshot.ts \
      --url http://localhost:5173/pricing --output .stitch/pricing.html --wait 2000
    npx tsx <SKILL_DIR>/scripts/snapshot.ts \
      --url http://localhost:5173/dashboard --output .stitch/dashboard.html --wait 2000 --html-class dark
    
  4. Clean Up Dev Server: 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.

Script Flags

Flag Default Description
--url (required) URL to capture
--output (required) Output file path
--wait 1000 Extra wait (ms) after network idle. Increase for lazy-loading apps.
--viewport 1280x800 Viewport size as WIDTHxHEIGHT
--html-class — Class(es) for <html> element (e.g., dark)
--remove-fixed false Remove fixed/sticky elements (cookie banners, chat widgets)
--full-height false Resize viewport to full scroll height
--title — Override page title (set to the route path, e.g. /dashboard or /settings/profile)
--auth-script — Path to a JS/TS module that exports a default async (page) => void function for authentication
--inline-canvas false Convert <canvas> elements (ECharts, Chart.js, D3) to base64 <img> tags

What It Does Automatically

  • Captures all CSSOM rules from document.styleSheets (preserves dynamic Vite/Tailwind dev styles and CSS-in-JS)
  • Inlines all <link rel="stylesheet"> → <style> blocks
  • Converts <img> src and srcset → base64 data URIs (skips external fonts)
  • Inlines same-origin and relative icon font files (@font-face) as base64 data URIs so ligatures never render as ASCII text
  • Inlines <source srcset> URLs as base64
  • Removes failed/dead srcset entries so the browser falls back to the inlined src
  • Removes <script> tags, Vite HMR dev style blocks (createHotContext, import.meta.hot), and dev overlays
  • Resolves relative CSS url() paths before inlining

Framework Notes

|

अक्सर पूछे जाने वाले सवाल

कौन सा तरीका सुझाया जाता है?

स्किल Puppeteer snapshot तरीका सुझाती है, और शुरू करने से पहले आपसे चुनने को कहती है।

क्या यह पहले पेज पर क्लिक कर सकती है?

हाँ, एक दूसरा तरीका पेज के साथ बातचीत कर सकता है, जैसे क्लिक करना या फ़ॉर्म भरना।

क्या यह लॉगिन पेज पर काम करता है?

snapshot तरीका बिना लॉगिन दीवार वाले लोकल ऐप के लिए सबसे अच्छा काम करता है।

जानकारी

लेखक का मूल विवरण

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'.

repo: google-labs-code/stitch-skills

लोकप्रियता

GitHub स्टार
8.7k
रैंकिंग में स्थान
#12343
लाइसेंस
Apache-2.0
अपडेट की गई
17/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

stitch::react-components

8.7k

यह आपके एजेंट को Stitch डिज़ाइन को React और Vite कंपोनेंट में बदलने, या मौजूदा कंपोनेंट को नए डिज़ाइन से मिलाने में मदद करती है, जांच के साथ।

कोडिंगवेबसाइट और UI (frontend)

stitch::react-native

8.7k

यह आपके एजेंट को Stitch वेब डिज़ाइन को React Native कंपोनेंट में बदलने, या मौजूदा मोबाइल स्क्रीन नए डिज़ाइन से मिलाने में मदद करती है।

कोडिंगमोबाइल ऐप

react-vite-dashboard

8.7k

यह आपके एजेंट को Stitch डिज़ाइन से डेटा वाले React और Vite डैशबोर्ड बनाने में मदद करती है, TanStack Query और DESIGN.md टोकन के साथ।

कोडिंगवेबसाइट और UI (frontend)

shadcn-ui

8.7k

यह आपके एजेंट को shadcn/ui कंपोनेंट खोजने, जोड़ने और अपने हिसाब से बदलने में मदद करती है, जो Tailwind CSS पर आधारित हैं।

कोडिंगवेबसाइट और UI (frontend)

मिलती-जुलती skills