0x0funky/agent-sprite-forge

Agent Skill for generating 2D sprite sheets and map, transparent PNG frames, and animated GIFs from prompts.

Python

4,399

246 commits

updated Oct 6, 2026

See the code

README

Agent Sprite Forge

Languages: English | 繁體中文 | 简体中文 | 日本語 | 한국어

Agent Sprite Forge banner

Agent Sprite Forge 0.4 teaser
0.4 launch teaser: every frame is real ASF output.

One still → a whole game-ready sprite set

Approve one generated still. Get every action of the character, keyed, looped, timed and exported for your engine.

Agent skills for Claude Code (plugin), Codex and Grok. The agent generates a master still with the best image route you have, makes one image-to-video clip per action from it, and deterministic Python tools gate, key, register, loop, retime, finish and package every action for Godot, Aseprite or a web game.

Aria, the approved master still: a young swordswoman with short dark hair, a teal cloak and a long red scarf, side view facing right
1. One approved master still
Generated by the local Codex CLI (image_gen), take 1 of 3.
Aria's six actions at real timing: idle, walk and run loops; attack, jump and hurt one-shots
2. Six actions, one image-to-video clip each
Grok image-to-video (local CLI), soft-matte keyed, registered, loops picked by measurement, one-shots retimed to game speed, HD finish with the colour lock. Real timing.

Aria runs across a generated meadow, stops for a sword thrust and runs on
3. In a scene: the packaged run, attack and idle over a generated background. The run speed is measured from the contact foot, so the feet do not slide. Every frame comes from the 2026-10-06 live run; nothing is mocked up.

What's new · Quickstart · Routes and providers · Pipeline · Maps · Showcase · Tools

What's new in 0.4 — the big upgrade

Before 0.4, character animation meant cutting frames out of an image-generated sheet, or keying a single clip by hand. 0.4 turns one approved still into the whole set: one image-to-video clip per action, and a measured pipeline from every clip to the engine. Before and after, measured on real outputs:

Old pixel fox run cut from one image-gen sheet next to the new 0.4 pixel fox run, 4x nearest, 80 ms per frame
Pixel finish: the 48x64 fox run
Old: one image-gen sheet cut 1/8 (594–709 colours per frame, soft alpha). New: master still → Grok clip → pixel finish (16–19 colours, binary alpha, selective outline). 4x nearest, both at 80 ms.
2x crop of the same Grok frame: a magenta outline with the old keyer, a clean edge with the 0.4 soft matte
Soft-matte keyer: no purple fringe
Same Grok clip, same frame, 2x crop. Fringe 0.704 → 0, leaked key pixels 7,780 → 0, keying 271 s → 44 s for 145 frames.
Aria's attack at the generator's slow-motion speed next to the auto-retimed attack at game speed
One-shots retimed to game speed
Image-to-video plays a quick attack as a slow-motion clip. retime --auto-oneshot cuts the frozen holds and pins the hit: 4.1 s → 0.7 s, hit at 292 ms.
Aria's run loop without and with the HD colour lock; without it the boots shimmer olive and maroon
HD colour lock
Video models drift colours on fast limbs. The lock holds every design colour on the master's (OKLab chroma, lightness kept): hue flips halve and most of the boot shimmer goes away.
Measured on the live runsbefore0.4
Pixel fox (48x64, 8 frames): colours per frame594–70916–19
Pixel fox: alpha levels1992
Pixel fox: lone pixels per frame (mean)73275
Keyer: purple fringe (outer-ring spill, mean)0.7040
Keyer: key pixels leaked over 145 frames7,7800
Keyer: time for 145 frames271 s44 s
Attack: one-shot length4.1 s0.7 s
Colour lock: hue flips per frame pair (run loop)352170
QC: good takes wrongly rejected18 of 240 of 24

What changed:

  • Image generation first. Every image and clip goes through one command, route_media.py: your API key if you configured one (OpenAI, Google Gemini, xAI, BytePlus, fal.ai), else your signed-in Codex or Grok CLI, else code art as the last resort. See Routes and providers.
  • One master still per character. master_still.py writes the prompt, generates takes, fixes a near-miss by edit and approves one still (master.json).
  • A whole set from that still. sprite_set.py makes one image-to-video clip per action, gates every take (area, feet, identity, zoom, turning around, edges, background, extra objects, motion, end pose, colour bleed, timing), retakes with fix clauses, keys with a soft matte, registers, picks loops, retimes one-shots, finishes and packages.
  • HD finish by default, crisp pixel finish on request. One body scale per character from the master. The pixel finish adds a crisp downscale, a spaced palette of at most 32 colours, a selective outline and binary alpha.
  • Colour lock on every action of a set, and QC recalibrated on 42 labelled live takes.
  • Engine exports. animation.json 3.0 with a PNG atlas, VP9-alpha WebM and packed-alpha MP4, decoded and verified; Godot SpriteFrames and Sprite3D; Aseprite JSON; maps for Tiled, Godot and LDtk.
  • Claude Code plugin, plus Codex and Grok installs. Hardened on Windows: Codex sandbox run folders, locked-file cleanup, cp1252/cp950 consoles.

Everything in the CHANGELOG. The live record, weak points included: docs/validation-2026-10-06.md.

Quickstart

1. Install

Claude Code (plugin)

claude plugin marketplace add 0x0funky/agent-sprite-forge --sparse .claude-plugin skills
claude plugin install agent-sprite-forge@agent-sprite-forge
python -m pip install "numpy>=1.26" "Pillow>=10.1" "scipy>=1.11"

--sparse checks out only the plugin manifest and the skills, not the showcase media.

Codex

git clone https://github.com/0x0funky/agent-sprite-forge.git
cd agent-sprite-forge
python -m pip install -r requirements.txt
python tools/install_skills.py --apply --host codex

Grok: from the same clone, python tools/install_skills.py --apply --host grok (~/.grok/skills). --host agents writes ~/.agents/skills and --dest <folder> any skills folder.

--apply backs up an installed copy and writes a sha256 manifest; python tools/install_skills.py --check --host codex reports drift later. Video needs ffmpeg 5.1+ on PATH. Start a new agent session so the skills load.

Optional: configure an API key (Setting API keys). Without one, the agent uses your signed-in Codex or Grok CLI.

2. Make the master still

Use $generate2dsprite to make a master still of Aria, a young swordswoman hero: short dark hair, a teal hooded cloak, a long red scarf and one steel sword. Side view, facing right, HD.

The agent runs master_still.py generate --takes 3 (every take through route_media.py), shows you the takes, fixes a near-miss with master_still.py edit ("THE ONLY CHANGE: ..."), and approves one: the still is keyed, padded to the class framing (a hero stands 788 px tall on 1024x1024) and recorded in master.json.

Three master takes of Aria side by side on the magenta key colour; take 1 was approved

3. Make the sprite set

Use $video2dsprite to animate the approved Aria master: idle, walk, run, attack, jump and hurt. Package them for Godot and the web.

Under the hood (<skill-dir> is the installed video2dsprite folder):

python "<skill-dir>/scripts/sprite_set.py" plan --master art/aria-master/master.json --output-dir art/aria-set
python "<skill-dir>/scripts/sprite_set.py" run --plan art/aria-set/set_plan.json
python "<skill-dir>/scripts/sprite_set.py" review --plan art/aria-set/set_plan.json
python "<skill-dir>/scripts/sprite_set.py" accept --plan art/aria-set/set_plan.json --action run --take 2
python "<skill-dir>/scripts/sprite_set.py" report --plan art/aria-set/set_plan.json

