Skip to content

anbeime/skill / skills/anatomy/anatomy

anatomy

Unverified

Build crafted, highly detailed, interactive isometric SVG figures that explain a technical idea as a real physical object (a test rig, a dial gauge, a cabinet of drawers, a plotter, a lock), with many small precise solid parts, four-tone shading, correct painter's order, a framed card with title, hint and live readout, and calm eased motion. Use this whenever someone wants an isometric illustration, an explanatory diagram or figure for docs, a blog post, a landing page or an article, a "Linear-style" or "premium" technical drawing, an interactive explainer, or an SVG that shows how a system, algorithm or component works, even if they never say "isometric". Works framework-free (TypeScript/JS that writes SVG and HTML) and in React/Next.js, and can add realistic WebGL shaders (fire, exhaust, water, caustics, lamp light) that live inside the drawing in the same isometric perspective. Also prints a figure as an A4 PDF (poster, drawing or handout) and publishes it to the Anatomy community gallery when asked.

FileKindSize
.gitattributesother89 B
.github/ISSUE_TEMPLATE/bug_report.ymlconfig2.7 KB
.github/ISSUE_TEMPLATE/config.ymlconfig213 B
.github/ISSUE_TEMPLATE/figure_request.ymlconfig1.9 KB
.github/PULL_REQUEST_TEMPLATE.mdmarkdown1005 B
.github/assets/dial-indicator.webpbinary17.0 KB
.github/assets/raptor-engine-apart.webpbinary34.3 KB
.github/assets/raptor-engine-firing.webpbinary36.9 KB
.github/assets/ripple-tank.webpbinary33.9 KB
.github/assets/turning-dial.webpbinary29.3 KB
.github/workflows/ci.ymlconfig2.0 KB
.gitignoreother216 B
CHANGELOG.mdmarkdown14.6 KB
CODE_OF_CONDUCT.mdmarkdown5.5 KB
CONTRIBUTING.mdmarkdown8.7 KB
LICENSEother1.0 KB
README.mdmarkdown25.6 KB
SECURITY.mdmarkdown1.2 KB
SKILL.mdskill md32.8 KB
agents/openai.yamlconfig120 B
evals/evals.jsonconfig8.0 KB
examples/arcade-cabinet/arcade-cabinet-detailed-a4.pdfbinary2.2 MB
examples/arcade-cabinet/arcade-cabinet-drawing-a4.pdfbinary1.8 MB
examples/arcade-cabinet/arcade-cabinet-light.htmlother985.3 KB
examples/arcade-cabinet/arcade-cabinet-poster-a4.pdfbinary709.6 KB
examples/arcade-cabinet/arcade-cabinet.cssother3.1 KB
examples/arcade-cabinet/arcade-cabinet.htmlother985.3 KB
examples/arcade-cabinet/build.mjsscript50.5 KB
examples/arcade-cabinet/live.jsscript20.8 KB
examples/arcade-cabinet/parts.mjsscript4.2 KB
examples/arcade-cabinet/screen.mjsscript6.5 KB
examples/arcade-cabinet/sheet.mjsscript5.4 KB
examples/desk-computer/build.mjsscript22.5 KB
examples/desk-computer/desk-computer-light.htmlother231.8 KB
examples/desk-computer/desk-computer.htmlother231.8 KB
examples/dial-indicator/build.mjsscript14.6 KB
examples/dial-indicator/dial-indicator-light.htmlother133.3 KB
examples/dial-indicator/dial-indicator.htmlother133.3 KB
examples/push-button/build.mjsscript15.9 KB
examples/push-button/push-button-detailed-a4.pdfbinary933.7 KB
examples/push-button/push-button-drawing-a4.pdfbinary680.6 KB
examples/push-button/push-button-light.htmlother124.5 KB
examples/push-button/push-button-poster-a4.pdfbinary453.1 KB
examples/push-button/push-button.htmlother124.5 KB
examples/push-button/sheet.mjsscript4.0 KB
examples/raptor-engine/build.mjsscript69.2 KB
examples/raptor-engine/live.jsscript30.0 KB
examples/raptor-engine/raptor-engine-detailed-a4.pdfbinary4.1 MB
examples/raptor-engine/raptor-engine-drawing-a4.pdfbinary2.8 MB
examples/raptor-engine/raptor-engine-light.htmlother1.5 MB
examples/raptor-engine/raptor-engine-poster-a4.pdfbinary599.0 KB
examples/raptor-engine/raptor-engine.htmlother1.5 MB
examples/raptor-engine/raptor.cssother6.6 KB
examples/raptor-engine/sheet.mjsscript6.2 KB
examples/ripple-tank/build.mjsscript31.3 KB
examples/ripple-tank/live.jsscript21.2 KB
examples/ripple-tank/model.mjsscript4.9 KB
examples/ripple-tank/ripple-tank-light.htmlother493.7 KB
examples/ripple-tank/ripple-tank.htmlother493.7 KB
examples/ripple-tank/ripple.cssother1.6 KB
examples/spot-plate/art.tsxother4.4 KB
examples/spot-plate/drops.tsscript18.7 KB
examples/spot-plate/fan.tsscript2.7 KB
examples/spot-plate/figure.tsxother1.1 KB
examples/spot-plate/geometry.tsscript10.7 KB
examples/spot-plate/live.tsxother11.4 KB
examples/spot-plate/rig.tsscript8.0 KB
examples/spot-plate/spot-plate.cssother1.5 KB
examples/test-rig/art.tsxother7.2 KB
examples/test-rig/figure.tsxother850 B
examples/test-rig/geometry.tsscript12.8 KB
examples/test-rig/live.tsxother17.1 KB
examples/test-rig/pose.tsscript3.8 KB
examples/test-rig/rig.tsscript5.5 KB
examples/test-rig/stretch.cssother1.2 KB
examples/test-rig/view.tsscript3.0 KB
examples/turning-dial/build.mjsscript31.3 KB
examples/turning-dial/dial.cssother509 B
examples/turning-dial/live.jsscript12.2 KB
examples/turning-dial/stress.mjsscript19.0 KB
examples/turning-dial/turning-dial-light.htmlother658.1 KB
examples/turning-dial/turning-dial-verify-light.htmlother685.3 KB
examples/turning-dial/turning-dial.htmlother658.1 KB
examples/turning-dial/turning-stress-light.htmlother1.2 MB
kit/audit.mjsscript90.4 KB
kit/canvas-painter.mjsscript26.9 KB
kit/gl-shared.mjsscript8.7 KB
kit/gl.mjsscript8.6 KB
kit/iso-kit.mjsscript34.4 KB
kit/iso-kit.tsscript37.7 KB
kit/iso.cssother7.5 KB
kit/lathe.mjsscript46.9 KB
kit/pdf-button.mjsscript1.3 KB
kit/react/draw.tsxother6.4 KB
kit/react/live.tsxother4.3 KB
kit/tube.mjsscript13.9 KB
kit/turn-audit.mjsscript56.0 KB
kit/turn-build.mjsscript64.4 KB
kit/turn-fixed.mjsscript143.6 KB
kit/turn.mjsscript136.5 KB
references/3d.mdmarkdown43.6 KB
references/craft.mdmarkdown49.1 KB
references/kit.mdmarkdown66.3 KB
references/motion.mdmarkdown22.1 KB
references/print.mdmarkdown6.9 KB
references/publish.mdmarkdown4.0 KB
references/react.mdmarkdown3.5 KB
references/verify.mdmarkdown42.6 KB
references/walkthrough.mdmarkdown5.2 KB
references/webgl.mdmarkdown59.7 KB
scripts/audit-affine-bounds.test.mjsscript4.1 KB
scripts/audit-cache.test.mjsscript1.6 KB
scripts/audit-clearance-envelope.test.mjsscript2.4 KB
scripts/audit-empty-clipping.test.mjsscript3.8 KB
scripts/audit-order-convergence.test.mjsscript2.8 KB
scripts/audit-path-origin.test.mjsscript1.6 KB
scripts/audit-profile.test.mjsscript2.1 KB
scripts/audit-projection.test.mjsscript1.9 KB
scripts/audit-slide-clearance.test.mjsscript2.8 KB
scripts/audit-svg-attributes.test.mjsscript3.4 KB
scripts/audit-taper.test.mjsscript1.2 KB
scripts/audit-tube-support.test.mjsscript2.6 KB
scripts/capture-current-geometry.test.mjsscript5.0 KB
scripts/capture-selector.test.mjsscript7.5 KB
scripts/capture.mjsscript14.7 KB
scripts/capture.test.mjsscript3.1 KB
scripts/chrome-port.mjsscript1.1 KB
scripts/chrome-startup.test.mjsscript1.8 KB
scripts/curve-density.test.mjsscript4.1 KB
scripts/drive-actions.test.mjsscript3.0 KB
scripts/drive-async-until.test.mjsscript2.7 KB
scripts/drive-page-load.test.mjsscript1.3 KB
scripts/drive-turn-controller.test.mjsscript2.6 KB
scripts/drive.mjsscript23.3 KB
scripts/drive.test.mjsscript3.6 KB
scripts/enter-key.test.mjsscript2.5 KB
scripts/fidelity-cut.test.mjsscript4.7 KB
scripts/fidelity-tube-coverage.test.mjsscript3.1 KB
scripts/fingerprint.mjsscript1.2 KB
scripts/inline-kit.mjsscript648 B
scripts/line-ends.mjsscript15.8 KB
scripts/lines-arcs.test.mjsscript2.0 KB
scripts/lines-bezier.test.mjsscript1.7 KB
scripts/lines-round.test.mjsscript2.4 KB
scripts/lines-rounded-rect.test.mjsscript2.5 KB
scripts/lines.mjsscript1.7 KB
scripts/lines.test.mjsscript1.5 KB
scripts/navigation.test.mjsscript2.2 KB
scripts/orbit-sampling.test.mjsscript2.7 KB
scripts/print-sheet.mjsscript28.3 KB
scripts/print-sheet.test.mjsscript6.6 KB
scripts/print.mjsscript14.5 KB
scripts/publish.mjsscript19.8 KB
scripts/publish.test.mjsscript7.6 KB
scripts/react-dots-opacity.test.mjsscript2.8 KB
scripts/react-readout-first-write.test.mjsscript3.8 KB
scripts/react-readout-target.test.mjsscript4.5 KB
scripts/react-solid-seamless.test.mjsscript2.7 KB
scripts/react-visibility-target.test.mjsscript3.8 KB
scripts/session.mjsscript4.7 KB
scripts/session.test.mjsscript2.6 KB
scripts/turn-audit-samples.test.mjsscript1.3 KB
scripts/turn-bench.mjsscript3.8 KB
scripts/turn-check.mjsscript37.5 KB
scripts/turn-convex-check.test.mjsscript1.8 KB
scripts/turn-fidelity.mjsscript19.9 KB
scripts/turn-group-reference.test.mjsscript2.1 KB
scripts/turn-rounded-polygon.test.mjsscript1.5 KB
scripts/turn-split-owner.test.mjsscript3.3 KB
tests/fixtures/react-dots-dark.pngbinary3.9 KB
tests/fixtures/react-dots-light.pngbinary3.8 KB
tests/fixtures/react-solid-dark.pngbinary9.2 KB
tests/fixtures/react-solid-light.pngbinary9.6 KB

