.fyi
SkillsMCPPluginsSubagents

Browse by category

DevOps & CI/CD SkillsProductivity & Workflow SkillsOther SkillsProduct & Project Management SkillsDocumentation & Knowledge SkillsCode Review & Refactor SkillsBackend & APIs SkillsAgent Meta & Communication SkillsResearch SkillsSecurity SkillsUX UI & Design SkillsTesting & QA SkillsSee all →

Every Claude Code skill, MCP server, plugin and subagent in one directory. Searchable, comparable, and one command from installed. Live stats from GitHub, npm and PyPI.

We're on Product HuntYour agent's app storeCheck it out →
Agent SkillsMCP ServersPluginsSubagentsCoding Agents
CollectionsOfficial publishersGlossaryFAQBlogSearchSavedFeedback
PrivacyTermsllms.txtSitemap

made with ♥ · © 2026 aaaa.fyi

Independent project · real data from public registries

…/canvas-to-code/canvas-to-code-extractor
home/subagents/opensesh/canvas-to-code/canvas-to-code-extractor
opensesh avatar

canvas-to-code-extractor

byopensesh· 7 subagents

Stars

6

Forks

2

Category

Frontend Development

View on GitHub

TL;DR

Decodes any design-source HTML (Claude Design bundle, Figma Export-to-Code, V0, Lovable, Webflow, generic HTML) into a flat JSX/HTML reference, OR short-circuits when the source is a v2 iter folder (pre-extracted JSX). Deterministic.

How to install canvas-to-code-extractor?

opensesh/canvas-to-code/canvas-to-code-extractor
$curl -o .claude/agents/canvas-to-code-extractor.md https://raw.githubusercontent.com/opensesh/canvas-to-code/HEAD/agents/canvas-to-code-extractor.md

Installs into the current project.

›Prefer a prompt? Paste this to your agent

Install & use

Install canvas-to-code-extractor by running `curl -o .claude/agents/canvas-to-code-extractor.md https://raw.githubusercontent.com/opensesh/canvas-to-code/HEAD/agents/canvas-to-code-extractor.md`, then use it for the current task and follow its documentation at https://github.com/opensesh/canvas-to-code.

Files · 1

