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/test-rig/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 { frameOf, type Frame } from "./pose";
import { HALF, REST, memberAt, one, poseOf, readoutOf, settled, sizeText, step, type Member, type Pose } from "./rig";
import { EX, FINGER_MOST, GRAB_MOST, HEIGHT, HOVER, PROBE_HOME, PROBE_MAX, PROBE_MIN, WIDTH, at } from "./view";

const FOLLOW = 0.09;
const DOWN = 0.07;
const UP = 0.16;
const NUDGE = 10;
const TOUR_FIRST = 1.4;
const TOUR_BACK = 3600;
const LOOP = 7.6;
const MOST_DT = 1 / 30;

interface Hand {
  held: boolean;
  grab: number;
  finger: number;
}

const clamp = (value: number, low: number, high: number) => Math.min(high, Math.max(low, value));
const ease = (t: number) => {
  const u = clamp(t, 0, 1);
  return u * u * (3 - 2 * u);
};

function tour(t: number): Hand {
  const at = t % LOOP;
  if (at < 0.6) return { held: false, grab: PROBE_HOME, finger: PROBE_HOME };
  if (at < 3.7) return { held: true, grab: PROBE_HOME, finger: PROBE_HOME - 80 * ease((at - 1.2) / 1.2) };
  return { held: false, grab: PROBE_HOME, finger: PROBE_HOME - 80 + 80 * ease((at - 4.4) / 1.2) };
}

interface Nodes {
  glass: SVGGElement | null;
  fill: SVGPathElement | null;
  shades: (SVGPathElement | null)[];
  top: SVGPathElement | null;
  crease: SVGPathElement | null;
  bevel: SVGPathElement | null;
  edge: SVGPathElement | null;
  rim: SVGPathElement | null;
  shine: SVGPathElement | null;
  coilsBack: SVGPathElement | null;
  coilsLeft: SVGPathElement | null;
  coilsRightBack: SVGPathElement | null;
  coilsRightFront: SVGPathElement | null;
  carriage: SVGGElement | null;
  plunger: SVGGElement | null;
  needle: SVGPathElement | null;
  pull: SVGPathElement | null;
  grab: SVGCircleElement | null;
  touch: SVGCircleElement | null;
  rider: SVGGElement | null;
  probe: SVGGElement | null;
  arm: SVGGElement | null;
  tip: SVGGElement | null;
  rest: SVGGElement | null;
}

function apply(nodes: Nodes, frame: Frame, held: boolean) {
  const { glass } = frame;
  nodes.fill?.setAttribute("d", glass.fill);
  glass.shades?.forEach((d, index) => nodes.shades[index]?.setAttribute("d", d));
  nodes.top?.setAttribute("d", glass.top);
  nodes.crease?.setAttribute("d", glass.crease);
  nodes.bevel?.setAttribute("d", glass.bevel ?? "");
  nodes.edge?.setAttribute("d", glass.outline);
  nodes.rim?.setAttribute("d", glass.rim);
  nodes.shine?.setAttribute("d", glass.shine);
  if (nodes.glass) {
    if (held) nodes.glass.dataset.lit = "";
    else delete nodes.glass.dataset.lit;
  }
  nodes.coilsBack?.setAttribute("d", frame.coilsBack);
  nodes.coilsLeft?.setAttribute("d", frame.coilsLeft);
  nodes.coilsRightBack?.setAttribute("d", frame.coilsRightBack);
  nodes.coilsRightFront?.setAttribute("d", frame.coilsRightFront);
  nodes.carriage?.setAttribute("transform", frame.carriage);
  nodes.plunger?.setAttribute("transform", frame.carriage);
  nodes.needle?.setAttribute("d", frame.needle);
  nodes.pull?.setAttribute("d", frame.pull);
  for (const [node, point] of [
    [nodes.grab, frame.grab],
    [nodes.touch, frame.finger],
  ] as const) {
    if (!node) continue;
    node.setAttribute("cx", `${point[0]}`);
    node.setAttribute("cy", `${point[1]}`);
    node.style.opacity = frame.pull ? "" : "0";
  }
  nodes.rider?.setAttribute("transform", frame.rider);
  nodes.probe?.setAttribute("transform", frame.probe);
  nodes.arm?.setAttribute("transform", frame.probe);
  nodes.tip?.setAttribute("transform", frame.tip);
}

