Game Tileset Generator
Overview
This skill turns a user request into an atlas-based tileset that can move through a stable production flow.
Dependencies
Required:
- the installed
imagegen skill
- a runnable Python interpreter
- Pillow
Notes:
$imagegen is used for all image generation in this skill
- a runnable Python interpreter runs the prepare, extract, validate, and compose scripts
- Pillow is required by those scripts for image read, crop, resize, QA, and atlas composition
If any dependency is missing:
- stop the skill flow
- tell the user which dependency is missing
- suggest how to install or enable it
Spec Confirmation
Turn the user request into a proposed spec, then normalize the approved version into tileset_spec.json.
Do not ask the user to define the whole spec from scratch.
Start from the user request, infer a reasonable proposal, then ask the user to confirm or adjust it.
Confirmation gate:
- do not start
prepare_tileset_spec.py, prepare_tileset_run.py, generation, or any downstream script until the user has explicitly approved the full proposed spec
- if the user changes one or more items, restate the full current proposal and wait again
- a partial adjustment is not final approval by itself
- only proceed after the user gives a clear affirmative go-ahead that means the spec is approved and generation may start
- examples:
go ahead, looks good, generate it, approved, start generation
- if the reply does not clearly mean approval to start, the flow is still in confirmation
- before asking for approval, include your recommendation for each key item and explain the tradeoff briefly
Confirm these items:
- tile size
common sizes:
16x16, 32x32, 64x64, 128x128
suggest a default based on the user's target style and detail level
means the pixel size of one tile
affects how much detail each tile can carry and the final atlas size
- pixel style
options:
full or partial
full means each tile fills its assigned area edge-to-edge
partial means artwork uses only part of the assigned area and keeps empty space around it
affects prompt wording, layout guide style, extraction rules, and QA rules
recommendation: usually use full for terrain, and partial for placed-object
- view
options:
top-down, three-quarter, side-view, front-view, isometric
means the gameplay camera angle the tileset is drawn for
mainly affects generation prompt wording and how objects should be drawn to read correctly in-game
- object layout size
means how many objects go into one atlas, which objects they are, and how many tiles each object occupies
default object size:
1x1
also supports MxN, such as 2x1 or 2x2
affects sheet size, atlas aspect ratio, extraction size, and final composition
- atlas content
means what this atlas should contain
options:
terrain, placed-object
also includes the concrete object list for that atlas
affects prompt content, object layout, extraction targets, and final atlas contents
- repeatability
options:
none, both, horizontal, vertical
means whether a tile should look seamless when repeated
affects prompt wording and seam QA checks
If information is missing:
- ask follow-up questions until the missing choice is clear
- give a suggested default first, then ask for confirmation or adjustment
- use plain language first, then include the spec term
- explain what each choice changes
- give a recommendation when one choice is more suitable
- avoid silently filling critical choices when they change prompt, layout, extraction, or QA behavior
Hard constraints:
- one atlas uses one pixel style
- one atlas uses one view
- one atlas uses one atlas content type
- one atlas uses one span convention
- one atlas uses one repeatability convention
Storage
The run directory stores one execution of the flow.
Storage rules:
- default run directory:
./game-tileset-generator/<run-name>
- allow user-specified run directories
- do not default to the installed skill directory
- keep all stage artifacts inside the run directory
Recommended run layout:
<run-dir>/
├── request.json
├── tileset_spec.json
├── imagegen-jobs.json
├── references/
│ ├── imagegen-request.json
│ └── layout-guide.png
├── decoded/
│ └── atlas-candidate.png
├── qa/
│ ├── candidate-review.json
│ └── review.json
├── tiles/
│ ├── object-a.png
│ └── ...
├── final/
│ └── atlas.png
Workflow
Overview:
request -> spec -> derived references -> generation -> candidate validation -> extraction -> tile validation -> composition -> delivery
Default workflow:
Confirm dependencies, atlas spec, and run directory.
Input: user request, active environment
Output: confirmed execution conditions
Action: stop early if imagegen, Python, or Pillow is missing.
Turn the user request into a proposed spec.
Input: user request
Output: AI-authored proposed spec
Action: infer a reasonable proposal first, give recommendations for the key atlas settings and atlas content, then ask the user to confirm or adjust them.
Wait for explicit user approval of the full proposed spec.
Input: AI-authored proposed spec, user feedback
Output: approved spec
Action: if the user changes any item, restate the full current proposal and wait again. Do not start scripts yet. Only a clear affirmative go-ahead counts as approval.
Normalize the approved spec into tileset_spec.json.
Input: approved spec
Output: tileset_spec.json
Script: scripts/prepare_tileset_spec.py
Action: reject invalid combinations before any generation starts.
Prepare the run directory.
Input: tileset_spec.json, optional request.json
Output: run folder, imagegen-jobs.json
Script: scripts/prepare_tileset_run.py
Action: create the standard run structure and write the files later stages expect.
Derive generation references from the spec.
Input: tileset_spec.json
Output: references/layout-guide.png, references/imagegen-request.json
Scripts: scripts/render_layout_guide.py, scripts/render_generation_prompt.py, scripts/prepare_imagegen_handoff.py
Action: keep layout, prompt, and imagegen request aligned to the same spec.
Dispatch generation work.
Input: imagegen-jobs.json, references/imagegen-request.json, references/layout-guide.png
Output: one or more worker outputs
Tool: $imagegen
Action: use the layout guide as a real reference image, not just a file path mention. After choosing one output, return its local path immediately.
Record the selected generation output into the run directory.
Input: selected worker image path
Output: updated imagegen-jobs.json, decoded/atlas-candidate.png
Script: scripts/complete_tileset_job.py
Action: copy the chosen result into the standard decoded path immediately after generation, then continue. Use --run-postprocess when the parent wants one command for record + serialized postprocess.
Run deterministic postprocess in one serialized call.
Input: tileset_spec.json, decoded/atlas-candidate.png
Output: qa/candidate-review.json, tiles/*.png, qa/review.json, final/atlas.png
Script: scripts/process_tileset_run.py
Action: this is the only parent entrypoint for postprocess. Do not start candidate validation, extraction, tile validation, or composition as separate parallel commands.
Validate the generated candidate before extraction.
Input: tileset_spec.json, decoded/atlas-candidate.png
Output: qa/candidate-review.json
Script: scripts/validate_full_candidate.py or scripts/validate_partial_candidate.py
Action: reject candidates whose overall atlas geometry does not match the spec closely enough.
Extract normalized tiles from the accepted candidate.
Input: tileset_spec.json, decoded/atlas-candidate.png
Output: tiles/*.png, extraction manifest
Script: scripts/extract_full_tiles.py or scripts/extract_partial_tiles.py
Action: crop by spec layout, then normalize each object footprint into its target size.
Validate extracted tiles.
Input: tileset_spec.json, tiles/*.png
Output: qa/review.json
Script: scripts/validate_full_atlas.py or scripts/validate_partial_atlas.py
Action: run deterministic tile checks before atlas composition.
Compose the final atlas.
Input: tileset_spec.json, validated tiles
Output: final/atlas.png
Script: scripts/compose_full_atlas.py or scripts/compose_partial_atlas.py
Action: compose only after validation passes.
Deliver or iterate.
Input: qa/candidate-review.json, qa/review.json, final/atlas.png
Output: finished atlas or another generation attempt
Action: if QA fails, revise the spec or regenerate; if QA passes, deliver the final atlas and run artifacts.
Workers Delegation
Main flow responsibilities:
- prepare and normalize the spec
- prepare the run folder
- derive layout and prompt references
- dispatch workers
- copy selected generation output into
decoded/
- run
scripts/process_tileset_run.py
- decide whether repair is needed
Worker responsibilities:
- generation worker runs
$imagegen from derived references
- generation worker selects one candidate output
- visual QA worker checks generated imagery for layout and obvious failures
Worker rules:
- one generation worker per atlas-generation job
- workers do not rewrite the production spec
- workers do not write downstream production outputs outside the assigned job
- the parent inspects QA artifacts, not every raw candidate
Worker return format:
selected_source=<worker-local-path-to-selected-output.png>
qa_note=<one sentence>
Generation worker prompt:
Generate one tileset atlas candidate.
Run directory: <run-dir>
Spec: <run-dir>/tileset_spec.json
Imagegen request: <run-dir>/references/imagegen-request.json
Before calling $imagegen, load the layout guide image into the worker context and attach it as a real reference image.
Use $imagegen. Follow the merged request and attached layout guide. Do not continue without the attached guide. Pick one output.
Return exactly:
selected_source=<worker-local-path-to-selected-output.png>
qa_note=<one sentence>
Visual QA worker prompt:
Review one generated tileset artifact.
Run directory: <run-dir>
Spec: <run-dir>/tileset_spec.json
Target image: <path-to-image-under-review>
Check layout adherence, missing tiles, visible guide marks, border artifacts, and obvious style or layout failures.
Return exactly:
qa_status=pass|fail
qa_note=<one sentence>
Tileset Rules
Supported pixel styles:
Atlas-wide rules:
- one atlas uses one pixel style
- one atlas uses one view
- one atlas uses one atlas content type
- one atlas uses one span convention
- one atlas uses one repeatability convention
- prompt, layout, extract, and QA rules all derive from the spec
full rules:
- each object fills its assigned footprint edge-to-edge
- repeatable tiles should tile cleanly in their declared directions
- candidate atlas geometry must match the spec closely enough before extraction
- reject square or portrait candidates when the spec expects a landscape atlas
- reject candidates whose cells do not read as square
partial rules:
- use
chroma_key for non-art background where required
- preserve safe area around smaller objects
- keep artwork inside the assigned footprint
- convert the chroma-key background to transparency during extraction
- remove chroma spill from semi-transparent edges during extraction
Prompt derivation rules:
- generate prompt text from the spec
- generate negative constraints from pixel style
full and partial use different negative constraints
- layout guide and prompt must describe the same sheet geometry
QA rules:
- the spec defines what is checked
- scripts implement the checks
- visual workers handle non-deterministic visual review
Current full QA checks:
- candidate atlas aspect ratio before extraction
- candidate cell aspect ratio before extraction
- expected tile size
- unexpected transparency
- seam continuity based on
repeatability
Current partial QA checks:
- candidate atlas aspect ratio before extraction
- candidate cell aspect ratio before extraction
- expected tile size
- non-empty visible pixels
- transparency preserved after chroma-key removal
- no chroma-key fringe or purple spill on semi-transparent edges
1---2name: game-tileset-generator3description: Turn user intent into atlas-based game tilesets through a production spec, layout-guided image generation, and deterministic postprocess stages.4---56# Game Tileset Generator78## Overview910This skill turns a user request into an atlas-based tileset that can move through a stable production flow.1112## Dependencies1314Required:15- the installed `imagegen` skill16- a runnable Python interpreter17- Pillow1819Notes:20- `$imagegen` is used for all image generation in this skill21- a runnable Python interpreter runs the prepare, extract, validate, and compose scripts22- Pillow is required by those scripts for image read, crop, resize, QA, and atlas composition2324If any dependency is missing:25- stop the skill flow26- tell the user which dependency is missing27- suggest how to install or enable it2829## Spec Confirmation3031Turn the user request into a proposed spec, then normalize the approved version into `tileset_spec.json`.3233Do not ask the user to define the whole spec from scratch.34Start from the user request, infer a reasonable proposal, then ask the user to confirm or adjust it.3536Confirmation gate:37- do not start `prepare_tileset_spec.py`, `prepare_tileset_run.py`, generation, or any downstream script until the user has explicitly approved the full proposed spec38- if the user changes one or more items, restate the full current proposal and wait again39- a partial adjustment is not final approval by itself40- only proceed after the user gives a clear affirmative go-ahead that means the spec is approved and generation may start41- examples: `go ahead`, `looks good, generate it`, `approved, start generation`42- if the reply does not clearly mean approval to start, the flow is still in confirmation43- before asking for approval, include your recommendation for each key item and explain the tradeoff briefly4445Confirm these items:46- tile size47 common sizes: `16x16`, `32x32`, `64x64`, `128x128`48 suggest a default based on the user's target style and detail level49 means the pixel size of one tile50 affects how much detail each tile can carry and the final atlas size51- pixel style52 options: `full` or `partial`53 `full` means each tile fills its assigned area edge-to-edge54 `partial` means artwork uses only part of the assigned area and keeps empty space around it55 affects prompt wording, layout guide style, extraction rules, and QA rules56 recommendation: usually use `full` for `terrain`, and `partial` for `placed-object`57- view58 options: `top-down`, `three-quarter`, `side-view`, `front-view`, `isometric`59 means the gameplay camera angle the tileset is drawn for60 mainly affects generation prompt wording and how objects should be drawn to read correctly in-game61- object layout size62 means how many objects go into one atlas, which objects they are, and how many tiles each object occupies63 default object size: `1x1`64 also supports `MxN`, such as `2x1` or `2x2`65 affects sheet size, atlas aspect ratio, extraction size, and final composition66- atlas content67 means what this atlas should contain68 options: `terrain`, `placed-object`69 also includes the concrete object list for that atlas70 affects prompt content, object layout, extraction targets, and final atlas contents71- repeatability72 options: `none`, `both`, `horizontal`, `vertical`73 means whether a tile should look seamless when repeated74 affects prompt wording and seam QA checks7576If information is missing:77- ask follow-up questions until the missing choice is clear78- give a suggested default first, then ask for confirmation or adjustment79- use plain language first, then include the spec term80- explain what each choice changes81- give a recommendation when one choice is more suitable82- avoid silently filling critical choices when they change prompt, layout, extraction, or QA behavior8384Hard constraints:85- one atlas uses one pixel style86- one atlas uses one view87- one atlas uses one atlas content type88- one atlas uses one span convention89- one atlas uses one repeatability convention9091## Storage9293The run directory stores one execution of the flow.9495Storage rules:96- default run directory: `./game-tileset-generator/<run-name>`97- allow user-specified run directories98- do not default to the installed skill directory99- keep all stage artifacts inside the run directory100101Recommended run layout:102103```text104<run-dir>/105├── request.json106├── tileset_spec.json107├── imagegen-jobs.json108├── references/109│ ├── imagegen-request.json110│ └── layout-guide.png111├── decoded/112│ └── atlas-candidate.png113├── qa/114│ ├── candidate-review.json115│ └── review.json116├── tiles/117│ ├── object-a.png118│ └── ...119├── final/120│ └── atlas.png121```122123## Workflow124125Overview:126127`request -> spec -> derived references -> generation -> candidate validation -> extraction -> tile validation -> composition -> delivery`128129Default workflow:1301311. Confirm dependencies, atlas spec, and run directory.132Input: user request, active environment133Output: confirmed execution conditions134Action: stop early if `imagegen`, Python, or Pillow is missing.1351362. Turn the user request into a proposed spec.137Input: user request138Output: AI-authored proposed spec139Action: infer a reasonable proposal first, give recommendations for the key atlas settings and atlas content, then ask the user to confirm or adjust them.1401413. Wait for explicit user approval of the full proposed spec.142Input: AI-authored proposed spec, user feedback143Output: approved spec144Action: if the user changes any item, restate the full current proposal and wait again. Do not start scripts yet. Only a clear affirmative go-ahead counts as approval.1451464. Normalize the approved spec into `tileset_spec.json`.147Input: approved spec148Output: `tileset_spec.json`149Script: `scripts/prepare_tileset_spec.py`150Action: reject invalid combinations before any generation starts.1511525. Prepare the run directory.153Input: `tileset_spec.json`, optional `request.json`154Output: run folder, `imagegen-jobs.json`155Script: `scripts/prepare_tileset_run.py`156Action: create the standard run structure and write the files later stages expect.1571586. Derive generation references from the spec.159Input: `tileset_spec.json`160Output: `references/layout-guide.png`, `references/imagegen-request.json`161Scripts: `scripts/render_layout_guide.py`, `scripts/render_generation_prompt.py`, `scripts/prepare_imagegen_handoff.py`162Action: keep layout, prompt, and imagegen request aligned to the same spec.1631647. Dispatch generation work.165Input: `imagegen-jobs.json`, `references/imagegen-request.json`, `references/layout-guide.png`166Output: one or more worker outputs167Tool: `$imagegen`168Action: use the layout guide as a real reference image, not just a file path mention. After choosing one output, return its local path immediately.1691708. Record the selected generation output into the run directory.171Input: selected worker image path172Output: updated `imagegen-jobs.json`, `decoded/atlas-candidate.png`173Script: `scripts/complete_tileset_job.py`174Action: copy the chosen result into the standard decoded path immediately after generation, then continue. Use `--run-postprocess` when the parent wants one command for record + serialized postprocess.1751769. Run deterministic postprocess in one serialized call.177Input: `tileset_spec.json`, `decoded/atlas-candidate.png`178Output: `qa/candidate-review.json`, `tiles/*.png`, `qa/review.json`, `final/atlas.png`179Script: `scripts/process_tileset_run.py`180Action: this is the only parent entrypoint for postprocess. Do not start candidate validation, extraction, tile validation, or composition as separate parallel commands.18118210. Validate the generated candidate before extraction.183Input: `tileset_spec.json`, `decoded/atlas-candidate.png`184Output: `qa/candidate-review.json`185Script: `scripts/validate_full_candidate.py` or `scripts/validate_partial_candidate.py`186Action: reject candidates whose overall atlas geometry does not match the spec closely enough.18718811. Extract normalized tiles from the accepted candidate.189Input: `tileset_spec.json`, `decoded/atlas-candidate.png`190Output: `tiles/*.png`, extraction manifest191Script: `scripts/extract_full_tiles.py` or `scripts/extract_partial_tiles.py`192Action: crop by spec layout, then normalize each object footprint into its target size.19319412. Validate extracted tiles.195Input: `tileset_spec.json`, `tiles/*.png`196Output: `qa/review.json`197Script: `scripts/validate_full_atlas.py` or `scripts/validate_partial_atlas.py`198Action: run deterministic tile checks before atlas composition.19920013. Compose the final atlas.201Input: `tileset_spec.json`, validated tiles202Output: `final/atlas.png`203Script: `scripts/compose_full_atlas.py` or `scripts/compose_partial_atlas.py`204Action: compose only after validation passes.20520614. Deliver or iterate.207Input: `qa/candidate-review.json`, `qa/review.json`, `final/atlas.png`208Output: finished atlas or another generation attempt209Action: if QA fails, revise the spec or regenerate; if QA passes, deliver the final atlas and run artifacts.210211## Workers Delegation212213Main flow responsibilities:214- prepare and normalize the spec215- prepare the run folder216- derive layout and prompt references217- dispatch workers218- copy selected generation output into `decoded/`219- run `scripts/process_tileset_run.py`220- decide whether repair is needed221222Worker responsibilities:223- generation worker runs `$imagegen` from derived references224- generation worker selects one candidate output225- visual QA worker checks generated imagery for layout and obvious failures226227Worker rules:228- one generation worker per atlas-generation job229- workers do not rewrite the production spec230- workers do not write downstream production outputs outside the assigned job231- the parent inspects QA artifacts, not every raw candidate232233Worker return format:234- `selected_source=<worker-local-path-to-selected-output.png>`235- `qa_note=<one sentence>`236237Generation worker prompt:238239```text240Generate one tileset atlas candidate.241242Run directory: <run-dir>243Spec: <run-dir>/tileset_spec.json244Imagegen request: <run-dir>/references/imagegen-request.json245246Before calling $imagegen, load the layout guide image into the worker context and attach it as a real reference image.247Use $imagegen. Follow the merged request and attached layout guide. Do not continue without the attached guide. Pick one output.248249Return exactly:250selected_source=<worker-local-path-to-selected-output.png>251qa_note=<one sentence>252```253254Visual QA worker prompt:255256```text257Review one generated tileset artifact.258259Run directory: <run-dir>260Spec: <run-dir>/tileset_spec.json261Target image: <path-to-image-under-review>262263Check layout adherence, missing tiles, visible guide marks, border artifacts, and obvious style or layout failures.264265Return exactly:266qa_status=pass|fail267qa_note=<one sentence>268```269270## Tileset Rules271272Supported pixel styles:273- `full`274- `partial`275276Atlas-wide rules:277- one atlas uses one pixel style278- one atlas uses one view279- one atlas uses one atlas content type280- one atlas uses one span convention281- one atlas uses one repeatability convention282- prompt, layout, extract, and QA rules all derive from the spec283284`full` rules:285- each object fills its assigned footprint edge-to-edge286- repeatable tiles should tile cleanly in their declared directions287- candidate atlas geometry must match the spec closely enough before extraction288- reject square or portrait candidates when the spec expects a landscape atlas289- reject candidates whose cells do not read as square290291`partial` rules:292- use `chroma_key` for non-art background where required293- preserve safe area around smaller objects294- keep artwork inside the assigned footprint295- convert the chroma-key background to transparency during extraction296- remove chroma spill from semi-transparent edges during extraction297298Prompt derivation rules:299- generate prompt text from the spec300- generate negative constraints from pixel style301- `full` and `partial` use different negative constraints302- layout guide and prompt must describe the same sheet geometry303304QA rules:305- the spec defines what is checked306- scripts implement the checks307- visual workers handle non-deterministic visual review308309Current `full` QA checks:310- candidate atlas aspect ratio before extraction311- candidate cell aspect ratio before extraction312- expected tile size313- unexpected transparency314- seam continuity based on `repeatability`315316Current `partial` QA checks:317- candidate atlas aspect ratio before extraction318- candidate cell aspect ratio before extraction319- expected tile size320- non-empty visible pixels321- transparency preserved after chroma-key removal322- no chroma-key fringe or purple spill on semi-transparent edges