world-architect
Skill4 starsChanged 7 months agoMITView on GitHub
Designs tile-based levels for a Phaser game using only the tile IDs and entity IDs from the GDD. Outputs a JSON array of level objects (tilemap + spawns + goal). Use after game-designer has produced a valid GDD and the orchestrator needs level data.
- Reads credentials
In this repository22 other files it gives its agents.
- action-platformerSkill
- audio-composerSkill
- beat-em-upSkill
- bg-artistSkill
- codesmithSkill
- game-designerSkill
- gameforgeSkill
- gap-checkerSkill
- iso-city-builderSkill
- iso-living-worldSkill
- manifest-auditorSkill
- mobile-compat-checkerSkill
- multiplayerSkill
- palette-enforcerSkill
- parallel-qa-orchestraSkill
- physics-debug-validatorSkill
- pixel-action-adventureSkill
- playtesterSkill
- refinerSkill
- rpg-overworldSkill
- sprite-artistSkill
- tile-artistSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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 12
After game-designer produces a valid GDD.
- Very specific: line 34
All tile values are integer indices into gdd.tilesetPalette (0-based).
- Distinctive: line 36
All other spawns on passable tiles.
- Very specific: line 45
Read the GDD from game-state.json.
- Distinctive: line 47
Start with the impassable border, then carve out walkable interior, then place obstacles, then place spawns, then place goal.
- Very specific: line 48
Run scripts/validate_levels.mjs <levels-file> <gdd-file> before returning.
- Very specific: line 54
Every tile value in [0, palette.length).
- Distinctive: line 56
All spawn coordinates within bounds and on passable tiles.
≈ “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
World Architect
Builds levels for the Phaser tilemap loader. Inputs a GDD, outputs a JSON array of levels.
When to use
After game-designer produces a valid GDD. The orchestrator passes the GDD; you produce levels.json.
Output contract
Single JSON array. Each element:
{
"id": "<e.g. '1-1'>",
"theme": "<matches gdd.levelHints.themes[i]>",
"size": [<width>, <height>], // tiles, must match levelHints.size
"tiles": number[][], // 2D array of palette indices, [row][col]
"spawns": [
{ "entity": "<ENTITY_ID>", "x": <col>, "y": <row>, "facing"?: "up"|"down"|"left"|"right" }
],
"goal": { "kind": "tile" | "entity", "x"?: <col>, "y"?: <row>, "entityId"?: "<ID>" }
}Hard constraints
tiles[][]dimensions matchsize. Outer rings are impassable tiles.- All tile values are integer indices into
gdd.tilesetPalette(0-based). - Exactly one player spawn per level, on a passable tile, not overlapping any other spawn.
- All other spawns on passable tiles.
- Coordinates:
(x = column, y = row), origin top-left. - Platformer: bottom row solid (impassable). Player one tile above the floor. Sprinkle 2-4 floating platforms.
- Top-down: open rooms with wall obstacles. Corridors ≥ 2 tiles wide.
- 2-6 enemies per level.
goal: ifkind === "tile", must be reachable from spawn; ifkind === "entity", that entity must be inspawns.
Process
- Read the GDD from
game-state.json. - For each
levelHints.themes[i](orcountif no themes), build one level. - Start with the impassable border, then carve out walkable interior, then place obstacles, then place spawns, then place goal.
- Run
scripts/validate_levels.mjs <levels-file> <gdd-file>before returning. - Save to
game-state.jsonunderlevels, also writepublic/data/levels.json.
Validation rules (encoded in scripts/validate_levels.mjs)
tiles.length === size[1]and every row's length ===size[0].- Every tile value in
[0, palette.length). - Exactly one player spawn per level, on a passable tile.
- All spawn coordinates within bounds and on passable tiles.
- Border ring is impassable.
- For platformer:
tiles[height-1][*]all impassable.
Examples
See references/level-examples.md for a 16×12 top-down level and a 22×12 platformer level (used by the playtester fixtures).
NPC dialogue (RPG genre)
For top-down-rpg games, after levels are written, run the NPC dialogue generator. It reads NPC entity personality fields from the GDD and generates 6-8 dialogue lines per NPC using Claude Haiku, writing them to public/data/npc-dialogue.json:
node --env-file=~/.all-skills/.env scripts/gen_npc_dialogue.mjs <project-dir>Game.js loads this file at runtime and falls back to built-in lines if absent. The personality block on each NPC entity drives the dialogue style — ensure the game-designer includes it for best results.
Scripts
scripts/validate_levels.mjs <levels-file> <gdd-file>— fails non-zero with reason if invalid.scripts/gen_npc_dialogue.mjs <project-dir>— generates NPC dialogue from personality (RPG).
References
references/level-schema.json— JSON Schema.references/level-examples.md— one level per genre with annotation.
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.

