stitch::extract-static-html

Extract self-contained static HTML from running web apps by inlining CSS and images.

Updated Jul 19, 2026
Ready to run
npx skills add https://github.com/DagimAlemayehuu/AgenticEngineering --skill stitch-extract-static-html-dagimalemayehuu
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: stitch::extract-static-html
Source: https://github.com/DagimAlemayehuu/AgenticEngineering/tree/main/agentic-engineering/core/dependencies/stitch/extract-static-html
Command: npx skills add https://github.com/DagimAlemayehuu/AgenticEngineering --skill stitch-extract-static-html-dagimalemayehuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires puppeteer, @babel/parser, @babel/traverse, @babel/generator, tsx, and includes scripts (resource) components.

What problem does it solve? Capturing a fully rendered web page as a single portable HTML file is difficult because stylesheets, images, and scripts are spread across many resources. This Skill produces self-contained HTML snapshots with all CSS inlined and images embedded as base64, ready for sharing or Stitch upload. ## Core Features & Use Cases - Puppeteer Snapshot: Launch headless Chrome against a locally running app (React, Next.js, Vue, Svelte, Storybook) and capture the fully rendered DOM with computed styles resolved. - Browser Subagent Capture: Interact with the page first (click, fill forms, navigate tabs) before extracting the DOM for state-specific captures. - MockPage Fallback: Convert flattened React/JSX mock components into static HTML using Babel AST parsing when the app cannot run locally. - Use Case: Run a Vite dev server, snapshot the home, pricing, and dashboard routes into .stitch/*.html files with dark mode applied, then upload them to Stitch for visual synchronization. ## Quick Start Use the extract-static-html skill to snapshot my app running at http://localhost:5173 into a self-contained HTML file.

Frequently Asked Questions about stitch::extract-static-html

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I capture a fully rendered web page as a single HTML file?▼

Run the snapshot script with Puppeteer against your locally running app: npx tsx snapshot.ts --url http://localhost:5173 --output .stitch/home.html. It inlines all stylesheets, converts images to base64, and removes scripts automatically.

How to extract static HTML from a React or Next.js app?▼

Start the dev server, then run the Puppeteer snapshot script per route. Next.js needs --wait 3000 for SSR hydration, and images from /_next/image are auto-inlined as base64 while the server runs.

Does the snapshot work with dark mode and cookie banners?▼

Yes. Pass --html-class dark to apply dark mode classes to the html element, and use --remove-fixed to strip fixed or sticky elements like cookie banners and chat widgets from the output.

Why are images missing or broken in my extracted HTML?▼

Images usually fail because lazy loading has not finished; increase the --wait flag. If srcset URLs fail, they are removed automatically so the browser falls back to the inlined src attribute.

What can I do when the app cannot run locally or requires login?▼

Use the MockPage.jsx fallback: flatten your React components into a single JSX file with hardcoded data, then convert it with extract_inline_html.ts and inline local images with post_process.ts.