function restShown(pose: Pose) {
  const off = Math.max(Math.abs(pose.mid - pose.half[0] + HALF[0]), Math.abs(pose.mid + pose.half[0] - HALF[0]), Math.abs(pose.half[1] - HALF[1]));
  return `${Math.round(clamp((off - 0.4) / 1.6, 0, 1) * 100) / 100}`;
}

function spokenOf(member: Member, pull: number, held: boolean) {
  const pose = poseOf(member);
  const size = sizeText(pose).replace(" × ", " by ");
  const state = held ? "Pressed" : member.swell.at === 0 && member.lean.at === 0 ? "At rest" : "Springing back";
  return `${state}: ${size} pixels, pulled ${one(Math.abs(pull))} px, leaning ${one(Math.abs(pose.lean))} px`;
}

const RESTING_TEXT = spokenOf(memberAt(), 0, false);

interface Props {
  label: string;
  base: React.ReactNode;
  rail: React.ReactNode;
  rider: React.ReactNode;
  block: React.ReactNode;
  frameBack: React.ReactNode;
  rods: React.ReactNode;
  carriage: React.ReactNode;
  plunger: React.ReactNode;
  rest: React.ReactNode;
  frameFront: React.ReactNode;
  dial: React.ReactNode;
  finger: React.ReactNode;
  arm: React.ReactNode;
}

