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 पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
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
puppeteeravailable (check:node -e "require('puppeteer')")
Workflow
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.
Run the Snapshot Script:
npx tsx <SKILL_DIR>/scripts/snapshot.ts \ --url http://localhost:5173 \ --output .stitch/home.html \ --wait 2000Multiple 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 darkClean 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>srcandsrcset→ 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
srcsetentries so the browser falls back to the inlinedsrc - 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'.
लोकप्रियता
- GitHub स्टार
- 8.7k
- रैंकिंग में स्थान
- #12343
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 17/8/2026
कमेंट
- …
इस repository की और skills
stitch::react-components
8.7kयह आपके एजेंट को Stitch डिज़ाइन को React और Vite कंपोनेंट में बदलने, या मौजूदा कंपोनेंट को नए डिज़ाइन से मिलाने में मदद करती है, जांच के साथ।
stitch::react-native
8.7kयह आपके एजेंट को Stitch वेब डिज़ाइन को React Native कंपोनेंट में बदलने, या मौजूदा मोबाइल स्क्रीन नए डिज़ाइन से मिलाने में मदद करती है।
react-vite-dashboard
8.7kयह आपके एजेंट को Stitch डिज़ाइन से डेटा वाले React और Vite डैशबोर्ड बनाने में मदद करती है, TanStack Query और DESIGN.md टोकन के साथ।
shadcn-ui
8.7kयह आपके एजेंट को shadcn/ui कंपोनेंट खोजने, जोड़ने और अपने हिसाब से बदलने में मदद करती है, जो Tailwind CSS पर आधारित हैं।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।