agent-manifesto-kit 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +44 -0
  2. package/collection/skills/art-direction-pass/SKILL.md +245 -0
  3. package/collection/skills/art-direction-pass/agents/openai.yaml +4 -0
  4. package/collection/skills/art-direction-pass/assets/presets.json +9 -0
  5. package/collection/skills/art-direction-pass/assets/visual_capture.gd +77 -0
  6. package/collection/skills/art-direction-pass/scripts/compare.py +86 -0
  7. package/collection/skills/art-direction-pass/scripts/metrics.py +56 -0
  8. package/collection/skills/art-direction-pass/scripts/test_tools.py +83 -0
  9. package/collection/skills/concept-asset-builder/SKILL.md +124 -0
  10. package/collection/skills/concept-asset-builder/agents/openai.yaml +4 -0
  11. package/collection/skills/concept-asset-builder/assets/templates/agent_brief.md +56 -0
  12. package/collection/skills/concept-asset-builder/assets/templates/rubric.json +50 -0
  13. package/collection/skills/concept-asset-builder/assets/templates/rubric_example_vending.json +14 -0
  14. package/collection/skills/concept-asset-builder/assets/templates/scene_style_example.md +30 -0
  15. package/collection/skills/concept-asset-builder/assets/templates/wear_description_example.md +50 -0
  16. package/collection/skills/concept-asset-builder/assets/templates/zones.json +10 -0
  17. package/collection/skills/concept-asset-builder/assets/templates/zones_example_vending.json +69 -0
  18. package/collection/skills/concept-asset-builder/references/examples/postbox_blender.py +1112 -0
  19. package/collection/skills/concept-asset-builder/references/examples/postbox_wear_three.js +742 -0
  20. package/collection/skills/concept-asset-builder/references/examples/vending_materials_blender.py +487 -0
  21. package/collection/skills/concept-asset-builder/references/examples/vending_wear_three.js +798 -0
  22. package/collection/skills/concept-asset-builder/references/field-lessons.md +36 -0
  23. package/collection/skills/concept-asset-builder/references/wear-language.md +36 -0
  24. package/collection/skills/concept-asset-builder/scripts/blender/bake_export.py +174 -0
  25. package/collection/skills/concept-asset-builder/scripts/blender/render_views.py +100 -0
  26. package/collection/skills/concept-asset-builder/scripts/blender/studio.py +73 -0
  27. package/collection/skills/concept-asset-builder/scripts/capture.mjs +44 -0
  28. package/collection/skills/concept-asset-builder/scripts/codex_review.sh +88 -0
  29. package/collection/skills/concept-asset-builder/scripts/compare_to.py +24 -0
  30. package/collection/skills/concept-asset-builder/scripts/composite_godot.py +13 -0
  31. package/collection/skills/concept-asset-builder/scripts/crop.py +9 -0
  32. package/collection/skills/concept-asset-builder/scripts/gen_texture.sh +18 -0
  33. package/collection/skills/concept-asset-builder/scripts/godot/capture.gd +122 -0
  34. package/collection/skills/concept-asset-builder/scripts/godot/project.godot +18 -0
  35. package/collection/skills/concept-asset-builder/scripts/init_workspace.sh +17 -0
  36. package/collection/skills/concept-asset-builder/scripts/measure_silhouette.py +40 -0
  37. package/collection/skills/concept-asset-builder/scripts/metrics.py +144 -0
  38. package/collection/skills/concept-asset-builder/scripts/sheet.py +19 -0
  39. package/collection/skills/concept-asset-builder/scripts/test_tools.py +121 -0
  40. package/collection/skills/concept-asset-builder/scripts/threejs/index.html +23 -0
  41. package/collection/skills/concept-asset-builder/scripts/threejs/model.js +9 -0
  42. package/collection/skills/concept-asset-builder/scripts/threejs/studio.js +178 -0
  43. package/collection/skills/concept-asset-builder/scripts/wear_stats.py +130 -0
  44. package/collection/skills/concept-scene-builder/SKILL.md +326 -0
  45. package/collection/skills/concept-scene-builder/agents/openai.yaml +4 -0
  46. package/collection/skills/concept-scene-builder/references/field-lessons.md +113 -0
  47. package/collection/skills/concept-scene-builder/scripts/blend.py +32 -0
  48. package/collection/skills/concept-scene-builder/scripts/crop.py +56 -0
  49. package/collection/skills/concept-scene-builder/scripts/grid_overlay.py +117 -0
  50. package/collection/skills/concept-scene-builder/scripts/test_tools.py +89 -0
  51. package/collection/skills/machine-builder/SKILL.md +222 -0
  52. package/collection/skills/machine-builder/agents/openai.yaml +4 -0
  53. package/collection/skills/machine-builder/assets/spec.example.yaml +47 -0
  54. package/collection/skills/machine-builder/scripts/validate.py +307 -0
  55. package/package.json +1 -1
