/dev-flow:iframe-canvasfrom dev-flow
Builds a pan/zoom canvas with live iframe artboards for AI site/app builders. Owns decisions on frame budget, same-origin vs cross-origin isolation, snapshot-vs-live per artboard, pointer event gating, camera coordinate spaces, and postMessage contracts.
Ships in dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A canvas of live <iframe> artboards is the architecture behind every AI site- and
app-builder: Reweb, Sleek, Plasmic, Builder.io, Onlook, v0. It is not the architecture
behind Figma, and starting from "like Figma" is how projects in this family go wrong.
The failure mode is late and looks like polish debt: it works with three artboards, drags with twelve, and by then the camera, the protocol and the selection model all assume live frames everywhere. Every decision below is cheap on day one and structural by month two.
Follows the dev-flow contract — see references/contracts.md. Key facts:
meta.json#stack.framework and stack.nextjs_version. For monorepo, reads stack.monorepo.web.*.stack.framework ∉ {"next", "monorepo"}. The camera maths and the iframe
process model are framework-agnostic, but the guidance here is written against App Router
routes serving the renderer document, and mis-applying it is worse than refusing.stack.canvas ("iframe-live" | "iframe-snapshot" | "rendered").history. Does not bump phase.| Need | Skill |
|---|---|
| The editor UI around the canvas (panels, toolbars, dialogs) | screenshot-to-page |
| Motion on the canvas chrome | transitions |
| State that is not the camera | state-discipline |
| Reads that populate the canvas | data-fetching |
| Shipping the product's API to coding agents | product-to-agent-skill |
Figma's canvas is not DOM. Evan Wallace's account of building it says HTML and SVG were rejected for "DOM access overhead" and because browsers are optimised for scrolling rather than zooming; the renderer is WebGL written from scratch, with the document model in C++, and it moved to WebGPU in 2023.
So "like Figma" describes a feel — smooth zoom, many boards, direct manipulation — and naming it as an architecture imports the wrong constraints. In an iframe canvas the expensive resource is not draw calls, it is browsing contexts.
State this out loud when a user says "like Figma". It is a stack decision, and dev-flow's golden rule is that stack decisions are never taken silently.
Every iframe is "a complete document environment" (MDN) and needs its own memory and compute. Two facts set the ceiling:
Which means the budget is not a number you can look up — it is frames × weight of each frame, on one thread, under one tab's ceiling. Measure it on the real content before you
design around it.
The precedent that matters. Plasmic — a production visual builder with isolated iframe artboards and runtime injection of the user's own component bundles — replaced its multi-artboard view with a single-artboard editing mode, citing performance and simplicity. Multi-artboard survives as a separate "Design Mode" for comparing breakpoints side by side.
Read that as the default, not as their local quirk: one live artboard, many static ones. A product that needs twelve live previews at once should be able to say why it is not Plasmic.
Pick per artboard, not per product. The four viable shapes:
| Shape | What an artboard is | Costs | Reach for it when |
|---|---|---|---|
| All live | every artboard an iframe, always | one process, N contexts, one thread | ≤ ~3 artboards, light content, and you have measured it |
| Snapshot + hydrate (default) | inactive = image/static HTML, focused = iframe | a snapshot invalidates on every edit to its source | more than a handful of artboards — what Miro and FigJam do for inactive content |
| Single live | one iframe, artboards are a selector | loses side-by-side comparison | editing is the main verb, comparison is occasional — Plasmic's answer |
| Rendered | no iframes; draw to WebGL/2D | you own layout, text, fonts, a11y | the content is your document model, not arbitrary HTML — Figma's answer. → references/rendered-canvas.md |
The mistake is not choosing wrong. It is not choosing, shipping "all live" by default, and discovering the budget at twelve artboards with a camera and a protocol already built on the assumption.
A real fork, not a detail:
| Same-origin | Cross-origin | |
|---|---|---|
| DOM access from the parent | direct | none — postMessage only |
| Process | shares the parent's, contends for the main thread | its own, isolated |
| A frame that hangs | can take the editor with it | contained |
| Untrusted / user-authored content | unsafe | the only safe answer |
There is a third position: Origin-Agent-Cluster: ?1 on the renderer document forces
origin-keyed isolation, giving same-site frames their own process. You keep one origin and
one deployment, you pay in cross-context access.
Write the protocol as if you were cross-origin even when you are not. Direct DOM reach across the boundary is the coupling that makes the isolation switch unaffordable later, and it is exactly the switch you will want when the canvas gets slow or the content gets untrusted.
Non-negotiable in either case: sandbox on the element, and an event.origin check on
both sides of every message handler. A renderer that trusts any origin is an XSS
surface with a nice UI.
The hardest interaction problem here, and it has one answer that production converged on from two directions: a declared mode, not scattered conditionals.
Interactive toggle inside the canvas, replacing what used to be
a separate preview screen — you click a real button, watch state change, exit, and keep
the state.inspectMode, and says plainly that
hover and click detection are gated on it "to avoid conflicts with scrolling or dragging".In CSS the mechanism is one property — pointer-events: none on the frame while the canvas
owns the gesture — but the discipline is that exactly one mode object decides it, and
every overlay, cursor and shortcut reads that object. The moment the answer is computed
inline in three components, the modes drift and the canvas develops dead zones.
Two spaces, one transform, and every bug in this area is a value used in the wrong one:
screen = (canvas − pan) × scale, and the inverse going back. A pan gesture moves the
camera by the pointer delta divided by the scale, which is what makes panning feel
identical at every zoom level.
Three consequences worth stating because they are the recurring bugs:
borderWidth: 1 / scale. Otherwise a 1px outline is
3px at 3× zoom.visualViewport.scale returns 1 inside an iframe
in every browser. If the rendered content must react to zoom, the parent has to tell it.Those are the decisions. references/pointer-and-lifecycle.md is the layer under them — the
seven places a pan/zoom surface actually breaks in a browser: touch-action taken too broadly, a
transform applied more than once a frame or interleaved with layout reads, a pointer stream that
ends in pointercancel or a lost capture instead of pointerup, portals laid out in screen space
outside your transform, a camera with no bounds, focus that scrolls the page instead of moving the
world, and fitting measured before layout settles. None of it changes the architecture; all of it
decides whether the canvas feels broken.
Real, reported, and not your bug to fix:
transform: scale is not controllable. Each browser picks
the bitmap scale with its own heuristics; a request for author control has been open at the
CSSWG since 2016. Scaled iframe content going soft is expected. If crispness at high zoom
is a requirement, re-render the content at the target size instead of scaling the frame.position: fixed content inside a scaled iframe blurry (bug 133801) —
worth knowing before you spend a day on your own CSS.The WICG is incubating html-in-canvas: drawElementImage() (plus WebGL/WebGPU
equivalents), a drawable attribute and a paint event, to render live HTML into a canvas.
It would collapse the snapshot problem. It is behind chrome://flags/#canvas-draw-element,
in the incubator, no standard. Track it; ship nothing on it. [VERIFY] on every pass.
| Mistake | What actually happens |
|---|---|
| "Like Figma", so we render DOM and expect Figma's smoothness | Figma rejected DOM for exactly this; you inherited the constraint it escaped |
| All artboards live from day one | fine at three, unusable at twelve, and by then the camera and protocol assume it |
| Same-origin because DOM access is convenient | every frame contends for the editor's main thread, and untrusted content is now in your origin |
The parent reaches into iframe.contentDocument | the isolation switch you will want later is now a rewrite |
Selection outline drawn with a fixed 1px | 3px at 3× zoom; every chrome element needs 1 / scale |
| Overlays injected into the renderer document | breaks on cross-origin, and your chrome inherits the content's CSS |
| Pointer gating decided inline per component | modes drift, the canvas grows dead zones nobody can reproduce |
| Fighting blurry scaled content with CSS | the browser picks the raster scale; open at the CSSWG since 2016 |
A message handler without an origin check | any page that can frame you now drives your editor |
| Snapshots treated as free | every edit invalidates one; the capture cost is the real budget |
Origin-Agent-Cluster) and write
the protocol as if cross-origin regardless.1 / scale rule
documented where the chrome is drawn.ready handshake before the first push.stack.canvas in meta.json and append history.references/rendered-canvas.md: the library choice (Konva, measured against
React Flow and Fabric), the Next.js 16 wiring ('use client' is the whole setup on Konva 10 — the
canvas package and ssr: false were Konva 9 workarounds), and the two failures that are
structural rather than fixable — no accessibility tree at all, and react-konva being a custom
React reconciler whose minor mirrors React's. The camera and the coordinate spaces above still
apply unchanged. The document model, hit-testing, layers, undo and export stay product work.screenshot-to-page.references/pointer-and-lifecycle.md is merged from ibelick/ui-skills component-canvas
(MIT, read 2026-10-13) — the knowledge in our words, inside the skill that owns the subject,
rather than a second skill installed beside it (dev-flow/references/resources.md).
Every claim above traces to references/production-survey.md, which carries the URLs and
what each source actually says. Re-check it on a cadence: three of the sources describe
products that changed their answer at least once.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
iframe-canvas, pan-zoom, visual-editor, artboard, live-preview, frame-budget
57 skills in this plugin
/animated-iconsAdd a Motion-animated icon to a Next.js app from a shadcn registry instead of hand-animating an SVG. Two registries, picked from the project's icon set: **heroicons-animated** (316 icons, `shadcn add @heroicons-animated/<name>`) and **hugeicons-animated** (165 icons, `shadcn add @hugeicons-animated/<name>`, which also installs a shared `lib/use-icon-animation.ts`). Both MIT, both on the `motion` runtime, both copied into your repo as source. This skill owns the install plus the two things the raw components lack: a `prefers-reduced-motion` guard and timing aligned to the project motion tokens (`lib/motion/`). Use when the user says "animated icon", "animate this icon", "make the bell/heart/menu icon animate on hover", "aggiungi un'icona animata", or wants an icon micro-interaction. Refuses outside Next.js web — for React Native use `rn-animations-gestures`. Not for: static icons, a whole motion system (`transitions`), or installing the runtime itself (`module-add motion`)./app-securityCheck whether an app's own code can be attacked before it ships — vulnerable dependencies, secrets in the code and in git history, Next.js authorization gaps (Server Actions and route handlers without a session check, queries by id with no owner filter — IDOR), data over-exposure, secrets in public env vars, raw SQL — then read the flagged code against an OWASP checklist, with an opt-in dynamic level (Strix) that proves exploits against the app running locally. The fifth pre-deploy gate, beside compliance-audit, vercel-doctor, shadscan and launch-audit; reports and routes, never blocks. Triggers: "security review", "è sicura l'app?", "controllo di sicurezza prima del deploy", "IDOR", "secrets in the repo", "pentest". Not for: GDPR and legal (compliance-audit), UI quality (shadscan), cost (vercel-doctor), launch readiness (launch-audit), a review of one branch diff (Claude Code's /security-review), third-party registry code (registry-intake).npx claudepluginhub lukedj78/dev-flow --plugin dev-flow