run resumes where it stopped and never generates a clip twice. The agent looks at every review sheet before it accepts an action, because the numbers cannot see a changed weapon or a covered face. Each action ends as a verified package; export_engine.py adds Godot and Aseprite files.

Routes and providers

Every generated image or clip goes through generate2dmedia/scripts/route_media.py. It walks this order and names the route it used:

OrderRouteImagesVideoUsed when
1API: a key you configuredOpenAI, Google Gemini, xAI, BytePlus Seedream, fal.ai (reference edits)xAI, BytePlus Seedance, fal.ai (Kling v3, Veo 3.1, Luma, MiniMax, Wan, Vidu, LTX)A key is configured. The key is your consent, so there is no per-call question
2Local CLI: your own signed-in Codex or GrokCodex image_gen (up to 8 references); Grok one-shot image or editGrok image-to-video in ACP mode (6 or 10 s)No key, or every API route refused for an account reason (no key, auth, quota, rate limit). Uses your subscription quota, never an API key
3Code art (codeart2d)Code-drawn pixel sprites, vector art, FX, tilesRigged animationThe last resort: only when no route exists (no-route, exit 3) or when you ask for code-drawn art. Always disclosed as code-drawn

python "<generate2dmedia>/scripts/route_media.py" resolve --kind image prints the route that would run, and forge_doctor.py lists which keys are configured (yes or no, never the key) and the resolved order. A moderation refusal, or an outcome that may have cost money, is never retried on another route.

Supported providers

ProviderKey variableImagesVideoPins the last frameNotes
OpenAIOPENAI_API_KEYgenerate and edit, 16 references, native alphanonen/agpt-image-2.5-sunburst by default
Google GeminiGOOGLE_API_KEY or GEMINI_API_KEYgenerate and edit, 14 referencesnonen/aPro model for hero masters; SynthID watermark
xAIXAI_API_KEYgenerate and edit, 5 references1–15 s, 480p–1080pyes (1.5 at 480p or 720p), up to 4 keyframesLite model for drafts
BytePlus ModelArkARK_API_KEYSeedream generate and edit, 10 referencesSeedance, 4–15 syesactivate the models first; no real faces
fal.aiFAL_KEYreference edits (Nano Banana 2 and Pro, Seedream 5, GPT Image 2)Kling v3, Veo 3.1, Luma Ray 3.2, MiniMax H3, Wan 3.0, Vidu Q3, LTX-2.5yes, on every curated modelVeo and LTX get the still padded to 16:9; the crop box is recorded

Each model's limits are checked against capabilities.json before anything is sent; a request the model cannot take is skipped with the reason or adapted with a note (for example a video length snapped to one the model renders). Every clip is published without audio. Details: route-media.md, api-usage.md, provider-survey.md, cli-routes.md.

Setting API keys

Each provider reads only its own key, from the environment or from one JSON file in your user configuration folder (never inside a project); the environment wins.

SystemConfig file
Windows%APPDATA%\agent-sprite-forge\config.json
macOS, Linux~/.config/agent-sprite-forge/config.json (or $XDG_CONFIG_HOME/agent-sprite-forge/config.json)
{
  "OPENAI_API_KEY": "sk-...",
  "GEMINI_API_KEY": "...",
  "XAI_API_KEY": "xai-...",
  "ARK_API_KEY": "...",
  "FAL_KEY": "key-id:key-secret",
  "providers": {"order": {"image": ["gemini", "openai"], "video": ["byteplus"]}}
}

Every field is optional. providers.order puts your favourite providers first; models picks a model per provider and tier. Keys are read in-process only: never printed, logged, written, passed on a command line or handed to a child process, and a provider never uses another provider's key. On macOS and Linux keep the file private (chmod 600).

Spend records

Every call, paid or local, is a line in <project>/.forge/ledger.jsonl with its estimate, the provider's job id and the artifact's sha256, and each output folder keeps a job.json. There is no cap unless you set one: --budget-usd, --max-calls, FORGE_MAX_PAID_REQUESTS, and FORGE_SESSION_IMAGES / FORGE_SESSION_VIDEOS for the local routes. media_ledger.py summary shows the totals.

Pipeline: master → set → finish → export

master still        one clip per action      cut                     finish                 package and export
master_still.py --> sprite_set.py run    --> gait_loop.py select --> finish_frames.py   --> engine_export.py package + verify
generate, edit,     route_media.py video,    (loops), retime.py      hd (default) or        export_engine.py (Godot, Aseprite)
approve             gates, retakes, soft     --auto-oneshot          pixel, colour lock
                    matte, registration      (one-shots)             to the master
StepToolWhat it does
Mastermaster_still.pyTakes through route_media.py, a fix by edit, then approve: keyed, padded to the class framing, master.json with the identity recap every motion prompt repeats
Clipssprite_set.py runOne image-to-video clip per action from the master, on a per-action canvas (jump 3:4 with headroom, attack 16:9); idle and attack pin their last frame where the route can
Gatessprite_set.pyArea, feet, identity, zoom, turning around, edges, background, extra objects, motion, end pose, colour bleed, timing; up to 3 takes with fix clauses, else the best usable window
Key and registervideo2dsprite.py process, register_clip.pySoft matte with one profile per character; the inverse of the recorded input transform, so the body scale never pumps
Cutgait_loop.py, retime.pyWalk, run and idle loops chosen by measurement; one-shots retimed to game length with the hit pinned (attack 0.7 s, jump 0.9 s, hurt 0.5 s)
Finishfinish_frames.pyHD: one scale per character, premultiplied area downscale, clean alpha, colour lock. Pixel: crisp downscale, shared spaced palette, selective outline, binary alpha, optional fixed cells (--canvas 48x64)
Packageengine_export.pyanimation.json 3.0, PNG atlas, WebM alpha, packed MP4, poster; verify decodes every file
Reviewsprite_set.py review, accept, reportContact sheets, finished strips and a cast line-up for the agent to look at; the report lists routes, takes, QC numbers, loops and timing

Engine exports

TargetWhat you getTool
Web and any engineanimation.json 3.0 (whole-ms durations, events, anchor), PNG atlas, VP9-alpha WebM, packed-alpha H.264 MP4 for iPhone, poster; forge-runtime.mjs and a WebGL packed-alpha compositorengine_export.py package, then verify
Godot 4SpriteFrames .tres with an AnimatedSprite2D .tscn; an AnimatedSprite3D packageexport_engine.py --target godot-spriteframes, godot-sprite3d
Aseprite, Phaser, PixiJSAseprite JSON array atlas with frame tags, events and the pivotexport_engine.py --target aseprite-json
MapsTiled 1.10, Godot 4.3+ (TileMapLayer scene), LDtk 1.5.3export_tiled.py, export_godot.py, export_ldtk.py

The new pixel fox run as an 8-frame sprite sheet, 48x64 cells, shown at 4x
The pixel fox as shipped: 8 frames, 48x64 cells, 80 ms each, with Godot, Aseprite and web packages (sheet shown at 4x).

Editor imports are not verified yet. The exporters prove parse-level round trips, and Tiled exports are re-rendered at 0 px difference; nobody has opened the 0.4.0 Godot, LDtk or Aseprite exports in the editors.

Maps

generate2dmap makes maps instead of isolated sprites: painted layered maps (a ground-only base, a dressed reference, a prop pack, then anchored transparent props), tiles and autotiles, side-scroll stages and HD-2D battle plates. Collision, reachability and exits come from data (map_bundle.v2, map_nav.py), with exports to Tiled, Godot 4 and LDtk and a single-file walkable HTML preview.

