The sprite-sheet skill is an executable Node script that divides a sprite sheet image into individual frame PNGs using the sharp image-processing library. It ships as part of funplay-skill, a game-development skills library for coding agents that contains 12 skills total, each declared with SKILL.md frontmatter specifying name, description, dependencies, inputs, and outputs.
What Is funplay-skill
Funplay-skill (version 0.1.0) provides 12 skills organized into two categories: executable scripts that transform assets directly, and conversational workflows that guide review and planning. The library is engine-agnostic and designed to work alongside dedicated MCP servers for Unity (79 tools), Godot (105 tools), and Cocos Creator (67 tools). The sprite-sheet skill belongs to the executable category alongside normal-map and audio-format-convert.
The skill's only dependency is sharp, a high-performance Node.js image-processing module. It targets any engine that accepts PNG input—Unity 2022.3 or later, Godot 4.2 or later, Cocos Creator 3.8 or later, or custom engines.
How the Slicing Works
The script takes three inputs: a source image path, a row count, and a column count. It reads the image dimensions, divides the pixel space into a uniform grid based on those values, and writes each cell as a separate PNG file.
This approach assumes every frame occupies the same width and height. Non-uniform layouts—texture atlases with varying sprite sizes or packed sheets from tools like TexturePacker—fall outside this skill's scope. For those, the texture-atlas skill handles 2D atlas grouping, padding, naming, and manifest planning.
Running the Script
Invoke the slice script from the command line:
node skills/sprite-sheet/scripts/slice.mjs <image> <rows> <cols>
Replace <image> with the path to your sprite sheet, <rows> with the number of rows, and <cols> with the number of columns.
Concrete Example
Assume you have a character run cycle sprite sheet at assets/player_run.png arranged as 4 rows and 6 columns (24 frames total):
node skills/sprite-sheet/scripts/slice.mjs assets/player_run.png 4 6
The script reads the source image with sharp, calculates each frame's pixel dimensions by dividing total width by 6 and total height by 4, crops every frame, and writes 24 individual PNG files to the output directory.
Common Use Cases
Use sprite-sheet when you have uniform grid sprite sheets exported from tools like Aseprite, Piskel, or Photoshop. Typical scenarios include:
- Character walk, run, and attack animations exported as a grid
- Tile sets arranged in a uniform grid for 2D level editors
- UI icon sheets with consistent cell sizes
- Particle effect frames rendered sequentially into a grid
The output PNGs work in any engine since the skill carries no engine-specific dependencies or metadata requirements.
Gotchas and Limitations
Uniform grids only. The script divides total image dimensions by the row and column counts to determine frame size. If your sprites are not evenly spaced, or if the sheet includes padding, spacing, or metadata rows, the cuts will be misaligned. Inspect your sheet layout before running.
No manifest or JSON output. The sprite-sheet skill outputs individual PNG files but does not generate a manifest mapping frame names to coordinates or timing. If your engine requires a sprite animation manifest, use the texture-atlas skill for atlas planning instead.
Sharp must be installed. The script imports sharp at runtime. If the package is missing from your environment, the script fails immediately. Ensure Node.js and the sharp dependency are available.
No nine-slice support. UI sprites that need nine-slice borders, pivot-point alignment, or padding checks require the ui-slicing-checklist skill. That skill reviews exports for nine-slice readiness rather than performing automated slicing.
Single sheet per invocation. The script processes one image per run. Batch processing multiple sheets requires a wrapper script or shell loop.
Combining with Other Skills
The sprite-sheet skill fits into a broader asset pipeline. After slicing frames, you can generate normal maps for individual textures:
node skills/normal-map/scripts/generate.mjs assets/player_run_0.png
Or convert audio files across formats:
node skills/audio-format-convert/scripts/convert.mjs assets/sfx_jump.wav ogg
For non-script workflows, slash commands route to conversational skills. /brainstorm-game maps to gameplay-prototyping, /review-level maps to level-design-review, and /engine-safe-edit selects the correct engine-facing workflow before modifying project files.
Related Repositories and Resources
- Primary repository: funplay-skill on GitHub
- Unity MCP server (79 tools): funplay-unity-mcp
- Godot MCP server (105 tools): funplay-godot-mcp
- Cocos MCP server (67 tools): funplay-cocos-mcp
- More tutorials: gamebooom.ai blog
Run node skills/sprite-sheet/scripts/slice.mjs on your next uniform sprite sheet and drop the output frames straight into your engine's animation pipeline.