Skip to content

armgit / viz3d

Public Imported from GitHub
0

An AI agent skill that turns any subject into a 3D film or app

Add the /viz3d command, harnesses and contributor rules

Nguyen Xuan An6fe760bec0d7
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..a8af3ba
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,62 @@
+# Agent guide for this repository
+
+This repository is the viz3d skill: a plugin that turns a subject into a 3D app or film. These rules are for a
+coding agent that changes the repository. To use the skill, not to change it, read
+`plugins/visualize-in-3d/skills/visualize-in-3d/SKILL.md` instead. People read [CONTRIBUTING.md](CONTRIBUTING.md).
+It has the same rules with more reasons.
+
+## Before you edit
+
+1. Read `plugins/visualize-in-3d/skills/visualize-in-3d/SKILL.md` and only the reference files that your change
+ touches. Do not load every file in `references/`.
+2. Run `git status`. Do not change or revert files that you did not touch.
+3. Find where the thing lives:
+
+| Change | Files |
+|---|---|
+| A look | `references/looks.md` (new section before `## Choosing`, one row in `## Choosing`), `README.md`, `SKILL.md` description |
+| A mode | `references/<mode>.md`, shape table in `SKILL.md`, mode table in `skills/viz3d/SKILL.md`, `README.md`, both files in `harness/` |
+| A fault | the fault list in `references/self-review.md` or in the mode reference |
+| An example | `examples/<topic>.md`, in the shape of `examples/airport-ramp.md` |
+| A script | `scripts/`, and the reference that tells the agent when to run it |
+| A harness | `harness/<agent>/`, plus the install and command tables in `README.md` |
+
+## Hard rules
+
+- `skills/visualize-in-3d/SKILL.md` has a maximum of 100 lines. Its frontmatter has only `name`, `description` and
+ `license`. Move detail into a reference file.
+- `skills/viz3d/SKILL.md` keeps `disable-model-invocation: true`, so the command runs only when a person types it.
+ `skills/viz3d/agents/openai.yaml` keeps `allow_implicit_invocation: false` for the same reason.
+- A mode word must match in all four places: `skills/viz3d/SKILL.md`, `harness/gemini/viz3d.toml`,
+ `harness/opencode/viz3d.md` and the `README.md` mode table.
+- No private data: no personal names, home folders, drive letters, internal tool names, API keys or tokens. Use
+ `{{WORK_DIR}}` and `{{SKILL_DIR}}` with forward slashes.
+- Assets and sounds need a reusable licence (CC0, CC BY) with the source named. Sound effects are real or made and
+ mixed in layers.
+- Scripts never read the wall clock or unseeded randomness. A frame depends only on its time.
+- Do not add a dependency to a script without a reason in the pull request. The scripts run on Node 20 and ffmpeg.
+- Prose follows plain technical English: short sentences, active voice, no em dashes, no semicolons in prose, no
+ sales words.
+
+## Check before you finish
+
+Run these from the repository root and fix every failure:
+
+```bash
+claude plugin validate .
+claude plugin validate plugins/visualize-in-3d
+for f in plugins/visualize-in-3d/skills/visualize-in-3d/scripts/*.js plugins/visualize-in-3d/skills/visualize-in-3d/scripts/*.mjs; do node --check "$f"; done
+bash -n plugins/visualize-in-3d/skills/visualize-in-3d/scripts/contact-sheet.sh
+wc -l plugins/visualize-in-3d/skills/*/SKILL.md
+git diff | grep -niE "C:\\\\|/Users/|/home/|api[_-]?key|token" || echo "scrub clean"
+```
+
+If `claude` is not installed, say so in your report and still run the other checks.
+
+## Finish
+
+- Raise `version` in `plugins/visualize-in-3d/.claude-plugin/plugin.json`: patch for a fix or a fault, minor for a
+ look, mode, script or harness.
+- Keep one topic in each commit. In the report, list the changed files and the checks with their result. Say what
+ you could not check.
+- Do not push, publish or open a pull request unless the person asked for it.
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..43c994c
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1 @@
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..07e2c61
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,114 @@
+# Contributing to viz3d
+
+Thanks for helping. This guide is for people. If you work through a coding agent, point it at
+[AGENTS.md](AGENTS.md). That file has the same rules in the order an agent needs them.
+
+## What helps most
+
+- **A fault you saw.** Maybe a film had a hidden hit, or a caption went by too fast. Open an issue with the prompt you used, the agent and model, and one frame that shows the fault. We add it
+ to a fault list in `references/self-review.md` or `references/action.md`, so every later run checks for it.
+- **A new look.** You need a style that the five looks do not cover. Add a section to `references/looks.md` (see
+ below).
+- **An example topic.** You built a place or a system that went well. Add it to `examples/` as a topic file.
+- **A harness adapter.** Your agent needs its own command file to run `/viz3d`.
+- **Fixes to the scripts** in `scripts/`.
+
+For a large change, such as a new mode or a new script, open an issue first. That way we can agree on the shape
+before you spend time on it.
+
+## Layout
+
+```text
+.claude-plugin/marketplace.json marketplace entry for Claude Code
+plugins/visualize-in-3d/
+ .claude-plugin/plugin.json plugin name and version
+ skills/visualize-in-3d/ the skill
+ SKILL.md entrypoint, read first by every agent
+ references/ one file per mode or topic, read on demand
+ examples/ topic files for real places and systems
+ scripts/ recording, checks and the mock feed
+ agents/openai.yaml Codex display name and invocation policy
+ skills/viz3d/ the /viz3d command
+harness/gemini/viz3d.toml /viz3d for Gemini CLI
+harness/opencode/viz3d.md /viz3d for OpenCode
+```
+
+## How to add things
+
+### A look
+
+1. Add a `## <Look name>` section to `references/looks.md`, before `## Choosing`.
+2. Describe the look in the same order as the other sections: palette, light, materials, camera, effects, and what
+ breaks it.
+3. Add one row for the look under `## Choosing`.
+4. Add the look name to the list of looks in `README.md` and in the `description` of `SKILL.md`.
+
+### A mode
+
+1. Add `references/<mode>.md` with the steps for the mode and its own fault list.
+2. Add one row to the shape table in `SKILL.md` and a mode word to the table in `skills/viz3d/SKILL.md`.
+3. Update the mode list in `README.md` and in `harness/gemini/viz3d.toml` and `harness/opencode/viz3d.md`.
+
+### An example topic
+
+Copy the shape of `examples/airport-ramp.md`: the real parts and their sizes, what moves, the beats, the look and
+the camera. Use made-up company and people names. Cite the sources for real sizes and procedures.
+
+### A fault
+
+Add one line to the matching list in `references/self-review.md` (generic faults) or in the mode's reference. Write
+what the fault looks like in a frame and how to measure it, not only its name.
+
+## Rules for every change
+
+- **`SKILL.md` stays under 100 lines.** Move detail into a reference file and link to it.
+- **Frontmatter of `skills/visualize-in-3d/SKILL.md`** has only `name`, `description` and `license`. Other keys
+ make the upload to claude.ai fail. The `viz3d` command can also use `argument-hint` and
+ `disable-model-invocation`.
+- **No private details.** No user names, home folders, drive letters, company names or internal tools. Write paths
+ as `{{WORK_DIR}}` and `{{SKILL_DIR}}`, with forward slashes.
+- **Assets and sounds** must have a licence that lets anyone reuse them, such as CC0 or CC BY. Name the source and
+ the licence. Sound effects are real recordings or sounds you made and mixed in layers, not one beep per hit.
+- **Write plainly.** Use short sentences, active voice and one name for one thing. Do not use em dashes or sales
+ words.
+- **Every frame is a function of time.** Scripts and briefs never read the wall clock or `Math.random` without a
+ seed.
+
+## Check your change
+
+Run these from the repository root before you open a pull request:
+
+```bash
+claude plugin validate .
+```
+
+```bash
+claude plugin validate plugins/visualize-in-3d
+```
+
+```bash
+for f in plugins/visualize-in-3d/skills/visualize-in-3d/scripts/*.js plugins/visualize-in-3d/skills/visualize-in-3d/scripts/*.mjs; do node --check "$f"; done
+```
+
+```bash
+bash -n plugins/visualize-in-3d/skills/visualize-in-3d/scripts/contact-sheet.sh
+```
+
+```bash
+wc -l plugins/visualize-in-3d/skills/*/SKILL.md
+```
+
+If you changed what the agent does, run the skill once on a small subject. Attach a contact sheet or a short clip
+to the pull request.
+
+## Versions
+
+Raise `version` in `plugins/visualize-in-3d/.claude-plugin/plugin.json` in the same pull request:
+
+- patch (0.3.0 to 0.3.1) for a fix or a new fault,
+- minor (0.3.0 to 0.4.0) for a new look, mode, script or harness.
+
+## Pull requests
+
+Keep one topic in each pull request. Say what changed, why, and how you checked it. By contributing, you agree
+that your work is released under the MIT licence of this repository.
diff --git a/harness/gemini/viz3d.toml b/harness/gemini/viz3d.toml
new file mode 100644
index 0000000..623d97a
--- /dev/null
+++ b/harness/gemini/viz3d.toml
@@ -0,0 +1,8 @@
+description = "Turn a place, system, object or event into a 3D world with the visualize-in-3d skill"
+prompt = """
+Activate the visualize-in-3d skill and follow it from the start for this request:
+
+{{args}}
+
+If the first word is a mode, use that shape and drop the word from the subject. The modes are app (live app with a dashboard and a short film), lesson (lesson app), prototype (quick prototype from primitives), embed (live embed on real data), film or doc (documentary film), action (action short). Otherwise pick the shape from the subject with the skill's table. If the request is empty, ask what the user wants people to see.
+"""
diff --git a/harness/opencode/viz3d.md b/harness/opencode/viz3d.md
new file mode 100644
index 0000000..1d3f76f
--- /dev/null
+++ b/harness/opencode/viz3d.md
@@ -0,0 +1,9 @@
+---
+description: Turn a place, system, object or event into a 3D world with the visualize-in-3d skill
+---
+
+Load the visualize-in-3d skill and follow it from the start for this request:
+
+$ARGUMENTS
+
+If the first word is a mode, use that shape and drop the word from the subject. The modes are app (live app with a dashboard and a short film), lesson (lesson app), prototype (quick prototype from primitives), embed (live embed on real data), film or doc (documentary film), action (action short). Otherwise pick the shape from the subject with the skill's table. If the request is empty, ask what the user wants people to see.
diff --git a/plugins/visualize-in-3d/skills/visualize-in-3d/agents/openai.yaml b/plugins/visualize-in-3d/skills/visualize-in-3d/agents/openai.yaml
new file mode 100644
index 0000000..78415f5
--- /dev/null
+++ b/plugins/visualize-in-3d/skills/visualize-in-3d/agents/openai.yaml
@@ -0,0 +1,4 @@
+interface:
+ display_name: "Visualize in 3D"
+ short_description: "Turn a subject into a 3D world: live app, film, lesson or action short"
+ default_prompt: "Use $visualize-in-3d to turn this into a 3D world: "
diff --git a/plugins/visualize-in-3d/skills/viz3d/SKILL.md b/plugins/visualize-in-3d/skills/viz3d/SKILL.md
new file mode 100644
index 0000000..ee748d9
--- /dev/null
+++ b/plugins/visualize-in-3d/skills/viz3d/SKILL.md
@@ -0,0 +1,31 @@
+---
+name: viz3d
+description: Start the visualize-in-3d skill from a command, with an optional mode first (app, lesson, prototype, embed, film, action) and then the subject, for example "/viz3d film the 1906 San Francisco earthquake".
+argument-hint: "[app|lesson|prototype|embed|film|action] <subject>"
+disable-model-invocation: true
+---
+
+# viz3d
+
+The user started viz3d with this request:
+
+$ARGUMENTS
+
+In tools that do not fill in the line above, the request is the rest of the user's message.
+
+1. Load the `visualize-in-3d` skill and follow it from the start. It is installed next to this one
+ (`../visualize-in-3d/SKILL.md`).
+2. If the first word of the request is a mode, use that shape and drop the word from the subject:
+
+ | Word | Shape |
+ |---|---|
+ | `app` | Live app with a dashboard and a short film |
+ | `lesson` | Lesson app that builds a real object step by step |
+ | `prototype` | Quick prototype from primitives, no Blender |
+ | `embed` | Live embed for an existing dashboard, on real data |
+ | `film` or `doc` | Documentary film |
+ | `action` | Action short |
+
+ Otherwise pick the shape from the subject with the skill's table.
+3. If the request names a look (toy, point cloud, terrain, documentary, pixel), use it. Otherwise the skill picks one.
+4. If the request is empty, ask one question: what do you want people to see?
diff --git a/plugins/visualize-in-3d/skills/viz3d/agents/openai.yaml b/plugins/visualize-in-3d/skills/viz3d/agents/openai.yaml
new file mode 100644
index 0000000..73dfbe3
--- /dev/null
+++ b/plugins/visualize-in-3d/skills/viz3d/agents/openai.yaml
@@ -0,0 +1,7 @@
+interface:
+ display_name: "viz3d"
+ short_description: "Start visualize-in-3d with a mode and a subject"
+ default_prompt: "Use $viz3d with: "
+
+policy:
+ allow_implicit_invocation: false