studioigor/ref2game/codex
Claude Code and agent skill by studioigor/ref2game
- community
Checking that the SKILL.md file is still in the repository.
Turn a reference (a screenshot, gameplay video, key art, concept art or mood image) into a live, playable 2D game slice that looks shipped, not like AI slop, and feels alive. Any 2D genre (platformer, top-down, isometric, shmup, puzzle, card/UI, runner…) and any style (pixel, painterly, cel/ink, flat vector, hand-drawn, watercolour, neon…). Art is AI-generated with the Codex session's built-in imagegen tool. Effects, rigs, animation, wind, reactive objects, critters, game feel, camera and HUD a…
Install
npx vskill@latest install studioigor/ref2game/codexSKILL.md
ref2game: reference → alive, playable 2D game slice
You turn a reference into a live, playable slice in its style. The user watches it in a browser page that reloads itself while you work. You also deliver the assets and a packed build.
There are two sources of truth:
art/gen/*.png: the generated art;live/*.js: the code (effects, rigs, simulation, scene).
This folder is self-contained: scripts, engine templates, references and Playwright.
Codex runtime
<skill>is this skill's directory. Run project scripts from the project root; quote paths that contain spaces.- Image generation. All raster generation and creative edits use the session's built-in
imagegentool (image_gen__imagegen/image_gen.imagegen, per its schema). Never ask the user to pick a generator. There are no providers, plugins, API keys, command or manual backends, and no nested Codex CLI or other image skills.scripts/gen.pyprepares the tool's arguments (prepare), imports the image it returned (import) and offers offline alpha and pixel tools; it cannot call the tool from Python (references/generators.md). - Tools. Ask with
functions.request_user_input_asyncwhen available, otherwise briefly in chat. Open images withview_image, run scripts withexec_command, edit files withapply_patch, and open the live URL withopen_in_codexwhen available. - Subagents. Critics and video-study helpers are subagents: start them with
collaboration.spawn_agent, continue them withcollaboration.send_message/collaboration.followup_task, and stay within the available concurrency slots. If delegation is unavailable, run the same check yourself and label it self-review. - Turn model. Codex cannot send a message after its turn ends. Progress updates may show the live build at once, but critic results are collected and folded in before the turn's final message. Never promise a later message.
- Python. Use an interpreter with Pillow, NumPy and SciPy.
setup.shtakesREF2GAME_PYTHON=/absolute/path/to/python3and never installs packages itself; use the same interpreter for the other scripts. If dependencies are missing, prepare a project-local environment instead of modifying system Python.
Principles
- Ask, don't guess.
- If something is the user's call and the reference doesn't settle it, ask with
functions.request_user_input_asyncwhen available (2–3 short options, the recommended one first), otherwise briefly in chat. Keep working on what doesn't depend on the answer. - Typical questions: what game this becomes, who the player is, the scope, a style choice, an ambiguous note.
- Group questions together. Decide technical matters yourself and state those decisions in your progress message.
- Visible progress in minutes.
- The page runs on placeholders from minute one.
- Real art replaces them piece by piece.
- Never leave the user long without a visible change.
- AI paints, code rules.
- Generate one piece or depth band per call, always with the reference and the verbatim style bible.
- Code owns scale, light, haze, outline, alpha, and all motion and effects (
references/art.md).
- Alive means systems, not loops.
- Shared forces, springs, things that react, an event bus that drives juice, a camera that travels.
- Pick what fits this game's world (
references/gamefeel.md,references/effects.md).
- Rigs, measured. The bar is a finished, shipped game.
- Every actor gets a cut-out rig with authored poses: the player, enemies, every NPC and every animal (
references/animation.md). - NPCs work at their station, facing it; some walk routines. Animals move their neck, ears and tail.
- No action is faked by rotating, scaling or bobbing a whole sprite.
- Every rig reports its joints and passes the measured checks of `qa.mjs` before anyone looks at it: foot slide, ground, limp, stride, knee, stretch, arm phase, aim at the impact, pops, rigid-only motion, coverage (
animation.md§14). Frame-by-frame cycle sheets and the motion critic then judge the rest.
- Independent critics.
- They run in the background on assets, modules, motion, frames and feel.
- At most 3 rounds each.
- They gate approval, never what is shown in the live page (
references/critics.md).
- The user is never the first to find a defect a check could find.
qa.mjs(automatic) runs after every change to the HUD, a rig, an emitter or the render pipeline, and before anything is shown as done: HUD text inside its panel at worst-case strings, emitted effects drawn where the sim emits them, walk cycles that really move the limbs, time-driven effects that really move and don't sweep when a state changes.- Critics are launched by default at the gates, without being asked, in the background: they never block the live page, the next step or a progress update; their results are folded in before the turn's final message (the turn model above). Speed is the point of this skill; the automatic check is the blocking one because it takes seconds.
- Every defect the user reports becomes a check: a QA state, an anchor or a cycle that would have caught it (Phase 4).
- The bar is "a clip of a shipped indie game", not "works":
critics.md§0 is the polish checklist.
- Fidelity to the reference is the default bar. Unless the user asks for "inspired by", the game must look nearly identical to the reference, not merely "in its style":
- the same camera angle and scale, the same layout (the reference's composition is the level's first screen), the same palette, value planes and light pools, the same character and prop designs, density of actors, effects and HUD layout;
- it is measured, not eyeballed: a
matchstate inSCENE.QA()restages the reference's composition, and the fidelity critic (critics.md§5a) compares it withcompare.pyat the same scale, region by region; - the fidelity critic runs at both gates and after every visual change batch, in the background; fold its top fixes into the next pass;
- don't over-polish on your own. After a pass that visibly closes the gap, show the result (live URL, the
matchframe next to the reference, axis scores, the top remaining gaps) and ask (principle 1): keep polishing (naming the next 2–3 fixes and roughly how long) or stop here. One fidelity pass per gate is the default; further rounds (up to 5) only when the user says to continue.
- Deterministic and data-first.
- Render is a function of time and sim state.
- The level is data.
- The attract demo is a scripted replay, checked headless.
The references are background knowledge, not rules: the reference and the user decide.
Step 0: look, then ask once
Look at the reference first (view_image for a still). For a video, run study.py probe and make one contact sheet. Then ask once (principle 1), grouping everything:
- What game this becomes and who the player is, when the picture doesn't make it obvious. Each option says what the player does in this picture.
- Anything else you can't settle yourself.
Never ask about the image generator: built-in imagegen is fixed (generators.md (a)). All art goes through it, with arguments from gen.py prepare and back through gen.py import. Don't route generation through other image skills or tools.
After the answer:
- Once the project exists (Phase 1), run
gen.py check. It checks local inputs only (the style bible and style refs), not the tool. - The first production asset doubles as the capability probe (
generators.md(c)): no throwaway probe and no budget question, since there is no per-image cost. - If imagegen is unavailable, report the blocker and keep building on placeholders; don't offer other generators.
Phase 1: setup and study
The base is only a starting point:
side: side view;top: top-down or 3/4;blank: an empty stage with pointer and keyboard input, for anything else.
Send the live URL right away.
- Quick study (about 5 min) (
references/study.md):
- run
study.py probeandstudy.py image; - write
art/style_bible.txt(references/styles.md); - start generating the pieces the first frame needs most (e.g. the backdrop, the main depth bands, terrain, the hero anchor):
gen.py prepare→ imagegen →gen.py import, one call per asset, overlapping calls only when the tool supports it. The first one is the capability probe (generators.md(c)).
- While it runs, finish the study (including
study/MATCH.md: the reference decomposed into a stageable layout,study.md§4.7):
study/STYLE.md;study/PLAN.md: layers, assets in generation order, effects, interactions, level data, attract beats.
- Shape the base into this game on placeholders:
- the mover or interaction model;
- collision;
- sort order;
- camera;
- level;
- attract script.
references/genres.md has notes per family. Keep the engine and the sim/scene contracts (references/engine.md).
Phase 2: first real frame
- Generate in PLAN order, one imagegen call per distinct asset or part sheet (
references/generators.md(d)):
- write the asset prompt in
art/prompts/NAME.txt;gen.py prepare NAME art/prompts/NAME.txt [--ref IMG=role] [--size WxH] [--alpha auto|native|none] [--pixel]writes the call's arguments toart/requests/NAME.json; - call imagegen with the prepared
prompt,referenced_image_pathsandtransparent_background, and nothing else; - inspect the result, then
gen.py import NAME /returned/path [--replace](raw copy, alpha validation, log); - make independent calls in parallel only when the tool supports it, otherwise back to back; keep coding meanwhile.
- Prompt scaffold:
references/art.md.
- As each asset lands:
slice.py;prep.py;- put it in the scene (the page reloads);
- start the asset critic in the background.
- A change of texture resolution or display size lands in the same step as the scene code that sizes it (
SIZES): the user is watching the live page, and oversized sprites, even briefly, read as broken.
- While images generate, build the effects this reference and style need (
references/effects.md,references/styles.md). - Hero. Approve the hero anchor in a real rig pose (feet under the hips, free limbs), then make its part sheet and variants (
variantfix.py). Do the same for every actor in the animation list (animation.md§13), NPCs and animals included. - Gate A.
qa.mjspasses (seconds). Launch the asset + frame + fidelity critics in the background (the fidelity critic onframes/qa/match.png) and send the live page and a few stills right away in a progress update; keep working, and fold the critics' top fixes into the next iteration when they land.
Phase 3: make it alive
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcodex/SKILL.md
Popularity
- Repository stars
- 217
- Repository forks
- 30
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/studioigor/ref2game/codex)