/pauls-skills:ops-figuresfrom pauls-skills
Build an on-brand Orono (OPS) interactive figure of an everyday object or machine (3D printer, washing machine, toaster, pump, lock, bike gear) as one self-contained HTML page for teaching, hand-inked in OPS colors with working buttons, captions, a Take apart view and a Present mode. Use whenever someone wants a "how does X work" figure, an interactive diagram or model of a machine or process for a class, PD session or staff training, or an "OPS figure" or "Colorfigure", even if they don't name the skill. For a photo of a textbook figure use figure-to-3d.
Ships in pauls-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Hand-inked isometric objects you can play with, in the Orono Technology brand and built for teaching. Each figure is
one HTML page: a small engine (assets/core.js) plus your figure script, which models the object in 3D and draws it
with the engine's shapes. The engine owns the look (OPS Blue Dark ink, flat light/mid/dark shading, a pale blue cast
shadow, Lexend and Roboto) and the teaching layer (caption, labels, Predict, Walk through, Present mode). You own the
object and its real process.
Based on Colorfigures by April Zhu (MIT); see README.md.
One fixed view (front, left side and top toward the viewer) and one fixed light. There is no turning and no light control. Don't add them.
The same figure serves two audiences. Read the request:
Ask only when the request truly could be either. Never write "students will…" or "teachers can…" on the page itself.
assets/core.js into the working folder next to your figure (the page loads it with
<script src="core.js"> while you work).assets/examples/printer.html: the how-it-works reference. Labels, Predict questions, caption per phase,
stats, a desk board, a feed tube, a part that grows layer by layer, and the real process written out at the top.assets/examples/headphones.html: the pacing reference. Captions kept in one CAP object, every phase
timed from READ_S of its caption, a see-through cover onto the parts inside, radio waves and sound drawn as
motion, a phone screen with text lying flat (txZ).assets/examples/washer.html: a rounded body made with extrude, a door, a drawer, a drum seen through glass,
timed animation, a picker in the walk-through.assets/examples/vending.html: products behind glass, clipping, a picker with disabled choices, stats.core.js: its helpers are short and commented, and the mountFigure({...}) options are listed just above that
function.
The washer and vending examples also contain code for drawing the back and the other side (facing, boxV,
txBack): that was for turning, which this skill doesn't do. You only need what is visible from the front view.figure.html (name it after the object): a doctype/head shell, <script src="core.js"></script>, then
one inline <script> that defines the geometry and calls mountFigure({...}).python "<skill folder>/scripts/build.py" figure.html OUT.html inlines the engine, so
OUT.html runs on its own (python3 on Mac/Linux).A built figure is one self-contained HTML file of roughly 60–80k characters, which fits a SpartBoard mini-app
(limit 120k). After handing over the file, offer once: "Want it on SpartBoard as a mini-app?" On a yes, follow the
spartboard skill's mini-app flow: call get_mini_app_spec first and do what it says, show the figure as an
artifact for the teacher to try, and save that exact HTML with create_mini_app when they say to. A figure doesn't
collect results, so don't set collects_results. If the build is over 120k characters, build again with
--strip-comments (drops the scripts' comments and blank lines, about a fifth smaller); if it's still over, say so
and leave it as a file.
Every figure gets a caption. Labels, Predict and Walk through depend on the request.
caption: st => 'one plain sentence' is shown under the figure and read out to screen readers. It says what is
happening right now and, when the figure is waiting, what to do next: "Water flows in through the soap drawer and
fills the drum." / "The plastic is hard now. Take the cup off the bed." Write it from state, one sentence per phase of
the real process. Sentence case, full sentences, no ALL CAPS, no emoji. Two short sentences at most.
Keep it to one or two lines. Aim for about 90 characters or fewer, which is two lines on a phone; never go past about 130 (four lines on a phone). A short caption gets read. A long one gets skimmed while the eye goes back to the figure. On a phone the caption box has room for three lines; a longer caption makes the box taller for that step and moves the figure up.
Give every caption time to be read. A caption the figure replaces on its own (the next phase of an animation)
must stay up at least READ_S(caption) seconds: about 3 words a second plus one, never under 3 s. A 12-word caption
needs 5 s. Pace the animation to the captions, not the other way round: the motion itself can be quick, and the
phase then holds until its caption has been read. Keep the caption strings in one CAP object and work out when each
phase ends from them (headphones.html does this with a small ends([...]) helper), so a caption you reword
re-times its own phase. Shorter sentences make a faster figure; cut words before you cut time. The engine records any
caption replaced too early on <html data-errors>, so the verification run catches it.
Earlier captions are never lost: the engine lists the current step's earlier captions above the current one, in a caption box of fixed height (a press that changes the state starts a new step and clears the list). The box reads like a wheel: the current caption sits on a white band at the front, each earlier one tilts back and fades, and a new one rolls in from below. It scrolls with the mouse wheel or a swipe, with no visible scroll bar. A caption that only differs by a number ("Layer 3 of 24" → "Layer 4 of 24") updates in place and counts as the same caption. On a phone the box sits under the figure, right above the buttons and Next, so it is on the way to the next tap; the current caption is never faded or cut, and only the earlier ones fade towards the top. Present on a big screen keeps the box above the figure.
tag([x,y,z], dx, dy, 'TEXT', on): a white pill with a leader line to that
3D point. Pass on = true while that part is doing its job (it turns OPS Red Light): HEATER while heating, FLOAT
while the tank fills. 3–6 short labels (one or two words, capitals).dx, dy (where the pill sits) are in screen units at the reference zoom; aim the pills outward into empty space.
Present mode draws them 1.35× larger, so leave room.?labels=0 starts with them off.On the same trigger as labels, give each key step's button a predict question. Before that button's first press the
page shows Predict with the question and a Show me button in the caption box; the step runs on Show me. Write questions that make
someone think about the mechanism, not recall a fact: "The nozzle only ever moves in a flat circle. How will the cup
get taller?" One question per key step (3–5 in a figure), none on trivial steps (closing a door, collecting a can).
Don't put the answer in the question; the caption that follows is the answer. A Predict first switch appears
automatically; it starts off, so a teacher turns it on when they want the questions (?predict=1 opens with it on). A press that changes nothing (an out-of-order press that only flashes
why) doesn't use up its question.
A figure of a real object or machine (a microscope, a washing machine, a kettle, a lock) always gets a Take
apart view: an exploded view that shows the hidden parts and the order something travels through them. A figure that
stands for an idea (the context window, the word machine) doesn't: there are no real parts to take apart. Pass
apart:{…} to mountFigure (the full shape is in the comment above it in core.js; gallery/figures/microscope.html
is the reference) and the engine does the rest: a Take apart button at the end of the row (it reads Put
together while apart), the last Walk through step, the slide out and back, labels on every part (even with the Labels
switch off; the figure's other labels hide), a dashed red line with arrows through the parts in order, and "Put it
back together first" from any button that would move a part.
flow): light, water, filament, coins, a radio
signal. The view teaches that path, not a parts list.path:false. Draw hidden parts that aren't in the figure yet (a pump, a coin checker) in the
same style; they appear only once it starts coming apart, fading in (the microscope's inside()).exOff(st, to) / exAt(st, p, to) (or your own geometry eased by
exK(st)), far enough to separate and no farther. size must hold the apart pose too, or set apart.zoom (.7)
to shrink the view as it comes apart. Use apart.path(st) when the line must bend between parts.allow:
the light still shines through the separated lenses, water still runs through the hoses. Everything else is
refused until it's put back together. ready(st) can refuse to come apart while a part is mid-move.caption: st => …, two lines at most): name the path in order and what is flowing now: "Light goes
lamp, iris, condenser, slide, objective, prism, eyepiece." The coming-apart caption already says "This is called an
exploded view." Give it a predict question about what's inside ("What makes the drum turn?").tag offset so no two pills overlap in any pose, on a phone too. on: st => … turns a
part's pill red while the flow is passing through it.On from the start (a switch turns it off; ?steps=0 opens without it): Back / Step 2 of 5 / Next: Add soap. Next
runs the real button for the next step (asking its Predict question first if that's on). Next never makes anyone wait:
pressed while a step is still running, it finishes that step at once and goes straight on to the next one. → and ←
(and a clicker's Page Down / Page Up) press Next and Back. Back restores the state saved before that step; the last
Next becomes Start over. The free buttons keep working alongside. By default the steps are
every button without a picker, in order. Pass walk: ['Load', 'Program>Quick', 'Start'] (the ?press= syntax) when
the real sequence needs a picker choice, a repeated press (three coins) or skips a button. For Walk through to work:
state plain JSON (numbers, strings, booleans, arrays, plain objects; no Maps, functions or DOM),ui.animate, and every delayed change through ui.after(sec, fn), never setTimeout,
so Next can finish a step and Back can cancel it. A setTimeout is fine only for something purely cosmetic (a key
flashing for 160 ms).dt that ui.animate passes in, never by performance.now() or Date.now(): the Speed setting
scales dt, and Next's skip runs the step with large steps of it all at once.Every figure opens in Present (a switch turns it off; ?present=0 opens the normal layout). It lays the page out for
projecting, where the top of the screen is the easiest
place to read from the back of a classroom:
ui.flash note pops up above
the button that was pressed. The row stays on one line: its text shrinks from 18px toward 12px until it fits
beside the longest Next label, and it only wraps if even 12px can't fit.?touch=1 tests
the touch controls with a mouse.The switches fold away. Nothing to do in the figure except leave room around labels, and keep button labels short (two or three words) so the row stays readable.
The switch row (wobble, starting low; Speed, ¼× to 3× for every animation, also ?speed=2; colour; Labels; Predict
first; Walk through; Present) has a Hide settings button at its
end; folded, only a small Settings button is left at the bottom right, and the figure gets the space. Present mode
folds it on its own, and ?settings=0 starts folded. Walk through's Back / Next bar (Present's button row) is not
part of it and stays.
The page always fits the window or the SpartBoard frame without scrolling. The header, buttons, caption box and
switches stay on screen, and the figure scales to the height that's left (up to 1280px wide). The caption box has a
fixed height (on a phone, room for three lines), so the figure doesn't jump when the caption changes or a Predict
question shows. Only a window too short
to leave the figure 240px scrolls. Nothing to do in the figure, but don't add page elements of your own around
mountFigure: they would push the figure down.
x = depth (the front face is at x = W, facing viewer-right), y = width (+y goes viewer-left), z = up.
Ground at z = 0. The viewer looks from (+1,+1,+1).+x (front, lit), +y (left side, in shade), +z (top).m = {l, m, d} (light / mid / dark), shaded with tone(normal, m). Every figure
starts in blue; the swatches switch to the other OPS families, red, gray (charcoal) and white, and ?pal=red
opens in one. Design the shading so the object reads well in all four. Small props and interiors
use toneI. Other materials stay realistic: METAL, CLEAR, CERAMIC, DARK, or matOf('#hex').INK). The cast shadow (SHADOW) is a pale Blue Light tint. ACCENT (Red Light) is for
a label on a working part; don't use it for anything else.tx(...) / txY(...) print in Lexend. Pass FONT_MONO as the last argument for things
that really are screens or LCDs (#1d2a26 panel with #8af0ae text). On a white or light body print in INK.
Plain letters and digits only; emoji and symbols render as blobs. Don't print the Orono logo or recreate it in shapes.#43c25c = on/ready, red #e2483d = stop/locked. Glass: #cfe9f0 at
low opacity + 1–2 white streaks at ~.38 opacity.rrUV(...) profile in the (y, z) plane swept along x with
extrude(profile, x0, x1, m). That gives the banded rounded edges. extrude draws only the swept sides: draw the
front cap (shape(on(PX(x1), profile), m.l, 2.2)) and the silhouette ink yourself, as washer.html does.
extrude/loft decide which way a strip faces from the shape's centre, so they only work for convex profiles:
split a C- or L-shaped part (a handle, a bracket) into convex pieces. Round things: cyl (upright), cylX
(pointing out of the front), rod(a, b, r, m) (between any two points, at any angle: arms, rods, handles, an axle;
pass a second radius for a cone), loft between rings (on(PZ(z), ellUV(...))) for cones, cups, bottles, domes.hullInk(points, ~2.8) drawn after the body; front-panel outline ~2.2; openings
1.6–1.8; details 0.8–1.4. Always draw through pd() on 3D points (screen-space strokes), no SVG transforms except
text. pd(pts) closes the path; use pd(pts, false) (or line(...)) for an open line such as a rim arc. Every
stroke-width="N" in the scene is rescaled with the zoom; for a stroke that is really a shape (a cable, a tube) use
style="stroke-width:…" as printer.html does.board(x0, y0, x1, y1, h, r, BOARD | WOOD | m) drawn first, a little bigger than the object's
footprint plus anything that ends up beside it. Either stand everything on z = h, or (as printer.html does) keep
the object at z = 0 and draw the board with OY += h around it. Big floor-standing machines (a washer, a vending
machine) stand on the paper instead.castShadow(points, z0, clip) with the object's outline points at the bottom and the top,
z0 = the surface it falls on, and on a board clip it to the board top. Shadows are short and must stay connected
to the object: see Tall things below.byDepth.<g opacity=".45">.smooth3 and a stroked path (washer.html tube, printer.html feedTube). To show
something travelling along a tube, stroke the same path with pathLength="1" and stroke-dasharray="t 2".size must cover the largest pose (an arm stretched up, a gantry at its highest, the finished part beside the
machine).clipTo(openingPoints3D, ...): back wall → side/floor surfaces →
contents, sorted so items with larger x+y+z draw later (byDepth([{at:[x,y,z], svg}, ...]))pointer-events="none" so clicks reach the contents)<path d="${outer}${hole1}${hole2}" fill-rule="evenodd">extrude(...)), then side-face details (vents, decals)tag) lastAn open frame (a printer, a shelf, scaffolding) has no single body: order its members by hand. Far post, then what
sits between the posts low down (the bed), then the near post, then what is higher or nearer (top bar, gantry, head),
then anything drawn over everything (a tube). Write the order as numbered comments, as printer.html does.
printer.html starts this way). Each button is one real step, and
things only move along their real path: nothing appears somewhere it couldn't get to, and no container is skipped.
Check the real order (a printer heats before loading filament, because cold plastic won't go through the nozzle).
Check every stage's screenshot against that list, not just that the button "did something".buttons are the interface: every important action has one, in the
order a person would use them ({label, onClick(st, ui), predict?}, or {label, choices: st => [...]} for a
picker). Parts wrapped in act('name', svg) respond on press and are handled in acts (the scene is redrawn every
animation frame, which would swallow a normal click). Don't add your own click listeners to drawn parts; if you
need one, use pointerdown. In a picker, mark the option in use with current: true and an option that can't be
chosen right now with disabled: true, why: 'the program is locked while it runs'. Never leave a control that
silently ignores a press.<g opacity> driven by state as it travels to the
work, then out on the way back. Make room before it arrives (step the neighbours back a slot so it drops into a
real gap, not through a block), and draw it at its depth: inside the loop over the things it sits between, not
after all of them.ui.flash('Heat up first: the plastic has to melt') (a short note under the buttons, sentence case) or on the object
itself (a display, a light). stats (big numbers top right) suit a measured quantity: credit, temperature, litres,
layer.ui.animate(dt => { ...; return stillRunning; }), eased. Movement can be quick, but each phase lasts
at least READ_S of its caption (see Caption), so a step with three captions runs ~15 s and a whole print or wash
~25–30 s. One state object is the one source of truth, and a
press during an animation either waits ("Wait for the printer to finish this step") or is safe.params(st, q): read URL params for every interesting state (?hot=1&prog=0.5) so a screenshot can show it.size ([W, D, H] = the true bounding box, including things that stick out, a lifted part
at its highest, and anything set down beside the object). The cast shadow may spill outside.inkScale(...).(x,y,z) inside appears on the front plane x = W at y' = y + (W − x),
z' = z + (W − x). Only things whose (y', z') land inside the opening are visible.hullInk over several parts draws false straight lines across
gaps. Ink each part's hull separately, before whatever covers its far side.-r·cos a and the head by r·sin a), so the parts meet where they should.P(...centre); shade with a light offset circle and a small highlight.tx(...) on the front, txY(...) on the side (≥ ~2 units or it smears under the wobble). On a curved surface
only put text where the surface faces the viewer, with txM(P(...), Dv(tangent), Dv(0,0,-1)). hint shows in the
header: keep it to one short line, lower case, comma-separated actions.core.js owns these global names. Never declare them in a figure (a clash blanks the page; short names like
S, C, L, SH, f are the usual trap): PALS METAL CLEAR CERAMIC DARK INK SHADOW ACCENT FONT_HEAD FONT_BODY FONT_MONO FONTS_URL C S OX OY VIEW RC VIEW_NAMES TURNS rotV rotXY P0 P Dv depthOf byDepth f pd sp arcUV rrUV rectUV ellUV PX PY PZ on sub dot cross norm avg vis facing SHADOW_K AZ_MIN AZ_MAX SHADOW_LEN L SH setLight LIN tone toneI mix matOf ease ink fill face shape line loft hull hullInk box extrude cyl cylX rod txM tx txY castShadow BOARD WOOD boardTop board act TAG_K tag clipTo READ_S INK_REF_VB INK_K inkScale CORE_CSS filterFor mountFigure. Prefix your own short
names (lampS, armL).size is the envelope the frame is fitted to: the object plus what really moves, no more.Render with headless Chrome over file://; each run needs its own --user-data-dir if you run several at once.
Windows (Git Bash):
"/c/Program Files/Google/Chrome/Application/chrome.exe" --headless=new --hide-scrollbars \
--user-data-dir="$TEMP/shot-profile" --force-device-scale-factor=1.5 --window-size=820,900 \
--virtual-time-budget=3000 --screenshot="$PWD/out.png" "file:///$PWD/figure.html"
Mac: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; Linux: google-chrome or chromium.
Each round is just:
?present=0 for the normal layout.?press= run of the main sequence (the buttons in the order a person would use them), shot at two or three
budgets, e.g. figure.html?press=Heat@200,Load@3600,Print@6400 at 2000, 7000, 12000 ms. ?press= clicks buttons
by the start of their label; Label>Choice picks from a picker; a Predict question that comes up is answered with
Show me. Add one out-of-order press (a later step first) to see it answers sensibly.?press=Next@300,Next@30300,Next@60300,…, spaces the Nexts wider than the longest step, counting any overflow
handling it can set off: a Next that lands early skips the rest of its step, and the caption timing is only checked
on steps that run to the end. The quick run, ?press=Next@300,Next@700,Next@1100,…, skips every step and must end
in the same state. After each, check that it reads "Step N of N" with the final caption you expect. The caption should match
each step, and a Back press should return to the state before the last step.--window-size=1366,650, a Chromebook):
labels must still clear each other and the moving parts, nothing should need scrolling, and the button row must
be one line at a readable size (if it shrank to 12px, shorten the button labels). Then one phone shot:
Headless Chrome won't make a window narrower than 500px, so shoot a page holding the figure in a 390×844 iframe
(figure.html?touch=1) and check the stats corner and the labels stay clear of each other.?press=Take apart@300, at a budget past its caption),
apart with the flow running, and on the phone: every part separate and readable, no labels overlapping, the
dashed line running the way the flow goes, nothing off the edge.--dump-dom and check <html data-errors="…"> (script errors, unknown
labels, unknown walk steps and captions replaced before READ_S land there; the full Walk through run above is the
one to check), grep for NaN, and read the caption text.Fix what you find, do the second round only if the first found something, then build and hand over. The figure's
state is window.__st if you need to read it.
LICENSE (opens in a new tab)README.md (opens in a new tab)assets/core.js (opens in a new tab)assets/examples/headphones.html (opens in a new tab)assets/examples/printer.html (opens in a new tab)assets/examples/vending.html (opens in a new tab)assets/examples/washer.html (opens in a new tab)scripts/build.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ops-pivers/claude-skills --plugin pauls-skills41 skills in this plugin
/aim-higherTake a task, research how top practitioners in its field work, push it to go deeper across altitude, depth, range and verification, grill the user until the plan is settled, then do the work and prove it worked with real measurements./animateBuild an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations./Other plugins' skills for the same job