examples/spot-plate/live.tsx

View on GitHub
"use client";

import * as React from "react";
import { IsoFigure } from "../../kit/react/draw";
import { asksForStillness, useReadout } from "../../kit/react/live";
import { keyOf, rowsOf, type GlassShape, type RowShape } from "./drops";
import { fanOf, type FanPose } from "./fan";
import { HEIGHT, MERGE, MERGE_LEAST, MERGE_MOST, MERGE_STEP, ROWS, WIDTH, mergeAtX, readoutOf, roundMerge, spokenOf } from "./rig";

const FOLLOW = 150;
const GLIDE = 560;
const SETTLED = 0.004;
const TOUR_FIRST = 1800;
const TOUR_BACK = 4200;
const TOUR_TRAVEL = 1400;
const TOUR: { merge: number; hold: number }[] = [
  { merge: MERGE_MOST, hold: 2400 },
  { merge: MERGE_LEAST, hold: 2200 },
  { merge: MERGE, hold: 3800 },
];
const BLADES = ROWS + 1;

function Glass({ shape, joined }: { shape: GlassShape; joined: boolean }) {
  const quiet = joined ? "lo" : "faint";
  return (
    <g className="iso-solid ml-glass" data-joined={joined ? "" : undefined}>
      <path className="iso-fill" d={shape.fill} />
      {shape.shades.map((shade, index) => (
        <path key={index} className="iso-shade" data-shade={shade.shade} d={shade.d} />
      ))}
      <path className="iso-top" d={shape.top} />
      <path className="iso-line" data-tone={quiet} d={shape.crease} />
      {shape.bevel ? <path className="iso-line iso-bevel" data-tone={quiet} d={shape.bevel} /> : null}
      <path className="iso-line iso-edge" data-tone={joined ? "hi" : "mid"} d={shape.outline} />
      {shape.shine ? <path className="iso-line ml-shine" data-tone="mid" d={shape.shine} /> : null}
    </g>
  );
}