export function StretchLive(props: Props) {
  const { anchor, say } = useReadout<HTMLDivElement>();
  const root = React.useRef<HTMLDivElement | null>(null);
  const nodes = React.useRef<Nodes>({
    glass: null,
    fill: null,
    shades: [null, null, null, null],
    top: null,
    crease: null,
    bevel: null,
    edge: null,
    rim: null,
    shine: null,
    coilsBack: null,
    coilsLeft: null,
    coilsRightBack: null,
    coilsRightFront: null,
    carriage: null,
    plunger: null,
    needle: null,
    pull: null,
    grab: null,
    touch: null,
    rider: null,
    probe: null,
    arm: null,
    tip: null,
    rest: null,
  });
  const member = React.useRef<Member>(memberAt());
  const hand = React.useRef<Hand>({ held: false, grab: PROBE_HOME, finger: PROBE_HOME });
  const local = React.useRef(PROBE_HOME);
  const finger = React.useRef(PROBE_HOME);
  const lift = React.useRef(1);
  const frame = React.useRef(0);
  const last = React.useRef(0);
  const clock = React.useRef(0);
  const script = React.useRef<((t: number) => Hand) | null>(null);
  const [pressing, setPressing] = React.useState(false);
  const user = React.useRef(false);
  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 rest = React.useMemo(() => frameOf(REST, 0, PROBE_HOME, PROBE_HOME, HOVER, PROBE_HOME), []);

  const grip = React.useCallback((next: Hand) => {
    const was = hand.current;
    if (next.held && !was.held) {
      const pose = poseOf(member.current);
      local.current = (next.grab - pose.mid) / (pose.half[0] / HALF[0]);
    }
    hand.current = next;
  }, []);

  const draw = React.useCallback(() => {
    const pose = poseOf(member.current);
    const now = hand.current;
    apply(nodes.current, frameOf(pose, member.current.lean.at, local.current, finger.current, HOVER * lift.current, PROBE_HOME, now.held), now.held);
    say(readoutOf(pose));
    const restNode = nodes.current.rest;
    const shownRest = restShown(pose);
    if (restNode && restNode.style.opacity !== shownRest) restNode.style.opacity = shownRest;
    const pulled = now.held ? finger.current - now.grab : 0;
    const node = root.current;
    if (node) {
      const value = `${Math.round(pulled)}`;
      if (node.getAttribute("aria-valuenow") !== value) node.setAttribute("aria-valuenow", value);
      const spoken = spokenOf(member.current, pulled, now.held);
      if (node.getAttribute("aria-valuetext") !== spoken) node.setAttribute("aria-valuetext", spoken);
    }
  }, [say]);

  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) / 1000, MOST_DT) : 1 / 60;
      last.current = now;
      const calm = asksForStillness();
      if (script.current) {
        clock.current += dt;
        grip(script.current(clock.current));
      }
      const want = hand.current;
      const follow = calm ? 1 : 1 - Math.exp(-dt / FOLLOW);
      finger.current += (want.finger - finger.current) * follow;
      if (Math.abs(want.finger - finger.current) < 0.02) finger.current = want.finger;
      const goal = want.held ? 0 : 1;
      const drop = calm ? 1 : 1 - Math.exp(-dt / (want.held ? DOWN : UP));
      lift.current += (goal - lift.current) * drop;
      if (Math.abs(goal - lift.current) < 0.002) lift.current = goal;
      const pulled = want.held ? finger.current - want.grab : 0;
      step(member.current, want.held, pulled, dt, calm);
      draw();
      const done = !script.current && settled(member.current, want.held, pulled) && finger.current === want.finger && lift.current === goal;
      frame.current = done ? 0 : requestAnimationFrame(tick);
    };
    frame.current = requestAnimationFrame(tick);
  }, [draw, grip]);

  const steer = React.useCallback(
    (next: Hand) => {
      script.current = null;
      grip(next);
      run();
    },
    [grip, run],
  );

  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();
      stop();
    };
  }, [stop]);

  const engaged = hovering || focused || pressing;

  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 (!visible) {
      script.current = null;
      stop();
      return;
    }
    if (touring && !asksForStillness()) {
      const timer = window.setTimeout(
        () => {
          clock.current = 0;
          script.current = tour;
          run();
        },
        TOUR_FIRST * 1000,
      );
      return () => {
        window.clearTimeout(timer);
        script.current = null;
      };
    }
    script.current = null;
    if (user.current) {
      run();
      return;
    }
    steer({ held: false, grab: hand.current.grab, finger: hovering ? hand.current.finger : PROBE_HOME });
  }, [visible, touring, hovering, run, steer, stop]);

  const xAt = (clientX: number) => {
    const svg = root.current?.querySelector("svg");
    const box = svg?.getBoundingClientRect();
    if (!box || !box.width) return null;
    const sx = ((clientX - box.left) / box.width) * WIDTH;
    const origin = at([0, 0, 0]);
    return (sx - origin[0]) / EX[0];
  };

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

  const hoverTo = (x: number) => steer({ held: false, grab: hand.current.grab, finger: clamp(x, PROBE_MIN, PROBE_MAX) });

  const hold = (on: boolean) => {
    user.current = on;
    setPressing(on);
  };

  const pressAt = (x: number) => {
    hold(true);
    const grab = clamp(x, -GRAB_MOST, GRAB_MOST);
    steer({ held: true, grab, finger: grab });
  };

  const pullTo = (x: number) => steer({ held: true, grab: hand.current.grab, finger: clamp(x, -FINGER_MOST, FINGER_MOST) });

  const release = () => {
    hold(false);
    steer({ held: false, grab: hand.current.grab, finger: hand.current.finger });
  };

  const bind = <K extends keyof Nodes>(key: K) => (node: Nodes[K]) => {
    nodes.current[key] = node;
  };

  const shown = rest.glass;

  return (
    <div
      ref={(node) => {
        root.current = node;
        anchor.current = node;
      }}
      className="ms"
      role="slider"
      tabIndex={0}
      aria-label="Glass button on a test rig: Space presses or lets go, arrow keys move the finger and pull"
      aria-valuemin={-FINGER_MOST - GRAB_MOST}
      aria-valuemax={FINGER_MOST + GRAB_MOST}
      aria-valuenow={0}
      aria-valuetext={RESTING_TEXT}
      data-held={pressing ? "" : undefined}
      onPointerEnter={(event) => {
        if (event.pointerType === "mouse") setHovering(true);
      }}
      onPointerMove={(event) => {
        const x = xAt(event.clientX);
        if (x === null) return;
        if (user.current && event.currentTarget.hasPointerCapture(event.pointerId)) {
          wake();
          pullTo(x);
        } else if (event.pointerType === "mouse" && !user.current) {
          wake();
          hoverTo(x);
        }
      }}
      onPointerDown={(event) => {
        const x = xAt(event.clientX);
        if (x === null) return;
        event.currentTarget.setPointerCapture(event.pointerId);
        wake();
        pressAt(x);
      }}
      onPointerUp={(event) => {
        if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId);
        if (user.current) release();
      }}
      onPointerCancel={() => {
        if (user.current) release();
      }}
      onPointerLeave={(event) => {
        if (event.pointerType !== "mouse" || user.current) return;
        setHovering(false);
        hoverTo(PROBE_HOME);
      }}
      onFocus={() => setFocused(true)}
      onBlur={() => {
        setFocused(false);
        if (user.current) release();
      }}
      onKeyDown={(event) => {
        const now = hand.current;
        const by = event.shiftKey ? NUDGE * 3 : NUDGE;
        if (event.key === " " || event.key === "Enter") {
          event.preventDefault();
          if (event.repeat) return;
          wake();
          if (user.current) release();
          else pressAt(now.finger);
          return;
        }
        let x: number | null = null;
        if (event.key === "ArrowLeft" || event.key === "ArrowDown") x = now.finger - by;
        else if (event.key === "ArrowRight" || event.key === "ArrowUp") x = now.finger + by;
        else if (event.key === "Home") x = -Infinity;
        else if (event.key === "End") x = Infinity;
        else if (event.key === "Escape") {
          if (user.current) release();
          return;
        }
        if (x === null) return;
        event.preventDefault();
        wake();
        if (user.current) pullTo(x);
        else hoverTo(x);
      }}
    >
      <IsoFigure width={WIDTH} height={HEIGHT} label={props.label}>
        {props.base}
        <g>
          <g>
            {props.rail}
            <g ref={bind("rider")} transform={rest.rider}>
              {props.rider}
            </g>
            <g ref={bind("probe")} transform={rest.probe}>
              {props.block}
            </g>
          </g>
        </g>
        {props.frameBack}
        <g>
          <g>
            <path ref={bind("coilsBack")} className="iso-line ms-coil" data-tone="lo" d={rest.coilsBack} />
            {props.rods}
            <path ref={bind("coilsLeft")} className="iso-line ms-coil" data-tone="mid" d={rest.coilsLeft} />
            <g ref={bind("carriage")} transform={rest.carriage}>
              {props.carriage}
            </g>
          </g>
        </g>
        <g>
          <g ref={bind("glass")} className="iso-solid ms-glass">
            <path ref={bind("fill")} className="iso-fill" d={shown.fill} />
            {[0, 1, 2, 3].map((index) => (
              <path
                key={index}
                ref={(node) => {
                  nodes.current.shades[index] = node;
                }}
                className="iso-shade"
                data-shade={index}
                d={shown.shades?.[index] ?? ""}
              />
            ))}
            <path ref={bind("top")} className="iso-top" d={shown.top} />
            <path ref={bind("crease")} className="iso-line" data-tone="lo" d={shown.crease} />
            <path ref={bind("bevel")} className="iso-line iso-bevel" data-tone="lo" d={shown.bevel ?? ""} />
            <path ref={bind("rim")} className="iso-line ms-rim" data-tone="mid" d={shown.rim} />
            <path ref={bind("shine")} className="iso-line ms-shine" data-tone="hi" d={shown.shine} />
            <path ref={bind("edge")} className="iso-line iso-edge" data-tone="hi" d={shown.outline} />
          </g>
        </g>
        <g>
          <g ref={bind("rest")} style={{ opacity: 0 }}>
            {props.rest}
          </g>
        </g>
        <g>
          <g className="iso-wire ms-pull" data-tone="hi">
            <path ref={bind("pull")} className="iso-line" data-tone="lit" d={rest.pull} />
            <circle ref={bind("grab")} className="iso-wire-end" cx={rest.grab[0]} cy={rest.grab[1]} r={1.2} style={{ opacity: 0 }} />
            <circle ref={bind("touch")} className="iso-wire-end" cx={rest.finger[0]} cy={rest.finger[1]} r={1.2} style={{ opacity: 0 }} />
          </g>
        </g>
        <g>
          <path ref={bind("coilsRightBack")} className="iso-line ms-coil" data-tone="mid" d={rest.coilsRightBack} />
        </g>
        <g>
          <g ref={bind("plunger")} transform={rest.carriage}>
            {props.plunger}
          </g>
        </g>
        <g>
          <path ref={bind("coilsRightFront")} className="iso-line ms-coil" data-tone="mid" d={rest.coilsRightFront} />
        </g>
        {props.frameFront}
        <g>
          <g>
            {props.dial}
            <path ref={bind("needle")} className="iso-line ms-needle" data-tone="hi" d={rest.needle} />
          </g>
        </g>
        <g>
          <g ref={bind("tip")} transform={rest.tip}>
            {props.finger}
          </g>
        </g>
        <g>
          <g ref={bind("arm")} transform={rest.probe}>
            {props.arm}
          </g>
        </g>
      </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