Ground-only cyberpunk canal base map
Ground-only base
Dressed cyberpunk canal reference map
Dressed reference
Generated 3x3 cyberpunk canal prop pack
3x3 prop pack

Layered cyberpunk canal map with y-sorted props
The layered map: anchored props sorted on their ground lines

Showcase: games made with Agent Sprite Forge

Original games and characters, assembled with Codex and the skills in earlier releases. They show the full loop: generated assets, structured scene data and playable prototype wiring.

Summon Survivors Unity WebGL gameplay
Summon Survivors — Unity WebGL
Generated map art, hero sheets, summons, evolutions, enemies, bosses, pickups, HUD, FX, level-up choices and a WebGL build.
Play build · Build conversation
Forest Pass Defense Godot tower-defense map
Forest Pass Defense — Godot tower defense
A Godot 4 prototype with map, separated props, tower slots, towers, enemy sheets, boss and flying enemies, waves, HUD, build/upgrade/sell flow, projectiles and targeting rules.
Generate2DMap Godot editor scene
Editable RPG map — Godot TileMap
An image-generated tileset and prop sheet wired into editable TileMapLayer, Sprite2D props, encounter grass Area2D, StaticBody2D collision, exits, metadata and a debug player and camera.
Neon Breach cyberpunk side-scroller
Neon Breach — cyberpunk side-scroller
A playable side-scroller prototype built around generated character, attack, map and gameplay assets.
Sengoku Era JavaScript RPG starter selection
Sengoku Era — JavaScript monster RPG
A browser RPG prototype with generated characters, starter selection, map flow and battle UI.
Play build
Sengoku Era JavaScript RPG battle scene
Starter selection and battle loop
A compact JavaScript game built from sprite, monster, battle and map assets made with the skills.
More Godot tower-defense output
Forest Pass Defense enemy roster
Enemy roster, including flyer and boss units
Forest Pass Defense tower icons
Tower lineup
Forest Pass Defense HUD icons
HUD and gameplay icons
  • scenes/ForestPass.tscn with base map, separated props, enemy paths, tower slots and HUD nodes.
  • Six tower families with generated tower art and upgrade stages.
  • Animated enemy sheets for ground units, flying units and boss encounters.
  • Wave, difficulty, tower catalog, collision, route and tower-slot metadata.
  • Runtime build, upgrade, sell, projectile and targeting behaviour connected in Godot.
More Unity survivors-like output
Summon Survivors Unity WebGL gameplay with summons, enemies, pickups, HUD and objective
Summons, enemies, pickups, HUD and objective flow
Summon Survivors Unity WebGL level-up menu
Level-up choices: summon unlocks, training, stats and recovery
  • Assets/Survivors/Scenes/SummonSurvivors.unity as the playable scene.
  • SurvivorContentDatabase.asset connecting generated hero, summon, enemy, pickup, HUD and FX sprites.
  • Starter summon selection, survival objective, XP and coin pickups, level-up choices, summon training and evolution flow.
  • Enemy spawning pressure, boss timing, projectile attacks, area damage, health bars and score tracking.
  • WebGL build output under Builds/WebGL with Vercel deployment config.
Godot editable TileMap: the meadow layers
Godot meadow layered RPG map preview
Layered map preview
Godot meadow debug preview with collision and zones
Collision and zone debug overlay
Image-generated Godot meadow tileset atlas
Image-generated tileset atlas
Image-generated 3x3 meadow prop pack
3x3 generated prop pack

FX and sheet sprites

Sheets stay the route for FX, icons and props: casts, projectiles and impacts come from $generate2dsprite sheets.

Fire mage cast animation
Spell cast
Fire mage projectile animation
Projectile
Earlier character output (0.3): four-direction walk sheets and the Ryo video case study

Characters were cut from image-generated sheets before 0.4; 0.4 animates them from one master still instead.

Samurai walking down
Down
Samurai walking left
Left
Samurai walking right
Right
Samurai walking up
Up

The 0.3 video pipeline on Ryo (base still → 6 s image-to-video → chroma key → 16-frame strip); the 0.4 keyer's numbers on this clip are in the CHANGELOG.

Base stillMotion (image-to-video)Sprite result (16 frames)
Ryo base still on magentaRyo 6 s run video preview
Download MP4
Ryo 16-frame run loop

Ryo 16-frame run strip
Short skill intro (MP4): intro.mp4

Code art: the last-resort fallback

When no image route exists, or when you ask for code-drawn art, codeart2d draws it from a spec with no image model and no quota, and says so. These are rendered from skills/codeart2d/examples.

Code-drawn pixel hero walk cycle
rig_animate.py: FK/IK walk with planted feet
Code-drawn slash, impact ring, dust and projectile FX
fx_build.py: slash, impact, dust and projectile with hit events
Code-made top-down meadow map with roads, a pond, houses and trees
autotile_build.py + layout_build.py: seam-proven tiles, every exit reachable

Included skills

Keep the five skill folders together: they call each other's scripts by relative path.

SkillUse it forMain outputs
generate2dspriteMaster stills, characters, creatures, props, icons and FX; sheets for FX, icons and props; packaging frames from any sourcemaster.json, registered frames, clips with ticks and events, palettes, QA, Aseprite/Godot exports
video2dspriteA whole sprite set from one master still (sprite_set.py), or one supplied clipGated, soft-keyed, registered, looped or retimed, finished frames; animation.json 3.0, WebM alpha, packed MP4, PNG fallback
generate2dmapTop-down and side-scroll maps, tiles, prop kits, parallax, HD-2D platesmap_bundle.v2, collision and navigation checks, Tiled/Godot/LDtk exports, HTML preview, scene loops
generate2dmediaThe route to every generated image and clip (route_media.py), the five API providers, the local Codex/Grok CLI routes, the capability checkMedia with receipts, ledger lines, route proofs
codeart2dCode-drawn pixel sprites, flat vector art, FX, autotiles, layouts, parallax: the last resort, or on requestExact-palette frames, clips, fx.v1 runtime, seam-proven tilesets, playable bundles, codeart-meta.json

In Codex, codeart2d and generate2dmedia are explicit-only: the sprite, video and map skills route to them.

Tools

Run from your project root as python "<skill-dir>/scripts/<tool>.py" .... Every tool has --help, writes a new output folder (it never replaces one), prints one JSON line and exits 1 on failure. The SKILL.md files hold the routing tables.

