agentleFS
Fable-ForgeFable-Forge/fableforge-agent-skills/skills/screen2layers/SKILL.md

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.

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
  1. Distinctive:

    Use this skill to turn a flat UI screenshot into a practical layered kit for Figma or game UI production.

    line 8
  2. Distinctive:

    Run the bundled script:

    line 22
  3. Very specific:

    Use the Codex bundled Python if system python is unavailable:

    line 30
  4. Distinctive:

    If the auto split misses pieces or groups too much together, create a manual boxes file and rerun:

    line 40
  5. Distinctive:

    Use manual boxes when the screenshot has complex illustration, dense text, or generated UI where auto-detection is noisy.

    line 56
  6. Very specific:

    Use imagegen to remove UI and produce background_clean.png.

    line 75
  7. Very specific:

    Run screen2layers.py on the original screenshot to extract foreground slices.

    line 76
  8. Very specific:

    Read references/output-format.md when you need exact output details or examples of Figma import behavior.

    line 91

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Locate the input screenshot. Prefer the highest-resolution PNG available.
  2. 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"
  1. Inspect debug/detected_boxes.png and preview.html.
  2. 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"
  1. Import into Figma:
    • Drag layout.svg into Figma for a positioned layer stack.
    • Or drag background_working.png plus individual slices/*.png.
    • Recreate text as Figma/Cocos text layers when precision matters.

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:

  1. Use imagegen to remove UI and produce background_clean.png.
  2. Run screen2layers.py on the original screenshot to extract foreground slices.
  3. Replace background_working.png in the output with background_clean.png.
  4. Open layout.svg or preview.html and 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.