agentleFS
Ar9avAr9av/game-exa/skills/palette-enforcer/SKILL.md

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.

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

    After all art generation (sprite-artist, tile-artist, bg-artist) and before codesmith.

    line 12
  2. Very specific:

    All PNGs in public/assets/ are overwritten in-place with palette-quantized versions.

    line 26

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

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

IDColorsBest for
sweetie-1616Default — friendly, any genre
pico816Bold retro, shoot-em-ups, platformers
endesga-3232RPGs, dungeon crawlers, rich detail
gameboy4Maximum constraint, mono-theme games
nes16Classic NES aesthetic

Output contract

  • All PNGs in public/assets/ are overwritten in-place with palette-quantized versions.
  • game-state.json gains state.style.palette with 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

  1. Choose palette: use --palette <id> arg, or auto-select based on genre:
    • platformer / action-platformer → pico8
    • top-down-rpg / dungeon-crawler → endesga-32
    • shoot-em-up → pico8
    • default → sweetie-16
  2. Run scripts/enforce_palette.mjs <project-dir> [--palette <id>]
  3. Script processes all PNGs found in public/assets/ and writes them back.
  4. Writes state.style.palette to game-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.

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.