screen2layers
Skill1 starsChanged 53 days agoMITView on GitHub
Convert UI screenshots or generated game UI effect images into Figma-ready layered design kits. Use when the user asks to split a flat PNG/JPG UI screenshot into editable or movable assets, make something "like SVG layers", create transparent UI slices, generate a Figma importable SVG layout, extract UI panels/buttons/cards from a screenshot, or build a screen-to-layers kit for game UI, app UI, mockups, or image-to-design workflows.
In this repository20 other files it gives its agents.
- llms.txtllms.txt
- agent-skill-migrationSkill
- agents-md-verification-mapSkill
- cocos-creator-mobile-gameSkill
- game-entity-movement-presentationSkill
- game-event-directorSkill
- game-ui-panelsSkill
- godot-narrative-workflowSkill
- narrative-game-prototype-plannerSkill
- obsidian-article-writebackSkill
- offline-ux-kitSkill
- product-image-prompt-iterationSkill
- product-teardownSkill
- reporting-disciplineSkill
- scene-anchor-systemSkill
- sol-luna-local-parallelSkill
- sprite-atlas-slicerSkill
- unfinished-work-auditSkill
- windows-ai-cli-recoverySkill
- xiaohongshu-copywriterSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to turn a flat UI screenshot into a practical layered kit for Figma or game UI production.
- Distinctive: line 22
Run the bundled script:
- Very specific: line 30
Use the Codex bundled Python if system python is unavailable:
- Distinctive: line 40
If the auto split misses pieces or groups too much together, create a manual boxes file and rerun:
- Distinctive: line 56
Use manual boxes when the screenshot has complex illustration, dense text, or generated UI where auto-detection is noisy.
- Very specific: line 75
Use imagegen to remove UI and produce background_clean.png.
- Very specific: line 76
Run screen2layers.py on the original screenshot to extract foreground slices.
- Very specific: line 91
Read references/output-format.md when you need exact output details or examples of Figma import behavior.
≈ “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
screen2layers
Use this skill to turn a flat UI screenshot into a practical layered kit for Figma or game UI production.
It does not recover true original vector layers from a raster image. It reconstructs a usable kit:
background_working.png: screenshot with detected UI regions softly filled or blurred as a rough background plate.slices/*.png: independent cropped UI pieces with transparent canvas padding.layout.svg: Figma-importable layout that places the background and slices at their original coordinates.manifest.json: coordinates, sizes, names, and type guesses for every layer.preview.html: browser preview of the reconstructed stack.debug/detected_boxes.png: visual QA overlay for detected slices.
Quick Workflow
- Locate the input screenshot. Prefer the highest-resolution PNG available.
- Run the bundled script:
& "<python>" "<skill>/scripts/screen2layers.py" `
"path/to/screen.png" `
--out "path/to/screen2layers-output"Use the Codex bundled Python if system python is unavailable:
& "python" `
"~/.codex/skills\screen2layers\scripts\screen2layers.py" `
"path/to/screen.png" `
--out "path/to/screen2layers-output"- Inspect
debug/detected_boxes.pngandpreview.html. - If the auto split misses pieces or groups too much together, create a manual boxes file and rerun:
& "<python>" "<skill>/scripts/screen2layers.py" `
"path/to/screen.png" `
--out "path/to/screen2layers-output-v2" `
--boxes "path/to/boxes.json"- Import into Figma:
- Drag
layout.svginto Figma for a positioned layer stack. - Or drag
background_working.pngplus individualslices/*.png. - Recreate text as Figma/Cocos text layers when precision matters.
- Drag
Manual Boxes
Use manual boxes when the screenshot has complex illustration, dense text, or generated UI where auto-detection is noisy.
Format:
[
{"name": "top_hud", "type": "hud", "x": 86, "y": 210, "w": 910, "h": 96},
{"name": "letter_card_highschool", "type": "card", "x": 124, "y": 1120, "w": 380, "h": 430}
]Coordinates are pixels in the input image. The script clips boxes to image bounds and writes one slice per box.
Use Image Generation For Clean Backgrounds
The script's background is a working plate, not a perfect inpaint. If the user needs a polished background with UI removed, use imagegen first to create a clean background plate, then use screen2layers for the foreground UI pieces.
Recommended pipeline for polished game UI:
- Use
imagegento remove UI and producebackground_clean.png. - Run
screen2layers.pyon the original screenshot to extract foreground slices. - Replace
background_working.pngin the output withbackground_clean.png. - Open
layout.svgorpreview.htmland verify alignment.
Quality Bar
Before delivering:
- Confirm
layout.svg,manifest.json,preview.html, and at least one slice exist. - Open or inspect
debug/detected_boxes.png. - Mention that raster slices are movable in Figma but are not true editable vector primitives.
- Recommend manually rebuilding text in Figma/Cocos if the screenshot text must be editable.
References
Read references/output-format.md when you need exact output details or examples of Figma import behavior.
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.

