vibegameengine/web-starter-kit/codex-asset-generation
Claude Code and agent skill by vibegameengine/web-starter-kit
- community
Checking that the SKILL.md file is still in the repository.
Delegate BITMAP generation to the codex CLI and turn what it returns into production PBR maps. Codex can draw images (its game-artist skill wraps an imagegen stack); it is not a procedural-noise generator, and asking it to write numpy noise wastes the capability. Covers the exec invocation, passing a reference image so the output matches THAT asset, recovering images when codex cannot write files, and the mandatory post-process: seamless tiling, colour calibration against the reference, and desaturation of stretch artifacts. Use whenever an asset needs textures, sprites, decals or any generated bitmap and codex is available.
Install
npx vskill@latest install vibegameengine/web-starter-kit/codex-asset-generationSKILL.md
The same SKILL.md was published earlier as vibegameengine/web-starter-kit/codex-asset-generation.
Codex asset generation
Codex draws bitmaps. That is the whole point of delegating to it. If a prompt is written as "write a Python script that generates a texture", the result is procedural noise that looks nothing like the reference — the capability was there and went unused.
Non-negotiable rules
- **IF A REFERENCE EXISTS IN ANY FORM, THE ASSET IS BUILT FROM IT — and the
prompt must say so before it says anything else.**
A reference "exists in any form" whenever the user has pointed at a picture, a render, a screenshot, a concept, a model or another asset — whether they attached it, named it, or merely said "like that one". There is no separate mode where a reference is present and the asset is designed independently of it. If a reference exists, it is not inspiration, it is the SOURCE.
So the prompt opens by naming the reference's absolute path, ordering codex to open it and sample real pixel values out of it, and stating the test:
> The only passing description of your output is "that is the same surface, > drawn flat and straight on". "Inspired by it", "in the same genre" and "in > the spirit of" are all failures.
And it demands evidence the file was actually opened: make codex report which pixel colours it sampled and where from. Without that line, a run that never opened the file is indistinguishable from one that did — and it is the more likely of the two, because inventing a plausible stone is easier than matching a specific one.
Written down because it was got wrong once and cost several rounds: the reference path was in the prompt, buried below the brief, with no sampling demand and no "inspired by" prohibition. Codex returned four perfectly competent PBR stone sets that looked nothing like the asset they were for, and the user's question was the right one — where else would you take the textures from?
- **Say WHAT the asset is and WHAT IT IS FOR, in that order, before anything
else.** "The button plates, isolated, as a source sheet I will cut into a nine-patch and stretch in the engine" produces a usable asset; "a weathered menu button" produces a picture of one. The purpose is what tells the generator which properties are load-bearing. See "State the job, not the vibe".
- Ask codex for IMAGES, and name its art skill in the prompt so its image stack
engages instead of its coding path.
- Never pass the reference through
-i. Write its absolute path directly in the
prompt text and tell codex to open and look at the file itself. A described colour is a guess; a file the model actually opens is ground truth — -i is not the only way to get that, and it is the fragile one (see Invocation).
- Never trust the returned file ORDER. Build a contact sheet and identify each
image by eye before naming them.
- A generated texture is not finished. It does not tile, its colours are lit-scene
colours, and per-channel processing throws stray hues. Post-process every one.
- Verify tiling by rolling the image half a tile and LOOKING at the seam, not by
trusting the generator's claim.
State the job, not the vibe
A prompt that describes a MOOD gets an interpretation. A prompt that describes a JOB gets the asset. The difference is not politeness — the generator resolves every ambiguity in your prompt toward "make a nice picture", and a nice picture is rarely a usable asset.
Three things must be in the prompt, and the first one is usually missing:
1. What it is FOR. Put the pipeline stage in words, at the top: this will be cut into a nine-patch and stretched; this is a tiling material for a floor; this is a sprite composited over a moving background; this is the back plate under a live UI. Every constraint below it then reads as a consequence instead of a whim, and the generator stops "improving" the thing you need boring.
2. That you want THE SAME asset, not one like it. When a reference is attached, say explicitly that the output must be describable as "the same object, isolated" — and that anything describable as "inspired by" or "in the spirit of" it is a failure. Name the specific properties that must survive: proportions, border weight, palette, surface treatment. Then forbid the drift by name: do not restyle, do not add bevels/gradients/ornament/rounded corners, do not change the palette. Without that sentence you get a variation, and a variation next to the reference reads as a mistake.
3. Exactly ONE subject, and what is NOT in the frame. "Only the buttons." "Only the background, with the interface taken off it." Then enumerate what to remove: the logo, the labels, the panels, the version text — and any overlay baked into the reference, such as the gradient darkening one side to make text readable. Overlays are the easiest thing to leave in by accident and the hardest to remove later.
Ask for the OPAQUE variant; add transparency at implementation
When a reference shows a UI element that looks semi-transparent, do NOT ask for that look. Ask for the element painted fully opaque and flat, and say why: the engine applies the alpha at render time, and a baked-in translucency would compound with it — twice-faded, unfixable, and impossible to re-tune without regenerating art.
The same reasoning generalises to every effect the runtime can apply itself: opacity, tint, blur, glow, drop shadow, dimming, disabled fades. Bake the IDENTITY of the asset; keep the STATE in code. An asset that carries its own state cannot be restyled, cannot be re-tinted, and cannot be reused for the second state you will inevitably need.
Invocation
Codex has its own skill tree, separate from this project's. Enumerate it before writing the prompt — capabilities live there, not in the CLI help:
Non-interactive run, reference given as a path IN THE PROMPT, prompt piped from a file:
Where prompt.txt states the reference's absolute path as plain text and tells codex to open it, e.g. The reference is at C:\full\path\to\reference.png — open it and look at it yourself before drawing anything.
- Never use `-i` to attach the reference. It is documented as "attaches an
image", but attaching stages the file through codex's own sandbox before the run starts, and that staging step can hard-fail before generation ever begins — for example when the platform's sandbox helper binary is missing after an upgrade. A path written into the prompt text has no such dependency: codex reads it with its own file tool, same as it reads any other file the task needs. Prefer this even when -i happens to be working — a project that works today may not tomorrow, and the two paths are not equally reliable.
-s workspace-writelets it write into the workspace;read-onlyif it should
only report.
-Csets the working root.- Piping the prompt from a file keeps long briefs out of shell quoting.
- Run it in the background; a multi-image batch takes minutes.
Model availability is account-bound. If it reports a model is unsupported or needs a newer CLI, do not silently fall back — the account may allow exactly one model, and probing others wastes minutes each. Report it and ask.
When codex cannot write files
Its sandbox helper can be missing after an upgrade. The symptom is every shell command failing with a sandbox/helper error — including reading the reference file itself, if the run still routed it through -i — while image GENERATION still succeeds. Do not conclude the run produced nothing.
Generated images are cached per session:
The newest session directory holds them, oldest-first by mtime matching the order they were requested. Copy them out and do the post-processing locally. This turns a hard failure into a working result.
Prompt shape that works
State, in this order: which of its skills to use; the reference's absolute path and that it is the single source of truth and must be opened and examined; the exact output filenames; then per-image, the material and its failure state, not just its name — "paint flaked off over half the surface with crisp ragged edges" produces something usable, "weathered wood" does not.
Then the constraints that decide whether the output is usable at all:
- seamless tileable, edges wrap, no border, no vignette
- FLAT lighting — no baked shadow, no directional highlight, no depth of field; it
is a base-colour map, not a photograph of a lit surface
- orthographic, straight-on, filling the frame; no object silhouette, no background,
no scene, no text, no watermark, no colour swatches
Cut-outs: ask for a background COLOUR, never for transparency
The image stack cannot emit an alpha channel. Ask for "a fully transparent background" and it does not refuse — it PAINTS a picture of transparency, the familiar grey-and-white checkerboard, as opaque pixels. The file comes back RGB, every pixel alpha 255, and the checker is now baked into the art.
So specify a background you can key instead:
- Name one flat, uniform colour and say it must fill every pixel that is not the
subject. Say "solid <colour>", never "transparent", "alpha", or "no background" — those words are what summon the checkerboard.
- CHOOSE the colour against the subject: it must not appear anywhere in the
subject, including its shadows and its darkest crevices. For a warm, earthy, desaturated subject a saturated green or magenta keys cleanly; for anything with foliage or skin tones, pick the one the subject does not contain.
- Ask for the subject to keep a clear margin from the frame edge, so the key has
somewhere to start and a sticker can be placed without a visible box.
- State that the background must be FLAT — no gradient, no vignette, no shadow
cast onto it. A shaded backdrop keys with a halo.
Keying it out
Do not threshold on colour alone. Whatever key colour was chosen, some part of the subject will come close to it somewhere, and a plain threshold eats holes in exactly the places that matter. Take the background as the keyed region connected to the frame border (label the mask, keep the components that touch an edge). Anything key-coloured that is enclosed by the subject is part of the subject and survives.
Two steps decide whether the cut-out looks right in an engine, and both are invisible in the source image:
- Despill. Edge pixels are blended with the key colour, so left alone they
ring the subject in a bright or coloured halo that only shows up once it is composited over something else. Rebuild the colour of every non-opaque pixel from its nearest opaque neighbour before applying the alpha.
- Feather deliberately. A one-pixel hard cut reads as a sticker pasted on;
the eye catches the outline before it catches the art. Ramp the alpha inward over a small band — a couple of percent of the sprite — using the distance transform of the mask, and composite with real blending rather than an alpha test. Keep it small: a wide feather turns a broken edge into a smear, and the whole point of a break is that it is broken.
Prove it by compositing over a mid-tone field and LOOKING, not by reading the alpha histogram. A halo is obvious over grey and invisible over the checker the generator drew.
Post-process (always)
Seamless tiling
Use the periodic component of the image (Moisan's periodic/smooth decomposition). The periodic part tiles exactly by construction and, unlike blending a border band, does not smear detail at the seam.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 96 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagents/skills/codex-asset-generation/SKILL.md
Popularity
- Repository stars
- 117
- Repository forks
- 22
- 7-day trend score
- 29
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/vibegameengine/web-starter-kit/codex-asset-generation)