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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
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 스냅샷 방법을 추천하며, 시작하기 전에 사용자가 방법을 고르도록 합니다.
먼저 페이지를 클릭할 수 있나요?
네. 두 번째 방법은 클릭이나 양식 입력처럼 페이지와 상호작용할 수 있습니다.
로그인 페이지에서도 작동하나요?
스냅샷 방법은 로그인 벽이 없는 로컬 앱에서 가장 잘 작동합니다.
상세 정보
작성자의 원본 설명
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
- 업데이트
- 2026. 8. 17.
댓글
- …
이 저장소의 다른 스킬
stitch::react-components
8.7kStitch 디자인을 React와 Vite 컴포넌트로 바꾸거나, 기존 컴포넌트를 최신 디자인에 맞게 업데이트하고, 점검을 거치도록 돕습니다.
stitch::react-native
8.7kStitch 웹 디자인을 휴대폰 앱용 React Native 컴포넌트로 바꾸거나, 기존 모바일 화면을 새 디자인에 맞게 업데이트하도록 돕습니다.
react-vite-dashboard
8.7kStitch 디자인으로 데이터가 많은 React와 Vite 대시보드를 만들고, TanStack Query와 DESIGN.md 파일의 디자인 토큰을 씁니다.
shadcn-ui
8.7kRadix 또는 Base UI와 Tailwind CSS로 만든, 복사해서 넣는 인터페이스 부품인 shadcn/ui 컴포넌트를 찾고 설치하고 맞춤 설정하도록 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.