mockup-lab

Prototype UI variants in HTML/CSS, render screenshots via headless browser, and export approved designs to Penpot as SVG.

1|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/psiagoleal/ai-coding-agent-profiles --skill mockup-lab-psiagoleal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mockup-lab
Source: https://github.com/psiagoleal/ai-coding-agent-profiles/tree/main/skills/dominio/mockup-lab
Command: npx skills add https://github.com/psiagoleal/ai-coding-agent-profiles --skill mockup-lab-psiagoleal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright, and includes scripts (resource) components.

What problem does it solve? Deciding on a UI layout requires comparing visual options, but iterating directly inside a design tool is slow. This Skill lets an agent generate HTML/CSS mockup variants, render them as comparable screenshots across viewports, and export the approved variant as an SVG importable into a self-hosted Penpot instance as the official design record. ## Core Features & Use Cases - Variant rendering: Renders every HTML file in a variants directory to PNG screenshots at multiple viewports (e.g., 1440x900 and 390x844) using Playwright and headless Chromium. - SVG export for Penpot: Serializes the approved variant's rendered DOM to SVG via dom-to-svg loaded from esm.sh, with resources inlined as data URIs. - Automated Penpot import: Logs into a self-hosted Penpot once via a persistent browser profile, then creates a file and pastes the SVG as native editable layers using a synthetic paste event. - Use Case: Ask the agent to mock up three sidebar layout options for a dashboard; it renders screenshots for comparison, and after you approve one, exports it to the Drafts project in Penpot. ## Quick Start Ask the agent to prototype two layout variants of a settings page in HTML, render screenshots at desktop and mobile widths, and export the one you approve to Penpot.

Frequently Asked Questions about mockup-lab

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

FAQPage Schema
How do I render HTML mockups to screenshots with Playwright?

Run the render-variants.mjs script with an input directory of HTML files, an output directory, and a comma-separated viewport list. It loads each file in headless Chromium and saves one full-page PNG per variant per viewport.

How to export an HTML page to SVG for Penpot import?

Use the export-svg-for-penpot.mjs script, which loads the page in Chromium and serializes the rendered DOM with dom-to-svg loaded from esm.sh. The resulting SVG can be pasted directly into a Penpot canvas, producing native editable layers.

Can I automate importing SVG files into a self-hosted Penpot?

Yes. After a one-time manual login via penpot-login.mjs that saves a persistent browser profile, import-svg-to-penpot.mjs creates a new file in a chosen project and pastes the SVG through a synthetic paste event, replicating the manual copy-paste flow.

Does dom-to-svg handle complex CSS Grid and Flexbox layouts?

Fidelity can be imperfect because dom-to-svg has not been actively maintained for about five years. Always compare the imported SVG visually against the original screenshot before treating the export as done.

Why did my Penpot import succeed but the file is empty?

Penpot syncs changes to the backend asynchronously over websocket, so closing the browser too early loses the paste. The import script waits several seconds before closing; increase that wait if the issue recurs.

What are the limitations of HTML-to-SVG design export?

The export is a static capture of a single viewport, so it does not reproduce responsiveness or interaction states like hover and focus. Export one SVG per viewport if multiple breakpoints are needed, and expect large files from inlined fonts and images.