Skip to content
Back to skills

Living Anatomy

ASecurity

Build a highly detailed, biologically realistic, LIVING and educational 3D model of a human (or animal) organ or body system in three.js + Vite + TypeScript. The organ never sits still. A physiology simulation with published formulas drives everything, and the user changes stimuli (light, exercise, altitude, sound, age, drugs) and watches the organ adapt. It includes a cutaway with labelled anatomy, live readouts with units, charts, a "what it does" function view, how a medical aid works (gla...

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 7, 2026
ai-agentstypescriptgoswiftbashnodegitapiperformance

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 14 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add joonsp/threejs-skills --skill living-anatomy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Living Anatomy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Living Anatomy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/joonsp-living-anatomy/badge)](https://www.skillsdirectory.com/skills/joonsp-living-anatomy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: living-anatomy
description: Build a highly detailed, biologically realistic, LIVING and educational 3D model of a human (or animal) organ or body system in three.js + Vite + TypeScript. The organ never sits still. A physiology simulation with published formulas drives everything, and the user changes stimuli (light, exercise, altitude, sound, age, drugs) and watches the organ adapt. It includes a cutaway with labelled anatomy, live readouts with units, charts, a "what it does" function view, how a medical aid works (glasses, pacemaker, hearing aid, inhaler), a guided tour and optional webcam/mic/hand-tracking interaction. It is built by a phased multi-agent Workflow (contracts first, parallel builders, integration, then realism, science and UX reviewers), scaled down for small demos. Use this whenever the user wants an anatomical, physiological or medical 3D visualisation or explainer: an eye that follows you, a beating heart, breathing lungs, a cochlea that responds to sound, a hand driven by hand tracking, a neuron firing, a kidney nephron, skin, teeth, etc. Use it even if they only say "make a 3D X that is educational" or "show how the X works" for a body part. Not for machines or devices (use science-visualiser), isometric worlds (use living-diorama), or plain charts of health data such as heart-rate or sleep logs (use dataviz).
---

# Living anatomy

The product is a local web app. The organ fills the centre of the screen and is alive: it moves, breathes, beats, blinks or twitches, driven by a physiology simulation rather than keyframes. Around it sit:
- **stimulus controls**: whatever the organ responds to, on realistic ranges with presets;
- **the organ's response**, visible in 3D and in **live readouts with units**;
- **charts** of the governing quantities over time;
- **a function view** of what the organ does for the body (the eye's retinal image, an ECG and pressure loop, a spirometer trace, an audiogram);
- **an intervention** showing how a medical aid fixes a malfunction (glasses, pacemaker, inhaler, hearing aid), with a diagram of the mechanism;
- **a cutaway** with clickable anatomy labels, (i) explanations on every control, and a guided tour;
- **optionally, the user's own body as input**: face tracking to follow them, a mic to drive a cochlea, hand tracking to drive a hand, room light from the webcam.

This skill was distilled from one build, "The Living Eye" (about 20k lines, 14 agents, ~3.8M subagent tokens, ~5.5 h wall time; 60 fps on an AMD iGPU). Its workflow script and hand-written contracts are in `examples/eye/`. Reuse the structure, not the eye specifics.

## Why it is built this way

- **Realism is what people judge first.** Users of this kind of app say "make it highly detailed and biologically realistic". Realism comes from anatomy-accurate dimensions, procedural micro-detail (vessels, fibres, pores, wet highlights) and agents that *look at close-up screenshots of their own work* and iterate. So the visually central tissue gets its own builder(s), and a dedicated realism reviewer critiques it like a clinician and a VFX look-dev artist.
- **The physiology must be right, because it is educational.** Wrong timings teach wrong biology. So:
  - Every dynamic uses a published formula or well-known figure written into the spec.
  - The simulation is pure TypeScript that runs in node.
  - A `simcheck` script prints scenario tables against the literature.
  - A separate science reviewer audits the numbers and the explanatory text.
- **Contracts before code.** Seven agents building in parallel invent seven incompatible APIs unless the shared types exist first. **Write the core contract yourself**, before the workflow: types, anatomical dimensions, core maths verified in node, and SPEC.md. The coherence of that contract matters more than anything else, and delegating it loses the design intent you gathered from the user. One contracts agent then writes compiling *stubs* for every module. Builders then own disjoint files, so they can work in one directory without worktrees.
- **Never static.** Idle life belongs in v1 (noise-driven micro-motion, periodic events, autonomous "wandering"). Verify it with two screenshots a few seconds apart.

## Process

### 1. Scout and clarify (keep it short)
- Check tooling: `node`, `npm`, a Playwright Chromium (`~/.cache/ms-playwright/chromium-*`), whether the directory is empty, and whether it is a git repo.
- If the request is already rich (organ + a few effects), **don't interview**: pick sensible defaults and state them. Ask at most 2–3 questions, each with a recommended option, and only when the answer changes the build. Examples: which species or side (a right eye?), audience (school, med students, general), whether webcam/mic interaction is wanted when that's unclear.
- Read `references/organs.md` for the organ's starter map: stimuli, responses, function view, intervention, sensor input and key formulas. Extend it with "whatever other effects the organ can have". Users often ask for exactly that, so list the organ's reflexes, pathologies, age effects and drugs.

### 2. Scaffold inline (not in the workflow)
```bash
npm create vite@latest . -- --template vanilla-ts --no-interactive
npm install && npm install three && npm install -D @types/three playwright
# optional sensors: npm install @mediapipe/tasks-vision  (then host wasm + .task model locally, see lessons)
```
Copy `scripts/shot.mjs` (headless screenshots) and `scripts/gpu-perf.mjs` (real-GPU fps) into the project's `scripts/`. Both need the app to expose `window.__app` with at least `params`, `state()`, `setParams(patch)`, `trigger(action)` and **`frames()`** (a rendered-frame counter; `shot.mjs` waits for `frames() > 3` and otherwise times out). Remove the template's counter and assets. Note the tsconfig flags (Vite's template enables `verbatimModuleSyntax`, `erasableSyntaxOnly` and `noUnused*`): builders must be told about them.

### 3. Write the contract yourself
Read `references/contract.md` and model it on `examples/eye/`. Write:
1. `src/types.ts`: `Params` (everything the user controls), the input type (sensors/pointer), the full sim state (name it for the organ, e.g. `EyeState`/`HeartState`), the action union (`SimAction`), anatomy label ids and the `LabelAnchor` type.
2. `src/anatomy.ts`: real dimensions in mm, with the coordinate frame and orientation (left/right, nasal/temporal, anterior axis) spelled out.
3. The core maths of the intervention or function (for the eye, refraction + glasses in `src/sim/optics.ts`). Test it with `node file.ts` (Node ≥ 23 strips types) against textbook cases before anyone builds on it.
4. `SPEC.md`: conventions, the file-ownership table, exact module interfaces, main-loop order, the physiology model with formulas and citations, the realism checklist, UI layout and the debug hook. Assign `scripts/simcheck.ts` (the scenario report, see `references/physiology.md`) to the sim builder.

Then call the advisor or re-read the contract once for gaps. Common gaps: how two builders share a deformation (a seam split for the eye's axial stretch, a shared deformation field for a beating heart), which frame the section plane lives in, who owns lighting, and whether fast dynamics need fixed sub-steps plus a ring buffer for traces (see `references/contract.md` §5).

### 4. Run the workflow
**Get the go-ahead first.** A full build costs roughly 4M subagent tokens and ~5 h. Unless the user already asked for a workflow or multi-agent build, say so and ask before launching. Loading this skill doesn't authorise the run.

**Scale to the ask.** Use the full shape below for a flagship, "highly detailed" request. For a classroom demo or a single-mechanism explainer (a neuron firing, a sarcomere), merge builders: sim + panels, organ + stage, UI + content. Use one combined reviewer and one fixer, for about 6 agents. Include a sensors builder only if the user asked for camera/mic/hand interaction, or the organ's sensor "wow" is cheap and opt-in (then tell the user you added it).

Load `workflow-authoring`, then adapt `examples/eye/eye.workflow.js`. When adapting it, change:
- the hard-coded `ROOT`;
- the contracts prompt: the hook is `window.__app` including `frames()`, and `shot.mjs`/`gpu-perf.mjs` are already copied, so the agent verifies them rather than writing them;
- the builder list and file ownership;
- the review `area` enum and the fixers' `isVisual` path test (they name `src/eye/` and `src/scene/`).

The shape:

| Phase | Agents | Notes |
|---|---|---|
| Contracts | 1 | stubs for every module (functional, compiling), real `main.ts` wiring, `params.ts` with presets, `debug.ts` (`window.__app`), verifies `shot.mjs` renders WebGL headless |
| Build | ~7 parallel | sim (+ simcheck) · organ surface · organ interior/cutaway · context + stage (surrounding tissue such as the face around an eye or the thorax/pericardium around a heart, lighting, camera, view transitions) + intervention 3D · panels (diagram, function view, charts) · sensors (optional) · UI + content + tour |
| Integrate | 1 | build passes, zero console errors, every wire works, screenshot checklist, perf sanity |
| Review | 3 parallel | realism · science & content accuracy · UX/function/robustness; read-only, findings need evidence |
| Fix | 2 parallel | split by file ownership (3D vs everything else); cross-ownership items go into `deferred` |

Prompt essentials (the example has them all):
- A COMMON preamble quoting the user's request verbatim.
- "Read SPEC/types/anatomy first."
- "Edit only your files; others are editing concurrently; fix tsc errors only in your files; no git, no new deps."
- "Inspect your own PNGs with --clip close-ups."
- A realism paragraph for the visual builders.
- A structured-output schema with `notesForIntegrator`.

Put **specific anatomy** in builder prompts (named structures, layer order, colours, typical counts). "Make it realistic" alone yields generic results.

### 5. After the workflow: verify and report honestly
- The workflow's output JSON has the script's return under `result`. Read `integration.remainingIssues` and each fixer's `skipped` and `deferred` lists. **Apply the deferred cross-ownership items yourself**; they are usually small but real (e.g. pointer mapping ignoring a camera shift).
- Take your own screenshots and look at them. `shot.mjs` renders on the host GPU by default; with `SW=1` (SwiftShader, no GPU) it runs at ~2–5 fps, so view transitions and slow dynamics then need `--wait 15000–25000`. A shot taken mid-transition is not a bug.
- Run `node scripts/simcheck.ts` and skim it against the literature.
- Measure **real-GPU** fps with `scripts/gpu-perf.mjs`: start `npx vite --port <p>` in the background first. SwiftShader numbers mean nothing for performance.
- Check every interaction path you can. Say clearly which ones were **not** tested with a real person, e.g. "face tracking only ran against Chromium's fake camera". Give the user a 5-second manual test for them.
- The final message covers:
  - what was built, grouped by the user's asks;
  - the scientific basis, with one or two key numbers;
  - what was verified and how;
  - what's untested;
  - known rough edges;
  - how to run it (localhost for camera/mic).

## References
- `references/contract.md`: what the hand-written contract must pin down, including sharing patterns for deformation and cutaways.
- `references/physiology.md`: modelling dynamics believably and correctly, plus the simcheck pattern.
- `references/realism.md`: techniques that made the eye look real (procedural shaders via `onBeforeCompile`, canvas textures, section caps, lids/AO, wet tissue, hair).
- `references/organs.md`: starter maps for eye, heart, lungs, ear, hand, neuron, skin, kidney, teeth.
- `references/lessons.md`: concrete pitfalls from the eye build (headless WebGL flags, MediaPipe 1.x, secure context, spec contradictions, pkill self-match…).
- `examples/eye/`: `types.ts`, `anatomy.ts`, `optics.ts`, `SPEC.md`, `eye.workflow.js`, the actual artefacts of the proven build.
- `scripts/shot.mjs`: headless screenshots and state probes. `scripts/gpu-perf.mjs`: real-GPU fps.

Files in this skill

  • SKILL.md11.9 KB
  • examples/eye/README.md1.4 KB
  • examples/eye/SPEC.md18.4 KB
  • examples/eye/anatomy.ts3.4 KB
  • examples/eye/eye.workflow.js39.3 KB
  • examples/eye/optics.ts11.7 KB
  • examples/eye/types.ts8 KB
  • references/contract.md7.2 KB
  • references/lessons.md5 KB
  • references/organs.md8.3 KB
  • references/physiology.md5.4 KB
  • references/realism.md7.4 KB
  • scripts/gpu-perf.mjs2.3 KB
  • scripts/shot.mjs13.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.