SkillToolWhat it does
generate2dspritemaster_still.pyprompt, generate --takes N, edit, pad, approve: one approved master still per character, master.json
generate2dsprite.py processKeys (soft or hard), slices and registers a sheet on one sampling grid; pipeline-meta v2 with QA
sheet_qc.pyspill finds parts crossing cell lines before slicing; frames checks identity, NEAR/FAR leg alternation, drift
scale_frames.pyOne scale and root per action; the canvas grows, nothing is clamped
plan_guide.py, make_anchor_layout.py, make_layout_guide.pySheet planning, pose guides and fixed-scale templates for an image tool
build_animation_clips.pyClips v2: 60 Hz ticks, events, transitions, hit-stop, review sheets and lints
assemble_frames.pyPacks whole frames losslessly; ownership slicing, loop seams, ambient crossfades
palette_tool.py, pixel_reduce.pyOKLab palettes, locks, variants, flicker-free clip quantizing; integer pixel-grid reduction
export_engine.pyAseprite JSON, Godot SpriteFrames and AnimatedSprite3D (imports not yet verified)
video2dspritesprite_set.pyplan, run, review, accept, retake, report: one clip per action from one master, gates, retakes, finish and packages
finish_frames.py, colour_lock.pyHD (default) or pixel finish, shared palettes, cast line-up; colour lock to the master and its measurement
video2dsprite.pykey-plan, triage, soft-matte process/clean, package, verify, doctor
prepare_i2v_input.py, register_clip.pyRegistration by construction: input on a recorded transform, one inverse transform back, take QC
gait_loop.py, retime.py, animation_review.pyMeasured walk/run/idle loops and stride; one-shot auto retime and impact/hold timing on ticks; classified candidates
engine_export.py, validate_animation.pyanimation.json 3.0 with WebM alpha, packed MP4 and mobile tiers behind a residue gate; decoded verify; contract check
references/runtime/forge-runtime.mjs, packed-alpha-webgl.mjsDistance-driven walks, hit-stop, transitions; WebGL packed-alpha compositor
generate2dmapextract_prop_pack.pyAnchored transparent props with footprints and despill (prop_pack.v2)
extract_terrain_tiles.py, extract_platform_strip.pyTerrain fills, overlays, iso/hex and Wang rows; platform caps with surface and seam QC
compose_layered_preview.py, validate_parallax.py, conform_background.pyGround-line sorted previews with audit overlays; parallax coverage and seams; fitting paintings to screens
map_bundle.py, map_nav.pymap_bundle.v2 validation; collision, reachability and portals from data
export_tiled.py, export_godot.py, export_ldtk.pyTiled 1.10 (re-render verified), Godot 4.3+ and LDtk 1.5.3 (parse level only)
validate_chunks.py, validate_layout.pyRoom-chunk sockets; side-scroll jumps, slopes and decks
build_scene_preview.py, references/runtime/map-runtime.mjsSingle-file walkable HTML preview with a route check; JS collision that mirrors map_nav
scene_layout_guide.py, validate_stage.py, extract_scene_lights.py, edit_locality_check.pyHD-2D stage guide, aspect-robust battle layout, lights and atmosphere, variant locality
build_motion_mask.py, scene_motion.pyMasked motion on a still plate; GOP-aligned loops with decoded-seam QA
generate2dmediaroute_media.pyimage, video, resolve: API key first, then the local CLIs, then no-route
media_providers.pyThe five API adapters (OpenAI, Gemini, xAI, BytePlus, fal.ai) behind one interface; list prints the models
forge_doctor.pyCapability check, configured keys (yes/no) and the route order; --verify-route
cli_media.pyLocal Codex/Grok CLI image, edit and video routes; resume, adopt --codex-thread, batch
generate_media.py, media_ledger.pyOne paid API call with a dry run, caps and receipts; ledger summary and settle
codeart2drender_pixelspec.py, pixel_qa.pyPixelSpec to exact-palette frames and clips; pixel-art QA
svg_render.py, rig_animate.pyPortable SVG render, lint and renderer doctor; SVG rigs with FK, two-bone IK and a ground constraint
fx_build.py, fx_verify.mjsSix FX presets with hit events and the fx.v1 runtime; runtime checker
autotile_build.py, layout_build.py, parallax_build.py, ambient_bake.pySeam-proven tilesets; playable top-down layouts; periodic parallax layers; ambient loops on a plate
repositorytools/install_skills.py, tools/vendor_sync.py, tools/check_links.pyGuarded install and drift check; shared-module copies in sync; README/doc link check

Requirements

NeedInstall
Every skillPython 3.10+, python -m pip install -r requirements.txt (numpy>=1.26, Pillow>=10.1, scipy>=1.11; scipy is an accelerator with an identical numpy fallback)
Video, sprite sets, packaging and scene loopsffmpeg 5.1+ with libvpx-vp9 and libx264 on PATH
Image and video generation (one of)An API key for OpenAI, Gemini, xAI, BytePlus or fal.ai (Setting API keys), or your own signed-in Codex CLI or Grok CLI
codeart2d SVG artpython -m pip install -r requirements-codeart.txt (resvg-py>=0.5,<0.6), or the resvg-js CLI, or Chrome/Edge. PixelSpec sprites need nothing extra
JS runtimes, fx_verify.mjs, scene preview checksnode 22 (optional); build_scene_preview.py --verify also uses playwright when present
Contributorspython -m pip install -r requirements-dev.txt, then python -m pytest -q and node --test "tests/js/*.test.mjs"

Suggested prompts

A character, start to finish

Use $generate2dsprite to make a master still of a fox ranger for a 2D platformer: orange fur, teal tunic, brown boots, side view facing right. Show me three takes.
Use $video2dsprite to turn the approved fox master into idle, run, attack and hurt, pixel finish in 48x64 cells at 80 ms, and export it for Godot and Aseprite.

Sprites and FX

Use $generate2dsprite to create a wizard spell bundle with cast, projectile and impact sprites.
Use $video2dsprite with my existing side-view hero PNG as the master. Make a run loop and an attack, and report the routes and QC numbers.

Maps

Use $generate2dmap to create a small top-down village with a pond, roads to three exits, collision and a walkable HTML preview, then export it to Tiled.
Use $generate2dmap to create an HD-2D battle plate for a harbour at night with lantern lights and moving water.
Whole-game prompts used for the showcase prototypes
use $generate2dsprite to create a 2D side-scrolling action game. It should include attack mechanics, map elements, and all the essential features. I would like you to design it, and all the necessary assets should be created using this skill. It needs to be an actually playable game, with a cyberpunk story setting.
Use $generate2dsprite to create a 2D monster-collecting RPG. You only need to build one scene for now. It must include a starter monster selection mechanic, a battle screen, and all basic gameplay functions. I would like you to design all the elements and the story, and you can also decide which game engine to use. Use this skill to create any assets you need. The story should be set in the Sengoku period.

Notes and limits

  • The scripts are not the creative brain, and numeric QA never approves anatomy or motion by itself: the agent looks at the review sheets, and you approve the master.
  • Image-to-video models drift on fast limbs and jumps. Expect retakes on run and jump; the gates and fix clauses exist for that, and the live record shows how many it took.
  • What is and is not proven is in docs/known-limitations.md; live results are in docs/validation-2026-10-06.md.
  • Engine and editor imports of the 0.4.0 exporters are not verified yet (see Engine exports).

Generated assets and licensing

The MIT license below covers this repository's code and documentation. It does not cover what you generate with it. Images and videos from an image or video model are subject to that provider's terms; code-drawn art is produced from specs you or your agent write. Do not trace or prompt for characters or people you do not own. For commercial projects, use original characters or IP you control, and check each provider's terms.

Repository layout

agent-sprite-forge/
  .claude-plugin/        plugin.json, marketplace.json (Claude Code)
  skills/
    generate2dsprite/    SKILL.md, agents/openai.yaml, references/, scripts/
    video2dsprite/
    generate2dmap/
    generate2dmedia/
    codeart2d/           examples/ with every spec shown above
  shared/                canonical shared modules and JSON schemas (vendored into skills)
  tools/                 install_skills.py, vendor_sync.py, check_links.py
  tests/                 pytest and node suites, fixtures with provenance
  docs/                  validation records, known limitations, audit
  src/                   README media (src/v040: the 0.4 showcase)
  CHANGELOG.md

Star history

Star History Chart

License

MIT. See LICENSE.

agent-skills
codex
pixel-art
sprite-generator

0x0funky/agent-sprite-forge

Agent Skill for generating 2D sprite sheets and map, transparent PNG frames, and animated GIFs from prompts.

