From fc167f32d9da928cad4c6ae555715dde7f24ed60 Mon Sep 17 00:00:00 2001 From: CRT Date: Fri, 28 Aug 2026 13:16:39 +0000 Subject: [PATCH] Install the vibe-model authoring skill and record the state of both kits in PROGRESS.md. --- .agents/skills/vibe-model/SKILL.md | 80 ++++++++ .agents/skills/vibe-model/agents/openai.yaml | 4 + PROGRESS.md | 202 +++++++++++++++++++ 3 files changed, 286 insertions(+) create mode 100644 .agents/skills/vibe-model/SKILL.md create mode 100644 .agents/skills/vibe-model/agents/openai.yaml create mode 100644 PROGRESS.md diff --git a/.agents/skills/vibe-model/SKILL.md b/.agents/skills/vibe-model/SKILL.md new file mode 100644 index 0000000..c9c5fec --- /dev/null +++ b/.agents/skills/vibe-model/SKILL.md @@ -0,0 +1,80 @@ +--- +name: vibe-model +description: Preview-first reconstruction of reference-driven hard-surface props, machinery, signage, modular architecture, and hero assemblies as direct Three.js source. Use when building, revising, visually matching, previewing, or preparing a procedural hard-surface model for a Vibe3D registry. Do not use for generic Three.js application code, bitmap editing, characters, organic assets, foliage, terrain, or particle effects. +--- + +# Vibe Model + +Build direct Three.js models with one short visual loop: + +```text +model source -> deterministic preview -> independent visual critique + ^ | + `----------- highest-impact fix -------' +``` + +Before authoring, read both references completely: + +- [fast-loop.md](references/fast-loop.md) for capture and critique; +- [modeling-rules.md](references/modeling-rules.md) for hard-surface geometry + rules that prevent generated-looking results and wasted iterations. + +## Author + +Work directly in the registry model source. In this repository the canonical +sources live at `assets/prototypes//model.ts` and are compiled into +the Sci-Fi Kit registry. In another registry, follow its configured source +directory. + +Export `createModel`. It may return a Three.js `Group` or a controller with a +stable `root`, optional `update`, semantic parts and actions, and idempotent +`dispose`. Keep preview-only scene setup in `createPreview` rather than inside +the installed model root. + +Use shared primitives and material sources when they preserve the intended +shape. Keep the model small enough to understand and change in one focused +edit. Preserve physical bevel widths, clearances, sockets, pivots, semantic +part anchors, and declared configuration behavior. + +## Preview + +Capture as soon as the primary silhouette and major secondary masses exist: + +```sh +bun run vibe:model preview \ + --module assets/prototypes//model.ts \ + --export createModel \ + --asset \ + --reference +``` + +The local compatibility command `bun run asset:forge preview` may be used +during migration. Prefer `vibe:model` in new documentation and automation. + +Keep the camera deterministic. Change yaw, pitch, width, height, or the preview +factory only when the reference requires it. + +## Critique + +Give a fresh critic only the brief, reference, and current beauty image. Ask +for a resemblance score, what reads correctly, and no more than three +prioritized fixes. + +Score silhouette and proportions first, then major masses and negative space, +distinctive landmarks, material/value/color read, and detail plausibility. +Apply the highest-impact correction and capture again. + +Stop at a score of 85 or higher, after two plateauing scores, or after ten +iterations. Treat a plateau as evidence to change the representation or obtain +better reference evidence. + +## Deliver + +Keep the accepted TypeScript source and final deterministic preview. Preserve +runtime anatomy and ownership contracts. Mark preview-only nodes with +`userData.excludeFromExport = true`. + +When a GLB is requested, export the accepted model through the shared portable +GLB path so procedural wear is baked into standard PBR data. Report the model +source, final preview, iteration count, accepted score, and unresolved visual +approximations. Do not commit generated previews or GLBs unless requested. diff --git a/.agents/skills/vibe-model/agents/openai.yaml b/.agents/skills/vibe-model/agents/openai.yaml new file mode 100644 index 0000000..e75cae1 --- /dev/null +++ b/.agents/skills/vibe-model/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Vibe Model" + short_description: "Build reference-matched Three.js props" + default_prompt: "Use $vibe-model to build a direct Three.js model from a reference and iterate deterministic previews until the result reads correctly." diff --git a/PROGRESS.md b/PROGRESS.md new file mode 100644 index 0000000..6bb5a1a --- /dev/null +++ b/PROGRESS.md @@ -0,0 +1,202 @@ +# Where this stands, and what it cost to learn + +Written so that a session picking this up cold does not repeat any of it. The +protocol lives in `REFERENCE.md`, the kit's public face in `README.md`. This is +the third thing: the state of the work, the loop that produces it, and the +mistakes that shaped both. + +## The two kits + +**`@medieval-kit`** is finished and published. 37 models, 30,390 triangles, 13 +material slots, MIT. On npm as `@medieval-kit/registry`, currently `0.1.2`. The +viewer is live at and rebuilds on every push. The +GitHub repository is private, which is deliberate, and which is why the npm +page's Repository and Issues links 404 until that changes. + +**`@contemporary-props`** is six models into a planned 119. Present-day objects, +no lowpoly budget, no historical constraint. 19 material slots. Nothing is +published and the version is `0.0.0`. + +The two share a repository and a demo app but nothing else. The geometry +vocabulary was forked rather than shared: `geometry.ts`, `occlusion.ts`, +`parts.ts` and `random.ts` carried over without a single edit, which is the +strongest evidence that the split between vocabulary and palette was drawn in +the right place. + +## The loop that makes a model + +The kit was built one model at a time, by hand, and the numbers say what that +cost: 37 models, but model files were touched 117 times. **Every model was +written about three times.** Almost every rewrite came from looking at a render +and seeing that the thing was wrong. + +That is the whole reason the loop looks like this rather than like "write it and +run the checks". + +### For a single model + + edit contemporary-props/models//model.ts + bun contemporary-props/check.ts # measures, and draws it + LOOK AT THE PNG + bun contemporary-props/check.ts --angles 6 + +`check.ts` deliberately does NOT rebuild the registry or install anything. The +kit-wide gate does both, and both write files the whole repository shares, so +several workers running it at once overwrite each other and every one of them +then verifies somebody else's code. That has already happened here once: a cart +was fixed, the reinstall was skipped, and the old geometry passed while the new +geometry was never looked at. + +### For the whole kit, once, in one place + + bun run registry:build + bunx vibe3d add @medieval-kit --overwrite # or @contemporary-props + bunx tsc --noEmit + bun run verify # ~1,000 checks + bun scripts/audit.ts # nothing floats, every config + bun run verify:glb + bun run check:docs + bunx vibe3d registry validate /dist/registry.json + +There are TWO model trees and this is the trap that catches everyone. +`/models/**` is what you edit. `src/models/**` is the installed copy +that `verify` and the viewer actually read. Skip the rebuild-and-reinstall and +you verify code you did not write. + +## The authoring protocol + +`bunx vibe-model` is installed at `.agents/skills/vibe-model`. Its loop is the +one to follow, and it is better than the one built here from scratch in three +specific ways that were only noticed by comparing them: + +- **The critic must not see the code.** Give a fresh critic the brief, the + reference and the render, nothing else. A critic told what the builder + intended tends to see the intention. +- **There must be a reference image.** Rendering our own output and looking at + it answers "is this broken". It cannot answer "is this right", because there + is nothing to be right about. +- **A score, at most three prioritised fixes, and a stop condition.** Accept at + 85. Stop after two plateauing scores or ten iterations. A plateau is evidence + that the representation or the reference has to change, not a reason to keep + grinding. + +Its own warning is worth repeating, because it is exactly the gap the local +checks fill: a resemblance score is blind to parts seated on the wrong plane, +geometry floating in front of a face, and coincident faces tearing. Ask for +modelling errors listed separately from resemblance gaps, each with a location. +`check.ts` and `scripts/audit.ts` exist to catch what the critic cannot see. + +`references/modeling-rules.md` carries 17 hard rules. The ones that cost real +time here: bevels budgeted by perceptual role, physical features sized in world +units, clearance calculated for every applied layer, and critic feedback treated +as evidence rather than as a number to optimise. + +### References + +`scripts/reference-shots.ts` generates one reference per model through the Codex +CLI's image tool. `references/` is gitignored: 37 images, tens of megabytes, +belonging to the studio and not to the registry consumers clone. The prompt asks +for the same shot every time, three-quarter view from slightly above, whole +object, plain dark ground, even light, because the images are measuring +instruments rather than art. A reference lit dramatically hides the silhouette +detail that is the entire point of having one. + +The script currently reads `MODEL_META` from `my-registry` and needs +generalising before it can serve `contemporary-props`, whose metadata lives in +`models//meta.json` sidecars instead. + +## Traps, each one paid for + +**Two trees.** Covered above. It is the single most common way to verify +nothing. + +**A part with `origin` has its geometry written RELATIVE to that point.** The +anchor supplies the rest. Writing the offset into the geometry as well applies +it twice. This put a handcart's wheels 304 mm in the air and every check passed, +because the cart was still resting on its shaft tips and the support check asks +about connectivity, not about whether a wheel is doing anything. + +**Moving a piece out and then rotating is not the same as rotating and then +moving.** `rotateZ(a)` sends local +X to `(cos a, sin a)` and local +Y to +`(-sin a, cos a)`. Getting it backwards built a cart wheel from twelve stubby +blocks sticking 89 mm past their own felloe, straight through the iron tyre. + +**Measure by slicing triangles, not by sampling vertices.** A tapered box has +corners only at its ends, so vertex sampling reported 0.0 mm for a 17 mm +shoulder. This produced confident wrong numbers three separate times in one +session. + +**Use `object.isMesh`, never `instanceof Mesh`.** Two copies of three can be +loaded at once, and across copies `instanceof` matches nothing. The failure is +silent and total: the traversal samples no geometry, finds no components, and +reports every model clean. It did exactly that against another repository, and +the only reason it was caught was a `components: 0` line in a debug print. + +**A check that passes by not running is worse than no check.** The docs check +once looked up the word before "slots", matched the ordinary phrase "material +slots" several paragraphs earlier, found that "material" is not a number, and +quietly checked nothing at all. + +**Generated is not the same as correct.** The model table is generated so it +cannot go stale, says so in its own prose, and was wrong for months: it decided +"animated" from the viewer's hand-registered button rather than from the model, +so six of the eleven models that carry actions were published as static. The +obvious replacement was worse. `update` is wrapped for every model whether or +not it does anything, so switching to it marked all thirty-seven animated. + +**Judge on a turntable, never on one three-quarter view.** The fence only looks +thin edge on. An oak was judged on a single angle for four rounds. + +**Mutation-test after committing, not before.** Reverting a file to test a check +destroyed an uncommitted fix. + +**A camera fitted to a bounding box is fitted to air.** Fitting the eight +corners of the box, then aiming at the centre of the bounding sphere, spent most +of the whole-kit picture on empty ground. Fitting sampled geometry and aiming at +the centre of the PROJECTION took the frame from 7.4% full to 23.6%. + +**Include the contact shadow in the camera fit.** It is drawn from geometry +flattened onto the floor, which projects somewhere else entirely, and fourteen +of thirty-seven models had a shadow running off the edge of its own cell. + +**Shadow strength has to be per pixel.** Per triangle looks fine on a wall and +tears a fan apart, because neighbouring triangles in a base cap have different +centre heights. The first attempt at a falloff produced a black starburst around +a vase's foot, which was worse than the bar it replaced. + +## Identity, and why it matters here + +Everything public is `CRTkafa`. Commits use the noreply address; the global git +config on this machine points at a different identity, so per-repository config +is not optional. + +**Commit messages are one sentence.** A long narrative message once carried the +owner's real name into a pushed commit. Scan every message for names before +pushing. + +npm stamps the publishing account's email into the public packument per version, +and nothing in `package.json` suppresses it. Later account changes do not rewrite +it. Verify the account's email before `npm login`, not after. + +Force-pushing does not remove a commit from a public repository. The orphan +stays reachable by its SHA. Only making the repository private, deleting it, or +asking GitHub Support to purge actually closes it. + +## Open + +- **`contemporary-props`**: 6 of 119 modelled. The catalogue, the build order, + the cuts and the slot argument are in `contemporary-props/CATALOGUE.md`. + `pepper-mill` reads as a wooden bottle and needs rewriting. `coffee-mug`'s + handle is a flat strap whose wide face turns toward the camera; the section + wants to be squarer and deeper in the plane of the loop. +- **The pipeline** needs rebuilding onto the vibe-model protocol: references, + a blind critic, a score, three fixes, a stop condition, and a revise stage. + There is currently no revise stage at all, so a critic's findings go nowhere. +- **A medieval pass** with that pipeline, before anything else is added to it. +- **vibe3d PR**: a branch adding `@medieval-kit` to the init template is pushed + to `CRTkafa/vibe3d` and unopened. A second contribution, the floating check, + is not ready: it ran on 174 of their models unmodified but flagged 28, and the + small-piece flags are artifacts of deriving voxel size from the longest axis. +- **`reflexive_keygen`**: the branch and tag were rewritten to the noreply + identity, but the orphaned commit is still publicly readable. Making the + repository private closes it.