canvas-to-html
Skill1 starsChanged 15 days agoMITView on GitHub
Export one Cursor Canvas (.canvas.tsx) to a standalone static directory (index.html + local CSS/JS). Triggers canvas-to-html, export canvas to html, canvas static export.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- BitSteve/claude-skillstheir own version, first seen Jan 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- BitSteve/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- criticSkill
- human-doc-voiceSkill
- local-llmSkill
- pipelineSkill
- prompt-engineerSkill
- tool-market-scoutSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Theme: Default light. Export embeds light and dark tokens.
- Distinctive: line 27
One canvas → one output dir: No monorepo, no extra entrypoints unless asked.
- Very specific: line 57
If {OUTPUT_DIR} exists and is not empty – STOP, ask overwrite ack before Step 2.
- Distinctive: line 64
If Out-of-scope v1 without fallback – STOP.
- Very specific: line 70
Create {OUTPUT_DIR}/ per references/output-contract.md:
- Distinctive: line 90
If HTML was assembled by a one-off script with hardcoded strings (not a live transpile), copy UI copy from the current canvas first, then:
- Very specific: line 104
If sandbox blocks open – retry with full permissions.
- Very specific: line 115
Do not: use external CDNs for CSS/JS/charts.
- Distinctive: line 116
Do not: use absolute asset paths.
- Distinctive: line 119
Do not: start a local HTTP server for preview.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Canvas to HTML
Exports one Cursor Canvas (.canvas.tsx) to a standalone static directory (index.html + local CSS/JS).
{SKILL_DIR} = directory of this SKILL.md.
Scope
In: one .canvas.tsx (path or name under ~/.cursor/projects/<ws>/canvases/); map cursor/canvas SDK → HTML/CSS/JS; inline/self-hosted charts; neutral light theme
Out: editing the canvas in the IDE; generating a canvas from scratch; wiki/CMS publish; interactivity that needs Cursor runtime (useCanvasAction, fetch)
Fallback: unsupported component → STOP + unsupported list; canvas not found → ask for a path
Gotchas
- Output format. Entrypoint
index.html, asset paths only relative (./styles.css,./app.js), no absolute/foo.css. - Data inline. No
fetch(), no external CDN for JS/CSS/charts. Charts – inline SVG or self-hosted.jsin the output dir. - Theme. Default light. Export embeds light and dark tokens; a «Theme» button toggles
html[data-theme]. - Canvas runtime hooks.
useCanvasAction– drop or a static stub.useCanvasState– freeze default values from source. - SDK surface. Full API –
~/.cursor/skills-cursor/canvas/sdk/index.d.ts. In-scope v1 –references/sdk-mapping.md.computeDAGLayout→ baked SVG; other out-of-scope without fallback → STOP + ack. - One canvas → one output dir. No monorepo, no extra entrypoints unless asked.
Preconditions
- Path to
*.canvas.tsxor a canvas name (no extension) to search incanvases/. - Canvas source readable (Read).
- Read
references/sdk-mapping.mdandreferences/output-contract.md.
Failure modes
| Mode | Action |
| Canvas not found | STOP, ask for a full path |
| Read failed | STOP |
| Out-of-scope SDK without fallback | STOP, list unsupported; wait for ack on a degraded export. Exception: computeDAGLayout + custom SVG → baked coordinates (degraded OK without ack) |
{OUTPUT_DIR} exists and is not empty | STOP, ask ack to overwrite |
verify_export.sh exit ≠ 0 | STOP, fix output to the contract |
Algorithm
Step 0: Resolve input
| Input | Action |
Absolute/relative path to *.canvas.tsx | Read the file |
| Canvas name (kebab-case) | search ~/.cursor/projects/*/canvases/<name>.canvas.tsx; if several workspaces – ask |
| Not found | STOP, ask for a full path |
Lock {CANVAS_PATH}, {CANVAS_STEM}, {OUTPUT_DIR} (default .tmp/canvas-export/{CANVAS_STEM}/ or a user path).
If {OUTPUT_DIR} exists and is not empty – STOP, ask overwrite ack before Step 2.
Step 1: Analyze canvas source
Read{CANVAS_PATH}whole.- Extract inline data,
cursor/canvasimports, hooks. - Match imports to In-scope v1 in
references/sdk-mapping.md. - If Out-of-scope v1 without fallback – STOP.
Reference SDK (read-only): ~/.cursor/skills-cursor/canvas/sdk/index.d.ts.
Step 2: Generate static files
Create {OUTPUT_DIR}/ per references/output-contract.md:
{OUTPUT_DIR}/
index.html
styles.css
app.js # optional
assets/ # optionalOrder: styles.css via scripts/canvas_export_lib.py → index.html → charts as inline SVG → theme on CSS vars (do not bake hex into SVG).
Forbidden in output: absolute paths, fetch() / XHR, Cursor IDE action links, external CDNs.
Step 3: Verify
bash "{SKILL_DIR}/scripts/verify_export.sh" "{OUTPUT_DIR}"If HTML was assembled by a one-off script with hardcoded strings (not a live transpile), copy UI copy from the current canvas first, then:
python3 "{SKILL_DIR}/scripts/assert_export_matches_canvas.py" \
"{CANVAS_PATH}" "{OUTPUT_DIR}"Exit ≠ 0 → STOP. Then open preview in the system browser (do not ask):
open "{OUTPUT_DIR}/index.html" # macOS
# xdg-open "{OUTPUT_DIR}/index.html" # LinuxIf sandbox blocks open – retry with full permissions. Skipping preview = fail DoD.
Forbidden: python3 -m http.server or any local static server.
Step 4: Report
Path, file list, SDK coverage, how it was opened.
Hard Stop Rules
- Do not modify the source
.canvas.tsx. - Do not use external CDNs for CSS/JS/charts.
- Do not use absolute asset paths.
- Do not continue on unsupported SDK without fallback / ack (except baked
computeDAGLayoutSVG). - Do not overwrite a non-empty
{OUTPUT_DIR}without ack. - Do not start a local HTTP server for preview.
Definition of Done
{OUTPUT_DIR}/index.htmlexists and opens locally- Asset refs relative
- Data inline; no network calls
- In-scope v1 components mapped (or STOP with gaps)
- Light theme via CSS vars (+ dark toggle)
- Preview opened via
open/xdg-open
Check commands
SKILL_DIR="<path-to-this-skill>"
test -f "$SKILL_DIR/references/sdk-mapping.md"
test -f "$SKILL_DIR/references/output-contract.md"
test -x "$SKILL_DIR/scripts/verify_export.sh"Example
In: review.canvas.tsx in ~/.cursor/projects/…/canvases/
Out: .tmp/canvas-export/review/index.html + styles.css + inline SVG charts
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

