The Problem
Technical documents often need a visual aid that literally builds the concept. Explaining a complex mechanism with a static diagram can leave gaps; an interactive, isometric figure that shows parts moving, shading changing, and numbers updating in real time removes those gaps. The pain point is that such figures are hard to create quickly, require multiple tools, and are difficult to embed in AI‑driven documentation.
What This Does
anatomy-skill supplies a reusable, dependency‑free kit that turns a small set of geometry and rig data into a polished SVG, an optional WebGL‑shaded canvas, and an interactive React UI.
- Geometry & Rig –
examples/spot-plate/geometry.ts,rig.ts,pose.tsdescribe the parts and their joints. - Rendering –
kit/iso-kit.mjsdrives the rendering pipeline, importingkit/gl.mjsfor WebGL andkit/canvas-painter.mjsfor 2‑D canvas. - React UI –
kit/react/live.tsxhosts the live preview, wiringdraw.tsxto the canvas and exposing controls. - Skill integration –
agents/openai.yamldeclares the/anatomycommand that Claude or Codex can invoke, which in turn calls the kit code.
The output is an SVG paired with a small JS bundle that animates under mouse or keyboard. The examples (e.g., examples/raptor-engine/*) demonstrate the full flow from source files to a clickable card.
How It Is Wired
Entry Point – agents/openai.yaml defines the skill entry. When a user issues /anatomy explain …, the runtime resolves to the kit’s main export in kit/iso-kit.mjs. Core Flow – iso-kit.mjs imports gl.mjs (WebGL context setup), canvas-painter.mjs (2‑D drawing helpers), and the geometry/rig modules. It exposes renderFigure() which:
- Loads geometry data from
geometry.tsandrig.ts. - Uses
draw.tsxto generate SVG nodes. - If
enableWebGLis true, passes the same data togl.mjsto create a shader‑based plume. - Serialises the SVG and writes it to disk via Node’s
fsmodule (used inexamples/*/build.mjs). - Serves the interactive canvas through
live.tsx, which mounts the React component to the page.
External Touches – The kit writes to the filesystem (fs.writeFile in examples/*/build.mjs) and serves a local HTTP preview (live.js uses http.createServer). No database or network calls are made. Hub & Cycle – The only dependency cycle is the small interplay between draw.tsx and live.tsx, which share a useState hook for joint positions. This tight coupling is intentional; the cycle is limited to the UI layer.
How To Use It
- Clone –
git clone https://github.com/moses-y/anatomy-skill. - Install – The kit uses only Node’s built‑in modules; run
npm iif apackage.jsonis added later, otherwise skip. - Generate a Figure –
node examples/raptor-engine/build.mjsproducesraptor-engine.htmlandraptor-engine.svg. - Preview Live –
node examples/raptor-engine/live.jsstarts an HTTP server onhttp://localhost:3000. - Run Tests –
npm test(ornode scripts/*test.mjs) executes the 44 Jest‑style test files inscripts/andtests/.
The README already documents the npx skills add command for deploying the skill in Claude or Codex.
Real‑World Use
A technical writer can embed raptor-engine.html in a product spec. The interactive card updates numeric readouts as the user drags the engine, providing an intuitive understanding of thrust vs. pressure. The writer can modify geometry.ts to reflect design changes, re‑run build.mjs, and instantly see an updated illustration.
Code Health & Issues
- Tests – 44 test files (mostly in
scripts/*.test.mjs), covering geometry, rendering, and UI. - CI –
.github/workflows/ci.ymlruns tests and lint checks on every push. - Dependencies – Zero external dependencies; MIT license.
- Missing Config – No
package.jsonor lint config; the repo relies on Node 20+ alone. - Documentation – README,
SKILL.md, andreferences/*.mdprovide usage guidance; deeper API docs would aid contributors. - Security – No secrets; CI badge shows no failures.
The Bottom Line
anatomy-skill delivers a lightweight, dependency‑free framework for generating interactive isometric illustrations that can be embedded in AI skill responses or web pages. Its minimal footprint and solid test coverage make it suitable for technical writers and developers who need quick, reproducible visual aids. The main limitation is the lack of build tooling and documentation beyond the examples, so contributors may need to add a package.json and richer API docs for broader adoption.