palette-enforcer
Skill4 starsChanged 7 months agoMITView on GitHub
Quantizes all generated PNG assets (sprites, tiles, background) to a named 8-bit color palette to achieve visual coherence. Run after sprite-artist, tile-artist, and bg-artist, before codesmith. Writes state.style.palette so downstream skills know the chosen palette.
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
- parallel-qa-orchestraSkill
- physics-debug-validatorSkill
- pixel-action-adventureSkill
- playtesterSkill
- refinerSkill
- rpg-overworldSkill
- sprite-artistSkill
- tile-artistSkill
- world-architectSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
After all art generation (sprite-artist, tile-artist, bg-artist) and before codesmith.
- Very specific: line 26
All PNGs in public/assets/ are overwritten in-place with palette-quantized versions.
≈ “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
Palette Enforcer — Visual Coherence
Applies color palette constraints to all generated PNG assets so every sprite, tile, and background shares the same enumerated color set. Without this, GPT Image 2 returns arbitrary colors and assets from the same game look like they came from different games.
When to use
After all art generation (sprite-artist, tile-artist, bg-artist) and before codesmith. Also run if the user says "make the art more cohesive" or "unify the palette."
Palettes available
| ID | Colors | Best for |
sweetie-16 | 16 | Default — friendly, any genre |
pico8 | 16 | Bold retro, shoot-em-ups, platformers |
endesga-32 | 32 | RPGs, dungeon crawlers, rich detail |
gameboy | 4 | Maximum constraint, mono-theme games |
nes | 16 | Classic NES aesthetic |
Output contract
- All PNGs in
public/assets/are overwritten in-place with palette-quantized versions. game-state.jsongainsstate.style.palettewith the chosen palette ID.- Transparent pixels (alpha < 128) are preserved; only opaque pixels are quantized.
- The magenta chroma-key background (#FF00FF) is kept as-is — it's stripped later at runtime.
// game-state.json after running
{
"style": {
"palette": "sweetie-16"
}
}Process
- Choose palette: use
--palette <id>arg, or auto-select based on genre:platformer/action-platformer→pico8top-down-rpg/dungeon-crawler→endesga-32shoot-em-up→pico8- default →
sweetie-16
- Run
scripts/enforce_palette.mjs <project-dir> [--palette <id>] - Script processes all PNGs found in
public/assets/and writes them back. - Writes
state.style.palettetogame-state.json.
Scripts
scripts/enforce_palette.mjs <project-dir> [--palette <id>]— quantize all assets.
References
references/palettes.json— all palette definitions with hex color arrays.
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.