const Row = React.memo(function Row({ shape }: { shape: RowShape }) {
  return (
    <>
      <g>
        <g>
          {shape.glass.map((glass, index) => (
            <Glass key={index} shape={glass} joined={shape.joined} />
          ))}
        </g>
      </g>
      {shape.neck.length ? (
        <g>
          <g className="ml-neck">
            {shape.neck.map((glint, index) => (
              <path key={index} className="iso-line" data-tone="lit" strokeOpacity={glint.alpha < 1 ? glint.alpha : undefined} d={glint.d} />
            ))}
          </g>
        </g>
      ) : null}
    </>
  );
});

interface BladeNodes {
  group: SVGGElement | null;
  fill: SVGPathElement | null;
  shades: (SVGPathElement | null)[];
  top: SVGPathElement | null;
  crease: SVGPathElement | null;
  outline: SVGPathElement | null;
  line: SVGPathElement | null;
}

const emptyBlade = (): BladeNodes => ({ group: null, fill: null, shades: [null, null, null, null], top: null, crease: null, outline: null, line: null });

function apply(nodes: BladeNodes[], halo: SVGPathElement | null, pose: FanPose) {
  halo?.setAttribute("d", pose.halo);
  pose.blades.forEach((blade, index) => {
    const node = nodes[index];
    if (!node) return;
    node.fill?.setAttribute("d", blade.fill);
    blade.shades.forEach((d, shade) => node.shades[shade]?.setAttribute("d", d));
    node.top?.setAttribute("d", blade.top);
    node.crease?.setAttribute("d", blade.crease);
    node.outline?.setAttribute("d", blade.outline);
    node.line?.setAttribute("d", blade.line);
    if (index < ROWS) {
      if (pose.out[index]) node.group?.setAttribute("data-out", "");
      else node.group?.removeAttribute("data-out");
    }
  });
}

