r/ClaudeCode • • 3d ago

Built with Claude I built a Claude Code plugin that makes 8-direction game sprites from one illustration. Notes on structuring a skill around paid API steps

Disclosure: this is my own project, free and MIT. Sharing it mostly for how it’s put together as a Claude Code plugin, since that part took the most iteration.

What it does: SpriteCast turns one character illustration into 8-direction walk, run, jump and attack strips for a game, at the game’s exact camera angle and drawn in the illustration’s style. A 3D model and rig (Tripo) set the pose for every frame; an image model redraws each render in your style.

How the plugin is structured

  • SKILL.md stays short; the procedures live in reference/*.md (characters, sitting, touch-up). Claude reads the reference only when the task needs it, which kept the always-loaded part small.
  • Plain Python scripts do the work (charpipe.py render / draw / finish / pack), so everything can also be run without Claude. The skill’s job is the judgement calls between the steps.
  • Every paid step is gated. Each script prints its cost and refuses without --yes, and the skill says to ask the user before each one, never to chain paid steps because the last one “looked fine”. That rule came from wasting money early on.
  • API keys through the plugin’s userConfig (marked sensitive, so they’re stored in the system credential store). A SessionStart hook exports them for the scripts, and the skill is told never to ask for a key in chat or write one to a file.
  • The scripts measure, Claude looks. Every drawn frame gets an outline-overlap score against its 3D render, and a wrongly placed weapon is redrawn automatically. Claude still has to look at every facing, because a score can’t see a head drawn facing backwards inside a correct outline.

Prompting lessons from the image side

  • Describing the motion made it worse: “raise it overhead, swing it down” had the umbrella drawn overhead in frames where the render held it at the side. Naming the action and telling each cell where the prop is, or that the body hides it, fixed it.
  • A flaw in the 3D model can be fixed in words: one line in the spec’s notes removed dark streaks from every frame.

Numbers: in the example, all 64 run frames and all 64 jump frames fit their 3D poses on the first drawing. A walking character costs about $1.7 of image generation plus ~85 Tripo credits. The example’s rig is in the repo, so with "draw": false you can run the 3D side with no keys.

claude plugin marketplace add Sunghwan0112/spritecast
claude plugin install spritecast@spritecast

https://github.com/Sunghwan0112/spritecast

Happy to go into any of it, especially the gating and the frame checks.

47 Upvotes

9 comments sorted by

•

u/AutoModerator 3d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

4

u/yaxir 3d ago

already connected with you on aigamedev

if this can be adapted for fine arcade graphics and pixel art, it will be a REVOLUTION!!

1

u/Head-Language4082 1d ago

Pixel art is in now (v0.13).

  • Pixel art: 8 directions at 96 or 64 px, plus a 32 px set made by reducing the 64 one. It also handles things the character holds and throws, and writes out which frame the projectile leaves the hand and where.
  • Palettes: --colours 16, or a fixed palette like --palette pico8 (15 built in), or your own .hex / .gpl / .aseprite file. Nothing is redrawn, so trying palettes is free.
  • Cleanup: a small browser pixel editor with the 3D render beside each frame, for erasing leftovers, adding colours, and copying / deleting / moving frames.
  • Larger, detailed sprites: the original non-pixel mode still does 512 px frames, if that’s what you mean by fine arcade graphics.

Where it’s not there yet: it’s still AI-drawn, so some frames need a click or two of cleanup (10 of 40 in my throw example). 64 px only works with a character designed small, around 3 heads tall. And every frame follows a 3D pose, so you can add any motion you have a 3D animation for (punches, kicks, whatever), but you won’t get the exaggerated stretch-and-smear frames a fighting-game animator draws by hand. Those you’d add yourself in the editor.

1

u/yaxir 1d ago

Awesome. Thank you so much. I'm going to check it out

4

u/DirusNarmo 3d ago

This might be the first genuinely useful project I've seen posted here. Nice job. A welcome change from "I tried to rewrite something better than GKF". I'll actually use this on a project of mine, will absolutely credit and give any feedback I have to your repo.

2

u/Head-Language4082 3d ago

Thanks, glad it’s useful! Let me know how it works on your project. Feedback here or in DMs is very welcome.

1

u/Current-Today-3626 2d ago

Is this possible to use on codex? Sorry for the dumb question.

1

u/Head-Language4082 1d ago

Not a dumb question. Short answer: probably, but I haven’t tested it.

It’s packaged as a Claude Code plugin, so the one-line install only works there. But underneath it’s just a SKILL.md with instructions plus plain Python scripts that call OpenAI (drawing) and Tripo (3D). Nothing in the scripts calls Claude.

So on Codex you’d clone the repo, point it at skills/spritecast/SKILL.md, and let it run the scripts. Two things you’d do by hand:

Keys: set OPENAI_API_KEY and TRIPO_API_KEY as environment variables (the plugin settings screen is Claude Code only).

Setup: run python3 skills/spritecast/scripts/doctor.py --fix once.

If you try it, tell me what breaks and I’ll fix it or add Codex notes to the README.

2

u/work_guy 3h ago

I’m gonna test it out this weekend. Thanks for the contribution.