Skip to content
Back to skills

Art Forge Loop

ASecurity

Graded art iteration loop - generate pixel art, 2D illustration or painted game UI parts with local MOSS/ComfyUI, judge every candidate against a score bar (default 9.5/10), refine the best with a specific note, and repeat until each target passes or runs out of rounds. Includes a preservation-first style-reference pass for restyling existing UI art without losing its silhouette or blank plates, plus an audited custom-SVG icon system for HUD controls, resources and cursors. Use when asked to ...

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentspythongoshellbashangularnodeawsgit

Works with

  • cursor
  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 9 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add barretV/asset-kicking-skills --skill art-forge-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Art Forge Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Art Forge Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/barretv-art-forge-loop/badge)](https://www.skillsdirectory.com/skills/barretv-art-forge-loop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: art-forge-loop
description: Graded art iteration loop - generate pixel art, 2D illustration or painted game UI parts with local MOSS/ComfyUI, judge every candidate against a score bar (default 9.5/10), refine the best with a specific note, and repeat until each target passes or runs out of rounds. Includes a preservation-first style-reference pass for restyling existing UI art without losing its silhouette or blank plates, plus an audited custom-SVG icon system for HUD controls, resources and cursors. Use when asked to make, upgrade, re-imagine or "iterate until it's good" on sprites, skins, enemies, items, props or world art, or to run the forge/grading loop (optionally under /ralph-loop).
---

# Art forge loop

A generate → judge → refine loop. The GPU makes candidates. You are the grader: you look at every candidate, score it honestly, keep the best, and write the one fix that would raise it. Repeat until every target clears the bar.

Keep its discipline: honest scores, specific notes, the best version always kept. That is what makes it converge on art people call beautiful instead of drifting.

## GPU safety (read before any GPU job)
Small and laptop GPUs can hang or hard-reboot when GPU work stacks up (the 6 GB reference laptop did), which kills every running session. GPU jobs include MOSS/ComfyUI generation, Blender renders and bakes, headed or headless browser runs (Playwright tests, playchecks, captures), benchmarks, and Unreal/Godot editor or PIE.
- **One intensive GPU job machine-wide.** Atomically acquire the configured machine-wide GPU lock (create the lock directory and owner file); if it already exists, wait. Before and after acquiring it, inspect running ComfyUI jobs, Blender renders/bakes, game engines, browser WebGL/WebGPU tests or captures, benchmarks and other agent workloads. Wait if another intensive job is running or activity cannot be identified safely. Never stop someone else's processes or remove their lock.
- **Desktop use is not automatically a job.** Normal compositor, Steam, Chrome and Electron GPU processes may remain open if no active GPU-intensive work is identified and usage is low and stable. Sample `nvidia-smi --query-gpu=memory.total,memory.used,memory.free,utilization.gpu --format=csv` several times over at least 10 seconds; on an unfamiliar workload require at least 80% of total VRAM free before starting and utilization below 25%. These are conservative starting checks, not proof of safety or a guarantee the model fits. Account for the launcher's reserved headroom; do not count GPU memory already used by the desktop as available. Use the configured low-memory profile, start experimental work with a single small image, monitor memory and errors, and stop on OOM, unstable GPU/desktop, unexpected competing work or failure. Do not repeatedly retry at higher load. Release only your own lock after your job and owned processes stop.
- **Cool down.** Leave about 60 s between heavy GPU jobs. Split long runs into chunks (one batch or one level at a time), not back to back.
- **Clean up.** Stop whatever you started (ComfyUI, dev servers, browsers) as soon as you are done with it.
- **Pass it on.** When you brief a subagent or a parallel session that will use the GPU, include this rule.

## Rules
- `<skill>` below means this skill's folder, e.g. `~/.claude/skills/art-forge-loop` or `<project>/.claude/skills/art-forge-loop`.
- Works in any project. Run the script from the project root; job paths are relative to it.
- Generation uses MOSS-Image Turbo + the moss-pixelart LoRA on local ComfyUI (port 8188). Check it with `curl -s localhost:8188/system_stats`. If it isn't up, start it in the background with the launcher `setup/launcher.py` wrote for this machine's tier: `<ComfyUI>/run_asset_kit.bat` (Windows) or `run_asset_kit.sh`. The 6 GB profile is `main.py --lowvram --reserve-vram 0.7 --vram-headroom 0.5 --disable-smart-memory --cache-none`.
- The ComfyUI folder comes from `$COMFYUI_DIR` or `comfyui_dir` in `~/.asset-kicking-skills/config.json` (written by `setup/detect.py`).
- The MOSS tools (generate, snap to the 8:1 pixel grid, hygiene) are bundled in `scripts/moss/`. A project's own `art/pipeline/bin/` copy wins if it has one; `FORGE_MOSS_BIN` overrides both. Needs Python with Pillow and numpy.
- The GPU runs **one gen at a time** (on every tier: batch size grows with VRAM, parallel jobs do not). Always `wait` before starting a `gen`.
- Run `gen` in the background. Judge while it runs; never sit idle waiting for it.
- Keep job folders in a scratch or gitignored folder (e.g. `work/forge/<job>`). Never commit, deploy or wire art into the game unless the user asks.
- Never delete candidates. `picks.json` points at the best one, and nothing is lost.

## 1. Set up a job
Create `work/forge/<job>/job.json`. All paths are relative to the project root.

```json
{
  "bar": 9.5,
  "max_rounds": 10,
  "bar_text": "what a 9.5 means for THIS job (see below)",
  "targets": {
    "ember_lord|frog": {
      "prompt": "cute chibi green frog hero with two big round shiny eyes ..., wearing legendary EMBER LORD armour: ...",
      "init": "work/forge/skins/init/frog-base.png",
      "ref": "work/forge/skins/init/frog-base.png",
      "note": "optional first-round extra"
    }
  }
}
```

**Required for each target:**
- `prompt` is the subject: species plus theme.
- `init` is the image img2img starts from. Use the approved or current art, cropped to its content.

**Optional for each target:**
- `ref` is shown as the first column when judging. It defaults to `init`.
- `note` is an extra for the first round.

**Optional settings, with their defaults:**

| Setting | Default |
|---|---|
| `seeds` | 2 |
| `size` | 768 |
| `init_scale` | 8 |
| `first_denoise` | 0.66 |
| `polish_denoise` | 0.45 |
| `fine_denoise` | 0.38 |
| `fine_at` | 9.3 |
| `speck` | 60 px |
| `style_palette` | off |
| `palette_strength` | 0.65 |

`style` wraps every prompt; `{prompt}` marks where the target's prompt goes. The default style is 16-bit SNES pixel art on a lavender background.

### Optional image-backed art direction

At the start of a new art direction, when the user hasn't already provided references or said to proceed without them, offer one concise choice: do they have reference images for the whole game, for specific asset groups, or none? Do not block an existing job or repeatedly ask; proceed without a guide if they decline. Use images the user provides or has rights to use. Keep references in the project or its scratch folder; do not upload them to another service.

Inspect each reference visually. Together with the user's stated constraints, write a concise **human-reviewed brief** covering palette, materials, lighting, rendering, edge treatment, mood, and what must remain consistent. Do not blindly copy composition, characters, logos or text; reference style, not someone else's specific assets. Add named guides to `job.json`:

```json
{
  "default_style_guide": "game",
  "style_guides": {
    "game": {"images": ["art/refs/game-1.png", "art/refs/game-2.png"], "brief": "deep indigo and aged brass; painterly edges; soft top-left lighting"},
    "hud": {"images": ["art/refs/hud.png"], "brief": "black enamel and aged brass, sculpted asymmetric silhouettes, soft cyan accents"}
  },
  "targets": {
    "frame|shop": {"init": "art/refs/frame-layout.png", "prompt": "blank shop frame", "style_guide": "hud"},
    "tree|oak": {"init": "art/refs/tree-layout.png", "prompt": "oak tree"},
    "icon|exception": {"init": "art/refs/icon-layout.png", "prompt": "icon", "style_guide": null}
  }
}
```

Each guide needs a nonempty `brief` and 1–4 readable reference images (PNG/JPEG/etc. supported by Pillow). Paths are relative to the project root. A target's `style_guide` overrides the job default; explicit `null` opts out. No guide means existing behavior is unchanged. Missing images or an unknown guide stop the affected generation/review with an error rather than silently omitting it.

**What it does:** the brief is included in that target's generation prompt; guide images appear in its judging-sheet row alongside the target shape reference and candidates. Compare every result to those images for palette, lighting, materials, edge language and style drift; record specific differences in the critique. The image model still receives only the target's `init` as img2img input—not the guide images. This is reference-informed prompting and human visual review, **not automatic image-conditioned style transfer or a consistency guarantee**. Do not bake live text into UI art, and use separately authored symbols when precision matters. Guides also apply when adaptive generation calls the same forge.

**Writing a good prompt:**
- Name the identity features that must survive, such as "huge glossy black eyes with white sparkle highlights exactly like the original" or "soft pale lavender feathers with a cream face disc".
- Then add the theme in concrete nouns: crown, cape, materials, a 3-colour palette.
- Never ask for things you don't want. "Visor" draws goggles over the eyes, and "floating leaves" fights a "no leaves" note.
- For several variants of one subject, write the species text once and the theme text once, then combine them.

## 1b. Pixel or illustration
`"mode": "pixel"` (default) uses the moss-pixelart LoRA, snaps to the 8:1 grid and 32 colours, and removes specks.

`"mode": "illustration"` is for regular 2D art: painted or cel-shaded sprites, portraits, card art and icons.
- The same MOSS turbo model with the pixel LoRA off (`lora` 0).
- A smooth upscale of the init, then a background cutout to transparency, downscaled to `out_px` (384).
- Illustration defaults: `size` 1024, an illustration `style` and `bg_tol` 38. Set `"lora"` above 0 only to blend in some pixel look.
- A pixel-art init needs `first_denoise` of about 0.7–0.8 to become painted. A painted init can polish at 0.35–0.45, as in pixel mode.
- Grade line quality, readable silhouette, consistent lighting and staying on-model, instead of grid cleanliness.
- **Clean transparency, no redo for leftovers.** After the colour cutout, an AI foreground matte removes what colour rules cannot: drop shadows and pockets painted in a darker shade of the background. It uses BiRefNet through ComfyUI's built-in `RemoveBackground` node when `models/background_removal/birefnet.safetensors` is there (it comes with the `trellis2` bundle), else rembg's isnet-anime if installed (`pip install "rembg[cpu]"`), else colour only. The matte never redraws the edge: within 3 px of the object the cutout keeps its own anti-aliased alpha, and it is ignored if it would drop 40% or more of the shape. Then `scripts/clean_alpha.py`'s passes drop haze (alpha < 24) and detached specks, and unmix edge pixels that blend the outline with the background (they keep their smooth coverage and lose the tint), so no pink, white or lavender fringe is left. A candidate that is still not clean prints a `cutout check:` line.
- **Existing cutouts:** `python <skill>/scripts/clean_alpha.py public/cards/*.png --out cleaned/` fixes a folder of finished PNGs (add `--key '#ff00ff'` if they were keyed off magenta rather than the forge lavender); `--check` only reports and exits 1 if any file still has leftovers. With ComfyUI running it uses BiRefNet; take the GPU lock first.
- Background specks that keep coming back usually start in the prompt: ask for "no ground shadow, no motion lines, no floating sparkles" when they are not part of the design.
- A pocket the model painted with its own outline (a cape or scarf) is a design fault, not background. Fix it in the note, for example "no cape".
- The cutout also removes enclosed background pockets (between a tail and a body, under an arm) within `hole_tol` (32) of the background colour. Lower it if a character's own colour is close to the lavender background.

## 1b-ui. Game UI art (frames, ribbons, medallions, icons)
For menus and HUDs, read `UI.md` in this skill first: painted parts from rough code-made inits, one material language, no baked text, glow and states added in the engine, and a mechanical layout check. `examples/ui/` in the asset-kicking-skills repo shows the result.

Functional icons are not emoji, platform glyphs or baked lettering. Use the project's typed custom-SVG icon set, with `data-icon` on every rendered glyph and no fallback characters. The "Functional icons" section of `UI.md` gives the source contract, carved-surface contrast and size rules, and the full-screen DOM/raster audit that catches missing, blank, unknown or unreadable icons.

## 1c. SVG export
`python <skill>/scripts/forge_loop.py <job> svg` writes `<job>/svg/<target>.svg` for every pick.
- **Pixel mode:** an exact vector copy, one rect per colour run with crisp edges. It is identical to the PNG at 1:1 and sharp at any size, with no dependencies.
- **Illustration mode:** a vector trace through `vtracer` (`pip install vtracer`, ask before installing). Cel-shaded art traces well. Soft gradients become colour bands, so check the result.

## 1d. Fixing only the marked spots (masks)
When the owner has drawn over the bad areas of an image, repaint only those areas and keep everything else.
- **Where masks come from:** a review page with a "Mark bad spots" pen (any small local page that saves a PNG per image works), whose `reviews.json` entries gain `"marks": {"<image path>": "masks/<id>.png"}`. A mask is a PNG at the image's own pixel size. Any non-transparent pixel is marked.
- **Set the target:** set `init` to the image the marks were drawn on, `mask` to the mask path, and `note` from the owner's comment plus what the marks show. Optionally set `mask_grow` (default 1 px for pixel art, 4 for illustration).
- **What happens:** after each generation, `apply_mask` aligns the new image onto the init by its unmarked area. It takes the new pixels only inside the grown mask and keeps the init's pixels everywhere else. Transparent new pixels erase, so marked specks and leftover background are removed. The result stays on the init's canvas, so the same mask still lines up in later rounds.
- **Denoise:** use a higher value than a polish, 0.5–0.66. Only the marked area is kept, so the model may change it freely. Judge only the marked area, plus whether the seam blends.
- **Before judging:** read the mask over the image (or the review page overlay) so you know exactly what the owner meant. Their comment says why; the mask says where.
- **Building a review page:** a tiny local server with a `/mask` endpoint that saves the PNG, and a draw dialog over each image with strokes, Undo, Clear all and Save, is enough.

## 2. The loop, one pass
```bash
python <skill>/scripts/forge_loop.py work/forge/<job> wait      # IDLE or BUSY (blocks up to 9 min)
python <skill>/scripts/forge_loop.py work/forge/<job> sheets    # sheets/sheet-NN.png, 7 targets each
python <skill>/scripts/forge_loop.py work/forge/<job> status
```
1. **Start the GPU.** If `wait` says IDLE and `status` shows `to_generate > 0`, run `gen` in the background:
   `PYTHONUNBUFFERED=1 python -W ignore <skill>/scripts/forge_loop.py work/forge/<job> gen`
   - Round 1 covers targets with no pick.
   - Round N+1 covers every pick that is not final, starting from its `path`.
2. **Judge.** Read every sheet. Each row shows the ref, the best so far, and the new candidates.
3. **Write verdicts** into `picks.json`, one entry per target:
   ```json
   "ember_lord|frog": {"path": ".../r4-s4041.png", "score": 9.2, "round": 4,
                       "note": "one specific fix", "denoise": 0.45, "final": false}
   ```
   - Skip targets in `approvals.json`: the owner already called them good enough (see 2b).
   - `round` is the newest round you judged. It must be set, or the target never advances.
   - `path` is the best image so far. If every new candidate is worse, keep the old path.
   - Set `final: true` when the score reaches the bar, or when round `max_rounds` has been judged. In that case keep the best.
4. **Report.** After each pass, run `report` and give the user its first lines: N of M good, how many left, the lowest scores and their notes.
5. **Repeat** until `status` prints `ALL FINAL`.

## 2a. Adaptive improvement methods (optional)

When the task asks for adaptive iteration, use `scripts/adaptive_forge.py` around the existing forge. It plans from an existing **reviewed** `picks.json`; it does not generate the initial round or judge images. Run from the game project root:

```bash
python <skill>/scripts/adaptive_forge.py work/forge/<job> plan --direction my-art-direction \
  --history work/forge/adaptive-history.json --defect 'frame|main=silhouette'
python <skill>/scripts/adaptive_forge.py work/forge/<job> apply
# Follow the GPU safety checks above, then start in the background:
python <skill>/scripts/adaptive_forge.py work/forge/<job> generate
python <skill>/scripts/forge_loop.py work/forge/<job> sheets
python <skill>/scripts/adaptive_forge.py work/forge/<job> review 'frame|main' work/forge/<job>/out/frame__main/r2-s2007.png 8.4 'Specific visible flaw and why it loses points.'
# Repeat review for EVERY candidate of every unapproved target, then:
python <skill>/scripts/adaptive_forge.py work/forge/<job> finish
python <skill>/scripts/forge_loop.py work/forge/<job> report
```

The agent must inspect every candidate and provide a real score and critique; this tool never invents judgments. `plan` suggests a method and records its reason. Prefer explicit defects (`silhouette`, `material`, `angle`, `cutout`, `symbol`) over its simple note-keyword fallback; pass `--defect 'target=type'`, or put `defect` in the reviewed pick. The reference-redesign and angle methods use the target's existing `init`: create a suitable new reference first if necessary. Material and cutout methods use the current best. This is method selection for img2img, not an automatic Blender redesign, masked edit, symbol compositor or guarantee of better quality. Add exact symbols yourself outside the model if needed.

History path precedence: `plan --history`, then `FORGE_ADAPTIVE_HISTORY`, then job `adaptive_history`, then `work/forge/adaptive-history.json` under the project root. `adaptive.json` pins the chosen path for the entire pass. Keep history local; it contains project paths and subjective reviews. It records each reviewed candidate, method, baseline, best candidate score and delta, grouped by the supplied direction and defect. Selection starts with rules, explores under-sampled eligible methods, and compares means only when each has at least two reviewed outcomes. These are small observational samples, not causal proof.

The adaptive path honors the job's `max_rounds` up to a **hard cap of five**; the ordinary forge is unchanged. It never edits `approvals.json`; approvals are checked at planning, before each target, before review, and at finish. It refuses to generate over existing outputs. If interrupted midway, preserve all files: inspect the partially generated round and resolve it manually rather than retrying `generate` over the same filenames. A missing seed, an unreadable approval file, or an unreviewed candidate blocks `finish`. An owner-approved target is skipped without grading or changing its pick. The best previous candidate is kept if the new ones score worse; passing or capped targets are final, including below-bar capped targets that must be reported honestly.

## 2b. Style-reference pass (optional, preservation-first)

When an asset must follow reference images but keep an existing shape and blank text plate, use `scripts/style_pass.py`. It needs the MOSS edit adapter `moss_image_edit_lora_rank_64_bf16.safetensors` in `<ComfyUI>/models/loras/` (about 297 MB, from `Comfy-Org/MOSS-Image`; it is not part of the default model bundle). It also needs the job's `style_guides` from section 1.

```json
"style_protect_mode": "region",
"targets": {
  "card|ticket": {
    "prompt": "ornate ticket card frame, blank center",
    "init": "work/forge/hud/init/card.png",
    "style_protect": [
      [0.28, 0.30, 0.84, 0.70],
      {"box": [0.05, 0.22, 0.30, 0.80], "mode": "exact"}
    ]
  },
  "tile|medallion": {
    "prompt": "ornate sunburst medallion with a blank dark center",
    "init": "work/forge/hud/init/tile.png",
    "style_protect": [[0.28, 0.28, 0.72, 0.72]],
    "style_protect_mode": "exact"
  }
}
```

```bash
python <skill>/scripts/style_pass.py work/forge/<job> --guide game --seeds 2 --denoise 0.65 --size 512
# --protect-mode region|flat|exact overrides every target; --region-tolerance 30 tunes growth
```

`style_protect` boxes are `[x0, y0, x1, y1]` fractions of the init's visible content (its alpha bounding box). The init's alpha silhouette is always kept exactly. Everything else on the object is repainted at the given denoise from the init latent. Multiple boxes are allowed; with no boxes the whole object is restyled and only the silhouette is protected.

The default `region` mode grows each box through the init's own flat plate colour and fills the whole plate with one palette colour sampled from the restyled image, stopping at the frame. It is the best choice for a flat label area whose plate is one connected colour.

`flat` fills only the box rectangle, for simple rectangular plates. `exact` copies init pixels in the box, which is the right choice for a logo, emblem or medallion center that must not be redrawn or flattened. Choose per target with `"style_protect_mode"`; a single box can override the target mode with `{"box": [...], "mode": "exact"}`. For a medallion whose center and field share one colour, use exact so the center does not get flattened into the field.

Outputs go to `<job>/style/<target>/s<seed>.png` (RGBA) with a `-preview.png`. The tool never edits `picks.json` or `approvals.json`, and refuses to overwrite an existing output. Review every result: it is reference-conditioned generation plus a deterministic protection composite, **not automatic style transfer or a consistency guarantee**. Internal details can still change, and seams can appear where the generated art's layout differs from the protected area. Use the sheet/contact-sheet review and keep only the results that improve the art.

### 2b-export. Make a style result game-ready

The style pass uses a square work canvas and fits the subject inside it. Game assets usually have their own aspect ratio and may be full-bleed, so do not copy the square result straight into the game. Add the real destination to the target and export with the skill:

```json
"card|ticket": {
  "init": "art/forging/ui/init/card.png",
  "asset": "public/art/ui/card.png"
}
```

```bash
python <skill>/scripts/style_export.py work/forge/<job> --seed 1007 --force
```

The exporter crops the generated content to its visible pixels, resizes it to the init's visible content size, pastes it at the init's alpha bounding box, and applies the init alpha exactly. The wired file therefore has the original path's dimensions and silhouette, not the square canvas. A target `seed` is honoured by the exporter. It refuses to overwrite without `--force`, and writes `JOB/exported.json` with the source/style hashes, dimensions, seed and the style-pass metadata. A partial export merges into that report instead of erasing other targets. For a repeat export, pass `--asset-dir` so the second copy gets its own paths and the original game files are untouched. Review the exported file at its real size, not only the square preview.

**Denoise and seed consistency:** 0.65 gives a stronger restyle; 0.55 preserved delicate internal geometry better in a controlled six-image HUD test (three shapes, two seeds, same refs). At 0.65 one seed drifted in a panel crest and a medallion center; the 0.55 panel crest stayed clean. Prefer 0.55 when the frame, crest or emblem is complex, then compare both before committing. A target can override the command's denoise and seed with `"denoise": 0.68` and `"seed": 2007`; this is useful when one simple filled shape needs a stronger material pass without moving the rest of the family's seed. Generate two seeds, judge them, and use **one seed family across the whole set**; the composite guarantees silhouette and plate preservation but does not guarantee identical internal detail between seeds.

On the 6 GB reference laptop, one 512 px seed took about 3.5 minutes and sampled around 5 GiB total GPU use including the desktop (validation peaks: 4,958-5,022 MiB). Follow the GPU safety rules, one image at a time. Attach the generated image to a full asset or use it as a concept reference for 3D work; do not claim it is production-ready before inspecting the cutout and edges.

### 2b-batch. Prove a kit is consistent

A single attractive output is not a style system. When the job is a kit or an asset family, lock the variables and measure the batch:

1. **One guide, one seed family, one denoise, one palette.** Add the shared palette to `job.json`; `palette_strength` pulls every opaque pixel toward the nearest anchor in Lab after the protected composite. The silhouette and protected plates do not move, and the step is deterministic.

```json
"style_palette": ["#0b1024", "#182252", "#1e4a86", "#6f1f2a", "#b33a3f", "#c79a45", "#f0e2b6", "#24252b", "#4fd9dc"],
"palette_strength": 0.75
```

Use one anchor per material role the art direction actually needs. Do not add a new colour because one target is being stubborn; fix that target's prompt or protection box.
2. Generate at least five **distinct silhouettes** (frame, panel, plaque, medallion, icon, etc.), not five variants of the same shape. Keep the same guide and seed family.
3. Audit the batch with the skill's mechanical gate:

```bash
python <skill>/scripts/style_audit.py work/forge/<job> \
  --out work/forge/<job>/style-audit.json \
  --repeat 'card|ticket;work/forge/a/style/card__ticket/s1007.png;work/forge/b/style/card__ticket/s1007.png'
```

The gate requires:
- `silhouette_iou >= 0.99` against every init and `edge_margin > 0` (nothing clipped) for isolated assets;
- shared-palette coverage `>= 0.60` and mean guide colour distance `<= 28` Lab;
- for the repeat pair, `MAE <= 0.025`, `SSIM >= 0.95`, and palette JS `<= 0.12`.

Full-bleed game frames legitimately touch the canvas edge. Mark those targets `"bleed": true`; the audit then reports the zero margin instead of rejecting it, while the alpha IoU still catches clipping. Do not use `bleed` for a free-floating icon that should have breathing room.

When a target has an `asset`, the same audit reads the **wired game file** instead of a scratch style output. It requires the asset to have the init's exact dimensions and compares alpha at that size. This is the project-facing check; set `asset` paths after `style_export.py` and run the audit again before wiring. `style-audit.json` also reports palette JS, luminance, saturation, edge density and protected-plate std. Those are diagnostics, not pass/fail: a line icon is mostly bright strokes, and a plaque is mostly dark face, so equal area coverage is not the goal. A kit can share a palette while different materials occupy different amounts of each piece.
4. **Repeat proof:** copy the job to a fresh directory, keep the same init, guide, prompt, seed, size, denoise and palette, and run one target again. Every output's `s<seed>.json` records the init, guide and prompt SHA-256; identical hashes plus the same parameters mean identical inputs. Compare the two files with `--repeat`.

If the audit fails, do not loosen the gate silently. Look at the actual sheet, then fix the shared palette, the prompt, the protection boxes, or the seed family, and rerun the affected assets. The audit catches drift, clipping and unstable reruns; it cannot judge composition or taste, so still inspect every result at full size.

**Line-only inits:** the style pass preserves alpha exactly, so a transparent line drawing cannot gain a filled enamel or wood body. That is a limitation of the silhouette contract, not a bad seed. Give the target a filled plate behind the line work, or use a filled-shape init, when the final asset needs a body. A line icon can still share the palette and remain a legitimate fifth silhouette.

### 2b-worlds. Derive world/stage variants from an approved plate

When one approved plate family must dress several worlds or levels, do not
re-run diffusion once per world. Derive a deterministic regrade from the
approved master and let the shared frame do the work:

- Keep the master's **alpha byte-for-byte** and its exact dimensions. The shape,
  bevels, text field and nine-slice geometry must not move between worlds.
- Re-grade only the large enamel field. Warm brass, cream parchment, soul-pink
  and cyan glass are shared anchors; do not recolor every accent into the new
  world's hue.
- Cap the per-pixel change (the reference pass used `0.48`; the bright sunburst
  tile used `0.25`). A full-strength regrade can look world-specific but fails
  the shared-palette gate, which is a real signal that the family stopped
  reading as one physical set. Preserve more of the master, do not lower the
  audit threshold.
- Put every derivative back into the **same job** as a target with the master's
  `init`, the wired `asset` path and `"bleed": true`. Run `style_audit.py`
  again; it then checks every world's silhouette, dimensions, palette coverage
  and guide distance against the same approved contract.
- The world's identity belongs in its backdrop, sigil/crest and props. The HUD
  frame stays the shared carnival prop shop with a different sky.

Inspect each derived plate at its real game size. A mechanical pass earns the
gate; it does not prove the result looks good, and a stage that is merely
recolored still needs a real background or model to sell the place.

### 2b-atlas. Dress a whole prop set from one painted atlas

When a scene needs many small props that share one material language (shops,
stalls, machines, signs, plants, furniture), generating a separate image-to-3D
mesh per prop is the wrong tool. Every independent TRELLIS pass invents its own
palette, wear and silhouette rules, and the set looks assembled from different
games. Use one atlas and one Blender kit instead:

1. **Author one atlas, one cell per material role.** A 512x512 atlas with
   padded cells (8 px gutters) for cream paint, saturated red, brass, black
   enamel, cyan glass, soul-pink, violet, flame, pearl and wood is enough for a
   large kit. Keep the palette anchors countable and name the cells; the atlas
   is the material contract, not a texture dump. Give every cell a UV box and
   enough padding that nearest/bilinear sampling cannot bleed a neighbour into
   a prop face.
2. **Build the kit in Blender from primitives, not from another diffusion
   pass.** Model each prop at a common authored height; assign UVs to atlas
   cells; keep static props as separate objects until export, then join them
   into one mesh per prop and normalize it to a floor pivot (min Y = 0) and the
   caller's height. Export each as a real GLB with the atlas embedded. Use
   image-to-3D for the hero silhouettes (the jar, crowd, crest, camera, dish),
   not for every chair and bottle.
3. **Animate only what moves, and bake it.** Keep an animated prop's hierarchy
   (so the parts can move) and bake a looping `Idle` clip into the GLB. Static
   props have no clip. Check `Idle` survived export before wiring; an engine
   mixer that never advances is not animated.
4. **Wire one shared loader and keep the look consistent.** One `OutlinedGLB`
   component with per-instance material cloning, `roughness`/`metalness`,
   `dim`, `env` and an optional `tint`; normalize by height so every caller
   controls real-world size; use the same inverse-hull outline. A dark or
   overbright prop is a look-control bug, not a reason to fork the loader.
5. **Gate the shipped GLBs, not the Blender scenes.** The 3D asset audit must
   parse each GLB, require a real UV set and the baked `baseColorTexture`,
   `normalTexture`, `occlusionTexture` and `metallicRoughnessTexture` (with UV
   coverage above 0.2 and hashed map files), a sane triangle budget, static min
   Y at the floor, `Idle` for every animated prop, and a consumer in the game
   code. A 64 px embedded texture is not a material gate. The live proof also expects each prop URL
   and samples each animated prop mixer before/after a frame. A static prop that
   only exists in `art/` is not shipped.
6. **Be explicit about provenance.** This is a Blender-authored kit sharing a
   forged painted atlas, **not** one image-to-3D generation per prop. Say so in
   the manifest. Never imply the pipeline was TRELLIS per asset when it was not.

**Full-bleed truth/dark plates:** a dark full-bleed backdrop has no isolated
silhouette to preserve, so `style_audit.py`'s `silhouette_iou` gate is the wrong
contract. Keep full-bleed plates out of the alpha kit and add a separate
mechanical gate: exact dimensions, dark mean luminance, shared carnival-palette
coverage, eight distinct hashes, and the game's `stageArt` path. The prop atlas
gets the same treatment: size, opaque coverage and palette coverage, not
silhouette IoU against a rectangular init.

## 2c. Live dashboard (watch the forge)
`node <skill>/dashboard/server.mjs` from the project root serves http://127.0.0.1:5390: what is generating now, ComfyUI's queue, the newest candidates with scores and picks, and a contact sheet per job against its bar. It also scans every git worktree's `work/forge/` and shows who holds the GPU lock. Offer it when the user wants to watch a run, and start it in the background. Options and the files it reads are in `dashboard/README.md`.

**The owner can end a target early.** Hovering a candidate shows **✓ good enough**; clicking it writes `<job>/approvals.json`. An approved target is final with that image, whatever you scored it: `gen` skips it, `sheets` drops it, `status` counts it as final and `report` lists it as approved. Never undo, overrule or re-judge an approval, and never delete `approvals.json`. If you want to say something about an approved piece, say it to the user. `--read-only` hides the button.
- To show every candidate's score, not only the pick's, also write `<job>/scores.json` while judging: `{"<target>": {"r1-s1007": 8.9, "r1-s1024": 9.1}}`.

## 3. Grading (the part that matters)
Score against the job's `bar_text`. For characters, cosmetics and skins, a 9.5 means **all** of these hold:
- **Instantly the original character:** same colours, face, eye style, and signature features (hat, shell, ears, gills).
- **The theme reads in one glance, and it looks premium,** like something people would pay for. Not a shirt recolour.
- **Clean clusters and one outline,** with no stray specks, mud or noise.
- **It fits the size budget,** with nothing clipped.
- **Clean cutout (illustration mode): an automatic fail.** Sheets are drawn on vivid magenta so leftovers stand out. Before scoring, scan every gap (between tail and body, under arms, between legs, around scarves and capes) and the outline for:
  - leftover background or pale pockets;
  - ghost outlines where a pocket was removed;
  - white or lavender halos;
  - semi-transparent (faded) parts.

  Any one of these caps the score below the bar, however good the art is. Note it ("background pocket between tail and body", or "no cape, no scarf" when it is a painted shape) and re-roll. Cleanup can't remove a painted shape, and it can miss small enclosed slivers.

Calibration:

| Score | Meaning |
|---|---|
| 7.8 | Plain recolour |
| 8.5 | Good theme, but weak identity or plain |
| 9.0 | Strong, with one clear flaw |
| 9.3 | Polish-only issues |
| 9.5 | You'd ship it as a paid item |

Be honest. Never round up to escape the loop.

## 4. Steering with `note` and `denoise`
- **Polish (score ≥ 9.3):** denoise 0.38, and the note names the last flaw.
- **Fix one thing (8.5–9.2):** denoise 0.45, and the note names that thing.
- **Faces drift** (squinting eyes, squashed faces): drop to 0.32 and add "big wide-open eyes exactly like the original".
- **Stuck feature** (a hat that won't swap, goggles that keep coming back, a colour that won't change): polishing can't fix it. Redesign:
  - set `best` to the current best path;
  - set `path` to a fresh init (the base art, or a rough code-made mock of the change);
  - set `denoise` to 0.66.

  The sheet keeps showing `best`. If the redesign loses, set `path` back to `best`.
- **Same failure on every target:** the fault is in the prompt, not the image. Fix `prompt` or `style` in job.json. It applies from the next round.

## 5. Running it unattended
Under `/ralph-loop`, make each iteration one pass of section 2. Use `wait` instead of sleeping. Use a completion promise that is only true when `status` prints `ALL FINAL`.

The finished picks are the deliverable. Put them on the review page or in a sheet for the owner's final call.

Files in this skill

  • SKILL.md14.1 KB
  • UI.md4.7 KB
  • dashboard/README.md4 KB
  • dashboard/index.html23.1 KB
  • dashboard/server.mjs23 KB
  • scripts/forge_loop.py26.5 KB
  • scripts/moss/hygiene.py23 KB
  • scripts/moss/moss_generate.py13.6 KB
  • scripts/moss/moss_snap.py12.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.