An agent skill for creating detailed, interactive isometric illustrations of real-world machines and complex systems. Generates polished SVGs with optional WebGL shaders and 3D effects.
Publish to anatomy-community, light page first
R.20b43ec90e3a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex aeaad41..a420885 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,7 +6,7 @@ All notable changes to Anatomy are recorded here. The format follows [Keep a Cha### Added-- `scripts/publish.mjs` and `references/publish.md`: share a finished framework-free figure in the community gallery, `wheresryan22/anatomy-figures`. The script copies the figure, points its kit imports at the gallery's `.skill/` link, records the kit fingerprint (`scripts/fingerprint.mjs`) so the gallery can rebuild it with the same kit version, rebuilds the pages and takes the poster. It never pushes.+- `scripts/publish.mjs` and `references/publish.md`: share a finished framework-free figure in the community gallery, `wheresryan22/anatomy-community`. The script copies the figure, points its kit imports at the gallery's `.skill/` link, records the kit fingerprint (`scripts/fingerprint.mjs`) so the gallery can rebuild it with the same kit version, rebuilds the pages and takes the poster. It never pushes.- OpenCode and Codex support, alongside Claude Code. `SKILL.md` exposes `/anatomy` to OpenCode through `metadata`, `agents/openai.yaml` gives Codex its display name, and the README, CONTRIBUTING and the bug report form cover all three agents.- `examples/arcade-cabinet/`, an upright arcade cabinet with its side panel off. A quarter rolls down the coin chute past the coin-switch wire into the cash box, the switch's pulse runs along its cable to the board, and the CRT warms up, self-tests and runs an attract mode drawn in the plane of the tilted monitor; the stick closes a microswitch under the panel. It draws in the light and dark themes and passes `--audit`.- `examples/spot-plate/`, a second React figure from the same site as `test-rig`: six pairs of glass drops that run together into one piece of glass as a fan of feeler blades sets `merge`. It draws in the light and dark themes.diff --git a/README.md b/README.mdindex 065b584..c8993ca 100644--- a/README.md+++ b/README.md@@ -303,7 +303,7 @@ anatomy/## Share a figure-Made something good? Ask your agent to publish it to the community gallery, [anatomy-figures](https://github.com/wheresryan22/anatomy-figures), or run `scripts/publish.mjs` yourself. It prepares the figure in your clone of the gallery and prints the commands to open a pull request; it never pushes for you. The gallery's own [CONTRIBUTING.md](https://github.com/wheresryan22/anatomy-figures/blob/main/CONTRIBUTING.md) has the steps.+Made something good? Ask your agent to publish it to the community gallery, [anatomy-community](https://github.com/wheresryan22/anatomy-community), or run `scripts/publish.mjs` yourself. It prepares the figure in your clone of the gallery and prints the commands to open a pull request; it never pushes for you. The gallery's own [CONTRIBUTING.md](https://github.com/wheresryan22/anatomy-community/blob/main/CONTRIBUTING.md) has the steps.## Contributingdiff --git a/references/publish.md b/references/publish.mdindex fca9ce6..634ee99 100644--- a/references/publish.md+++ b/references/publish.md@@ -1,6 +1,6 @@# Publishing a figure to the community gallery-The community gallery is the repository `wheresryan22/anatomy-figures`. People share framework-free figures there: a build script that writes standalone pages next to itself, as the skill's examples do. React and Next.js figures can't be published yet.+The community gallery is the repository `wheresryan22/anatomy-community`. People share plain HTML figures there: a build script that writes standalone pages next to itself, as the skill's examples do. React and Next.js figures can't be submitted. The gallery shows every figure in the light theme, so a published figure needs its light page (`build.mjs --light`); a dark page is optional.Publish only when the user asks to share or publish a figure. Never push, fork or open a pull request yourself: prepare everything locally, show it, and give the user the commands to run.@@ -13,7 +13,7 @@ Publish only when the user asks to share or publish a figure. Never push, fork o- the license: MIT (the default) or CC-BY-4.0;- confirmation that it is their own work and they are happy to share it.The prompt is the request that made the figure; reuse it, trimmed to 600 characters.-3. **Get a local clone of the gallery.** If the user has none, give them the commands to fork and clone it (`gh repo fork wheresryan22/anatomy-figures --clone`), and wait.+3. **Get a local clone of the gallery.** If the user has none, give them the commands to fork and clone it (`gh repo fork wheresryan22/anatomy-community --clone`), and wait.4. **Publish into the clone:**```shnode <skill>/scripts/publish.mjs <figure folder> --into <clone> --id <kebab-id> \diff --git a/scripts/publish.mjs b/scripts/publish.mjsindex b4cee9b..d91aed4 100644--- a/scripts/publish.mjs+++ b/scripts/publish.mjs@@ -18,7 +18,7 @@ function usage(message) {if (message) console.error(`publish: ${message}\n`);console.log(`Copy a figure into a local clone of the community gallery, ready for a pull request.- node scripts/publish.mjs <figure folder> --into <anatomy-figures clone> --id <kebab-id> --title "..." --prompt "..." --author <github user>+ node scripts/publish.mjs <figure folder> --into <anatomy-community clone> --id <kebab-id> --title "..." --prompt "..." --author <github user>[--agent "Claude Code"|OpenCode|Codex|Other] [--model "..."] [--license MIT|CC-BY-4.0] [--tags a,b][--build build.mjs] [--pages dark.html,light.html] [--kind "SVG + WebGL"] [--audit] [--no-poster] [--force]@@ -112,7 +112,7 @@ export function publish(options) {const source = resolve(options.source);const repo = resolve(options.into);if (!existsSync(join(source, options.build))) throw new Error(`no ${options.build} in ${source}`);- if (!existsSync(join(repo, "figures")) || !existsSync(join(repo, "scripts", "validate.mjs"))) throw new Error(`${repo} doesn't look like a clone of anatomy-figures (no figures/ or scripts/validate.mjs)`);+ if (!existsSync(join(repo, "figures")) || !existsSync(join(repo, "scripts", "validate.mjs"))) throw new Error(`${repo} doesn't look like a clone of anatomy-community (no figures/ or scripts/validate.mjs)`);if (inside(SKILL, source) && !inside(join(SKILL, "examples"), source)) throw new Error("the figure folder is inside the skill itself; publish the folder where the figure was built");const dest = join(repo, "figures", options.id);if (existsSync(dest)) {@@ -125,6 +125,10 @@ export function publish(options) {const skipped = all.filter((file) => !files.includes(file));const pages = detectPages(source, files, options.pages);for (const page of Object.values(pages)) if (page && !files.includes(page)) throw new Error(`page ${page} not found in ${source}; build the figure first`);+ const themeOf = (page) => (readFileSync(join(source, page), "utf8").match(/<body[^>]*\bdata-theme="(light|dark)"/) ?? [])[1] ?? "dark";+ if (pages.dark && !pages.light && themeOf(pages.dark) === "light") [pages.light, pages.dark] = [pages.dark, undefined];+ if (!pages.light) throw new Error("the gallery shows figures in the light theme: build the light page too (node build.mjs --light), then publish again");+ for (const [key, page] of Object.entries(pages)) if (page && themeOf(page) !== key) throw new Error(`${page} is a ${themeOf(page)} page, not ${key}; pass --pages dark.html,light.html in that order`);const skillLink = join(repo, ".skill");const kit = fingerprintOfSkill(SKILL);@@ -153,9 +157,8 @@ export function publish(options) {throw new Error(`${repo}/.skill (${where}) is a different kit version than this skill; remove it and run again`);}- const build = [[`src/${options.build}`]];- if (pages.light) build.push([`src/${options.build}`, "--light"]);- if (!pages.dark) build.shift();+ const build = [[`src/${options.build}`, "--light"]];+ if (pages.dark) build.push([`src/${options.build}`]);for (const command of build) run(command, dest);const pageText = Object.values(pages).filter(Boolean).map((page) => readFileSync(join(dest, "src", page), "utf8")).join("\n");@@ -178,7 +181,7 @@ export function publish(options) {writeFileSync(join(dest, "figure.json"), JSON.stringify(figure, null, 2) + "\n");if (!options.noPoster) {- const page = join(dest, "src", pages.light ?? pages.dark);+ const page = join(dest, "src", pages.light);run([join(SKILL, "scripts", "capture.mjs"), page, "--width", "1200", "--out", join(dest, "poster.png")], dest);const size = statSync(join(dest, "poster.png")).size;if (size > 600 << 10) throw new Error(`poster.png is ${(size / 1024).toFixed(0)} KB, over 600 KB; retake it smaller with scripts/capture.mjs --width 900`);@@ -195,7 +198,7 @@ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.urif (skipped.length) console.log(` left out (not a source type): ${skipped.join(", ")}`);console.log(` .skill link: ${linked}`);console.log(`\nCheck it:\n cd ${repo}\n node scripts/validate.mjs figures/${figure.id}`);- console.log(`\nWhen you are happy with it, from your fork of anatomy-figures:\n git switch -c figure/${figure.id}\n git add figures/${figure.id}\n git commit -m "Add ${figure.title.replace(/"/g, "'")}"\n git push -u origin figure/${figure.id}\n gh pr create --repo wheresryan22/anatomy-figures --fill`);+ console.log(`\nWhen you are happy with it, from your fork of anatomy-community:\n git switch -c figure/${figure.id}\n git add figures/${figure.id}\n git commit -m "Add ${figure.title.replace(/"/g, "'")}"\n git push -u origin figure/${figure.id}\n gh pr create --repo wheresryan22/anatomy-community --fill`);} catch (error) {console.error(`publish: ${error.message}`);process.exit(1);diff --git a/scripts/publish.test.mjs b/scripts/publish.test.mjsindex ea628e7..f0ce7d9 100644--- a/scripts/publish.test.mjs+++ b/scripts/publish.test.mjs@@ -41,7 +41,7 @@ test("publishing an example rebuilds it byte for byte in the gallery", () => {const { dest, figure } = publish({ source: join(SKILL, "examples", "dial-indicator"), into: repo, id: "dial-indicator", title: "Dial indicator", prompt: "/anatomy a dial indicator", author: "octo-cat", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], noPoster: true, date: "2026-10-12" });assert.equal(figure.kind, "SVG");assert.equal(figure.skill.kit, fingerprintOfSkill(SKILL));- assert.deepEqual(figure.build, [["src/build.mjs"], ["src/build.mjs", "--light"]]);+ assert.deepEqual(figure.build, [["src/build.mjs", "--light"], ["src/build.mjs"]]);assert.deepEqual(figure.pages, { dark: "src/dial-indicator.html", light: "src/dial-indicator-light.html" });for (const page of ["dial-indicator.html", "dial-indicator-light.html"]) assert.ok(readFileSync(join(dest, "src", page)).equals(readFileSync(join(SKILL, "examples", "dial-indicator", page))), page);assert.ok(existsSync(join(repo, ".skill", "kit", "iso-kit.mjs")));@@ -54,7 +54,7 @@ test("publishing an example rebuilds it byte for byte in the gallery", () => {test("publishing refuses a folder that is not a gallery clone", () => {const empty = mkdtempSync(join(tmpdir(), "not-gallery-"));try {- assert.throws(() => publish({ source: join(SKILL, "examples", "dial-indicator"), into: empty, id: "x", title: "x", prompt: "x", author: "x", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], noPoster: true }), /doesn't look like a clone of anatomy-figures/);+ assert.throws(() => publish({ source: join(SKILL, "examples", "dial-indicator"), into: empty, id: "x", title: "x", prompt: "x", author: "x", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], noPoster: true }), /doesn't look like a clone of anatomy-community/);} finally {rmSync(empty, { recursive: true, force: true });}