Python

4,399

246 commits

updated Oct 6, 2026

See the code

README

Agent Sprite Forge

Languages: English | 繁體中文 | 简体中文 | 日本語 | 한국어

Agent Sprite Forge banner

Agent Sprite Forge 0.4 teaser
0.4 launch teaser: every frame is real ASF output.

One still → a whole game-ready sprite set

Approve one generated still. Get every action of the character, keyed, looped, timed and exported for your engine.

Agent skills for Claude Code (plugin), Codex and Grok. The agent generates a master still with the best image route you have, makes one image-to-video clip per action from it, and deterministic Python tools gate, key, register, loop, retime, finish and package every action for Godot, Aseprite or a web game.

Aria, the approved master still: a young swordswoman with short dark hair, a teal cloak and a long red scarf, side view facing right
1. One approved master still
Generated by the local Codex CLI (image_gen), take 1 of 3.
Aria's six actions at real timing: idle, walk and run loops; attack, jump and hurt one-shots
2. Six actions, one image-to-video clip each
Grok image-to-video (local CLI), soft-matte keyed, registered, loops picked by measurement, one-shots retimed to game speed, HD finish with the colour lock. Real timing.

Aria runs across a generated meadow, stops for a sword thrust and runs on
3. In a scene: the packaged run, attack and idle over a generated background. The run speed is measured from the contact foot, so the feet do not slide. Every frame comes from the 2026-10-06 live run; nothing is mocked up.

What's new · Quickstart · Routes and providers · Pipeline · Maps · Showcase · Tools

What's new in 0.4 — the big upgrade

Before 0.4, character animation meant cutting frames out of an image-generated sheet, or keying a single clip by hand. 0.4 turns one approved still into the whole set: one image-to-video clip per action, and a measured pipeline from every clip to the engine. Before and after, measured on real outputs:

Old pixel fox run cut from one image-gen sheet next to the new 0.4 pixel fox run, 4x nearest, 80 ms per frame
Pixel finish: the 48x64 fox run
Old: one image-gen sheet cut 1/8 (594–709 colours per frame, soft alpha). New: master still → Grok clip → pixel finish (16–19 colours, binary alpha, selective outline). 4x nearest, both at 80 ms.
2x crop of the same Grok frame: a magenta outline with the old keyer, a clean edge with the 0.4 soft matte
Soft-matte keyer: no purple fringe
Same Grok clip, same frame, 2x crop. Fringe 0.704 → 0, leaked key pixels 7,780 → 0, keying 271 s → 44 s for 145 frames.
Aria's attack at the generator's slow-motion speed next to the auto-retimed attack at game speed
One-shots retimed to game speed
Image-to-video plays a quick attack as a slow-motion clip. retime --auto-oneshot cuts the frozen holds and pins the hit: 4.1 s → 0.7 s, hit at 292 ms.
Aria's run loop without and with the HD colour lock; without it the boots shimmer olive and maroon
HD colour lock
Video models drift colours on fast limbs. The lock holds every design colour on the master's (OKLab chroma, lightness kept): hue flips halve and most of the boot shimmer goes away.
Measured on the live runsbefore0.4
Pixel fox (48x64, 8 frames): colours per frame594–70916–19
Pixel fox: alpha levels1992
Pixel fox: lone pixels per frame (mean)73275
Keyer: purple fringe (outer-ring spill, mean)0.7040
Keyer: key pixels leaked over 145 frames7,7800
Keyer: time for 145 frames271 s44 s
Attack: one-shot length4.1 s0.7 s
Colour lock: hue flips per frame pair (run loop)352170
QC: good takes wrongly rejected18 of 240 of 24

What changed:

  • Image generation first. Every image and clip goes through one command, route_media.py: your API key if you configured one (OpenAI, Google Gemini, xAI, BytePlus, fal.ai), else your signed-in Codex or Grok CLI, else code art as the last resort. See Routes and providers.
  • One master still per character. master_still.py writes the prompt, generates takes, fixes a near-miss by edit and approves one still (master.json).
  • A whole set from that still. sprite_set.py makes one image-to-video clip per action, gates every take (area, feet, identity, zoom, turning around, edges, background, extra objects, motion, end pose, colour bleed, timing), retakes with fix clauses, keys with a soft matte, registers, picks loops, retimes one-shots, finishes and packages.
  • HD finish by default, crisp pixel finish on request. One body scale per character from the master. The pixel finish adds a crisp downscale, a spaced palette of at most 32 colours, a selective outline and binary alpha.
  • Colour lock on every action of a set, and QC recalibrated on 42 labelled live takes.
  • Engine exports. animation.json 3.0 with a PNG atlas, VP9-alpha WebM and packed-alpha MP4, decoded and verified; Godot SpriteFrames and Sprite3D; Aseprite JSON; maps for Tiled, Godot and LDtk.
  • Claude Code plugin, plus Codex and Grok installs. Hardened on Windows: Codex sandbox run folders, locked-file cleanup, cp1252/cp950 consoles.

Everything in the CHANGELOG. The live record, weak points included: docs/validation-2026-10-06.md.

Quickstart

1. Install

Claude Code (plugin)

claude plugin marketplace add 0x0funky/agent-sprite-forge --sparse .claude-plugin skills
claude plugin install agent-sprite-forge@agent-sprite-forge
python -m pip install "numpy>=1.26" "Pillow>=10.1" "scipy>=1.11"

--sparse checks out only the plugin manifest and the skills, not the showcase media.

Codex

git clone https://github.com/0x0funky/agent-sprite-forge.git
cd agent-sprite-forge
python -m pip install -r requirements.txt
python tools/install_skills.py --apply --host codex

Grok: from the same clone, python tools/install_skills.py --apply --host grok (~/.grok/skills). --host agents writes ~/.agents/skills and --dest <folder> any skills folder.

--apply backs up an installed copy and writes a sha256 manifest; python tools/install_skills.py --check --host codex reports drift later. Video needs ffmpeg 5.1+ on PATH. Start a new agent session so the skills load.

Optional: configure an API key (Setting API keys). Without one, the agent uses your signed-in Codex or Grok CLI.

2. Make the master still

Use $generate2dsprite to make a master still of Aria, a young swordswoman hero: short dark hair, a teal hooded cloak, a long red scarf and one steel sword. Side view, facing right, HD.

The agent runs master_still.py generate --takes 3 (every take through route_media.py), shows you the takes, fixes a near-miss with master_still.py edit ("THE ONLY CHANGE: ..."), and approves one: the still is keyed, padded to the class framing (a hero stands 788 px tall on 1024x1024) and recorded in master.json.

Three master takes of Aria side by side on the magenta key colour; take 1 was approved

3. Make the sprite set

Use $video2dsprite to animate the approved Aria master: idle, walk, run, attack, jump and hurt. Package them for Godot and the web.

Under the hood (<skill-dir> is the installed video2dsprite folder):

python "<skill-dir>/scripts/sprite_set.py" plan --master art/aria-master/master.json --output-dir art/aria-set
python "<skill-dir>/scripts/sprite_set.py" run --plan art/aria-set/set_plan.json
python "<skill-dir>/scripts/sprite_set.py" review --plan art/aria-set/set_plan.json
python "<skill-dir>/scripts/sprite_set.py" accept --plan art/aria-set/set_plan.json --action run --take 2
python "<skill-dir>/scripts/sprite_set.py" report --plan art/aria-set/set_plan.json

