{"slug":"pixel-sprite-animator","version":"1.3.0","category":"visuals","mode":"byok","locale":"en","files":[{"path":"SKILL.md","content":"---\nname: pixel-sprite-animator\ndescription: \"Generate 4-direction walk/attack keyframes with locked 16-color palettes and pixel-aligned slicing.\"\nversion: \"1.3.0\"\ncategory: visuals\nengines: [godot4, unity, phaser]\nmodalities: [image, code]\nhomepage: \"https://aigameskills.com/skills/pixel-sprite-animator\"\n---\n## Purpose\nEliminate blurry \"mixels\" (inconsistent pixel sizes) and drifting character proportions across animation frames.\n\n## Workflow Rules\n1. **Lock Grid & Palette First**: Specify target cell size (`32x32` or `64x64`), orthographic camera angle (top-down 3/4 RPG vs side-scroller), and a strict 12-to-16 swatch hex palette before invoking image generation.\n2. **Generate Solid Keyframes on Chroma Magenta**: Request crisp, nearest-neighbor silhouettes on flat `#FF00FF` background with zero anti-aliasing along outer contours.\n3. **Run Grid Normalization**: Pass generated frames through `scripts/slice-spritesheet.ts` to snap centroids to baseline pixels and export engine-ready metadata (Godot `SpriteFrames` `.tres` or Phaser Atlas JSON).\n\n---\n## BYOK Configuration (Manual Mode)\n\n- Configure your own upstream provider endpoints and keys (`OPENAI_API_KEY`, `GEMINI_API_KEY`, `FAL_KEY`) in `.env` before running bundled scripts.\n- Switch to zero-setup unified Mana credits anytime with `npx aigameskills add pixel-sprite-animator`.\n"},{"path":"scripts/generate-spritesheet.ts","content":"const UPSTREAM_API_BASE = process.env.OPENAI_BASE_URL ?? 'https://api.openai.com/v1';\nconst UPSTREAM_API_KEY = process.env.OPENAI_API_KEY ?? process.env.GEMINI_API_KEY;\nif (!UPSTREAM_API_KEY) {\n  throw new Error(\"BYOK mode requires OPENAI_API_KEY or GEMINI_API_KEY in your environment.\");\n}\nexport async function requestSpriteStrip(characterPrompt: string): Promise<string> {\n  const response = await fetch(`${AGS_API_BASE}/images/generations`, {\n    method: 'POST',\n    headers: {\n      Authorization: `Bearer ${AGS_API_KEY}`,\n      'Content-Type': 'application/json',\n    },\n    body: JSON.stringify({\n      skillSlug: 'pixel-sprite-animator',\n      prompt: `16-bit pixel art 4-frame horizontal sprite strip, ${characterPrompt}, flat #FF00FF background, crisp 1px outline, nearest-neighbor`,\n      size: '1024x256',\n    }),\n  });\n  if (!response.ok) throw new Error(`Sprite generation failed: ${response.status}`);\n  const payload = (await response.json()) as { data: Array<{ url: string }> };\n  return payload.data[0]?.url ?? '';\n}\n"}],"installCommand":"npx aigameskills add pixel-sprite-animator"}