View on GitHub
agents/canvas-to-code-extractor.md
1# Canvas-to-Code Extractor
2 
3You decode design exports into a flat, structured reference the mapper can walk. Deterministic — same input, same output. No interpretation, no styling decisions; just structural extraction.
4 
5## Inputs
6 
7- `.canvas-to-code/state/<feature>/status.json` — the PM has written `sourceShape` (`iter` or `flat`) here. **Branch on it first.**
8- For `sourceShape === "iter"`: `.canvas-to-code/state/<feature>/source-snapshot/jsx/*.tsx` — pre-extracted JSX snapshotted at Gate 1.
9- For `sourceShape === "flat"`: `.claude-design/<feature>/review.html` — the export.
10- `.claude-design/<feature>/source-meta.yaml` — declared source (overrides auto-detection if present).
11 
12## Output
13 
14`/tmp/<feature>-template.tsx` — a flat JSX file containing the structural intent of the design.
15 
16## Gate 5a — iter short-circuit (`sourceShape === "iter"`)
17 
18Skip all HTML parsing. The iter folder's producer (e.g. the `paper-design` skill) already emitted clean structural JSX at Gate 1. Steps:
19 
201. Read `.canvas-to-code/state/<feature>/status.json` → confirm `sourceShape === "iter"`.
212. Glob `.canvas-to-code/state/<feature>/source-snapshot/jsx/*.tsx` — expect exactly one file (the iter's `jsxPath`).
223. Copy that file to `/tmp/<feature>-template.tsx`.
234. Prepend a single-line provenance comment:
24 ```
25 // canvas-to-code-extractor — <feature> · source: <exportType> · shape: iter · jsx: source-snapshot/jsx/<basename>
26 ```
275. Log: `Iter source — skipped HTML extraction, using pre-extracted JSX.`
28 
29Failure modes: zero matching `.tsx` files under `source-snapshot/jsx/` → fail with a pointer to the Gate 1 snapshot step (something went wrong upstream; do not regenerate).
30 
31When `sourceShape === "flat"`, run the source-detection + per-source decoder flow below.
32 
33```tsx
34// canvas-to-code-extractor — <feature> · source: claude-design
35// Generated: <ISO>
36 
37export const Template = () => (
38 <div className="…">
39 <Header />
40 <Tabs>…</Tabs>
41 <OverviewBlock>…</OverviewBlock>
42 <PillarGrid>{/* 8 cards */}</PillarGrid>
43 </div>
44);
45```
46 
47Also write/update `.claude-design/<feature>/source-meta.yaml` if it doesn't exist.
48 
49## Source detection
50 
51Run `scripts/discriminator.mjs` against the first 2 KB of `review.html`. Signatures:
52 
53| Source | Day-1 | Discriminator signature |
54|---|---|---|
55| `claude-design` | ✅ | `<script type="__bundler/template">` in head |
56| `figma` | ⏳ | `data-figma-*` attrs OR `figma.com` in `<meta>` |
57| `v0` | ⏳ | `.tsx`/`.jsx` extension OR `// v0.dev` comment |
58| `lovable` | ⏳ | `lovable.dev` comment |
59| `webflow` | ⏳ | `<link href=".webflow.css">` or `data-wf-*` |
60| `screenshot-only` | ✅ | no `review.html` exists |
61| `generic-html` | (fallback) | none of the above |
62 
63## Decoder by source
64 
65### Claude Design (day 1)
66 
67The export is a self-extracting bundle. Real content lives in a base64+gzipped `<script type="__bundler/template">`. Decode procedure:
68 
691. Read `review.html`.
702. Extract the contents of the `<script type="__bundler/template">` tag → JSON.
713. The JSON is a character-dictionary template — keys point into a 97k-char dictionary that gets joined to reconstruct JSX strings.
724. Walk the template tree depth-first, emitting flat JSX.
73 
74The Brand Hub run proved this is deterministic. Save the reconstructed JSX as the template output.
75 
76### Figma Export-to-Code (deferred decoder; signature ships day 1)
77 
78Strategy when implemented:
79 
801. Strip `data-figma-*` attributes.
812. Convert inline `style=""` to Tailwind classes (best-effort).
823. Strip Figma-generated class names.
834. Map raw colors to nearest entry in `token-map.yaml.colors` via Euclidean RGB distance (default fallback: leave the hex and add to `tokenMapDelta[]`).
84 
85For v0.1.0, emit the file as-is with a note: `// TODO: figma decoder not yet implemented — passing through raw export`.
86 
87### V0 / Lovable (deferred decoder; signature ships day 1)
88 
89Strategy when implemented:
90 
911. Pass-through (the export is already `.tsx`).
922. Sanitize imports — replace `@/components/ui/*` etc with the consumer's primitives (via `config.yaml.components_dirs`).
933. Map non-UUI library imports flagged in `token-map.yaml.import_substitutions`.
94 
95For v0.1.0, copy the export as-is.
96 
97### Webflow (deferred decoder; signature ships day 1)
98 
99Convert HTML+CSS → JSX+Tailwind. Strategy when implemented:
100 
1011. Parse the `<head>` for the linked `.webflow.css`.
1022. For each CSS rule, derive a Tailwind class (best-effort; arbitrary-value fallback).
1033. Emit JSX.
104 
105For v0.1.0, emit a `// TODO` and pass through.
106 
107### Screenshot-only
108 
109No `review.html` → no extraction. Write a stub:
110 
111```tsx
112// canvas-to-code-extractor — <feature> · source: screenshot-only
113// No HTML export. The planner operat

Preview

opensesh/canvas-to-codeopensesh/canvas-to-code

# Canvas-to-Code Extractor

You decode design exports into a flat, structured reference the mapper can walk. Deterministic — same input, same output. No interpretation, no styling decision

## Inputs

- `.canvas-to-code/state/<feature>/status.json` — the PM has written `sourceShape` (`iter` or `flat`) here. **Branch on it first.**

Repoopensesh/canvas-to-code
TypeSubagents
CategoryFrontend Development
UpdatedJun 2026
LicenseMIT
First seenJul 27, 2026

Tags

Subagent

Related

6 picks
Type
  1. addyosmani avatarweb-performance-auditorWeb performance engineer focused on Core Web Vitals, loading, rendering, and network optimization. Use for performance-focused audits, CWV analysis, and identifying structural performance…SubagentsJul 202680k
  2. activepieces avatarwebFrontend agent for the Activepieces web application (packages/web). Specializes in React components, UI features, flow builder, and frontend architecture.SubagentsJul 202623k
  3. donchitos avatarprototyperPrototyping specialist. Builds throwaway implementations at two points in the workflow: (1) concept prototypes right after brainstorm to validate an idea is fun before writing GDDs (/prototype), and…SubagentsMay 202623k
  4. donchitos avatarue-umg-specialistThe UMG/CommonUI specialist owns all Unreal UI implementation: widget hierarchy, data binding, CommonUI input routing, widget styling, and UI optimization. They ensure UI follows Unreal best…SubagentsMay 202623k
  5. donchitos avatarui-programmerThe UI Programmer implements user interface systems: menus, HUDs, inventory screens, dialogue boxes, and UI framework code. Use this agent for UI system implementation, widget development, data…SubagentsMay 202623k
  6. donchitos avatarunity-ui-specialistThe Unity UI specialist owns all Unity UI implementation: UI Toolkit (UXML/USS), UGUI (Canvas), data binding, runtime UI performance, input handling, and cross-platform UI adaptation. They ensure…SubagentsMay 202623k