/vibedgames:animated-spritesheetsfrom vibedgames
Generates a character's animation frames as a labeled pose-board image, then slices and packs them into an engine-ready spritesheet.
Ships in vibedgames. 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.
Turn a character into a packed, engine-loadable spritesheet by generating one labeled pose-board image — a grid of the same character in the frames of an action — then recovering/slicing it. This is the image-generation method.
Why image generation, not image-to-video. One generation per action keeps identity consistent (cloak/face/weapon stay the same across frames); video morphs the character mid-clip. Trade-off: fewer frames (a model reliably lays out ~4–12 grid cells, not a long strip), so motion is choppier — per-frame pose labels + pixel-snapping make the few frames count.
You are an agent. All scripts run with node <script> — no Python, no uv, and
nothing to install: each imports a bundled, dependency-free scripts/_lib/.
# This skill's directory. Claude Code substitutes CLAUDE_SKILL_DIR (project, global
# or plugin install); other agents fall back to wherever `vg init` put it.
SKILL="${CLAUDE_SKILL_DIR}"
[ -d "$SKILL" ] || for d in .agents/skills .claude/skills ~/.agents/skills ~/.claude/skills; do
[ -d "$d/animated-spritesheets" ] && SKILL=$d/animated-spritesheets && break
done
# 0. (once) An approved character anchor PNG on a flat chroma matte (the identity
# reference). Make it via the pixel-art skill, or:
node $SKILL/scripts/sprite-prompt.mjs anchor --direction e --chroma '#00FF00' # -> vg generate run
# 1. ASK what the action needs (frame count / fps)
node $SKILL/scripts/sprite-presets.mjs --action attack --json
# 2. PROMPT — get the labeled pose-board prompt (per-frame semantic poses on an
# implied 4x3 grid, identical-character + no-shadow litany, the craft):
node $SKILL/scripts/sprite-prompt.mjs pose-board --action attack --direction e --frames 8 \
--frame-prompt-style specific --pose-board standard --style lobit-v1 --chroma '#00FF00'
# 3. GENERATE the pose board with the anchor as the identity reference. The board
# is a 4-col x 3-row grid; the first N cells are the frames (4:3 aspect). Use 2K
# so each cell clears ~512px — pixel snapping (step 4) needs that resolution to
# recover a clean grid:
vg generate run fal-ai/nano-banana-pro/edit --prompt "<from step 2>" \
--image_urls '["<anchor_url>"]' --aspect_ratio "4:3" --resolution "2K" \
--download attack-board.png --json
# 4. PROCESS into runtime frames with ONE command. Default = naive uniform slice
# (the robust path). Add --recover to re-center a pose that drifted off its cell
# (it falls back to the uniform slice if it can't, so passing it is always safe):
node $SKILL/scripts/process-sheet.mjs attack-board.png --action attack --rows 3 --cols 4 --frames 8 --out-dir runs/hero-attack
--download x.pngdoes not make the file a PNG. The model chooses the output format, so an endpoint that answers JPEG writes JPEG bytes into the.pngyou named, and every script here — they read PNG only, by design — rejects it withNot a PNG file (bad signature).vg generatewarns when the bytes contradict the extension; when it does, pick an endpoint that returns PNG rather than trying to convert (there is no converter in this toolkit, and no ImageMagick/ffmpeg to fall back on).nano-banana-pro/editreturns PNG;flux/devreturns JPEG.
The deliverable is <out-dir>/spritesheet.png + spritesheet.json, with
runtime/ frames and review/<action>.gif. Load it:
// spritesheet.json -> { frameWidth, frameHeight, frameCount, fps, animations }
this.load.spritesheet("attack", "assets/hero-attack/spritesheet.png", {
frameWidth: 256,
frameHeight: 256,
});
this.anims.create({
key: "attack",
frameRate: 10,
frames: this.anims.generateFrameNumbers("attack", { start: 0, end: 7 }),
}); // end = frameCount - 1
Ship it as PNG or lossless WebP (--columns so no side exceeds 4096 px — mobile GPUs load a wider strip as an empty texture). Lossy WebP makes pixel-art sheets 51–85% bigger, not smaller.
process-sheet.mjs does (under the hood)--rows × --cols slice (the
robust path). --recover instead re-centers each cell's foreground component to
rescue a pose that drifted off-grid; it can't split poses that merged into one
blob, so it falls back to the uniform slice when it can't fill the cells —
passing --recover is always safe. --frames N takes the first N cells.chroma-clean.mjs clean — key the matte → fringe → despill → decontaminate
(global speck-removal so dark/low-contrast sprites stay clean).--no-pixel-snap keeps the smooth high-res look (for painterly/non-pixel
sprites); --snap-k-colors sets palette size. Needs ≥~512px cells to work well
— hence the 2K board (see pixel-snapper). The snapper is a port of an
MIT-licensed upstream; attribution in references/credits.md.normalize-canvas.mjs — place each frame on a shared 256×256 anchor with
headroom (--char-fill, default ~0.5 of the cell) so attack arcs and big
poses never clip the edge.pack-spritesheet.mjs — pack to spritesheet.png + manifest.sheet-qc.mjs — QC the packed sheet and report a verdict (same token in the
--json qc field and the human badge, just uppercased there): clean /
review (soft hints to eyeball — size outliers, possible facing flips) /
warn (hard defects — empty cells, edge-clipping, foot-baseline wander,
an inked cell grid). Runs automatically; --no-qc skips it. Read the
verdict: regenerate the board on warn; eyeball review/<action>.gif on
review. Run it standalone too: sheet-qc.mjs sheet.png [--json] [--strict].
The grid check deserves special attention: models routinely ink the cell
outlines despite the prompt forbidding them, and the uniform slice bakes a
black rule into every frame. That rule then joins each frame's bounding box,
so size/baseline/facing get measured against the rectangle rather than the
character — a grid warn makes the rest of the report meaningless, so
regenerate rather than reading past it.sprite-prompt.mjs pose-board:
(1) it always frames the used cells as consecutive film frames of one continuous
motion sampled at evenly-spaced instants; (2) with --frame-prompt-style specific
(the default) it writes per-frame labels as monotonic spatial progression along a single path
(weapon back → wind-up peak → mid-strike across centerline → contact →
follow-through → recover), not abstract beats. If you add an action to
sprite-presets.mjs / frame_label, label it as progression along one path —
that, not the frame count, makes it read as motion._pose_board_facing_lock);
--direction e/w adds a side-profile lock. sheet-qc.mjs catches gross flips;
eyeball the gif for subtle ones.normalize_canvas can't
un-drift mixed scales, so sheet-qc.mjs flags size outliers (sparing monotonic
pose arcs like a death collapse).#00FF00 (#FF00FF if the subject is green). Generate-time
prompts must forbid baked shadows — the engine adds those.sprite-presets.mjs (frames, fps, profiles).One labeled pose-board image, one consistent character, recovered into frames. Fewer frames than a video clip, but they're the same character across the whole animation — which is what a game sprite needs most.
For 3D props built the same generate-one-reference-image way (rigged,
procedural Three.js instead of frames), see image-to-threejs.
references/credits.md (opens in a new tab)references/model-map.json (opens in a new tab)scripts/_lib/asset-tools.mjs (opens in a new tab)scripts/build-sequence-gif.mjs (opens in a new tab)scripts/chroma-clean.mjs (opens in a new tab)scripts/normalize-canvas.mjs (opens in a new tab)scripts/pack-spritesheet.mjs (opens in a new tab)scripts/pixel-snapper.mjs (opens in a new tab)scripts/process-sheet.mjs (opens in a new tab)scripts/recover-component-frames.mjs (opens in a new tab)scripts/sheet-qc.mjs (opens in a new tab)scripts/size-contract.mjs (opens in a new tab)scripts/sprite-presets.mjs (opens in a new tab)scripts/sprite-prompt.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kyh/vibedgames --plugin vibedgames35 skills in this plugin
/animationMake 2D sprite animation read well: frame budgets per clip, timing and spacing, cancel windows, smears, secondary motion, wiring clips in Phaser. Generating frames is pixel-art / animated-spritesheets./asepriteParse Aseprite files (.ase/.aseprite) — layers, cels, tags, slices, palettes, tilesets — into JSON, durations and bounds for engines and tools./ask-meInterview the user about a fuzzy game idea, one question at a time, until it is build-ready. Skip when they already know what to build./asset-pipelineAudit 2D game art on disk: validate an asset manifest against PNGs, probe sprite sheets and tilesets for occupied frames, report sizes, fix sprite baselines./capacitor-iosShip a Three.js + Vite app on Capacitor iOS: GLTF loading, animation UI, OrbitControls touch mapping, Swift Package Manager, iOS sync and run troubleshooting./character-designCreate consistent characters with `vg generate`: reference and expression sheets, outfit variants, identity-preserving edits, character-to-video.Other plugins' skills for the same job