Agent skill

Code-Drawn 2D Game Art

by 0x0funky in 0x0funky/agent-sprite-forge

Draws 2D game art from code with no image model: pixel sprites, SVG props and icons, rigged characters, FX, autotiles and layouts, only when explicitly asked for.

MITAuto-check passedGame Development

Install Code-Drawn 2D Game Art

skills CLI
$ npx skills add 0x0funky/agent-sprite-forge --skill codeart2d -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 0x0funky/agent-sprite-forge codeart2d --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/0x0funky/agent-sprite-forge.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codeart2d .claude/skills/codeart2d && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codeart2d
GitHub stars
4.3k
Token cost
~2.5k tokens
SKILL.md length
1,136 words
Files
45 (incl. scripts, references)
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Draws 2D game art from code with no image model: pixel sprites, SVG props and icons, rigged characters, FX, autotiles and layouts, only when explicitly asked for.

  • Works in 4 steps: Write gem.pixelspec.json (the "Hello… → python "/scripts/render_pixelspec.py"… → Open out/gem-v1/preview-x8.png; the… → …
  • You explicitly ask for sprites or props drawn in code rather than by an image model
  • SKILL.md covers Use when, Do not use when, Capability check (once per… and Art source, plus 6 more sections
  • Calls python and node

What it does

This is an explicit-only last resort. The agent writes the art as text (PixelSpec JSON, portable SVG, rigs, FX, material, layout and parallax specs) and scripts render, check and package it, so no image model is involved. It applies when you ask for code-drawn art, or when the media router script route_media.py reports no route because no API key or local image or video tool exists. Otherwise the image-generation skills for sprites, maps and video come first.

Output covers pixel sprites, flat vector props, UI and icons, rigged characters with planted feet, FX with a JavaScript runtime, autotiles proven to tile without seams, playable top-down layouts with collision, stylized parallax and ambient plate motion, kept palette-exact and delivered with QA and review sheets. It is not for painterly or likeness art, HD-2D plates or realistic fire, smoke and water, and licensed characters are never traced. Every result is disclosed as code-drawn and recorded in codeart-meta.json. Example specs and reference files for PixelSpec, FX and layouts ship with it.

When your agent uses it

  • You explicitly ask for sprites or props drawn in code rather than by an image model
  • The media router finds no image or video route and art is still needed
  • Making seam-proven autotiles, parallax backgrounds or small FX in an exact palette
  • Creating pose or layout guides to support an image model

Example prompts

  • “Draw a 16x24 pixel walker sprite from a PixelSpec in code, with no image model.”
  • “Make a seam-proven water and grass autotile set drawn entirely in code.”
  • “Draw a set of potion icons as portable SVG using code only.”
  • “Our image route reports no-route, so draw the slime enemy sprite with code art and say it is code-drawn.”

Requirements

  • Python to run the bundled scripts

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Write gem.pixelspec.json (the "Hello sprite" block in pixelspec.md).
  2. python "/scripts/render_pixelspec.py" --spec gem.pixelspec.json --output-dir out/gem-v1 --preview-scale 8 --strict-qc
  3. Open out/gem-v1/preview-x8.png; the frames are in out/gem-v1//frames/.
  4. Tell the user it is code-drawn (no image model).

What it can do on your machine

Read from SKILL.md and the folder at commit 5324342. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code-Drawn 2D Game Art loads about 2.5k tokens when it runs, and up to ~98k if it reads all its reference files. Until then it costs about 199 tokens; SKILL.md has 1,136 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~199
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~98k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from 0x0funky/agent-sprite-forge at commit 5324342, republished under its MIT licence (© 0x0funky). 1,136 words, ~2,462 tokens.

Download SKILL.mdSave it as .claude/skills/codeart2d/SKILL.md (or your agent's skills folder). This skill also uses 44 other files; get the full folder from GitHub.
name
codeart2d
description
Explicit-only last resort. Draws game art from code, with no image model - pixel sprites from a PixelSpec, flat vector props, UI and icons from portable SVG, rigged characters with planted feet, FX with a JS runtime, seam-proven autotiles, playable top-down layouts with collision, stylized parallax and ambient plate motion - palette-exact, with QA and review sheets. Use only when the user explicitly asks for code-drawn art, or when generate2dmedia route_media.py finds no image or video route (no-route, exit 3). Never the default - image generation (generate2dsprite, generate2dmap, video2dsprite) comes first for characters, props, maps and FX. Not for painterly, detailed or likeness art, HD-2D plates or realistic fire, smoke or water. Always disclose the result as code-drawn.

Code Art 2D

You write the art as text (PixelSpec JSON, portable SVG, rig, FX, material, layout or parallax specs); the scripts render, check and package it. No image model is involved. It is a declared art source (art_source: "code"), not a placeholder.

Use when

  • The user explicitly asks for code-drawn art: a PixelSpec or SVG sprite, palette variants drawn in code, a code rig, code FX, a seam-proven autotile set, a code-made layout, stylized parallax or ambient loops.
  • route_media.py prints no-route (exit 3): no API key is configured and no local image or video route exists. Say so, and offer to add a key or a CLI as well.
  • Pose and layout guides that help an image model (support material, not final art).

Do not use when

  • Any art request while an image or video route exists and the user did not ask for code art: generate2dsprite, generate2dmap or video2dsprite generate it.
  • Painterly, organic or identity-rich art, likenesses, portraits, HD-2D plates or textured terrain; realistic fire, smoke or water.
  • Never trace licensed characters into specs.

Capability check (once per session)

Run python "<skill-dir>/../generate2dmedia/scripts/route_media.py" resolve --kind image (or --kind video): when it names a route, the image or video skill takes the request unless the user asked for code art. forge_doctor.py in the same folder shows the full picture. If encoding.stdout fails, set PYTHONUTF8=1. For SVG work also run svg_render.py doctor --report <new.json> once per machine.

Art source

This skill is the explicit-only last resort of the route order: the API when a key is configured, then the local image tools, then code art, only when the user asks for it or no route exists. Never substitute it silently for generated art. Before you draw, check what code art can and cannot draw well in style-envelope.md (its table describes strengths, not the route order), and tell the user when a request needs an image model. Disclose every result: "code-drawn, no image model" (codeart-meta.json records "art_source": "code"); never present it as image-model output.

Host notes

  • Codex: this skill is explicit-only; image_gen and route_media.py make the art unless the user asks for code art. Look at review sheets with view_image.
  • Claude Code: use it only on request or after no-route. Look at every preview-*.png and review/*.png with Read before you report; run tools with Bash; <skill-dir> is ${CLAUDE_SKILL_DIR}.
  • Grok: runs the same Python tools; its native image tools make the art unless the user asks for code art.

Commands

Run each tool as one line from the user's project root: python "<skill-dir>/scripts/<tool>.py" .... <skill-dir> is this skill's folder; sibling skills sit beside it (--build-clips calls <skill-dir>/../generate2dsprite/scripts/build_animation_clips.py). Keep specs and outputs inside the project. Every tool writes a new --output-dir: it refuses an existing one and publishes only a complete result; with --strict-qc a failed check publishes nothing. Success prints one JSON line; errors print error: ... and exit 1; usage errors exit 2. Examples to copy: examples/.

Dependencies: numpy and Pillow for everything; PixelSpec rendering and pixel_qa.py need nothing else. SVG art also needs one rasterizer: resvg-py (python -m pip install "resvg-py>=0.5,<0.6", preferred), the resvg-js CLI on PATH, or Chrome/Edge (set CHROME_PATH) (rasterizers.md). Never PyMuPDF, skia-python or cairosvg: they silently ignore crispEdges, <style>, clipPath or gradients. fx_verify.mjs needs node.

Hello sprite

  1. Write gem.pixelspec.json (the "Hello sprite" block in pixelspec.md).
  2. python "<skill-dir>/scripts/render_pixelspec.py" --spec gem.pixelspec.json --output-dir out/gem-v1 --preview-scale 8 --strict-qc
  3. Open out/gem-v1/preview-x8.png; the frames are in out/gem-v1/<variant>/frames/.
  4. Tell the user it is code-drawn (no image model).
Show full SKILL.md (562 more words)Show less

Pipeline

NeedRoute
Pixel character, prop or FX with palette variantsPixelSpec (pixelspec.md), then render_pixelspec.py --spec <spec> --output-dir <new> --build-clips --strict-qc; review with pixel_qa.py
Flat vector character, prop, UI or icon setportable SVG with palette classes (svg-profile.md), then svg_render.py render --svg <svg> --palette <palette.json> --output-dir <new> --zoom N
Crisp pixel art drawn with SVG shapessvg_render.py render --crisp --zoom N --strict-qc
Check an SVG before renderingsvg_render.py lint --svg <svg> --profile portable (add --compile --palette <p>)
Small character that walks, idles or attacks with planted feetrig SVG plus a rig_anim.v1 file (rig-animation.md), then rig_animate.py --rig <svg> --anim <json> --output-dir <new> --build-clips --strict-qc; look at review/*.png
Slash, sparks, impact ring, hit flash, dust, projectilefx.v1 spec (fx-language.md), then fx_build.py --spec <json> --output-dir <new> --build-clips --export-runtime; baked frames for pixel games, fx-runtime.mjs for gameplay-timed FX (fx-runtime-contract.md)
Check an fx.v1 runtimenode "<skill-dir>/scripts/fx_verify.mjs" <module.mjs> --report <file>
Terrain transitions, roads meeting water, paths over ground, walls and ledgesmaterial spec, then autotile_build.py --material-spec <json> --output-dir <new> --strict-qc (Wang-16, three materials, blob-47, bevel; tiles-and-maps.md)
An image-tool texture inside exact tile masksautotile_build.py --material-texture NAME=PATH --quantize-textures (one tile that wraps)
Playable top-down map: roads, props, exits, collision, reachabilitylayout_build.py --spec <layout.json> --output-dir <new> --preview --strict-qc (--tiles <tileset manifest> for real tiles); open debug.png (layouts-and-parallax.md)
Stylized parallax backgroundparallax_build.py --spec <parallax.json> --output-dir <new> --validate --sweep-frames 49; review sweep-sheet.png
Ambient motion on a static plateambient_bake.py --plate <png> --spec <effects.json> --output-dir <new> --preview --strict-qc; encode with generate2dmap scene_motion.py
QA any pixel framespixel_qa.py --input "<glob>" --palette <palette, spec or codeart-meta.json> --review <new.png> --onion --strict --report <new.json>

Hand-offs: clips go to generate2dsprite export_engine.py (never generate2dsprite.py process); a layout's map_bundle.v2 goes to generate2dmap map_bundle.py validate, map_nav.py check and export_tiled.py / export_godot.py / export_ldtk.py.

Rules

  • SVG (portable profile, enforced by lint): root width and height equal an integer viewBox (1 unit = 1 logical pixel); colours via class="c-NAME"; bones rotate with transform="rotate(a cx cy)"; no <text>, <image>, feTurbulence, feDisplacementMap or mix-blend-mode; pixel art adds shape-rendering="crispEdges" and no gradients, masks, filters or opacity.
  • Tilesets are seam-proven before they are published: tiles assembled from the atlas are compared pixel for pixel with an independent global render over every adjacency the set allows. --strict-qc never passes without that proof.
  • Fold empty FX tail frames before building clips; the builder refuses fully transparent frames.
  • Side-view walk and run cycles: give the near and far legs a clear value contrast (the far leg two or more shades darker, never two darks that read alike) and keep the arms or forelegs visible (not hidden under a scarf, cape or bag). render_pixelspec.py warns half_cycle_duplicates when frame i and i+n/2 of a walk/run clip share a silhouette (IoU >= 0.95); fix the legs, or pass --allow-duplicate-half-cycle only after the review sheet shows the stride reads.
  • generate2dsprite sheet_qc.py frames on code-drawn frames (art_source=code): identity_residual and torso_drift are advisory, since the head and root are fixed in code; judge them by eye, and treat near_duplicates and leg_alternation as real.

Acceptance

Look at the preview and review sheets at game size and 1x before reporting (style-envelope.md has the review loop). Quote the QA status and failed checks from the JSON summary. Report every WARN or FAIL check verbatim (id, value, threshold, files) from each published QA envelope; never say "all checks passed" when any published envelope has a warn. Deliver specs, rendered frames or tiles, clips or bundles, codeart-meta.json and the disclosure line. Data contracts: references/schemas/codeart.schema.json.

© 0x0funky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 44 other files (scripts, references) in skills/codeart2d of 0x0funky/agent-sprite-forge.

  • SKILL.md
  • agents/openai.yaml
  • examples/dirt-path.material.json
  • examples/hero.anim.json
  • examples/hero.rig.svg
  • examples/meadow-layout.json
  • examples/palette.json
  • examples/parallax-gen.json
  • examples/plate-effects.json
  • examples/potion-icons.svg
  • examples/slash.fx.json
  • examples/slime.pixelspec.json
  • examples/walker16x24.pixelspec.json
  • examples/water-grass.material.json
  • references/fx-language.md
  • references/fx-runtime-contract.md
  • references/layouts-and-parallax.md
  • references/pixelspec.md
  • … and 27 more

Open the folder on GitHubat commit 5324342

Compare with similar skills

Code-Drawn 2D Game Art next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code-Drawn 2D Game Art compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code-Drawn 2D Game Art this skill0x0funky/agent-sprite-forge4.3k—~2.5kAutomated safety check: PassMIT
Sprite Genaldegad/sprite-gen2.6k—~4.4kAutomated safety check: PassApache-2.0
Hatch PethAcKlyc/MyAgents9151 repos~9.5kAutomated safety check: PassApache-2.0
Img Gen Avatar4thfever/cultivation-world-simulator2.1k—~641Automated safety check: PassCustom licence
Animatewith-pebbly/aseprite-ai-artist149—~1.4kAutomated safety check: PassMIT
Hatch Petnexu-io/open-design100k—~6kAutomated safety check: PassApache-2.0

Similar skills

  • Sprite Gen

    aldegad/sprite-gen

    Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation.

    2.6k GitHub stars~4.4k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Hatch Pet

    hAcKlyc/MyAgents

    Create, repair, validate, visually QA, and package MyAgents/Codex-compatible animated pets and pet spritesheets from character art, generated images, company or prospect brand cues, or visual…

    915 GitHub starsUsed in 1 repo~9.5k tokens
    Game DevelopmentAuto-check passed
  • Img Gen Avatar

    4thfever/cultivation-world-simulator

    A skill your agent uses when working on tools/imggen avatar image generation, OpenAI-compatible image API config, human or yaoguai portrait prompts, qi-refining base generation, image-to-image realm…

    2.1k GitHub stars~641 tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Animate

    with-pebbly/aseprite-ai-artist

    Build an idle, walk, run or attack cycle from key poses, set timing that reads as motion rather than a metronome, tag it, and review it as a filmstrip.

    149 GitHub stars~1.4k tokensUpdated today
    Game DevelopmentAuto-check passed
  • Hatch Pet

    nexu-io/open-design

    Create, repair, validate, preview, and package Codex-compatible animated pet spritesheets from character art, screenshots, generated images, or visual references.

    100k GitHub stars~6k tokensUpdated today
    Game DevelopmentAuto-check passed
  • Mira Img Animator

    sandeco/mira-animator

    Transforma imagens (fotos, logos, diagramas) em animações D3.js interativas e self-contained.

    218 GitHub stars~1.7k tokensUpdated 22 days ago
    Game DevelopmentAuto-check passed

More from 0x0funky/agent-sprite-forge

  • 2D Map and Scene Generator

    0x0funky/agent-sprite-forge

    Plans and builds 2D game maps and scenes, from tilemaps and parallax backgrounds to HD-2D plates, with collision checks, a playable HTML preview and Tiled, Godot or LDtk export.

    4.3k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Forge Media Route Layer

    0x0funky/agent-sprite-forge

    Generates an image or an image-to-video clip through a configured provider API or a signed-in Codex or Grok CLI, and reports the route, file, hash and cost estimate.

    4.3k GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • 2D Sprite Generator

    0x0funky/agent-sprite-forge

    Produces game-ready 2D characters, creatures, props, icons and effects as master stills, sheets or clips, and exports frames for common game engines.

    4.3k GitHub stars~3.6k tokensUpdated yesterday
    Auto-check passed
  • Video-to-Sprite Animation Generator

    0x0funky/agent-sprite-forge

    Turns one approved master still into a full set of animated action clips for a character, one image-to-video take per action, then packages them for a game engine.

    4.3k GitHub stars~3.8k tokensUpdated yesterday
    Auto-check passed

Questions about Code-Drawn 2D Game Art

What does Code-Drawn 2D Game Art do?

Draws 2D game art from code with no image model: pixel sprites, SVG props and icons, rigged characters, FX, autotiles and layouts, only when explicitly asked for. This is an explicit-only last resort. The agent writes the art as text (PixelSpec JSON, portable SVG, rigs, FX, material, layout and parallax specs) and scripts render, check and package it, so no image model is involved.

When should I use Code-Drawn 2D Game Art?

Code-Drawn 2D Game Art fits situations like: you explicitly ask for sprites or props drawn in code rather than by an image model; the media router finds no image or video route and art is still needed; making seam-proven autotiles, parallax backgrounds or small FX in an exact palette; creating pose or layout guides to support an image model.

How do I install Code-Drawn 2D Game Art in Claude Code?

Run `npx skills add 0x0funky/agent-sprite-forge --skill codeart2d -a claude-code`. Or copy the skill folder (skills/codeart2d in 0x0funky/agent-sprite-forge) into .claude/skills/codeart2d in your project. Claude Code loads it when a task matches its description.

How do I install Code-Drawn 2D Game Art in Codex?

Run `npx skills add 0x0funky/agent-sprite-forge --skill codeart2d -a codex`. Or copy the skill folder (skills/codeart2d in 0x0funky/agent-sprite-forge) into .agents/skills/codeart2d in your project. Codex loads it when a task matches its description.

Can I use Code-Drawn 2D Game Art in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 0x0funky/agent-sprite-forge --skill codeart2d -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codeart2d, .gemini/skills/codeart2d, .github/skills/codeart2d and .opencode/skills/codeart2d in your project.

What does Code-Drawn 2D Game Art need to run?

Going by SKILL.md and its folder, Code-Drawn 2D Game Art needs the command-line tools its instructions call (python and node). Our summary lists: Python to run the bundled scripts.

Does Code-Drawn 2D Game Art access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code-Drawn 2D Game Art safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Code-Drawn 2D Game Art use?

Code-Drawn 2D Game Art is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code-Drawn 2D Game Art use?

About 2.5k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 95k tokens, read only when the agent opens those files.

What are the alternatives to Code-Drawn 2D Game Art?

Skills that share tags, products or a category with Code-Drawn 2D Game Art: Sprite Gen (aldegad/sprite-gen, 2.6k stars), Hatch Pet (hAcKlyc/MyAgents, 915 stars), Img Gen Avatar (4thfever/cultivation-world-simulator, 2.1k stars) and Animate (with-pebbly/aseprite-ai-artist, 149 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code-Drawn 2D Game Art?

0x0funky (a GitHub user) maintains it in 0x0funky/agent-sprite-forge, which has 4,309 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

Source: 0x0funky/agent-sprite-forge on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.