sprite-director
GitHubSprite Director 用于生成、动画和验证像素艺术精灵。根据资产类型路由请求,支持角色、生物、特效及地形瓦片,利用 ImageGen 创建主图并通过确定性渲染器或原生 Rig 引擎输出游戏级 PNG 文件。
Trigger Scenarios
Install
npx skills add JohnKinyanjui/sprite-maker --skill sprite-director -g -y
SKILL.md
Frontmatter
{
"name": "sprite-director",
"description": "Infer, create, animate, and validate original pixel-art sprites for Sprite Studio. Use for brief prompts that ask to make, draw, generate, revise, or animate characters, props, terrain, effects, icons, tiles, or style-inspired game assets, especially when canvas size, frame count, palette, category, or FPS are not specified."
}
Sprite Director router
Turn the user's intent into real, game-ready PNG files. The Rust harness routes the request by asset kind. Do not stop at a description or plan when creation is requested.
Direct the asset
- Preserve every explicit user constraint.
- Infer only missing production details from
references/style-presets.md. - Translate named-game inspiration into broad visual traits and create an original design. Never reproduce a specific protected character, costume, logo, or exact sprite.
- Prefer a transparent background, a compact palette, one-pixel-readable clusters, a clear silhouette, and consistent light direction.
- Use the harness brief supplied above the request as the default. Override it only when the user's explicit words conflict.
Route
character: followreferences/character-harness.md. ImageGen creates only a new master; animation uses the deterministic rig renderer.creature: followreferences/creature-harness.md. Lock one ImageGen master, then animate anatomical segments with the deterministic rig renderer.effect: followreferences/effect-harness.md. ImageGen creates one high-quality VFX master/keyframe; deterministic raster motion creates the final frames.- animated
propor other game object: follow the deterministic game-object rig harness. - a
/rigrequest or an explicit ask for joint points, capsule bones, or pose keyframes: followreferences/native-rig-engine.md. Return onerig-suggestionJSON block; the app's Rust engine renders the frames. - full
terrain tileset: followreferences/terrain-tileset-harness.mdand return one atlas PNG, never one file per tile. - static
propand individual terrain objects such as trees or rocks: use the deterministic renderer workflow below.
The routed harness name appears above the request. Do not substitute another harness.
Deterministic renderer for non-character jobs
Write one JSON spec under .sprite-studio/, then run:
python3 .sprite-studio/sprite_tool.py .sprite-studio/<spec>.json
The spec supports name, category, size, fps, palette, and frames. A frame supports pixels or commands:
pixel:x,y,colorrect:x,y,w,h,colorline:x1,y1,x2,y2,thickness,colorellipse:x,y,w,h,colorpolygon:points,color
Use terrain, props, or effects as the category. Character jobs must use the character harness and ImageGen instead.
Native Rust rig renderer (preferred)
For any raster master that needs animation, use the Sprite Studio MCP native rig path — do not call python3 .sprite-studio/sprite_rig.py unless the user explicitly requests the legacy Python renderer for debugging.
suggest_rig_pointsoranalyze_rig_fiton the masterassetIdto seed joints and morphology.save_rigwith points, bones, and motion frames bound to the master asset.render_rig_animationto emit frame PNGs and a draft animation in the workspace.
The bundled Python sprite_rig.py remains for offline compatibility only; agents and chat flows should use MCP save_rig + render_rig_animation. ImageGen must never invent animation timing, poses, or pose sheets. When the user explicitly selects AI Polish or Full redraw, follow references/ai-frame-polish-contract.md: edit only completed rough rig frames before acceptance.
After promote_anchor, read get_character_profile for palette, dHash, linked rigId, and known directionFamilies before generating follow-up motions.
Validate
Follow references/quality-gates.md. Verify every reported PNG exists and report the asset name, logical dimensions, frames, FPS, and category concisely. Do not expose internal spec paths unless troubleshooting.
Post-generation pipeline (Sprite Studio MCP)
When animation frames come from AI strips or need production hardening, prefer the single orchestrator instead of ad-hoc Python crops:
- Promote anchor — after the user approves a character master, call
promote_anchorwithautoOrient: true(side view) so.sprite-studio/anchors/<slug>.jsonbecomes the size and foot-baseline authority. Runcheck_anchor_facingbefore locomotion strips; useorient_anchorif facing is not canonical W. - Generate strip-first — prefer one horizontal strip per action with a shared anchor silhouette; never independent frame generations for locomotion.
harden_animation— idempotent chain: optionalsourcePath+frameCountsplit →clean_alpha→normalize_animation(lock-first + shared scale) → optionalsnap_to_pixel_grid→check_size_contract→ optionaloptions.deriveMirroredFacing: "e"after pass → optionalqueue_contract_retrywhenoptions.queueContractRetry: trueandconversationIdis set. Writes.sprite-studio/last-generation.jsonfrom the animation frames.- Multi-facing RPG (8-dir) — generate only N, E, S, NE, NW; derive SE←NE, SW←NW, W←E with
mirror_animationorqueue_direction_set(set: "8"). Finish withcheck_character_contracton the character worktree. - Manual steps (only when debugging) —
score_stripbefore import;split_strip/extract_video_frames;align_framesfor 1–2 px nudges;retry_size_contract+finalize_contract_retryinstead of autonomous retry. - Accept —
check_size_contractmust pass, thenset_animation_review_statuswithacceptedbefore export or sprite-sheet jobs. - Batch motions — after the canonical west-facing walk passes contract, call
queue_motion_batch(onlyMissing: trueto skip motions already satisfied) and pollget_jobper motion. - Ship pack — when the character worktree passes
get_production_scoreandcheck_character_contract, callexport_character_packwith a workspace-relativedestination(setincludeAnimatedPreviews: truefor GIF previews).
Typical agent flow after frames exist: harden_animation → if contractReport.passed is false and a chat is available, call again with options: { cleanAlpha: false, normalize: false, queueContractRetry: true } (skip re-normalizing) → poll get_job → set_animation_review_status accepted** → optional **queue_motion_batch** → **export_character_pack`.
Other MCP tools: score_animation_frames (per-frame motion QC), list_facing_checks (anchor facing history), queue_region_regen (masked frame repair with rect regions and optional brushStrokes). Pose-only in-betweens: MCP interpolate_rig_frames. Rendered PNG in-betweens inserted into an animation timeline: Tauri/UI command interpolate_rig_animation_frames (not exposed on MCP — use the Rig editor or invoke the Rust command from the app). Optical flow is permanently deferred — use rig bridge, motion-aware midpoint, or rendered in-betweens instead.
Always write .sprite-studio/last-generation.json for static and animated outputs so the workbench can recover assets without a manual rescan.
Version History
-
9de73a6
Current 2026-09-27 11:29
修复 CI 中 ffmpeg 下载失败问题;解决 Linux CI 路径拼接错误;增强工作室工作流稳定性,包括调试日志、提示词优化取消竞态及并行生成支持。
- 336c711 2026-08-27 09:01


