본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)8.7k · #12343

stitch::extract-static-html

하는 일

이 스킬은 렌더링된 웹 페이지를 혼자 열리는 단일 HTML 파일로 캡처합니다. 화면의 정적 사본을 원하는 디자이너와 개발자를 위한 것입니다.

사용하는 경우

  • ✓페이지의 단일 HTML 사본을 공유하거나 검토하고 싶을 때.
  • ✓Stitch에 올리기 전에 특정 화면 상태를 저장해야 할 때.
  • ✓라이브 앱을 실행하지 않고 화면의 정적 목업이 필요할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-design/skills/extract-static-html/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 로컬 앱의 현재 결제 페이지를 공유할 수 있는 독립 HTML 파일 하나로 저장해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 헤드리스 브라우저에서 페이지를 불러오고, 스타일과 이미지를 파일 안에 넣은 뒤, 어떤 방법을 쓸지 먼저 묻고 파일로 씁니다.

기술 내용 (원본 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 스냅샷 방법을 추천하며, 시작하기 전에 사용자가 방법을 고르도록 합니다.

먼저 페이지를 클릭할 수 있나요?

네. 두 번째 방법은 클릭이나 양식 입력처럼 페이지와 상호작용할 수 있습니다.

로그인 페이지에서도 작동하나요?

스냅샷 방법은 로그인 벽이 없는 로컬 앱에서 가장 잘 작동합니다.

상세 정보

작성자의 원본 설명

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
업데이트
2026. 8. 17.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