An AI agent skill that turns any subject into a 3D film or app
Add a ground-share script for the prototype gate, say which tool budget wins and how to frame the side-by-side camera; release 0.9.1
Nguyen Xuan Anaffee1f8e3a7
diff --git a/plugins/visualize-in-3d/.claude-plugin/plugin.json b/plugins/visualize-in-3d/.claude-plugin/plugin.jsonindex 1bea809..905af76 100644--- a/plugins/visualize-in-3d/.claude-plugin/plugin.json+++ b/plugins/visualize-in-3d/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "visualize-in-3d",- "version": "0.9.0",+ "version": "0.9.1","description": "Visualize anything in 3D: places, systems, objects, products, creatures, stories and events, as a documentary or action film, a showcase, a live three.js app with a dashboard, a lesson, an illustrated cutaway book or a playable game, in twelve looks across four families, built from real layouts and models made from real references.","author": {"name": "CodePawl",diff --git a/plugins/visualize-in-3d/skills/visualize-in-3d/references/live-embed.md b/plugins/visualize-in-3d/skills/visualize-in-3d/references/live-embed.mdindex bb0e9ba..87d4018 100644--- a/plugins/visualize-in-3d/skills/visualize-in-3d/references/live-embed.md+++ b/plugins/visualize-in-3d/skills/visualize-in-3d/references/live-embed.md@@ -36,13 +36,14 @@ Skip Pass 1 and do not ask about Blender. Build everything in one pass in `{{WORocclusion on, with dark contact under every object; no single-colour ground area over a quarter of the frame;the surroundings dressed to the card's density; every palette colour from the card; every model the right realkind; the side-by-side shows no gap in camera, palette, light or density. Fix and re-shoot until all pass.- Measure the ground rule on the screenshot: quantise colours and report the largest bucket's share of the frame.+ Measure the ground rule with `uv run --no-project --with pillow python {{SKILL_DIR}}/scripts/ground-share.py+ <screenshot>`; it prints PASS or FAIL and the share of the largest flat colour.7. **Done when** the gates pass, the overview, a clicked unit with its card and each stage preset look right in screenshots, it runsat 60 fps, the page logs no errors, and `npm run build` gives a static folder that opens from any web server.From `self-review.md` run "Each round" and the generic faults that apply to a still view; the film checks applyonly when the user asked for a film.-Budget about 60 tool calls. Report the URL to run it, the screenshots, and what a full build adds (Blender models,+Budget about 60 tool calls, unless the user or a brief sets another budget. Report the URL to run it, the screenshots, and what a full build adds (Blender models,film, more sites).## Live embeddiff --git a/plugins/visualize-in-3d/skills/visualize-in-3d/references/style-reference.md b/plugins/visualize-in-3d/skills/visualize-in-3d/references/style-reference.mdindex 240eb77..bcb7861 100644--- a/plugins/visualize-in-3d/skills/visualize-in-3d/references/style-reference.md+++ b/plugins/visualize-in-3d/skills/visualize-in-3d/references/style-reference.md@@ -47,7 +47,8 @@ shapes (`asset-sources.md`) instead of reshaping primitives toward them.## Compare each round-Each self-review round renders the build from the reference's camera at the same size and puts the two side by+Each self-review round renders the build from the reference's camera (its angle and field of view, at a distance+where the subject fills the same share of the frame) at the same size and puts the two side byside in one image. Write the three biggest gaps, each tied to a card line ("ground is one flat colour, card saysgrass with flowers and stones"), fix them, and render again. A round passes when no gap is about the card's camera,palette, light or density. Show the user the side-by-side, not the render alone.diff --git a/plugins/visualize-in-3d/skills/visualize-in-3d/scripts/ground-share.py b/plugins/visualize-in-3d/skills/visualize-in-3d/scripts/ground-share.pynew file mode 100644index 0000000..0565176--- /dev/null+++ b/plugins/visualize-in-3d/skills/visualize-in-3d/scripts/ground-share.py@@ -0,0 +1,44 @@+"""Report how much of a screenshot one flat colour covers.++Usage: uv run --no-project --with pillow python ground-share.py <image> [--levels 24]++Each RGB channel is cut into `levels` steps, so near-identical colours fall in one bucket.+The script prints the largest bucket's share of the frame and its colour. The prototype+quality gate in references/live-embed.md fails when that share is over 0.25.+"""++import argparse+import sys+from collections import Counter++from PIL import Image+++def largest_bucket_share(image_path, levels):+ image = Image.open(image_path).convert("RGB")+ image.thumbnail((640, 640))+ step = 256 // levels+ raw_bytes = image.tobytes()+ pixel_count = len(raw_bytes) // 3+ buckets = Counter(+ (raw_bytes[index] // step, raw_bytes[index + 1] // step, raw_bytes[index + 2] // step)+ for index in range(0, len(raw_bytes), 3)+ )+ bucket, count = buckets.most_common(1)[0]+ centre = tuple(channel * step + step // 2 for channel in bucket)+ return count / pixel_count, centre+++def main():+ sys.stdout.reconfigure(encoding="utf-8", errors="replace")+ parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])+ parser.add_argument("image")+ parser.add_argument("--levels", type=int, default=24)+ arguments = parser.parse_args()+ share, colour = largest_bucket_share(arguments.image, arguments.levels)+ verdict = "FAIL" if share > 0.25 else "PASS"+ print(f"{verdict} largest flat colour covers {share:.3f} of the frame, near #{colour[0]:02x}{colour[1]:02x}{colour[2]:02x}")+++if __name__ == "__main__":+ main()