run resumes where it stopped and never generates a clip twice. The agent looks at every review sheet before it accepts an action, because the numbers cannot see a changed weapon or a covered face. Each action ends as a verified package; export_engine.py adds Godot and Aseprite files.

Routes and providers

Every generated image or clip goes through generate2dmedia/scripts/route_media.py. It walks this order and names the route it used:

OrderRouteImagesVideoUsed when
1API: a key you configuredOpenAI, Google Gemini, xAI, BytePlus Seedream, fal.ai (reference edits)xAI, BytePlus Seedance, fal.ai (Kling v3, Veo 3.1, Luma, MiniMax, Wan, Vidu, LTX)A key is configured. The key is your consent, so there is no per-call question
2Local CLI: your own signed-in Codex or GrokCodex image_gen (up to 8 references); Grok one-shot image or editGrok image-to-video in ACP mode (6 or 10 s)No key, or every API route refused for an account reason (no key, auth, quota, rate limit). Uses your subscription quota, never an API key
3Code art (codeart2d)Code-drawn pixel sprites, vector art, FX, tilesRigged animationThe last resort: only when no route exists (no-route, exit 3) or when you ask for code-drawn art. Always disclosed as code-drawn

python "<generate2dmedia>/scripts/route_media.py" resolve --kind image prints the route that would run, and forge_doctor.py lists which keys are configured (yes or no, never the key) and the resolved order. A moderation refusal, or an outcome that may have cost money, is never retried on another route.

Supported providers

ProviderKey variableImagesVideoPins the last frameNotes
OpenAIOPENAI_API_KEYgenerate and edit, 16 references, native alphanonen/agpt-image-2.5-sunburst by default
Google GeminiGOOGLE_API_KEY or GEMINI_API_KEYgenerate and edit, 14 referencesnonen/aPro model for hero masters; SynthID watermark
xAIXAI_API_KEYgenerate and edit, 5 references1–15 s, 480p–1080pyes (1.5 at 480p or 720p), up to 4 keyframesLite model for drafts
BytePlus ModelArkARK_API_KEYSeedream generate and edit, 10 referencesSeedance, 4–15 syesactivate the models first; no real faces
fal.aiFAL_KEYreference edits (Nano Banana 2 and Pro, Seedream 5, GPT Image 2)Kling v3, Veo 3.1, Luma Ray 3.2, MiniMax H3, Wan 3.0, Vidu Q3, LTX-2.5yes, on every curated modelVeo and LTX get the still padded to 16:9; the crop box is recorded

Each model's limits are checked against capabilities.json before anything is sent; a request the model cannot take is skipped with the reason or adapted with a note (for example a video length snapped to one the model renders). Every clip is published without audio. Details: route-media.md, api-usage.md, provider-survey.md, cli-routes.md.

Setting API keys

Each provider reads only its own key, from the environment or from one JSON file in your user configuration folder (never inside a project); the environment wins.

SystemConfig file
Windows%APPDATA%\agent-sprite-forge\config.json
macOS, Linux~/.config/agent-sprite-forge/config.json (or $XDG_CONFIG_HOME/agent-sprite-forge/config.json)
{
  "OPENAI_API_KEY": "sk-...",
  "GEMINI_API_KEY": "...",
  "XAI_API_KEY": "xai-...",
  "ARK_API_KEY": "...",
  "FAL_KEY": "key-id:key-secret",
  "providers": {"order": {"image": ["gemini", "openai"], "video": ["byteplus"]}}
}

Every field is optional. providers.order puts your favourite providers first; models picks a model per provider and tier. Keys are read in-process only: never printed, logged, written, passed on a command line or handed to a child process, and a provider never uses another provider's key. On macOS and Linux keep the file private (chmod 600).

Spend records

Every call, paid or local, is a line in <project>/.forge/ledger.jsonl with its estimate, the provider's job id and the artifact's sha256, and each output folder keeps a job.json. There is no cap unless you set one: --budget-usd, --max-calls, FORGE_MAX_PAID_REQUESTS, and FORGE_SESSION_IMAGES / FORGE_SESSION_VIDEOS for the local routes. media_ledger.py summary shows the totals.

Pipeline: master → set → finish → export

master still        one clip per action      cut                     finish                 package and export
master_still.py --> sprite_set.py run    --> gait_loop.py select --> finish_frames.py   --> engine_export.py package + verify
generate, edit,     route_media.py video,    (loops), retime.py      hd (default) or        export_engine.py (Godot, Aseprite)
approve             gates, retakes, soft     --auto-oneshot          pixel, colour lock
                    matte, registration      (one-shots)             to the master
StepToolWhat it does
Mastermaster_still.pyTakes through route_media.py, a fix by edit, then approve: keyed, padded to the class framing, master.json with the identity recap every motion prompt repeats
Clipssprite_set.py runOne image-to-video clip per action from the master, on a per-action canvas (jump 3:4 with headroom, attack 16:9); idle and attack pin their last frame where the route can
Gatessprite_set.pyArea, feet, identity, zoom, turning around, edges, background, extra objects, motion, end pose, colour bleed, timing; up to 3 takes with fix clauses, else the best usable window
Key and registervideo2dsprite.py process, register_clip.pySoft matte with one profile per character; the inverse of the recorded input transform, so the body scale never pumps
Cutgait_loop.py, retime.pyWalk, run and idle loops chosen by measurement; one-shots retimed to game length with the hit pinned (attack 0.7 s, jump 0.9 s, hurt 0.5 s)
Finishfinish_frames.pyHD: one scale per character, premultiplied area downscale, clean alpha, colour lock. Pixel: crisp downscale, shared spaced palette, selective outline, binary alpha, optional fixed cells (--canvas 48x64)
Packageengine_export.pyanimation.json 3.0, PNG atlas, WebM alpha, packed MP4, poster; verify decodes every file
Reviewsprite_set.py review, accept, reportContact sheets, finished strips and a cast line-up for the agent to look at; the report lists routes, takes, QC numbers, loops and timing

Engine exports

TargetWhat you getTool
Web and any engineanimation.json 3.0 (whole-ms durations, events, anchor), PNG atlas, VP9-alpha WebM, packed-alpha H.264 MP4 for iPhone, poster; forge-runtime.mjs and a WebGL packed-alpha compositorengine_export.py package, then verify
Godot 4SpriteFrames .tres with an AnimatedSprite2D .tscn; an AnimatedSprite3D packageexport_engine.py --target godot-spriteframes, godot-sprite3d
Aseprite, Phaser, PixiJSAseprite JSON array atlas with frame tags, events and the pivotexport_engine.py --target aseprite-json
MapsTiled 1.10, Godot 4.3+ (TileMapLayer scene), LDtk 1.5.3export_tiled.py, export_godot.py, export_ldtk.py

The new pixel fox run as an 8-frame sprite sheet, 48x64 cells, shown at 4x
The pixel fox as shipped: 8 frames, 48x64 cells, 80 ms each, with Godot, Aseprite and web packages (sheet shown at 4x).

Editor imports are not verified yet. The exporters prove parse-level round trips, and Tiled exports are re-rendered at 0 px difference; nobody has opened the 0.4.0 Godot, LDtk or Aseprite exports in the editors.

Maps

generate2dmap makes maps instead of isolated sprites: painted layered maps (a ground-only base, a dressed reference, a prop pack, then anchored transparent props), tiles and autotiles, side-scroll stages and HD-2D battle plates. Collision, reachability and exits come from data (map_bundle.v2, map_nav.py), with exports to Tiled, Godot 4 and LDtk and a single-file walkable HTML preview.