interface Props {
  label: string;
  back: React.ReactNode;
  deck: React.ReactNode;
  front: React.ReactNode;
}

export function LiquidLive({ label, back, deck, front }: Props) {
  const { anchor, say } = useReadout<HTMLDivElement>();
  const root = React.useRef<HTMLDivElement | null>(null);
  const blades = React.useRef<BladeNodes[]>(Array.from({ length: BLADES }, emptyBlade));
  const halo = React.useRef<SVGPathElement | null>(null);
  const rest = React.useMemo(() => fanOf(MERGE), []);
  const goal = React.useRef(MERGE);
  const lead = React.useRef(MERGE);
  const shown = React.useRef(MERGE);
  const ease = React.useRef(FOLLOW);
  const frame = React.useRef(0);
  const last = React.useRef(0);
  const [quant, setQuant] = React.useState(keyOf(MERGE) / 4);
  const [hovering, setHovering] = React.useState(false);
  const [focused, setFocused] = React.useState(false);
  const [visible, setVisible] = React.useState(false);
  const [idle, setIdle] = React.useState(true);
  const [poke, setPoke] = React.useState(0);

  const rows = React.useMemo(() => rowsOf(quant), [quant]);
  const value = roundMerge(quant);

  const draw = React.useCallback((merge: number) => {
    apply(blades.current, halo.current, fanOf(merge));
    setQuant(keyOf(merge) / 4);
  }, []);

  const stop = React.useCallback(() => {
    cancelAnimationFrame(frame.current);
    frame.current = 0;
  }, []);

  const run = React.useCallback(() => {
    if (frame.current) return;
    last.current = 0;
    const tick = (now: number) => {
      const dt = last.current ? Math.min(now - last.current, 64) : 16;
      last.current = now;
      const blend = 1 - Math.exp(-dt / ease.current);
      lead.current += (goal.current - lead.current) * blend;
      shown.current += (lead.current - shown.current) * blend;
      const done = Math.abs(goal.current - lead.current) < SETTLED && Math.abs(goal.current - shown.current) < SETTLED;
      if (done) {
        lead.current = goal.current;
        shown.current = goal.current;
      }
      draw(shown.current);
      frame.current = done ? 0 : requestAnimationFrame(tick);
    };
    frame.current = requestAnimationFrame(tick);
  }, [draw]);

  const aim = React.useCallback(
    (merge: number, pace = FOLLOW) => {
      const next = Math.min(MERGE_MOST, Math.max(MERGE_LEAST, merge));
      ease.current = pace;
      goal.current = next;
      if (asksForStillness()) {
        stop();
        lead.current = next;
        shown.current = next;
        draw(next);
        return;
      }
      run();
    },
    [draw, run, stop],
  );

  React.useEffect(() => stop, [stop]);

  React.useEffect(() => {
    say(readoutOf(value));
  }, [value, say]);

  React.useEffect(() => {
    const node = root.current;
    if (!node) return;
    const observer = new IntersectionObserver((entries) => setVisible(Boolean(entries.at(-1)?.isIntersecting)));
    observer.observe(node);
    return () => observer.disconnect();
  }, []);

  React.useEffect(() => {
    if (!visible) stop();
  }, [visible, stop]);

  const engaged = hovering || focused;

  React.useEffect(() => {
    if (engaged) {
      setIdle(false);
      return;
    }
    const timer = window.setTimeout(() => setIdle(true), TOUR_BACK);
    return () => window.clearTimeout(timer);
  }, [engaged, poke]);

  const touring = visible && idle && !engaged;

  React.useEffect(() => {
    if (!touring || asksForStillness()) return;
    let timer = 0;
    let step = 0;
    const next = () => {
      const stop = TOUR[step % TOUR.length]!;
      aim(stop.merge, GLIDE);
      step += 1;
      timer = window.setTimeout(next, stop.hold + TOUR_TRAVEL);
    };
    timer = window.setTimeout(next, TOUR_FIRST);
    return () => window.clearTimeout(timer);
  }, [touring, aim]);

  const mergeAt = (clientX: number) => {
    const svg = root.current?.querySelector("svg");
    const box = svg?.getBoundingClientRect();
    if (!box || !box.width) return null;
    return mergeAtX(((clientX - box.left) / box.width) * WIDTH);
  };

  const hold = () => {
    setIdle(false);
    setPoke((count) => count + 1);
  };

  const follow = (clientX: number) => {
    const merge = mergeAt(clientX);
    if (merge !== null) aim(merge, FOLLOW);
  };

  const stepBy = (by: number) => roundMerge(goal.current + by);

  const bindBlade = (index: number) => ({
    group: (node: SVGGElement | null) => {
      blades.current[index]!.group = node;
    },
    path: (key: "fill" | "top" | "crease" | "outline" | "line") => (node: SVGPathElement | null) => {
      blades.current[index]![key] = node;
    },
    shade: (shade: number) => (node: SVGPathElement | null) => {
      blades.current[index]!.shades[shade] = node;
    },
  });

  return (
    <div
      ref={(node) => {
        root.current = node;
        anchor.current = node;
      }}
      className="ml"
      role="slider"
      tabIndex={0}
      aria-label="Merge, in pixels"
      aria-valuemin={MERGE_LEAST}
      aria-valuemax={MERGE_MOST}
      aria-valuenow={value}
      aria-valuetext={spokenOf(value)}
      onPointerEnter={(event) => {
        if (event.pointerType === "mouse") setHovering(true);
      }}
      onPointerMove={(event) => {
        if (event.pointerType === "mouse" || event.currentTarget.hasPointerCapture(event.pointerId)) {
          hold();
          follow(event.clientX);
        }
      }}
      onPointerDown={(event) => {
        if (event.pointerType !== "mouse") event.currentTarget.setPointerCapture(event.pointerId);
        hold();
        follow(event.clientX);
      }}
      onPointerUp={(event) => {
        if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId);
      }}
      onPointerLeave={(event) => {
        if (event.pointerType !== "mouse") return;
        setHovering(false);
        aim(MERGE, GLIDE);
      }}
      onFocus={() => {
        setFocused(true);
        aim(roundMerge(shown.current), FOLLOW);
      }}
      onBlur={() => setFocused(false)}
      onKeyDown={(event) => {
        let next: number | null = null;
        const big = event.shiftKey ? 4 : 1;
        if (event.key === "ArrowLeft" || event.key === "ArrowDown") next = stepBy(-MERGE_STEP * big);
        else if (event.key === "ArrowRight" || event.key === "ArrowUp") next = stepBy(MERGE_STEP * big);
        else if (event.key === "PageDown") next = stepBy(-MERGE_STEP * 8);
        else if (event.key === "PageUp") next = stepBy(MERGE_STEP * 8);
        else if (event.key === "Home") next = MERGE_LEAST;
        else if (event.key === "End") next = MERGE_MOST;
        if (next === null) return;
        event.preventDefault();
        hold();
        aim(next, FOLLOW);
      }}
    >
      <IsoFigure width={WIDTH} height={HEIGHT} label={label}>
        {back}
        {rows.map((shape) => (
          <Row key={shape.row} shape={shape} />
        ))}
        {deck}
        <g>
          <g>
            <path ref={(node) => void (halo.current = node)} className="iso-halo ml-fan-halo" d={rest.halo} />
            {rest.blades.map((blade, index) => {
              const bind = bindBlade(index);
              const isLead = index === ROWS;
              return (
                <g
                  key={index}
                  ref={bind.group}
                  className="iso-solid ml-blade"
                  data-lead={isLead ? "" : undefined}
                  data-lit={isLead ? "" : undefined}
                  data-out={!isLead && rest.out[index] ? "" : undefined}
                >
                  <path ref={bind.path("fill")} className="iso-fill" d={blade.fill} />
                  {[0, 1, 2, 3].map((shade) => (
                    <path key={shade} ref={bind.shade(shade)} className="iso-shade" data-shade={shade} d={blade.shades[shade] ?? ""} />
                  ))}
                  <path ref={bind.path("top")} className="iso-top" d={blade.top} />
                  <path ref={bind.path("crease")} className="iso-line" data-tone="faint" d={blade.crease} />
                  <path ref={bind.path("outline")} className="iso-line iso-edge" data-tone={isLead ? "hi" : "mid"} d={blade.outline} />
                  <path ref={bind.path("line")} className="iso-line ml-blade-line" data-tone={isLead ? "lit" : "lo"} d={blade.line} />
                </g>
              );
            })}
          </g>
        </g>
        {front}
      </IsoFigure>
    </div>
  );
}
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall