Sprite Animation logo

Sprite Animation

Community
danicat
sprite-animation

2D sprite sheet management, frame animation sequencing, and Aseprite integration guide for games. Covers sprite grid slicing, animation state machines (idle, walk, attack, death), frame duration timing, tag loops, and Go animation controllers in Ebitengine. Activate when slicing sprite sheets, configuring character animations, integrating Aseprite files (.ase/.aseprite), or writing game animation controllers.

Overview

Publisherdanicat
Repositoryskills
Skill namesprite-animation
Stars
24
Forks
4
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by danicat on GitHub. Read the source before you install it.

Installation

Install the Sprite Animation AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/danicat/skills/tree/main/game-dev/sprite-animation
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/danicat/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/game-dev/sprite-animation .claude/skills/sprite-animation
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sprite Animation in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sprite Animation on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sprite Animation is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

2D Sprite Animation & Aseprite Integration Guide (Animator Role)

This skill equips AI agents acting in the Animator Agent Role with the specifications, deterministic CLI slicing tools, and fail-fast Ebitengine v2 Go controllers required to design, validate, slice, and manage 2D character sprite sheets, animation frame sequences, tag loops, and Aseprite files (.ase / .aseprite / .json).


1. Animator Agent Role & Core Responsibilities

In a game development workflow, the Animator Agent owns all 2D sprite animation pipelines:

  1. Fail-Fast Asset Validation & Grid Slicing: Validates sprite sheet images using file / mimetype and scripts/slice_spritesheet.py to verify binary integrity and exact frame grid divisibility before loading.
  2. Animation Tag & State Specification: Defines animation tags (idle, walk, run, attack, hurt, death, cast), positive frame durations (40ms–200ms), and loop modes (LoopForward, LoopReverse, LoopPingPong, LoopOnce).
  3. Zero-Allocation Frame Pre-Slicing: Pre-slices all ebiten.Image.SubImage frame references at load time (NewGridSpriteSheet) and reuses a persistent ebiten.DrawImageOptions field (ac.drawOp) so Draw() performs zero heap allocations.
  4. Fail-Fast State Transitions: Rejects corrupt sprite sheet dimensions, non-positive frame durations, out-of-bounds tag ranges, and unknown animation tag names with rich fmt.Errorf diagnostics.

2. Technical Reference Standards & Companion Scripts

ModulePathKey Topics Covered
Go Animation Controllerreferences/animation_controller.goFail-fast GridSpriteSheet (load-time SubImage pre-slicing) and zero-allocation AnimationController with delta-time (dt) accumulation and horizontal flipping.
Aseprite Binary Format & GPLreferences/aseprite_format.mdHeader, frame headers, cel chunks (0x2005), tag chunks (0x2018), 9-patch slices (0x2022), GIMP .gpl RGBA palettes, and zero-alloc goaseprite wrapper.
Deterministic Grid Slicer CLIscripts/slice_spritesheet.pyPEP 723 (pillow>=10.0.0) CLI script that validates PNG dimensions against --frame-width / --frame-height, slices grid cells, and exports an Aseprite-compatible JSON manifest + optional frame PNGs.

3. Deterministic Sprite Sheet Validation & Slicing (scripts/slice_spritesheet.py)

Never assume an image is a valid PNG or has evenly divisible grid dimensions based on its filename. Always validate the binary format and run scripts/slice_spritesheet.py:

bash
# 1. Verify actual binary MIME/file type
file assets/sprites/player_sheet.png
# Expected: PNG image data, 256 x 128, 8-bit/color RGBA

# 2. Validate grid divisibility, define animation tags, and export Aseprite JSON manifest
uv run scripts/slice_spritesheet.py assets/sprites/player_sheet.png \
  --frame-width 32 \
  --frame-height 32 \
  --duration-ms 100 \
  --tag idle:0:5:150:forward \
  --tag run:8:15:80:forward \
  --tag attack:16:21:60:forward \
  --tag death:24:31:100:forward \
  --output-json assets/sprites/player_sheet.json \
  --export-frames-dir build/frames/player

If player_sheet.png is not an exact integer multiple of --frame-width and --frame-height, slice_spritesheet.py fails fast with a non-zero exit code and reports the exact pixel remainder to stderr.


4. Animation State Machine Benchmark Table

Animation TagFrame Range / CountFrame DurationLoop ModeGameplay Trigger / Transition
idle4–8 frames120ms–180msLoopForwardDefault state when velocity is zero (VX=0, VY=0).
walk / run8–12 frames60ms–100msLoopForwardActive when moving (VX != 0 or VY != 0).
jump / fall2–4 frames100msLoopOnceTriggered on airborne launch; holds final frame until landing.
attack6–10 frames40ms–80msLoopOnceTriggered on attack action. Invokes OnComplete callback back to idle.
hurt3–5 frames50msLoopOnceTriggered on damage hit alongside Kage hit-flash shader.
death6–10 frames100msLoopOnceTriggered on zero health. Holds final collapse frame without looping.

5. Fail-Fast Integration Patterns in Ebitengine

5.1 Pre-Sliced Grid Sprite Sheet & Controller (references/animation_controller.go)

go
sheet, err := NewGridSpriteSheet(embeddedSpriteImage, 32, 32)
if err != nil {
	return fmt.Errorf("load player sprite sheet: %w", err)
}

controller, err := NewAnimationController(sheet)
if err != nil {
	return fmt.Errorf("init player animation controller: %w", err)
}

if err := controller.AddTag(AnimationTag{
	Name:          "idle",
	StartFrame:    0,
	EndFrame:      5,
	FrameDuration: 150 * time.Millisecond,
	Loop:          LoopForward,
}); err != nil {
	return err
}

if err := controller.AddTag(AnimationTag{
	Name:          "run",
	StartFrame:    8,
	EndFrame:      15,
	FrameDuration: 80 * time.Millisecond,
	Loop:          LoopForward,
}); err != nil {
	return err
}

if err := controller.Play("run"); err != nil {
	return err
}

5.2 Zero-Allocation Update and Draw Usage

go
// In Update():
if err := p.Controller.Update(dt); err != nil {
	return err
}

// In Draw(screen *ebiten.Image):
// Uses pre-sliced sheet.Frames[currentFrame] and persistent controller.drawOp (0 allocs/op)
if err := p.Controller.Draw(screen, p.X, p.Y, p.FacingLeft); err != nil {
	panic(err)
}

6. Animator Agent Pre-Flight Checklist

Before completing animation code or sprite assets:

  • Validated File Format: Verified image using file CLI tool (ensuring valid RGBA PNG and no misnamed JPEG/WebP headers).
  • Grid Math Verified: Verified exact divisibility via scripts/slice_spritesheet.py and NewGridSpriteSheet.
  • All Animation Tags Validated: Checked that StartFrame <= EndFrame < TotalFrames and FrameDuration > 0.
  • Pre-Sliced SubImage Frames at Load Time: Never call SubImage or allocate ebiten.DrawImageOptions inside Draw().
  • Horizontal Flipping Handled: Configured negative matrix scale (Scale(-1, 1) + Translate(FrameWidth, 0)) for left-facing orientation without duplicating sprite sheets.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sprite Animation AI skill do?

2D sprite sheet management, frame animation sequencing, and Aseprite integration guide for games. Covers sprite grid slicing, animation state machines (idle, walk, attack, death), frame duration timing, tag loops, and Go animation controllers in Ebitengine. Activate when slicing sprite sheets, configuring character animations, integrating Aseprite files (.ase/.aseprite), or writing game animation controllers.

Why use Sprite Animation on TypingMind?

Because you install it once and use it with any model. Sprite Animation is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sprite Animation in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/danicat/skills/tree/main/game-dev/sprite-animation. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sprite Animation?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sprite Animation?

As many as you like. As long as a model supports skills, you can use Sprite Animation with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sprite Animation AI skill free?

Yes. It is published on GitHub by danicat under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