codex-visual
Generate 2D art in one locked style: sprites, icons, pixel-art tilesets, sheets, breathing idles.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- codex-visual
- description
- Generate 2D art in one locked style: sprites, icons, pixel-art tilesets, sheets, breathing idles.
02 资源文件 37
- 参考文档reference/animation-faults.md15.2 KB
- 参考文档reference/animation-route.md2.0 KB
- 参考文档reference/animation-scripts.md33.4 KB
- 参考文档reference/animation-sheets.md20.0 KB
- 参考文档reference/art-direction-schema.md6.9 KB
- 参考文档reference/codex-runtime.md23.6 KB
- 参考文档reference/geometry-gate.md6.9 KB
- 参考文档reference/identity-audit.md10.8 KB
- 参考文档reference/image-model.md15.1 KB
- 参考文档reference/image-to-3d-input.md20.3 KB
- 参考文档reference/job-shape.md2.3 KB
- 参考文档reference/layered-2d-source.md5.6 KB
- 参考文档reference/overview-sheets.md5.3 KB
- 参考文档reference/pixel-grid.md18.3 KB
- 参考文档reference/pre-review.md9.8 KB
- 参考文档reference/review-sheets.md4.2 KB
- 脚本scripts/audit_3d_source.py16.8 KB
- 脚本scripts/audit_frames.py35.3 KB
- 脚本scripts/audit_identity.py52.8 KB
- 脚本scripts/audit_pixel.py22.9 KB
- 脚本scripts/audit_set.py10.4 KB
- 脚本scripts/breathe.py40.8 KB
- 脚本scripts/codex_generate.py28.3 KB
- 脚本scripts/contact_sheet.py24.5 KB
- 脚本scripts/embed.py18.8 KB
- 脚本scripts/frames_to_anim.py22.2 KB
- 脚本scripts/key_unmix.py46.1 KB
- 脚本scripts/normalize_set.py10.5 KB
- 脚本scripts/overview_sheet.py17.8 KB
- 脚本scripts/pick_key.py20.1 KB
- 脚本scripts/pixel_ops.py55.9 KB
- 脚本scripts/pixel_snap.py17.2 KB
- 脚本scripts/prereview.py51.4 KB
- 脚本scripts/sheet_to_frames.py130.6 KB
- 脚本scripts/slice_grid.py15.6 KB
- 脚本scripts/sprite_ops.py20.4 KB
- 脚本scripts/turnaround_to_views.py3.7 KB
03 SKILL.md 正文
codex-visual — consistent asset generation via Codex CLI + a project art bible
Image generation is stateless, so a project's look drifts as it grows. This skill routes visual work through one canonical project spec.
Start here — which mode am I in? (check first, every time)
Read /ART_DIRECTION.md. Missing / Status: PENDING → PHASE 1 first, whatever was asked.
Status: LOCKED → start from the request:
| You want | Go to |
|---|---|
| A look for a new project; "lock the art style" | PHASE 1 → 2 |
| "Generate / edit a sprite, icon, tileset or key art": one sprite, icon, key art or background | job shape → PHASE 3 |
A pixel-art tileset or pixel sprites: snap to the grid and palette, audit_pixel.py |
PHASE 3; reference/pixel-grid.md |
| A matching set — icons, pickups, variants; one more for a shipped set | PHASE 3S |
| "Make a GIF / an idle loop", a walk, an attack; "the animation jitters" | PHASE 3A; reference/animation-route.md |
A breathing idle loop from one still (breathe.py); jitter, cut feet, a boiling idle |
reference/animation-faults.md §1a |
| How many frames fit a sheet: the four locks, grid → cell, the style floors | reference/job-shape.md |
| A transparent PNG; "a fringed cut-out"; which key colour | reference/codex-runtime.md §5 |
| "Off-centre", "one is smaller"; a crosshair template | reference/geometry-gate.md |
| "The assets don't match / the style drifted" | PHASE 4 |
| A source image for image-to-3D; the views a generated mesh's texture is repainted from | reference/image-to-3d-input.md; repaint: mesh-texture-paint |
| A 2D character or scene to cut into layers (PSB, Live2D, parallax) | reference/layered-2d-source.md |
| A review sheet (8-view QA, clips, before/after), gated; its pre-review | reference/review-sheets.md; reference/pre-review.md |
| Read a screenshot; compare two images | reference/codex-runtime.md §7 |
Any codex exec image work by hand (bare codex hangs; exit 0 proves nothing) |
Step 0; reference/codex-runtime.md §1–4 |
| Which model rendered it; size and quality limits | reference/image-model.md |
This skill decides no art. Style, dimensionality (2D / 2.5D / 3D), the generation engine, asset formats, palette and folder layout all live in the project's
/ART_DIRECTION.md, chosen with the user; the skill provides only the method. Reference images a user shows you are inspiration to characterize a target, never artwork to copy or ship.
Files this skill governs
| Path | Role |
|---|---|
/ART_DIRECTION.md |
Single source of truth (art bible). Read before EVERY generation. |
/ArtDirection/refs/ |
User-supplied reference images. |
/ArtDirection/candidates/ |
Bootstrap explorations. |
/ArtDirection/anchors/ · anchors/sets/ |
Locked reference image(s) fed via -i; sets/ = per-set anchors (an approved first member). |
/ArtDirection/manifest.md |
Registry of every generated asset. |
skill scripts/ |
Key: pick_key.py · key_unmix.py. Sets: slice_grid.py · normalize_set.py · audit_set.py. Animation: sheet_to_frames.py · audit_frames.py · audit_identity.py · frames_to_anim.py · breathe.py. Pixel: pixel_snap.py · audit_pixel.py. 3D source: turnaround_to_views.py · audit_3d_source.py. Review: contact_sheet.py · prereview.py · overview_sheet.py (reference/overview-sheets.md) · embed.py. Call: codex_generate.py |
| project asset dir | Shippable art, at the path the spec defines (e.g. Assets/… for Unity). |
<repo> = the project root, as an absolute path.
Step 0 — prerequisite check
command -v codex && codex --version
Missing → stop and ask the user to install it; never auto-install. Generation needs no
OPENAI_API_KEY: $imagegen — codex's bundled image skill, typed literally —
uses the ChatGPT login (codex login status).
Golden rule — always
codex exec(barecodex "..."hangs; the Bash tool cannot drive a TUI), and never trust its exit code: it is 0 when the model was rejected and when no image was made.scripts/codex_generate.py --prompt-file P --out DEST -i <anchor>makes the call and proves it (model probe, scratch dir, the original from its own session, real size). By hand:reference/codex-runtime.md§1–4.
Models — agent vs image
Every codex exec call involves two models.
- Agent model — analysis and orchestration,
-m <slug>or configmodel =: the default for generation, the strongest for PHASE 2 and PHASE 4. A pinned slug that errors is the usual sudden failure: pass-mexplicitly, checkcodex exec --help, record a project pin inART_DIRECTION.md. - Image model — renders the pixels;
-mdoes not choose it. Read which one rendered from the file itself (reference/image-model.md§1). It takes a prompt and reference paths, nothing else, renders a fixed ~1,572,864-pixel budget and has no native transparency (§2–4 there).
Decide the shape of the job
Three shapes, three priorities; the wrong one makes a sheet unusable. Locks, grid → cell and the
style floors for each: reference/job-shape.md.
| Shape | Priority | Path |
|---|---|---|
| Static single — key art, hero, boss, background | quality | one generation at the full pixel budget, style anchor via -i, plus the family anchor if one exists → PHASE 3 |
| Static set — icons, pickups, avatars, variants | quality, then consistency | 2x2 or 3x3 per sheet (627 / 418 px cells); more members → more sheets chained to the first; then slice_grid.py + normalize → PHASE 3S |
| Animation — loop, one-shot, transformation, UI feedback | stability | frames → grid → cell px → style floor → split; key → sheet_to_frames.py --register (never slice_grid.py) → gate → onion skin + GIF → Unity handoff → PHASE 3A |
PHASE 1 — Bootstrap a direction
- Settle the axes with the user and record them; default to nothing:
- Dimensionality / render target: 2D · 2.5D (billboarded sprites in a 3D world) · 3D.
- Style family: pixel · flat/vector cartoon · low-poly · painterly · …
- Asset-template formats needed: item-icon sheet · auto-tile tileset · character spritesheet · animation sheet · tileable texture · skybox · UI/HUD — layouts, not looks.
- Generation engine / approach:
$imagegenis weak at true pixel art; pixel work needs a pixelation post-process, another engine or hand-authoring (reference/image-model.md§7).
- Gather inputs — a scenario and/or reference images: a 1–3 sentence brief (theme, hero, key
objects, obstacles) and/or images →
ArtDirection/refs/. Inspiration only; never copy or ship them. Analyze them (reference/codex-runtime.md§7). - Explore options: 2–3 styles x 2–3 key game screens, not posters, into
ArtDirection/candidates/unless the user pinned one (reference/image-model.md§7). - Present & pick. Summarize each (
codex exec "描述每張的風格差異" -i optionA.png …); the user picks or asks for another round.
PHASE 2 — Lock the direction (write /ART_DIRECTION.md)
- Set the anchor: the chosen board (or user ref) →
ArtDirection/anchors/master.png. - Extract ground truth with vision, never invented (
reference/codex-runtime.md§7). - Fill the spec:
Status: LOCKED, version and every section ofreference/art-direction-schema.md. - Log it in
manifest.md.
PHASE 3 — Generate one asset consistently
- Read
/ART_DIRECTION.md. If PENDING → Phase 1. - Follow the recorded engine/approach: codex
$imagegen—STYLE PREAMBLEverbatim + the asset request on a flat key colour, anchor via-i, original copied toDEST(reference/codex-runtime.md§9); pixel via post-process — snap to the spec's grid and palette, thenaudit_pixel.py(reference/pixel-grid.md); transparency —key_unmix.py, never a binary key (reference/codex-runtime.md§5); another engine — the spec's recipe. - Verify + register:
ls -la "$DEST" && file "$DEST", then amanifest.mdrow (date, path, type, size, spec version, one-line prompt); an animation is one row for the set (reference/animation-scripts.md§4).
PHASE 3S — Generate consistent SETS
Three SCOPES of consistency, each owned by one mechanism; they stack in one call:
| Scope — "must match…" | Mechanism | How |
|---|---|---|
| Global style (the project) | style anchor | -i anchors/master.png on EVERY gen |
| Within a set (its siblings) | grid one-shot | the whole set as ONE gridded image → one context, no drift |
| Across sets / over time (shipped work) | reference-chaining | ALSO -i the prior approved sheet — a FIXED promoted anchor, never the previous output |
| guarantee (size and centre) | normalize + gate | slice_grid.py / normalize_set.py, then audit_set.py |
The canonical call: style anchor + family anchor (chain) + grid layout, in ONE generation, then slice + normalize.
- New set of N≥2 siblings → grid one-shot:
cols=ceil(√N),rows=ceil(N/cols), leftover cells blank or repeated, the static-set floors (reference/job-shape.md), a related family's anchor chained. Too many members? Split, chain every later sheet to the first, normalize all to one target. - +1 member for an already-shipped set → pure reference-chaining to that set's anchor + normalize (its sheet can't be re-generated).
Recipe — grid + chain in one call
Style anchor, then family anchor; locks 1–3; capture → key → slice → gate → promote. The call:
reference/image-model.md §6.
One cell wrong? Re-gen the whole sheet — never patch one cell: a repair request re-renders the whole canvas (
reference/animation-faults.md§3, with the local splice).
PHASE 3A — Animation sheets (one short motion as ONE gridded sheet)
PHASE 3S's stack, but the cells are moments of one character, seated by silhouette afterwards
(never centred per cell; never slice_grid.py). Shape → prompt with the four locks → anchors →
generate, key_unmix.py, sheet_to_frames.py --report → --register → audit_frames.py and
frames_to_anim.py --onion --bg → frames + frames.json + previews. A boiling idle, or an idle
loop from one still: breathe.py. Every step: reference/animation-route.md.
PHASE 4 — Audit & evolve
- Consistency audit: the audit call in
reference/codex-runtime.md§7, strongest agent model. - Changing the style: bump
version+ changelog; flag older assets in the manifest as re-gen candidates. Version the palette; never edit it silently. - New IP later → PHASE 1→2 again (bump version); keep old anchors.
Scope — what this skill does NOT do
- Unity import and frame animation — texture type, PPU, slicing, pivots, 9-slice, sprite
sub-assets,
AnimationClip/AnimatorController, loop vs one-shot playback, UIImageframe animation:unity-2d-sprites. This skill stops at a normalised PNG, or at the frames,frames.jsonand a GIF/APNG/WebP preview — Unity plays none of those three formats. - 3D meshes — this skill draws the source image (
reference/image-to-3d-input.md); conversion:comfyui-asset-generation; its texture repainted from these views:mesh-texture-paint; import:unity-3d-models; a character's route:game-character-pipeline. - Audio and video, a real moving-camera clip included — music, SFX and MiniMax H3 video through
a self-hosted ComfyUI:
comfyui-asset-generation; a still → a transparent loop from a video:sprite-from-video. - Where the art goes in a HUD, type sizes, contrast:
unity-game-ui.
Related: game-character-pipeline, comfyui-asset-generation, art-asset-registry.
04 同仓库更多 Skills
unity-web-release
Ship a WebGL/WebGPU build: shrink the download, Brotli server headers, Safari and iPhone memory.
unity-vivox
Vivox voice and text chat: channels, positional voice, mute and push-to-talk, mic permission.
unity-urp-migration
Migrate a Built-in project to URP, or fix a half-moved one: pink materials, PPv2, old shaders.
unity-ui-ugui
Canvas UI (uGUI): CanvasScaler, RectTransform anchors, Layout Groups, ScrollView, UI built from C#.
unity-ui-toolkit
UI Toolkit (UXML, USS, UIDocument): flex layout, binding, custom elements, editor windows.
unity-ugs
Unity Gaming Services API: which package, init and sign-in order, Cloud Save, Cloud Code, Remote Config.