Ground-only cyberpunk canal base map
Ground-only base
Dressed cyberpunk canal reference map
Dressed reference
Generated 3x3 cyberpunk canal prop pack
3x3 prop pack

Layered cyberpunk canal map with y-sorted props
The layered map: anchored props sorted on their ground lines

Showcase: games made with Agent Sprite Forge

Original games and characters, assembled with Codex and the skills in earlier releases. They show the full loop: generated assets, structured scene data and playable prototype wiring.

Summon Survivors Unity WebGL gameplay
Summon Survivors — Unity WebGL
Generated map art, hero sheets, summons, evolutions, enemies, bosses, pickups, HUD, FX, level-up choices and a WebGL build.
Play build · Build conversation
Forest Pass Defense Godot tower-defense map
Forest Pass Defense — Godot tower defense
A Godot 4 prototype with map, separated props, tower slots, towers, enemy sheets, boss and flying enemies, waves, HUD, build/upgrade/sell flow, projectiles and targeting rules.
Generate2DMap Godot editor scene
Editable RPG map — Godot TileMap
An image-generated tileset and prop sheet wired into editable TileMapLayer, Sprite2D props, encounter grass Area2D, StaticBody2D collision, exits, metadata and a debug player and camera.
Neon Breach cyberpunk side-scroller
Neon Breach — cyberpunk side-scroller
A playable side-scroller prototype built around generated character, attack, map and gameplay assets.
Sengoku Era JavaScript RPG starter selection
Sengoku Era — JavaScript monster RPG
A browser RPG prototype with generated characters, starter selection, map flow and battle UI.
Play build
Sengoku Era JavaScript RPG battle scene
Starter selection and battle loop
A compact JavaScript game built from sprite, monster, battle and map assets made with the skills.
More Godot tower-defense output
Forest Pass Defense enemy roster
Enemy roster, including flyer and boss units
Forest Pass Defense tower icons
Tower lineup
Forest Pass Defense HUD icons
HUD and gameplay icons
  • scenes/ForestPass.tscn with base map, separated props, enemy paths, tower slots and HUD nodes.
  • Six tower families with generated tower art and upgrade stages.
  • Animated enemy sheets for ground units, flying units and boss encounters.
  • Wave, difficulty, tower catalog, collision, route and tower-slot metadata.
  • Runtime build, upgrade, sell, projectile and targeting behaviour connected in Godot.
More Unity survivors-like output
Summon Survivors Unity WebGL gameplay with summons, enemies, pickups, HUD and objective
Summons, enemies, pickups, HUD and objective flow
Summon Survivors Unity WebGL level-up menu
Level-up choices: summon unlocks, training, stats and recovery
  • Assets/Survivors/Scenes/SummonSurvivors.unity as the playable scene.
  • SurvivorContentDatabase.asset connecting generated hero, summon, enemy, pickup, HUD and FX sprites.
  • Starter summon selection, survival objective, XP and coin pickups, level-up choices, summon training and evolution flow.
  • Enemy spawning pressure, boss timing, projectile attacks, area damage, health bars and score tracking.
  • WebGL build output under Builds/WebGL with Vercel deployment config.
Godot editable TileMap: the meadow layers
Godot meadow layered RPG map preview
Layered map preview
Godot meadow debug preview with collision and zones
Collision and zone debug overlay
Image-generated Godot meadow tileset atlas
Image-generated tileset atlas
Image-generated 3x3 meadow prop pack
3x3 generated prop pack

FX and sheet sprites

Sheets stay the route for FX, icons and props: casts, projectiles and impacts come from $generate2dsprite sheets.

Fire mage cast animation
Spell cast
Fire mage projectile animation
Projectile
Earlier character output (0.3): four-direction walk sheets and the Ryo video case study

Characters were cut from image-generated sheets before 0.4; 0.4 animates them from one master still instead.

Samurai walking down
Down
Samurai walking left
Left
Samurai walking right
Right
Samurai walking up
Up

The 0.3 video pipeline on Ryo (base still → 6 s image-to-video → chroma key → 16-frame strip); the 0.4 keyer's numbers on this clip are in the CHANGELOG.

Base stillMotion (image-to-video)Sprite result (16 frames)
Ryo base still on magentaRyo 6 s run video preview
Download MP4
Ryo 16-frame run loop

Ryo 16-frame run strip
Short skill intro (MP4): intro.mp4

Code art: the last-resort fallback

When no image route exists, or when you ask for code-drawn art, codeart2d draws it from a spec with no image model and no quota, and says so. These are rendered from skills/codeart2d/examples.

Code-drawn pixel hero walk cycle
rig_animate.py: FK/IK walk with planted feet
Code-drawn slash, impact ring, dust and projectile FX
fx_build.py: slash, impact, dust and projectile with hit events
Code-made top-down meadow map with roads, a pond, houses and trees
autotile_build.py + layout_build.py: seam-proven tiles, every exit reachable

Included skills

Keep the five skill folders together: they call each other's scripts by relative path.

SkillUse it forMain outputs
generate2dspriteMaster stills, characters, creatures, props, icons and FX; sheets for FX, icons and props; packaging frames from any sourcemaster.json, registered frames, clips with ticks and events, palettes, QA, Aseprite/Godot exports
video2dspriteA whole sprite set from one master still (sprite_set.py), or one supplied clipGated, soft-keyed, registered, looped or retimed, finished frames; animation.json 3.0, WebM alpha, packed MP4, PNG fallback
generate2dmapTop-down and side-scroll maps, tiles, prop kits, parallax, HD-2D platesmap_bundle.v2, collision and navigation checks, Tiled/Godot/LDtk exports, HTML preview, scene loops
generate2dmediaThe route to every generated image and clip (route_media.py), the five API providers, the local Codex/Grok CLI routes, the capability checkMedia with receipts, ledger lines, route proofs
codeart2dCode-drawn pixel sprites, flat vector art, FX, autotiles, layouts, parallax: the last resort, or on requestExact-palette frames, clips, fx.v1 runtime, seam-proven tilesets, playable bundles, codeart-meta.json

In Codex, codeart2d and generate2dmedia are explicit-only: the sprite, video and map skills route to them.

Tools

Run from your project root as python "<skill-dir>/scripts/<tool>.py" .... Every tool has --help, writes a new output folder (it never replaces one), prints one JSON line and exits 1 on failure. The SKILL.md files hold the routing tables.