@@ -0,0 +1,178 @@
1
+ // Shared white studio for pipeline A (procedural three.js) and pipeline C (Blender GLB in three.js).
2
+ // Identical renderer, light, camera fitting and capture contract for both viewers.
3
+ import * as THREE from 'three';
4
+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
5
+ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
6
+ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
7
+ import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
8
+ import { GTAOPass } from 'three/addons/postprocessing/GTAOPass.js';
9
+ import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
10
+
11
+ export async function loadSpec() {
12
+ const res = await fetch('/spec/object.json');
13
+ return res.json();
14
+ }
15
+
16
+ /** True if a static file exists (vite answers missing paths with index.html, so check the content type). */
17
+ export async function fileExists(url, typePrefix) {
18
+ try {
19
+ const res = await fetch(url, { method: 'HEAD', cache: 'no-store' });
20
+ if (!res.ok) return false;
21
+ const type = res.headers.get('content-type') || '';
22
+ return typePrefix ? type.startsWith(typePrefix) : !type.startsWith('text/html');
23
+ } catch {
24
+ return false;
25
+ }
26
+ }
27
+
28
+ export const params = new URLSearchParams(location.search);
29
+
30
+ export function createStudio(spec, container = document.body, opts = {}) {
31
+ const view = params.get('view');
32
+ // GTAO on by default (pipeline A); a viewer can default it off (C: AO is already baked into the GLB);
33
+ // ?ao=0 / ?ao=1 overrides either way
34
+ const useAO = params.has('ao') ? params.get('ao') !== '0' : (opts.ao ?? true);
35
+ const [imgW, imgH] = spec.cameras.image;
36
+ const width = view ? imgW : window.innerWidth;
37
+ const height = view ? imgH : window.innerHeight;
38
+
39
+ const renderer = new THREE.WebGLRenderer({ antialias: true, preserveDrawingBuffer: true });
40
+ renderer.setPixelRatio(view ? 1 : Math.min(window.devicePixelRatio, 2));
41
+ renderer.setSize(width, height);
42
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
43
+ // Neutral (Khronos PBR Neutral) keeps albedo hue and saturation: ACES/AgX shift the red paint toward orange/pink.
44
+ renderer.toneMapping = THREE.NeutralToneMapping;
45
+ renderer.toneMappingExposure = 0.82;
46
+ renderer.shadowMap.enabled = true;
47
+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;
48
+ container.appendChild(renderer.domElement);
49
+
50
+ const scene = new THREE.Scene();
51
+ // with the composer the OutputPass tone-maps the background too: ×1.35 compensates so the page bg matches the
52
+ // concept; without it (renderer clear colour, not tone-mapped) the plain colour already matches
53
+ scene.background = new THREE.Color(spec.palette.background).multiplyScalar(useAO ? 1.35 : 1.0);
54
+
55
+ const pmrem = new THREE.PMREMGenerator(renderer);
56
+ scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
57
+ scene.environmentIntensity = 1.0;
58
+
59
+ // Soft key: upper-left of the CAMERA. The concept sheet lights every view the same way relative to the
60
+ // viewer (left side of the body lighter), so the key follows the camera instead of being fixed in the world.
61
+ const key = new THREE.DirectionalLight(0xffffff, 1.25);
62
+ const KEY_AZ = THREE.MathUtils.degToRad(-40), KEY_EL = THREE.MathUtils.degToRad(38);
63
+ key.target.position.set(0, 0.6, 0);
64
+ function placeKey() {
65
+ const az = Math.atan2(camera.position.x - key.target.position.x, camera.position.z - key.target.position.z) + KEY_AZ;
66
+ key.position.set(Math.sin(az) * Math.cos(KEY_EL), Math.sin(KEY_EL), Math.cos(az) * Math.cos(KEY_EL))
67
+ .multiplyScalar(3.5).add(key.target.position);
68
+ // RoomEnvironment is asymmetric: turn it with the camera so every view gets the same studio
69
+ scene.environmentRotation.y = az - KEY_AZ;
70
+ }
71
+ key.castShadow = true;
72
+ key.shadow.mapSize.set(2048, 2048);
73
+ key.shadow.radius = 6;
74
+ key.shadow.bias = -0.0004;
75
+ key.shadow.normalBias = 0.015;
76
+ const sc = key.shadow.camera;
77
+ sc.left = -0.9; sc.right = 0.9; sc.top = 0.9; sc.bottom = -0.9; sc.near = 0.5; sc.far = 8;
78
+ scene.add(key, key.target);
79
+
80
+ // Invisible ground that only receives a faint shadow (concept sheet has almost none).
81
+ const ground = new THREE.Mesh(
82
+ new THREE.PlaneGeometry(6, 6),
83
+ new THREE.ShadowMaterial({ opacity: 0.04 })
84
+ );
85
+ ground.rotation.x = -Math.PI / 2;
86
+ ground.receiveShadow = true;
87
+ scene.add(ground);
88
+
89
+ const camera = new THREE.PerspectiveCamera(spec.cameras.fov_deg, width / height, 0.05, 50);
90
+
91
+ let composer = null;
92
+ if (useAO) {
93
+ // multisampled target (MSAA x4): the composer path otherwise loses the canvas antialiasing
94
+ composer = new EffectComposer(renderer, new THREE.WebGLRenderTarget(width, height, { type: THREE.HalfFloatType, samples: 4 }));
95
+ composer.setPixelRatio(renderer.getPixelRatio());
96
+ composer.setSize(width, height);
97
+ composer.addPass(new RenderPass(scene, camera));
98
+ const gtao = new GTAOPass(scene, camera, width, height);
99
+ gtao.updateGtaoMaterial({ radius: 0.12, distanceExponent: 1.5, thickness: 1.0, scale: 1.0 });
100
+ gtao.blendIntensity = 1.0;
101
+ composer.addPass(gtao);
102
+ composer.addPass(new OutputPass());
103
+ }
104
+
105
+ let controls = null;
106
+ if (!view) {
107
+ controls = new OrbitControls(camera, renderer.domElement);
108
+ controls.enableDamping = true;
109
+ window.addEventListener('resize', () => {
110
+ camera.aspect = window.innerWidth / window.innerHeight;
111
+ camera.updateProjectionMatrix();
112
+ renderer.setSize(window.innerWidth, window.innerHeight);
113
+ composer?.setSize(window.innerWidth, window.innerHeight);
114
+ });
115
+ }
116
+
117
+ function render() {
118
+ if (composer) composer.render();
119
+ else renderer.render(scene, camera);
120
+ }
121
+
122
+ /** Place the camera for a named view and fit the object's bounding box to `fill` of the image height. */
123
+ function frame(object, viewName = view || '3q', fill = spec.cameras.fill ?? 0.955) {
124
+ const az = THREE.MathUtils.degToRad(spec.cameras.views[viewName] ?? -38);
125
+ const el = THREE.MathUtils.degToRad(spec.cameras.elevation_deg);
126
+ const dir = new THREE.Vector3(Math.sin(az) * Math.cos(el), Math.sin(el), Math.cos(az) * Math.cos(el));
127
+ const box = new THREE.Box3().setFromObject(object);
128
+ const corners = [];
129
+ for (const x of [box.min.x, box.max.x])
130
+ for (const y of [box.min.y, box.max.y])
131
+ for (const z of [box.min.z, box.max.z]) corners.push(new THREE.Vector3(x, y, z));
132
+ const target = box.getCenter(new THREE.Vector3());
133
+ let dist = 6;
134
+ for (let i = 0; i < 8; i++) {
135
+ camera.position.copy(target).addScaledVector(dir, dist);
136
+ camera.lookAt(target);
137
+ camera.updateMatrixWorld();
138
+ let ymin = Infinity, ymax = -Infinity;
139
+ for (const c of corners) {
140
+ const p = c.clone().project(camera);
141
+ ymin = Math.min(ymin, p.y); ymax = Math.max(ymax, p.y);
142
+ }
143
+ dist *= (ymax - ymin) / (2 * fill);
144
+ // recentre vertically: shift target along camera up by the NDC offset
145
+ const mid = (ymax + ymin) / 2;
146
+ const halfH = Math.tan(THREE.MathUtils.degToRad(camera.fov / 2)) * dist;
147
+ const up = new THREE.Vector3(0, 1, 0).applyQuaternion(camera.quaternion);
148
+ target.addScaledVector(up, mid * halfH);
149
+ }
150
+ camera.position.copy(target).addScaledVector(dir, dist);
151
+ camera.lookAt(target);
152
+ if (controls) {
153
+ controls.target.copy(target);
154
+ controls.update();
155
+ }
156
+ }
157
+
158
+ function start() {
159
+ let frames = 0;
160
+ renderer.setAnimationLoop(() => {
161
+ controls?.update();
162
+ placeKey();
163
+ render();
164
+ if (++frames === 3) window.__ready = true;
165
+ });
166
+ }
167
+
168
+ return { THREE, renderer, scene, camera, key, controls, frame, render, start, view };
169
+ }
170
+
171
+ /** Small corner label (hidden in capture mode). */
172
+ export function label(text, view) {
173
+ if (view) return;
174
+ const el = document.createElement('div');
175
+ el.textContent = text;
176
+ el.style.cssText = 'position:fixed;left:12px;top:10px;font:13px/1.3 system-ui;color:#5a4a42;opacity:.8;pointer-events:none';
177
+ document.body.appendChild(el);
178
+ }
@@ -0,0 +1,130 @@
1
+ """Generic wear measurement (v2) for an object concept vs renders.
2
+
3
+ Usage: python3 tools/wear_stats.py [image_dir] (default reference/crops) -> table + out/wear_stats_<dir>.json
4
+ Config: reference/zones.json
5
+ height_m: real height of the silhouette
6
+ bands: {name: [y0_m, y1_m]} horizontal bands over the whole silhouette (every view)
7
+ front_rects: {name: [x0, x1, y0, y1]} metres, x from the silhouette centre; front view only
8
+ chip: {dL, min_L, max_C, window_m} chip = lighter than the local paint by dL, L > min_L, chroma < max_C
9
+ or {mode: "hue", paint_hue: [h0, h1], neutral_C, min_L, max_C} for light paint: chip = not the paint hue
10
+ rust: {mode: "dark"|"hue", hue: [h0, h1], min_C, dL} hue mode: orange-brown hue range (for non-red paint)
11
+ grime: {hue: [h0, h1], min_C, max_L} olive grime
12
+ exclude_emissive: true drop the glowing window (and what is inside it) from all measurements
13
+ All images are resampled so the silhouette is 527 px tall; windows are in metres; vertical components longer
14
+ than 0.2 m are dropped from rust (edges/grooves, not drips).
15
+ """
16
+ import json, sys, pathlib
17
+ import numpy as np
18
+ from PIL import Image
19
+ from scipy import ndimage as ndi
20
+ sys.path.insert(0, str(pathlib.Path(__file__).parent))
21
+ import metrics as M
22
+
23
+ ROOT = M.ROOT
24
+ Z = json.loads((ROOT / "reference/zones.json").read_text())
25
+ H = Z["height_m"]
26
+ src = pathlib.Path(sys.argv[1]) if len(sys.argv) > 1 else ROOT / "reference/crops"
27
+ TARGET = 527
28
+
29
+
30
+ def normalise(img):
31
+ m = M.mask_of(img); y0, y1, x0, x1 = M.bbox(m); k = TARGET / (y1 - y0)
32
+ if abs(k - 1) < 0.02:
33
+ return img
34
+ im = Image.fromarray(img.clip(0, 255).astype(np.uint8)).resize((round(img.shape[1] * k), round(img.shape[0] * k)), Image.LANCZOS)
35
+ return np.asarray(im).astype(np.float32)
36
+
37
+
38
+ def masks(img, mpp, sil):
39
+ lab = M.srgb_to_lab(img); L, a, b = lab[..., 0], lab[..., 1], lab[..., 2]
40
+ C = np.hypot(a, b); hue = np.degrees(np.arctan2(b, a)) % 360
41
+ win = max(5, int(round(0.033 / mpp)) | 1)
42
+ Lloc = ndi.median_filter(L, size=win)
43
+ ch = Z.get("chip", {}); dL, minL, maxC = ch.get("dL", 10), ch.get("min_L", 55), ch.get("max_C", 38)
44
+ # chips can be larger than the rust window: compare with a wider (8 cm) paint neighbourhood
45
+ Lchip = ndi.median_filter(L, size=max(7, int(round(ch.get("window_m", 0.08) / mpp)) | 1))
46
+ chip = (L > np.minimum(Lloc, Lchip) + dL) & (L > minL) & (C < maxC)
47
+ if ch.get("mode") == "hue":
48
+ # light paint: chips are not much lighter, they differ by hue (warm/neutral primer vs the paint hue)
49
+ ph0, ph1 = ch["paint_hue"]
50
+ not_paint = ~((hue >= ph0) & (hue <= ph1)) | (C < ch.get("neutral_C", 4))
51
+ chip = not_paint & (C < maxC) & (L > minL) & (L > np.minimum(Lloc, Lchip) - 3)
52
+ r = Z.get("rust", {"mode": "dark"})
53
+ if r.get("mode") == "hue":
54
+ h0, h1 = r.get("hue", [30, 85])
55
+ rust = (hue >= h0) & (hue <= h1) & (C > r.get("min_C", 15)) & (L < Lloc - r.get("dL", 2)) & (L < 72)
56
+ else:
57
+ rust = (L < Lloc - 6) & (L < 50) & (C > 20)
58
+ g = Z.get("grime")
59
+ grime = ((hue >= g["hue"][0]) & (hue <= g["hue"][1]) & (C > g.get("min_C", 10)) & (L < g.get("max_L", 65))) if g else np.zeros_like(rust)
60
+ keep = sil.copy()
61
+ if Z.get("exclude_emissive"):
62
+ glow = (L > 93) & (C < 25) & sil # the display glows at L 95-99; lit light paint stays below ~90
63
+ glow = ndi.binary_closing(glow, iterations=3)
64
+ lab_, n = ndi.label(glow)
65
+ if n:
66
+ sizes = ndi.sum(glow, lab_, range(1, n + 1))
67
+ big = np.isin(lab_, 1 + np.where(sizes > 0.01 * sil.sum())[0])
68
+ win_m = ndi.binary_fill_holes(ndi.binary_dilation(big, iterations=4))
69
+ # fill also the box spanned by the glow (bottles split it into bands)
70
+ if win_m.any():
71
+ ys, xs = np.where(win_m); win_m[ys.min():ys.max() + 1, xs.min():xs.max() + 1] = True
72
+ keep &= ~win_m
73
+ lab_, n = ndi.label(rust)
74
+ for i, sl in enumerate(ndi.find_objects(lab_), 1):
75
+ if sl is not None and (sl[0].stop - sl[0].start) * mpp > 0.20:
76
+ rust[sl][lab_[sl] == i] = False
77
+ return chip & keep, rust & keep, grime & keep, keep
78
+
79
+
80
+ def summarise(mask, area, mpp):
81
+ lab_, n = ndi.label(mask); out = []
82
+ for sl in ndi.find_objects(lab_):
83
+ h = (sl[0].stop - sl[0].start) * mpp * 100; w = (sl[1].stop - sl[1].start) * mpp * 100
84
+ if max(h, w) >= 0.6:
85
+ out.append((h, w))
86
+ if not out:
87
+ return {"count": 0}
88
+ s = np.array([max(h, w) for h, w in out])
89
+ return {"count": int(len(s)), "size_cm_p10_p50_p90_max": [round(float(np.percentile(s, q)), 1) for q in (10, 50, 90)] + [round(float(s.max()), 1)],
90
+ "small_lt2cm": int((s < 2).sum()), "medium_2_5cm": int(((s >= 2) & (s < 5)).sum()), "large_ge5cm": int((s >= 5).sum())}
91
+
92
+
93
+ def measure(region, chip, rust, grime, mpp):
94
+ area = region.sum()
95
+ if area < 50:
96
+ return None
97
+ return {"chip_pct": round(100 * (chip & region).sum() / area, 1), "rust_pct": round(100 * (rust & region).sum() / area, 1),
98
+ "grime_pct": round(100 * (grime & region).sum() / area, 1),
99
+ "chips": summarise(chip & region, area, mpp), "drips": summarise(rust & region, area, mpp)}
100
+
101
+
102
+ res = {}
103
+ for v in M.VIEWS:
104
+ p = src / f"{v}.png"
105
+ if not p.exists():
106
+ continue
107
+ img = normalise(M.load(p)); sil = M.mask_of(img); y0, y1, x0, x1 = M.bbox(sil); mpp = H / (y1 - y0)
108
+ sil = ndi.binary_erosion(sil, iterations=3)
109
+ chip, rust, grime, keep = masks(img, mpp, sil)
110
+ rv = {}
111
+ for z, (a, b) in Z["bands"].items():
112
+ reg = np.zeros_like(sil); reg[max(int(y1 - b / mpp), 0):int(y1 - a / mpp)] = True
113
+ r = measure(reg & keep, chip, rust, grime, mpp)
114
+ if r: rv[z] = r
115
+ if v == "front":
116
+ cx = (x0 + x1) / 2
117
+ for z, (xa, xb, a, b) in Z.get("front_rects", {}).items():
118
+ reg = np.zeros_like(sil); reg[int(y1 - b / mpp):int(y1 - a / mpp), int(cx + xa / mpp):int(cx + xb / mpp)] = True
119
+ r = measure(reg & keep, chip, rust, grime, mpp)
120
+ if r: rv[z] = r
121
+ res[v] = rv
122
+ name = "concept" if src == ROOT / "reference/crops" else src.name
123
+ (ROOT / "out").mkdir(exist_ok=True)
124
+ (ROOT / f"out/wear_stats_{name}.json").write_text(json.dumps(res, indent=1))
125
+ for v, rv in res.items():
126
+ print(f"\n[{v}] zone chip% rust% grime% chips n (S/M/L) size p10/p50/p90/max cm rust comps n")
127
+ for z, r in rv.items():
128
+ c, d = r["chips"], r["drips"]
129
+ cs = f"{c['count']:3d} ({c['small_lt2cm']}/{c['medium_2_5cm']}/{c['large_ge5cm']}) {c['size_cm_p10_p50_p90_max']}" if c["count"] else " 0"
130
+ print(f" {z:14s} {r['chip_pct']:5.1f} {r['rust_pct']:5.1f} {r['grime_pct']:5.1f} {cs:42s} {d['count']}")
@@ -0,0 +1,326 @@
1
+ ---
2
+ name: concept-scene-builder
3
+ description: Build a game environment scene (terrain, water, roads, vegetation, rocks, buildings, props, lighting; no units or vehicles) that matches a concept image or screenshot as closely as possible in style and layout, from a reusable asset kit and data-driven layout. Decomposes the scene into objects and builds the hero/mid objects through an object conveyor (a pilot object approved by the owner, a scene style file, then the rest in parallel via concept-asset-builder), then assembles the scene and runs the look pass. Any genre, grid or free-form. Godot or Three.js + Blender. Use when a game needs its environment rebuilt from a concept image or screenshot.
4
+ ---
5
+
6
+ # Concept Scene Builder
7
+
8
+ You build an environment scene that matches a concept image in style AND layout, using a reusable, data-driven asset kit. The concept can be anything: a tiled board, a grid map, an isometric scene, a top-down map, a third-person or in-game screenshot. No genre or game is assumed. The output is not one pretty scene but:
9
+ 1. a kit of parametric assets (engine-procedural + Blender scripts),
10
+ 2. a layout format and a scene builder that turns layout data into a scene,
11
+ 3. a "golden scene" — the concept layout rebuilt as data — used as the comparison fixture,
12
+ 4. style documents shared with the `art-direction-pass` skill.
13
+
14
+ Units, mechs, characters and vehicles visible in the concept are NOT built. Ignore them (optionally record their positions as `spawn_hints`).
15
+
16
+ ## Prerequisites
17
+
18
+ - Python 3 with Pillow and numpy: `python3 -m pip install Pillow numpy`; verify with `python3 -c "import PIL, numpy"`.
19
+ - Godot 4 or Three.js (Node, Playwright for captures), and Blender 4.2 or later for kit assets. Find Blender as `blender` on PATH, the `BLENDER` environment variable or the standard install location (macOS: `/Applications/Blender.app/Contents/MacOS/Blender`) and verify with `--version`; only when none works, build everything in-engine at lower fidelity.
20
+ - A real display/GPU for captures (`--headless` Godot does not render).
21
+ - Optional: the `concept-asset-builder` skill for the object conveyor (5.0): one object to concept fidelity with an independent review loop and a scene style file. Without it, `asset` entries are built as Blender assets.
22
+ - Optional: the `art-direction-pass` skill. It shares the `docs/art/` format, provides `compare.py`, the capture harness and the look pass (Phase 6). Without it, use the fallbacks named in each phase.
23
+ - The skill's resources, installed with it under `.claude/skills/concept-scene-builder/` (other tools use their own skills directory): `scripts/grid_overlay.py`, `scripts/crop.py`, `scripts/blend.py`, `references/field-lessons.md`. Invoke the scripts by path from the project root, so relative outputs land in the project.
24
+
25
+ ## Git
26
+
27
+ Follow the project's own Git rules. The workflow below names commits (a baseline tag, one commit per finished asset family and per scene iteration): if the project's instructions require approval for commits or tags, ask once at the start. Without permission, or with the user's own uncommitted changes in the tree, create no commits or tags and never commit changes this run did not make; use snapshots instead. A snapshot is a tree object written through a temporary index; it creates no commit, ref or tag and leaves the project's index alone. `docs/art/` is excluded so reverts never touch the records:
28
+
29
+ ```sh
30
+ snap() { idx=$(mktemp); GIT_INDEX_FILE=$idx git read-tree HEAD && GIT_INDEX_FILE=$idx git add -A -- . ':!docs/art' && GIT_INDEX_FILE=$idx git write-tree; rm -f "$idx"; }
31
+ ```
32
+
33
+ - Baseline: `snap` before any change; record its id and `git rev-parse HEAD` in `docs/art/kit.md`. The user's uncommitted and untracked files are part of it.
34
+ - Finished step: `snap` again and record the id with the files the step created or changed in `kit.md`.
35
+ - Revert: `snap` the current state as `<cur>`, run `git diff --binary <cur> <last kept> | git apply --binary` (this also deletes files the step added), then check that a fresh `snap` equals `<last kept>`. Never use tree-wide `checkout`, `reset`, `clean` or `stash`.
36
+
37
+ Never push.
38
+
39
+ ## Stop conditions
40
+
41
+ - No `scene` image: ask if the user is present; otherwise stop and report it. Never invent the target.
42
+ - Captures cannot be produced (no display/GPU, e.g. a sandbox or CI): deliver the Phase 0–2 outputs (style docs, `kit.json`/`kit.md`, layout JSON and overlay), report the blocker, and do not start Phase 4.
43
+ - The game no longer runs or existing tests fail after a change: revert that change before anything else.
44
+
45
+ ---
46
+
47
+ ## 0. Inputs and arguments
48
+
49
+ Read from the invocation text. Defaults in brackets.
50
+
51
+ - `scene` — concept image(s) or screenshot(s) of the assembled scene (required): any camera — top-down, isometric, perspective, third-person.
52
+ - `kit` — kit sheet(s) with individual assets (optional but strongly preferred).
53
+ - `engine` [auto] — `godot` or `threejs`. Detect from the project; if there is no project, ask once if the user is present; if unattended, create a minimal Godot 4 project.
54
+ - `space` [auto] — `hex`, `square` (the concept has a visible game grid) or `free` (no grid: positions in metres). Detect from the concept; when in doubt, use `free`.
55
+ - `layout_fidelity` [close] — `close`: rebuild the concept layout as precisely as the camera allows (cell by cell on grids, object by object in metres otherwise); `style`: same composition and kit, layout may differ.
56
+ - `max_asset_iterations` [4] per asset; scene look tuning is delegated (Phase 6).
57
+
58
+ Concepts are often AI-generated. They are the source of truth for style, palette, lighting, materials, proportions and layout intent — not for geometric consistency. Expect: buildings that overflow their cell, roads and rivers that ignore the grid, inconsistent scale between objects, more than one vanishing point, details that change between the scene and the kit sheet. Resolve each contradiction into an explicit rule (section 3.3) instead of copying it or silently ignoring it.
59
+
60
+ ---
61
+
62
+ ## 1. Phase 0 — Discover
63
+
64
+ 1. Read the project's agent instructions (`AGENTS.md` or the tool's own instruction file) and README. Detect engine, renderer, color space, existing map/grid format, existing `docs/art/`.
65
+ 2. If the project already has a grid/map format, write an adapter from this skill's layout JSON to it instead of replacing it.
66
+ 3. Check Blender (see Prerequisites for where to find it). Assets are generated headless: `blender -b --python tools/blender/kit/<id>.py -- --out <path>.glb --seed N`. If Blender is missing, say so and build everything in-engine (lower fidelity for trees/rocks/buildings); the build-time placement checks of 5.3 then apply to the in-engine builders.
67
+ 4. If `docs/art/` exists (from `art-direction-pass` or a previous run), extend it; never overwrite it.
68
+ 5. Record the baseline within the Git rules above: tag the current commit `scene-baseline-<date>` when tags are allowed; otherwise note `git rev-parse HEAD` and the uncommitted file list in `docs/art/kit.md`.
69
+
70
+ ## 2. Phase 1 — Style deconstruction
71
+
72
+ Write or extend `docs/art/direction/00-global.md` (the `art-direction-pass` format: mood and its 5 traits, palette hex + value + screen share, value structure, lighting, atmosphere, post, camera, global material rules, readability, Uncertain).
73
+
74
+ Then add a section **Signature traits**: the 5–8 traits that make this concept recognisable, ranked by impact. Each trait gets: description, technique, owner (asset / shader / lighting / post / camera), verification. Derive them from THIS concept; the table below is only an example (a tabletop-diorama concept):
75
+
76
+ | Trait | Technique | Owner |
77
+ |---|---|---|
78
+ | Miniature look | shallow depth of field / tilt-shift focused on board centre | post + camera |
79
+ | Tiles as physical objects | hex prism, beveled top edge, earth/cork side band ~8–10% of width | asset |
80
+ | Flocked grass | high-frequency noise albedo + instanced tufts, olive→straw variation | shader + scatter |
81
+ | Foam-clump trees | trunk + clusters of displaced blobs, conifers as stacked noisy cones | Blender |
82
+ | Resin water | glossy, translucent, visible bed | shader |
83
+ | Soft studio light | large soft key, soft shadows, dark table backdrop | lighting |
84
+
85
+ Every signature trait must be implemented and verified before the scene counts as done.
86
+
87
+ ## 3. Phase 2 — Kit and layout extraction
88
+
89
+ ### 3.1 Kit inventory
90
+
91
+ `docs/art/kit.json` (+ human-readable `docs/art/kit.md`). One entry per asset:
92
+
93
+ ```json
94
+ {
95
+ "id": "tile_grass",
96
+ "category": "terrain",
97
+ "build": "engine",
98
+ "reference": "docs/art/reference/kit/tile_grass.png",
99
+ "dimensions": {"relative_to": "tile", "width": 1.0, "height": 0.1},
100
+ "variants": 4,
101
+ "materials": ["flock_grass", "tile_side_earth"],
102
+ "tri_budget": 2000,
103
+ "screen_share": "high",
104
+ "notes": ""
105
+ }
106
+ ```
107
+
108
+ - `build`: `engine` (tiles or terrain meshes, ground surfaces, grass/scatter, water, road and river surfaces, simple cliffs), `blender` (trees, rocks, buildings, ruins, bridges, complex props), `shader` (surface-only effects), `asset` (an object the viewer looks at closely — street furniture, machines, signs, shop fronts, hero props: built through the object conveyor, 5.0, with the `concept-asset-builder` skill).
109
+ - Large objects (a shop, a station, a house with a porch) are decomposed: a parent entry with `"parts": ["shop_building", "shop_awning", "shop_shelves", "shop_counter", ...]` and an `assembly` block (part ids with positions/rotations in the parent's metres). Every part is its own kit entry (usually `asset`) and gets its own sheet; decompose recursively until each part is one object a sheet can describe in 5 views.
110
+ - `dimensions`: relative to the tile for grid concepts, in metres for free-form concepts.
111
+ - `category`: terrain / architecture / props / vegetation / vfx — same categories as `art-direction-pass`.
112
+ - Derive the list from the kit sheet AND the scene concept: anything visible in the scene must exist in the kit.
113
+ - Cut references with `crop.py` (look at the sheet, write `boxes.json`, run, check the crops). If there is no kit sheet, crop from the scene concept.
114
+
115
+ ### 3.2 Layout extraction
116
+
117
+ Every scene has a ground plane. Map the concept's ground onto it first, then read the layout from that mapping. `grid_overlay.py` does both jobs.
118
+
119
+ **Grid concepts (`hex` / `square`):**
120
+ 1. Estimate grid type, orientation (pointy/flat), columns, rows and the image pixels of the board's four corners.
121
+ 2. Run `grid_overlay.py` and LOOK at the overlay. Adjust corners/cols/rows until cell outlines match the concept's cells. Raised tiles look shifted, the board is treated as a plane.
122
+ 3. Read the concept cell by cell and fill the layout JSON.
123
+
124
+ **Free-form concepts (`free`):**
125
+ 1. Find a scale reference: objects of known size (door ≈ 2.1 m, road lane ≈ 3.5 m, car ≈ 4.5 m, person ≈ 1.8 m, storey ≈ 3 m). Record which ones you used.
126
+ 2. Pick four ground points that form a rectangle in the world (field corners, road edges, a building footprint, a plaza). Estimate its size in metres.
127
+ 3. Run `grid_overlay.py --grid square --cell-m <size>` as a MEASUREMENT grid: each label is the metre coordinate of its cell's centre. Adjust until the grid lies convincingly on the ground (parallel to roads, square on building footprints).
128
+ 4. Read positions, sizes and rotations of everything on the ground in metres. Elevated parts (hills, roofs, plateaus) are measured at their base.
129
+ 5. In perspective or third-person views, measure only the ground region where the grid is reliable. Treat the horizon, skyline and distant hills as `backdrop` elements with a direction and rough distance, not as precisely placed objects.
130
+
131
+ Save the final overlay next to the layout; it is the evidence for every placement.
132
+
133
+ Layout format `docs/art/layout/<scene>.json`. The `space` block decides how positions are written.
134
+
135
+ Grid example:
136
+
137
+ ```json
138
+ {
139
+ "space": {"type": "hex", "orientation": "pointy", "coords": "axial", "cell_size_m": 2.0},
140
+ "cells": [
141
+ {"q": 0, "r": 0, "terrain": "grass", "height": 0, "features": ["rock_small"], "seed": 11}
142
+ ],
143
+ "paths": [
144
+ {"type": "road", "cells": [[4, 7], [4, 6], [5, 5]], "style": "spline_through_centres"},
145
+ {"type": "river", "cells": [[-1, 3], [0, 3], [1, 4]], "width": 0.45}
146
+ ],
147
+ "structures": [
148
+ {"kit": "factory_a", "anchor": [5, 0], "footprint": [[5, 0], [6, 0]], "rotation_deg": 0}
149
+ ],
150
+ "scatter": [
151
+ {"kit": ["tree_conifer", "tree_broadleaf"], "cells": [[10, 1], [11, 1]], "density": 0.9, "seed": 5}
152
+ ],
153
+ "camera": {"preset": "concept_view"},
154
+ "spawn_hints": [{"cell": [3, 1], "note": "unit in concept"}],
155
+ "notes": ["factory_a overflows one hex in the concept -> 2-hex footprint"]
156
+ }
157
+ ```
158
+
159
+ Free-form example (metres, x right, y away from camera, height up):
160
+
161
+ ```json
162
+ {
163
+ "space": {"type": "free", "units": "m", "extent": [0, 0, 120, 80], "scale_refs": ["road lane 3.5 m", "door 2.1 m"]},
164
+ "terrain": {
165
+ "heights": [{"at": [30, 20], "h": 4.0, "radius": 12, "profile": "plateau"}],
166
+ "regions": [{"material": "dry_grass", "polygon": [[0, 0], [40, 0], [40, 25], [0, 30]]}]
167
+ },
168
+ "paths": [
169
+ {"type": "road", "points": [[0, 60], [50, 45], [120, 40]], "width": 6.0},
170
+ {"type": "river", "points": [[0, 30], [60, 35], [120, 28]], "width": 4.0}
171
+ ],
172
+ "objects": [{"kit": "factory_a", "pos": [62, 18], "rot_deg": 15, "scale": 1.0}],
173
+ "scatter": [{"kit": ["tree_conifer"], "polygon": [[90, 0], [120, 0], [120, 30]], "density_per_100m2": 2.0, "seed": 5}],
174
+ "backdrop": [{"kit": "hills_far", "direction_deg": 0, "distance_m": 400}],
175
+ "camera": {"preset": "concept_view"},
176
+ "spawn_hints": [],
177
+ "notes": []
178
+ }
179
+ ```
180
+
181
+ Square grids use `x, y` instead of `q, r`. If the project already has its own map format, keep this JSON as the extraction result and write an adapter.
182
+
183
+ ### 3.3 Contradiction rules
184
+
185
+ Record every resolution in `layout.notes` and in `kit.md`:
186
+ - Building larger than a cell → multi-cell footprint, or an allowed overhang (state the max, e.g. ≤ 15% of a cell). Never scale the grid to fit one building.
187
+ - Road or river not aligned with the grid → path through cell centres, smoothed with a spline, keeping the concept's visual direction as closely as the grid allows.
188
+ - Inconsistent cell sizes → one cell size.
189
+ - Objects at inconsistent scales (free-form) → normalise to the scale references; note the objects that were resized.
190
+ - Several vanishing points or a distorted ground → pick the dominant ground plane, accept small placement errors elsewhere.
191
+ - Scene and kit sheet disagree on an asset → the scene wins for proportions in context, the kit sheet wins for detail and materials.
192
+ - The user overrides the concept ("the concept is wrong here") → record it as a rule like the ones above, so no later pass reverts it.
193
+
194
+ ### 3.4 Checkpoint
195
+
196
+ If the user is present: show signature traits, the kit list, the overlay image, the scale references (free-form) and the contradiction rules; wait for approval. If unattended, continue and note it.
197
+
198
+ ## 4. Phase 3 — Foundations
199
+
200
+ 1. **Scene builder** — reads layout JSON + kit.json and builds the scene: tiles or a terrain mesh, surface regions, paths, objects, scatter, backdrop. No hand-placed objects: everything comes from data, so the same code builds any future map or level.
201
+ - Godot: `SceneBuilder` node with an `@tool` script (rebuild in editor and at runtime).
202
+ - Three.js: `buildScene(layout, kit)` module returning a `Group`.
203
+ - Instancing for repeated meshes (MultiMeshInstance3D / InstancedMesh), shared materials, deterministic seeds.
204
+ 2. **Material presets library** — one preset per material in kit.json (`res://art/materials/<category>/` in Godot, a `materials.ts/json` registry in Three.js).
205
+ 3. **Capture harness** — reuse the one from `art-direction-pass` if present (same `tools/visual/`). Otherwise build one: named camera presets in `tools/visual/presets.json`, a fixed RNG seed applied before generation, paused animation and particles, settle frames before each capture, a PNG plus frame time per preset, and two identical runs (mean abs diff < 1/255) before relying on it. Presets:
206
+ - `concept_view` — camera matched to the scene concept,
207
+ - `kit_<id>` — each asset alone on a neutral background in the kit sheet's angle,
208
+ - `gameplay_wide` — the real gameplay camera, if the game has one.
209
+ 4. **Camera match** — render `concept_view` with debug cell outlines (or the measurement grid for free-form), overlay it on the concept with `blend.py`, adjust position/pitch/FOV until the grids coincide. Do this before any style work: a wrong camera makes every comparison misleading.
210
+
211
+ ## 5. Phase 4 — Build the kit
212
+
213
+ ### 5.0 Object conveyor (`build: asset`)
214
+
215
+ Objects the viewer looks at closely are built one by one to concept fidelity with the `concept-asset-builder` skill, in one shared style. The conveyor gets early owner feedback on ONE object and then runs the rest without the owner. Without that skill, build `asset` entries as Blender assets (5.3) and keep the pilot and style-file steps.
216
+ 1. **Sheets.** Each `asset` entry needs an asset sheet (5 views + detail on a plain background). Cut it from the kit sheet if there is one; otherwise generate it from the scene crop in the layout and rendering style of an approved sheet (concept-asset-builder 1.2). Keep all sheets of a scene visually consistent (same background, light, weathering language).
217
+ 2. **Pilot.** Pick one object of medium complexity with a high screen share and the scene's typical materials (not the simplest, not the hardest). Build it with concept-asset-builder in pilot mode. Show it to the owner (concept | result per view, close-ups); record every remark that generalises into `docs/art/style/<scene>_style.md` (numbered rules with reasons). Iterate until the owner accepts the pilot. Do not start other assets before this: every remark on the pilot would otherwise be repeated on every object. Unattended: build the pilot, record the open questions in `kit.md`, and continue with the style file the pilot's reviews produced.
218
+ 3. **Conveyor.** Run the remaining `asset` entries through concept-asset-builder in parallel (one builder agent or session per object and engine, each on its own files), each with: its sheet, the scene style file, the pilot's code as the style library, the shared frozen studio. Each object goes through its own review rounds. Show the owner results in batches with a line-up next to the pilot at true relative scale; new general remarks go into the style file for the next objects (re-run earlier objects only if the owner asks).
219
+ 4. **Composite objects.** Build the parts of a decomposed object through the conveyor, then assemble them from the `assembly` block, and check the whole (contact, gaps, scale between parts, defect pass 5.4) before it enters the scene.
220
+ 5. Finished assets export as GLB (concept-asset-builder Phase 7: bake per part, join after) into the kit with their kit id; the scene builder places them like any other kit asset.
221
+
222
+ Before the first iteration of an asset, read its section in `references/field-lessons.md` (rules and recipes from
223
+ real runs: grass, roads, water, trees, buildings, light, performance, porting between engines).
224
+
225
+ Order by screen share and dependency:
226
+ ground (tiles or terrain mesh) → surface materials → elevation (height levels, hills, cliffs) → paths (roads, rivers, bridges) → ground scatter (grass, tufts, pebbles) → vegetation → rocks → buildings → ruins and debris → backdrop.
227
+
228
+ ### 5.1 Per-asset loop
229
+
230
+ For each asset, up to `max_asset_iterations`:
231
+ 1. Build or regenerate it.
232
+ 2. Capture `kit_<id>`.
233
+ 3. `compare.py sheet reference.png render.png` (from `art-direction-pass`), or any side-by-side image, and LOOK at it.
234
+ 4. Fix the biggest 1–3 differences: silhouette and proportions first, then materials, then detail.
235
+ - When the user says it is far from the concept: first write how the concept looks, how ours looks, and the 5 main differences with a fix each.
236
+ - Add a new feature at low strength and measure its share against the concept (area of dust, cracks per metre, stone count); first passes at full strength overshoot.
237
+ - Matching colour statistics is not matching the look: compare 3x crops and structure metrics too.
238
+ 5. Run the defect pass (5.4) on the result. Fix what it finds before anything else; never report an iteration that has not passed it.
239
+ 6. Log in `docs/art/kit.md`: status (draft / matched / accepted with gaps), remaining differences, which defect checks ran.
240
+
241
+ For assets with high screen share, also run a fresh blind reviewer (a subagent, or a separate session when the tool has none; reference, close crops, the defect checklist and the render only) before marking them matched; guard its verdict with metrics measured on the same crops (luminance quantiles, hue/value of the region, share of each feature such as dust or cracks, element counts). `asset` entries get their review loop from concept-asset-builder (5.0) instead. If the user reviews the renders themselves and asks for no subagents, skip the reviewer, never the defect pass.
242
+
243
+ ### 5.2 Engine-procedural assets
244
+
245
+ - Tiles (grid concepts): prism with beveled top edge, side band with its own material if the concept shows one, height levels as stacked prisms; cliff sides with displaced rock material.
246
+ - Terrain (free-form concepts): heightmap mesh built from `terrain.heights`, surface materials blended by masks from `terrain.regions`, soft transitions; cliffs as separate meshes where slopes are steep.
247
+ - Ground surfaces: noise-driven albedo and roughness; break tiling at gameplay distance with world-space macro noise.
248
+ - Colours: sample the concept (hue/luminance quantiles of the region), not the user's words. Mind colour spaces (sRGB uniforms vs linear literals). Fade sub-pixel detail (joints, bump) with distance and cap the bump tilt.
249
+ - Grass and scatter: instanced cards or small meshes, density and colour range from the concept, slight per-instance hue/value jitter. For full-coverage grass use camera-following GPU blades (recipe in `references/field-lessons.md`).
250
+ - Water: match the concept (glossy resin, realistic, stylised flat); visible bed if the concept shows one.
251
+ - Roads: mesh or decal along a spline (through cell centres on grids), with edge wear and kerbs if the concept has them.
252
+
253
+ ### 5.3 Blender assets
254
+
255
+ - One script per asset family: `tools/blender/kit/<family>.py`. Parameters at the top, `--seed` and `--out` from the command line, deterministic.
256
+ - Export GLB: metres, Y-up, applied transforms, pivot at base centre, names `<id>_<variant>`. `bpy.ops.export_scene.gltf(filepath=out, export_format='GLB', export_apply=True, export_yup=True)`.
257
+ - Respect `tri_budget`. Bevels and weighted normals on hard surfaces; no subdivision for its own sake.
258
+ - Trees: trunk/branch curves + clusters of displaced blobs (broadleaf), stacked noisy cones (conifer); vertex colours or a small gradient material for value variation.
259
+ - Rocks: displaced icosphere → decimate → bevel; moss via a top-facing mask.
260
+ - Buildings: modular parts (walls, window bands, roller doors, roof units, pipes, ladders, chimneys) assembled by parameters; ruins reuse the same parts with breaks and a debris scatter.
261
+ - Keep the scripts: regenerating variants must never require manual Blender work.
262
+ - Encode placement rules as build-time checks that fail the script (not warnings): ladders, pipes and signs never cross windows or doors; windows are derived from the same column grid as the pilasters (one opening per bay); doors and their canopies stay below window bands; parts stay inside the footprint or tile; roof equipment fits inside the parapet. Every defect found in 5.4 that a rule could have caught becomes a new check.
263
+
264
+ ### 5.4 Defect pass (before every report)
265
+
266
+ The wide `concept_view` hides defects: an element of a few pixels there can be absurd up close. For every asset changed in the iteration:
267
+ 1. **Look up close, from every side.** Crop the `kit_<id>` render at 100 % and render the asset from at least three sides (front-left, both side walls; orbit or extra kit presets), plus one close orbit view of it in the scene. Look at all of them, not only the side-by-side with the concept.
268
+ 2. **Function and logic.** Doors at ground level and leading somewhere (no gates on upper floors, no door into a wall); ladders and stairs reach a roof or floor and do not cross windows, doors or pipes; pipes connect to something; awnings and canopies sit over openings; windows not blocked by props; openings follow the structural grid (windows and doors between columns/pilasters, never across them; pipe risers on columns, not across windows; columns stop on a lintel above wide gates); every building has a visible entrance on a side the game camera sees; attached parts (awnings, canopies, brackets, signs) touch the wall and their supports, with no gaps.
269
+ 3. **Counts and scale against the reference.** Count repeated elements (roof units, windows, chimneys, branches, stones) and compare with the concept; extra copies read as clutter. Check sizes against neighbours (door vs storey height, ladder rung spacing, tree vs building).
270
+ 4. **Contact and fit.** Nothing floating or sunk, no parts hanging over the tile/cell edge, no interpenetration (pipes through walls, trees through roofs), no z-fighting.
271
+ 5. **Patterns at close range.** Procedural surfaces must not read as tiles, a mosaic or stained glass (voronoi cells with flat colour and dark outlines are the usual culprit), and must show no visible repetition or seams.
272
+ 6. **Material logic.** Light and dark parts where the real object has them (frames, copings, caps, edges); weathering where water and dirt actually collect.
273
+
274
+ In the report, say what was checked and what was found; list anything left unfixed instead of calling the asset done.
275
+
276
+ ## 6. Phase 5 — Assemble the golden scene
277
+
278
+ Assemble only after the pilot is accepted and the conveyor objects have passed their reviews; the final light/shadow/post pass (Phase 6) happens on the assembled scene, never per object.
279
+
280
+ 1. Build the concept layout with the scene builder.
281
+ 2. Capture `concept_view`; make a side-by-side sheet and a 50% blend with the concept.
282
+ 3. Fix LAYOUT errors first (wrong cell types or regions, heights, path routes, missing or misplaced objects), then proportions of assets in context, only then style.
283
+ 4. Check every signature trait; list any that is not yet present.
284
+ 5. Run the defect pass (5.4) on the assembled scene with close orbit views of each area (assets in context reveal new problems: overlaps, scale, placement on tiles).
285
+
286
+ ## 7. Phase 6 — Look and light
287
+
288
+ Run `art-direction-pass` with `scope=global,environment`, the scene concept as reference and `concept_view` as the main preset (plus `gameplay_wide` if it exists). If that skill is not available, follow the same loop: one parameter group per iteration, a fresh blind A/B reviewer, keep or revert within the Git rules above, 5–12 iterations. Keep the review blind: shuffle before/after into A and B per preset, copy them with the concept into a temporary folder outside the project, keep the mapping in the project, and give the reviewer only the paths of those files.
289
+
290
+ Lighting and post tuning happen there, not inside asset building. Do not compensate for a weak asset with lighting.
291
+ - Faces turned away from the key go near-black: add a shadowless low fill light from the mirrored side and re-check the median.
292
+ - Depth of field is relative to the focus distance, weak, toggleable, and keeps gameplay objects out of the blur.
293
+ - Once the user starts asking for "a bit less of X", build a live tweak panel generated from the shader uniforms.
294
+
295
+ ## 8. Phase 7 — Deliver
296
+
297
+ - `docs/art/kit.md` — every asset: status, how to regenerate it, remaining gaps.
298
+ - `docs/art/layout/README.md` — how to author a new map or level in the layout format and build it.
299
+ - `docs/art/scene-final.md` — concept vs golden scene sheet and blend, signature-trait checklist, remaining discrepancies and why, performance (draw calls, instance counts, frame time on `concept_view`).
300
+ - One commit per finished asset family and per scene iteration (or a `kit.md` record each, per the Git rules above).
301
+
302
+ ## 9. Constraints
303
+
304
+ - No units, mechs, characters or vehicles.
305
+ - Everything reproducible from data and scripts; no manual-only steps.
306
+ - Performance: instancing for scatter and repeated tiles, shared materials, LOD or impostors for dense forests if needed. Report frame time. Profile by switching features off one at a time (draw calls are a poor proxy); never time while another render or agent uses the GPU. Never auto-decimate to a triangle cap: use a failing budget check.
307
+ - The runtime scene is interactive by default (zoom/orbit work at once); the report gives the run command and controls. Animate at runtime, freeze time in captures.
308
+ - Do not distort the camera, the grid or object scales to win a pixel match. Grid layouts must stay on a regular grid.
309
+ - Never claim a match without a render you looked at.
310
+ - Never report a change as done before the defect pass (5.4) has run on it.
311
+
312
+ ## 10. Engine notes
313
+
314
+ **Godot 4**: MultiMeshInstance3D for grass/scatter/forests; a heightmap ArrayMesh built from the layout for free-form terrain (or the terrain plugin the project already uses); GLB import with materials replaced by presets; if the concept has a miniature look, tilt-shift via CameraAttributesPractical DOF (near/far blur around the board centre) or a screen-space shader blurring by vertical distance from a focus band; StandardMaterial3D with transparency + refraction or a custom shader for water; `--headless` does not render.
315
+
316
+ **Three.js**: InstancedMesh for scatter; PlaneGeometry displaced from a heightmap for free-form terrain; GLTFLoader; MeshPhysicalMaterial (transmission, roughness, ior) for water; miniature tilt-shift as a custom ShaderPass (vertical gradient blur) or BokehPass; capture via Playwright headed with `preserveDrawingBuffer: true`.
317
+
318
+ ## 11. Templates
319
+
320
+ Invoke by path from the project root (requires Pillow and numpy). `compare.py` and the capture harness come from `art-direction-pass` when it is installed.
321
+
322
+ - `scripts/grid_overlay.py CONCEPT --grid hex|square --orient pointy|flat --cols N --rows M --corners "x,y x,y x,y x,y" [--cell-m METRES] -o overlay.png` — projects a grid through the four corner pixels (TL TR BR BL of the grid's bounding box as it appears). Labels are axial `q,r` (hex) or `col,row` (square); with `--cell-m` a square grid becomes a measurement grid whose labels are the metre coordinates of each cell's centre. Corners that are repeated, collinear or out of order are rejected. The board is a plane: raised tiles look shifted.
323
+ - `scripts/crop.py SHEET boxes.json -o docs/art/reference/kit/` — `boxes.json` is `{"tile_grass": [x0, y0, x1, y1], ...}` in sheet pixels; names must be plain file names, and all boxes are checked before anything is written.
324
+ - `scripts/blend.py CONCEPT RENDER -o out.png [--alpha 0.5]` — overlays the render (resized to the concept) for camera and layout alignment.
325
+
326
+ Tests of the tools themselves: `python3 -B -m unittest discover -s .claude/skills/concept-scene-builder/scripts` (skipped without Pillow and numpy).