/agent-sprite-forge:generate2dspritefrom Agent Sprite Forge
Generates game-ready 2D sprites, sprite sheets, and animation clips for characters, creatures, props, icons, and FX. Plans size/motion/finish, generates art via API or local tools, then keys, slices, registers, scales, palettes, QAs, and exports frames for Aseprite JSON or Godot SpriteFrames/Sprite3D.
Ships in Agent Sprite Forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Make the smallest asset bundle the game needs, at its real display size, camera and style. Game logic (collision, damage, timing) stays independent of the art.
Run python "<skill-dir>/../generate2dmedia/scripts/forge_doctor.py" --host-tools <tools> --save <output>/doctor.json, where <tools> lists the media tools in your own tool list (image_gen, image_edit, image_to_video) or none. Its ROUTES block shows which API keys are configured (yes or no), the local readiness and the resolved order. If encoding.stdout fails, set PYTHONUTF8=1.
Image generation is the default art source for characters, creatures, props, icons and FX. Record it as art_source (api, host_image, existing, or code only on request) and name the route in your reply. A route the user names explicitly wins.
OPENAI_API_KEY), Google Gemini (GEMINI_API_KEY), xAI (XAI_API_KEY), BytePlus Seedream (ARK_API_KEY) or fal.ai (FAL_KEY), in the environment or the user config file (route-media.md). The configured key is the owner's consent, so there is no per-call question.image_gen, Grok's native tool) when you have one, otherwise the user's signed-in Codex CLI, then Antigravity CLI, then Grok CLI.route_media.py prints no-route (exit 3). Then say "code-drawn, no image model".Hibit FX are the one exception: fx_pixelfx.py check sends them to pixelfx when the user has it installed (route A, third-party code-drawn FX, credited and disclosed), else to the image route (route B). See hibit.md.
Every image goes through one command: python "<skill-dir>/../generate2dmedia/scripts/route_media.py" image --prompt-file <txt> --reference <png> --size 1024x1024 --out-dir <new>. It picks the route in that order and prints one JSON line with route, artifact, sha256 and estimateUsd; resolve --kind image says which route would run. Existing art the user supplies is always welcome. Never claim a generation that did not happen; keep the prompt and contract and report a missing capability.
pixel_look.py makes a real 1x sprite that follows a reference picture (a sprite the user likes: the look comes from that picture, never from words), makes every pose and view from that master on its own lattice so the build cannot change, and video2dsprite pixel_motion.py makes the motion (pixel-looks.md). It is not a default and replaces nothing above; it is the one place where a model is asked for pixels, because the grid it draws is then measured and followed, never trusted.sprite_set.py). Keep every action's body height from the master's rest pose.One approved master still per character, then one image-to-video clip per action from it (video2dsprite); sheets are for FX, icons and props. Wording: prompt-rules.md; commands, framing and master.json: master-still.md.
--spec <json> and/or flags): --name, --subject, --identity (long and precise), --facing left|right|front|back, --class hero|mob|boss|prop, --finish hd|pixel|hibit (HD default; pixel or hibit only when asked; hibit makes the still flat and lineless), --identity-ref (FIRST image, copied exactly), --style-ref (SECOND: an approved peer sprite, style and framing only), --key (default #FF00FF; green or blue for purple and pink designs).python "<skill-dir>/scripts/master_still.py" generate --spec <json> --takes 3 --output-dir <new>. Each take goes through generate2dmedia route_media.py (API key first, then the local daemon); takes.png shows them side by side. Exit 3 means no route: say so; codeart2d is the fallback ("code-drawn, no image model"). With the host's own image tool: run master_still.py prompt and attach the listed references in that order.master_still.py edit --run <dir> --take N --change "<one change>" --output-dir <new> (or --master <dir>).master_still.py approve --run <dir> --take N --output-dir <new> (a still from elsewhere: --still <png> --route <what made it>). It keys the still, crops it with a 6 px margin, LANCZOS-scales it to the class framing on 1024x1024 (hero 788 px tall, top margin 138 px) and writes master.png (opaque, pure key), master_rgba.png and master.json (generate2dsprite.master.v1).master.json (identity_recap, facing, finish, class, framing, key, files, transform, route) and never re-measure the still; every clip prompt starts with "The same <identity_recap>".Report the route from master.json route. A FORGE_ROUTE_MEDIA_FAKE warning means the image is not a real generation.
image_gen is your own image tool; with no configured key use it and look at results with view_image. An image this session made that is not in the project: python "<skill-dir>/../generate2dmedia/scripts/cli_media.py" adopt --codex-thread <thread-id> --output-dir <new>, then process generated.png. codeart2d and generate2dmedia are explicit-only: open their SKILL.md when this one routes there.route_media.py takes the API or the local CLIs. Look at every PNG you make with Read; run tools with Bash; <skill-dir> is ${CLAUDE_SKILL_DIR}.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 (<skill-dir>/../video2dsprite). Keep inputs and outputs inside the project. Every tool writes a new --output-dir: it refuses an existing one, stages beside it and publishes only after its checks (--strict-qc / --strict publish nothing on failure). Success prints one JSON line; errors print error: ... and exit 1 (nothing usable is published); usage errors exit 2; a result published for inspection with QA status fail exits 4. master_still.py generate and edit exit 4 when every take failed (the run folder is kept for diagnosis) and take --progress-file <jsonl> (or FORGE_PROGRESS_FILE): one JSON line per stage for a host, never on stdout. Needs Python 3.10+, numpy and Pillow (scipy recommended). --help lists every flag. A host lists everything the skills made under a folder with python "<skill-dir>/scripts/forge_index.py" scan <dir> (one forge.asset_index.v1 JSON line: masters, sprite sets (each action's chosen and accepted take, and the package and review status of the chosen take only), FX, plates, maps; references/schemas/host.schema.json).
Record identity and reference, camera and facing, style, game display size, finish (HD by default, pixel on request), action list and phases, loop or one-shot, motion envelope, shared root and output format. Keep one accepted master and one source-to-display scale per character; mobs are no taller than the hero unless planned. A grid is not smoothness: pose spacing, timing, the loop seam and ground contact matter more. Poses, NEAR/FAR legs and timing: animation-planning.md.
native_alpha keeps real transparency (a painted checkerboard is not alpha); chroma_key uses flat magenta only when the subject has none; opaque keeps whole images (assemble_frames.py).lanczos or a premultiplied area resize for generated art; nearest only for a verified pixel grid. A high-resolution pixel-like painting is not clean 32 px art.Write the prompt yourself (prompt-rules.md; grids, phases and presets in action-recipes.md). Attach references through --reference (or your tool's real image input); a path in prose is not a reference. Keep the accepted master in every generation and describe absolute phases, not chained edits; a fix is an edit of the approved still that names the only change. Generate one action family at a time and keep wide slashes, trails and projectiles out of the body sheet. Verify the actual route, model and returned size; never claim them from the prompt.
Sheets (FX, icons, props): sheet_qc.py spill on the raw sheet, then generate2dsprite.py process, then sheet_qc.py frames, then scale_frames.py, then build_animation_clips.py, then export_engine.py. Character actions come back from video2dsprite as packaged clips.
| Need | Route |
|---|---|
| Plan a sheet for an image tool (aspect, grid, guide, prompt) | plan_guide.py --frames N --cycle run --output-dir <new>; attach guide.png, paste prompt.txt. Fixed scale and feet line: make_anchor_layout.py; empty safe frame: make_layout_guide.py |
| Check a raw sheet before slicing | sheet_qc.py spill --input <sheet> --rows R --cols C --output-dir <new>; crossing parts mean regenerate with more margin or slice by ownership, never a largest-component filter |
| Key, slice and register a sheet | generate2dsprite.py process --input <sheet> --target asset --mode <mode> --rows R --cols C --output-dir <new> --strict-qc (geometry v2; processing.md) |
| Pixel art drawn at M source px per art px | process --resampler nearest --logical-pixel M --pixel-scale N (whole scales only) |
| Jumps, bob or recoil on one registration point | process --scale-strategy registered (or --anchor-px X,Y) |
| One character's scale across actions | process --write-scale-profile <p.json> on the grounded reference, then --scale-profile <p.json> --max-profile-scale-drift 0.08 |
| Canvas does not divide into the grid; other row order | process --grid-rounding nearest or --pad-to-grid; --direction-order down,up,left,right (modes.md) |
| Identity, NEAR/FAR alternation, drift, baselines | sheet_qc.py frames --sheet <sheet> --rows R --cols C --cycle run --output-dir <new>; a duplicated half-cycle means regenerate the second half. On code-drawn frames (art_source=code) identity_residual and torso_drift are advisory |
| Game size on one canvas and root, never clamped | scale_frames.py --frames <pngs> --root-lock torso-x --row-baseline --emit-clips --ticks N --output-dir <new>; later actions add --profile <first>/scale-frames.json --action-padding L,T,R,B |
| Clips with timing, events, transitions | build_animation_clips.py --manifest clips.json --output-dir <new>; read the lints and review/ (frames-and-clips.md) |
| Whole frames or a scene loop (no keying) | assemble_frames.py (--key chroma, --slice ownership; --loop-overlap K --ambient for ambient loops only) |
| Shared palette, locks, variants, flicker (pixel finish) | palette_tool.py build, apply, lock, quantize-seq, variants, luts; strict logical grid: pixel_reduce.py (palette-and-pixels.md) |
| A character as a small real pixel sprite (a pixel look, only on request) | pixel_look.py ask-master, the image route, pixel_look.py master (the user accepts the manner, then the master); every further character beside that master with ask-cast and cast; a weapon or a pose with ask-pose and pose, a side or back view with ask-view and view (both made from the master, never as pictures of their own); lineup before any motion is shown; motion with video2dsprite pixel_motion.py (pixel-looks.md) |
| Engine export | export_engine.py --clips <animation-clips.json> --target all --output-dir <new>; Sprite3D: --target godot-sprite3d --world-height <units> (engine-export.md) |
| Play clips in a game (gait, hit-stop, transitions) | runtime-integration.md |
| Code-drawn sprites, rigs or FX, only on request | codeart2d render_pixelspec.py, rig_animate.py or fx_build.py with --build-clips (never process), then export_engine.py; disclose them as code-drawn |
| FX for a hibit game | fx_pixelfx.py check picks the route (a route the user names wins). A, pixelfx installed (recommended): fx_pixelfx.py render --pixelfx <checkout> --id <effect> --ramp ... --snap <palette.json>, pixelfx by Patch (MIT, a separate project the user clones), ship CREDITS.txt and disclose as code-drawn by pixelfx. B, otherwise: a 2x2 FX sheet from the image route, process --scale-strategy registered --cell-size 512, then hibit_fx.py pixelize --palette <palette.json> (hibit.md) |
pipeline-meta.json matte.qa (a key_ring_spill warning: add --despill-radius 1 or --key-quality soft), sheet-qc.json, the clip builder's lints. Numeric QC finds symptoms; it never approves anatomy or motion.estimateUsd), QA and remaining limits. Keep the last accepted bundle when revising.processing.md (process flags, legacy switches), modes.md, prompt-rules.md, action-recipes.md, character-animation.md (animation index), frames-and-clips.md, palette-and-pixels.md, hibit.md (hi-bit finish, plates, FX routes A pixelfx and B image), pixel-looks.md (pixel looks: small real pixel sprites that follow a reference, and their motion), engine-export.md, runtime-integration.md, video-handoff.md; data contracts in references/schemas/sprite.schema.json.
agents/openai.yaml (opens in a new tab)references/action-recipes.md (opens in a new tab)references/animation-planning.md (opens in a new tab)references/character-animation.md (opens in a new tab)references/engine-export.md (opens in a new tab)references/frames-and-clips.md (opens in a new tab)references/hibit.md (opens in a new tab)references/master-still.md (opens in a new tab)references/modes.md (opens in a new tab)references/palette-and-pixels.md (opens in a new tab)references/pixel-looks.md (opens in a new tab)references/processing.md (opens in a new tab)references/prompt-rules.md (opens in a new tab)references/runtime-integration.md (opens in a new tab)references/schemas/common.schema.json (opens in a new tab)references/schemas/host.schema.json (opens in a new tab)references/schemas/sprite.schema.json (opens in a new tab)references/video-handoff.md (opens in a new tab)scripts/assemble_frames.py (opens in a new tab)scripts/build_animation_clips.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2d-sprite, sprite-sheet, game-art, frame-animation, aseprite, godot
npx claudepluginhub 0x0funky/agent-sprite-forge --plugin agent-sprite-forge5 skills in this plugin
/codeart2dExplicit-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./generate2dmapPlan and build 2D game maps and scenes - top-down and side-scrolling levels, tilemaps, prop packs, parallax backgrounds and HD-2D battle or story plates - with collision, navigation and reachability checks, environment motion, a playable HTML preview and export to Tiled, Godot 4 or LDtk. Map art (terrain, tiles, props, plates, parallax layers) is image generation by default, through generate2dmedia route_media.py (the API when a key is configured, else the local Codex, Antigravity or Grok CLI); map data (layout, collision, exits, spawns) is written as data. Use for any map, level, room, scene, background, terrain or prop-kit request. Not for characters, creatures, items or FX (generate2dsprite), character animation (video2dsprite), code-drawn tiles or maps (codeart2d, only on request) or calling an image or video API by itself (generate2dmedia)./generate2dmediaThe art-route layer of the Forge skills. route_media.py is the one command that generates an image or an image-to-video clip - through the paid API of any provider whose key is configured (OpenAI, Google Gemini, xAI, BytePlus ModelArk, fal.ai; the configured key is the owner's consent), else through the user's own signed-in Codex, Antigravity or Grok CLI - and prints one JSON line with the route, artifact, sha256 and cost estimate; with no route it answers no-route (codeart2d is then the last resort). Also the capability check (forge_doctor), API key configuration, the spend ledger, resume and Codex image adoption. Use when a Forge skill sends a generation here, for the capability check, or when the user asks about keys, routes or spend. Not for planning, processing or QA of sprites, video frames or maps (generate2dsprite, video2dsprite, generate2dmap) or for code-drawn art (codeart2d)./video2dspriteTurn one approved master still into a character's whole animated sprite set - one image-to-video clip per action (idle, walk, run, attack, jump, hurt, cast and so on), all from that still, generated through generate2dmedia route_media.py (the xAI API when a key is configured, else the local Grok CLI) - then gate each take, key it with a soft matte, register it to the master, pick loops or retime actions, finish (HD by default, pixel on request) and package fixed-canvas frames, alpha WebM, packed MP4 for iPhone and a PNG fallback with engine metadata and a JS runtime. Also processes a supplied clip. Use for character and creature animation, fluid motion and any video-to-sprite work. Not for FX, icon or prop sheets (generate2dsprite), maps or plate loops (generate2dmap), code-drawn animation (codeart2d, only on request) or calling a video API by itself (generate2dmedia).Other plugins' skills for the same job