SkillToolWhat it does
generate2dspritemaster_still.pyprompt, generate --takes N, edit, pad, approve: one approved master still per character, master.json
generate2dsprite.py processKeys (soft or hard), slices and registers a sheet on one sampling grid; pipeline-meta v2 with QA
sheet_qc.pyspill finds parts crossing cell lines before slicing; frames checks identity, NEAR/FAR leg alternation, drift
scale_frames.pyOne scale and root per action; the canvas grows, nothing is clamped
plan_guide.py, make_anchor_layout.py, make_layout_guide.pySheet planning, pose guides and fixed-scale templates for an image tool
build_animation_clips.pyClips v2: 60 Hz ticks, events, transitions, hit-stop, review sheets and lints
assemble_frames.pyPacks whole frames losslessly; ownership slicing, loop seams, ambient crossfades
palette_tool.py, pixel_reduce.pyOKLab palettes, locks, variants, flicker-free clip quantizing; integer pixel-grid reduction
export_engine.pyAseprite JSON, Godot SpriteFrames and AnimatedSprite3D (imports not yet verified)
video2dspritesprite_set.pyplan, run, review, accept, retake, report: one clip per action from one master, gates, retakes, finish and packages
finish_frames.py, colour_lock.pyHD (default) or pixel finish, shared palettes, cast line-up; colour lock to the master and its measurement
video2dsprite.pykey-plan, triage, soft-matte process/clean, package, verify, doctor
prepare_i2v_input.py, register_clip.pyRegistration by construction: input on a recorded transform, one inverse transform back, take QC
gait_loop.py, retime.py, animation_review.pyMeasured walk/run/idle loops and stride; one-shot auto retime and impact/hold timing on ticks; classified candidates
engine_export.py, validate_animation.pyanimation.json 3.0 with WebM alpha, packed MP4 and mobile tiers behind a residue gate; decoded verify; contract check
references/runtime/forge-runtime.mjs, packed-alpha-webgl.mjsDistance-driven walks, hit-stop, transitions; WebGL packed-alpha compositor
generate2dmapextract_prop_pack.pyAnchored transparent props with footprints and despill (prop_pack.v2)
extract_terrain_tiles.py, extract_platform_strip.pyTerrain fills, overlays, iso/hex and Wang rows; platform caps with surface and seam QC
compose_layered_preview.py, validate_parallax.py, conform_background.pyGround-line sorted previews with audit overlays; parallax coverage and seams; fitting paintings to screens
map_bundle.py, map_nav.pymap_bundle.v2 validation; collision, reachability and portals from data
export_tiled.py, export_godot.py, export_ldtk.pyTiled 1.10 (re-render verified), Godot 4.3+ and LDtk 1.5.3 (parse level only)
validate_chunks.py, validate_layout.pyRoom-chunk sockets; side-scroll jumps, slopes and decks
build_scene_preview.py, references/runtime/map-runtime.mjsSingle-file walkable HTML preview with a route check; JS collision that mirrors map_nav
scene_layout_guide.py, validate_stage.py, extract_scene_lights.py, edit_locality_check.pyHD-2D stage guide, aspect-robust battle layout, lights and atmosphere, variant locality
build_motion_mask.py, scene_motion.pyMasked motion on a still plate; GOP-aligned loops with decoded-seam QA
generate2dmediaroute_media.pyimage, video, resolve: API key first, then the local CLIs, then no-route
media_providers.pyThe five API adapters (OpenAI, Gemini, xAI, BytePlus, fal.ai) behind one interface; list prints the models
forge_doctor.pyCapability check, configured keys (yes/no) and the route order; --verify-route
cli_media.pyLocal Codex/Grok CLI image, edit and video routes; resume, adopt --codex-thread, batch
generate_media.py, media_ledger.pyOne paid API call with a dry run, caps and receipts; ledger summary and settle
codeart2drender_pixelspec.py, pixel_qa.pyPixelSpec to exact-palette frames and clips; pixel-art QA
svg_render.py, rig_animate.pyPortable SVG render, lint and renderer doctor; SVG rigs with FK, two-bone IK and a ground constraint
fx_build.py, fx_verify.mjsSix FX presets with hit events and the fx.v1 runtime; runtime checker
autotile_build.py, layout_build.py, parallax_build.py, ambient_bake.pySeam-proven tilesets; playable top-down layouts; periodic parallax layers; ambient loops on a plate
repositorytools/install_skills.py, tools/vendor_sync.py, tools/check_links.pyGuarded install and drift check; shared-module copies in sync; README/doc link check

Requirements

NeedInstall
Every skillPython 3.10+, python -m pip install -r requirements.txt (numpy>=1.26, Pillow>=10.1, scipy>=1.11; scipy is an accelerator with an identical numpy fallback)
Video, sprite sets, packaging and scene loopsffmpeg 5.1+ with libvpx-vp9 and libx264 on PATH
Image and video generation (one of)An API key for OpenAI, Gemini, xAI, BytePlus or fal.ai (Setting API keys), or your own signed-in Codex CLI or Grok CLI
codeart2d SVG artpython -m pip install -r requirements-codeart.txt (resvg-py>=0.5,<0.6), or the resvg-js CLI, or Chrome/Edge. PixelSpec sprites need nothing extra
JS runtimes, fx_verify.mjs, scene preview checksnode 22 (optional); build_scene_preview.py --verify also uses playwright when present
Contributorspython -m pip install -r requirements-dev.txt, then python -m pytest -q and node --test "tests/js/*.test.mjs"

Suggested prompts

A character, start to finish

Use $generate2dsprite to make a master still of a fox ranger for a 2D platformer: orange fur, teal tunic, brown boots, side view facing right. Show me three takes.
Use $video2dsprite to turn the approved fox master into idle, run, attack and hurt, pixel finish in 48x64 cells at 80 ms, and export it for Godot and Aseprite.

Sprites and FX

Use $generate2dsprite to create a wizard spell bundle with cast, projectile and impact sprites.
Use $video2dsprite with my existing side-view hero PNG as the master. Make a run loop and an attack, and report the routes and QC numbers.

Maps

Use $generate2dmap to create a small top-down village with a pond, roads to three exits, collision and a walkable HTML preview, then export it to Tiled.
Use $generate2dmap to create an HD-2D battle plate for a harbour at night with lantern lights and moving water.
Whole-game prompts used for the showcase prototypes
use $generate2dsprite to create a 2D side-scrolling action game. It should include attack mechanics, map elements, and all the essential features. I would like you to design it, and all the necessary assets should be created using this skill. It needs to be an actually playable game, with a cyberpunk story setting.
Use $generate2dsprite to create a 2D monster-collecting RPG. You only need to build one scene for now. It must include a starter monster selection mechanic, a battle screen, and all basic gameplay functions. I would like you to design all the elements and the story, and you can also decide which game engine to use. Use this skill to create any assets you need. The story should be set in the Sengoku period.

Notes and limits

  • The scripts are not the creative brain, and numeric QA never approves anatomy or motion by itself: the agent looks at the review sheets, and you approve the master.
  • Image-to-video models drift on fast limbs and jumps. Expect retakes on run and jump; the gates and fix clauses exist for that, and the live record shows how many it took.
  • What is and is not proven is in docs/known-limitations.md; live results are in docs/validation-2026-10-06.md.
  • Engine and editor imports of the 0.4.0 exporters are not verified yet (see Engine exports).

Generated assets and licensing

The MIT license below covers this repository's code and documentation. It does not cover what you generate with it. Images and videos from an image or video model are subject to that provider's terms; code-drawn art is produced from specs you or your agent write. Do not trace or prompt for characters or people you do not own. For commercial projects, use original characters or IP you control, and check each provider's terms.

Repository layout

agent-sprite-forge/
  .claude-plugin/        plugin.json, marketplace.json (Claude Code)
  skills/
    generate2dsprite/    SKILL.md, agents/openai.yaml, references/, scripts/
    video2dsprite/
    generate2dmap/
    generate2dmedia/
    codeart2d/           examples/ with every spec shown above
  shared/                canonical shared modules and JSON schemas (vendored into skills)
  tools/                 install_skills.py, vendor_sync.py, check_links.py
  tests/                 pytest and node suites, fixtures with provenance
  docs/                  validation records, known limitations, audit
  src/                   README media (src/v040: the 0.4 showcase)
  CHANGELOG.md

Star history

Star History Chart

License

MIT. See LICENSE.

agent-skills
codex
pixel-art
sprite-generator

Significant stargazers

svjack

102 followers · starred Apr 2026

kiui

1,950 followers · starred Jun 2026

Max Ku

198 followers · starred May 2026

utzcoz

126 followers · starred Apr 2026