Communitygithub.com

explorable-model

Build an explorable explanation - a live model the reader steers with one or two sliders or toggles while linked views show the outcome change - for questions where the answer depends on a choice or an assumption, such as a price, a threshold, a rate, a budget, an error cost, a break-even point or a tradeoff between options. Use when someone wants an interactive "what if" calculator that teaches, a break-even or crossover explainer, a sensitivity visual, or asks to let readers "play with the numbers", "see when it pays off" or "find where the answer flips", from data or a cost model.

¿Qué es explorable-model?

explorable-model is a Claude Code agent skill that build an explorable explanation - a live model the reader steers with one or two sliders or toggles while linked views show the outcome change - for questions where the answer depends on a choice or an assumption, such as a price, a threshold, a rate, a budget, an error cost, a break-even point or a tradeoff between options. Use when someone wants an interactive "what if" calculator that teaches, a break-even or crossover explainer, a sensitivity visual, or asks to let readers "play with the numbers", "see when it pays off" or "find where the answer flips", from data or a cost model.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/k-sandhu/visual-explainer-skills/tree/HEAD/skills/explorable-model

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Explorable model

Some answers are not a number but a rule: "checking pays off when a mistake costs more than X", "stop early when the first two tries agree, unless success is rarer than Y". A table of scenarios states the rule; an explorable lets the reader find it. When the reader drags a price and watches the winner change, the threshold stops being a fact they were told and becomes something they discovered (Bret Victor, "Explorable Explanations", 2011).

Build with explainer-kit (scaffold.py --kind explorable, which is a stepper with a slider row). When the whole explorable is one view and one or two knobs with no setup steps, for example a figure inside an article, use --kind figure instead: the same slider row, no Next or Back.

Design the model before the picture

  1. Write the model as one pure function model(params) → outputs, in plain JavaScript, at the top of the scene. Every number and every mark is computed from its output. If the drawing and the caption ever disagree, the model is not the single source.
  2. Separate measured inputs from assumptions. Measured: counts and rates from the data (with the file they come from). Assumed: prices, costs of a mistake, volumes. The reader may move assumptions; measured inputs stay fixed unless the point is sensitivity to them, and then show their uncertainty.
  3. Choose one or two knobs. The ones that flip the answer. Five sliders is a spreadsheet, not an explanation. Hide the rest as fixed values listed in a small note.
  4. Find the flip. Solve for the threshold in code (break-even, crossover, where the best option changes). It becomes a labelled marker the reader can see coming as they drag.

Layout: knob, outcome, and a concrete view

Use linked views so the reader sees both the rule and the things it is about:

  • Outcome chart (top): outcome against the knob for every option, e.g. cost per item against price, one line per option. A vertical marker at the knob's current value; the winning line drawn thicker; the crossover marked with its value ("break-even 42 cents").
  • Concrete view (middle): the items themselves at the current setting, e.g. 200 orders as dots coloured by where each one went, or a stacked bar of where the money goes. This answers "what does this mean for my 200 orders?"
  • The reader's units. State the outcome the way the audience budgets it: dollars per month at a volume they can type in, hours per week, errors per thousand. A per-item cost in fractions of a cent, or a share on a log scale, is correct but makes a finance reader do arithmetic before they can decide.
  • Verdict line (caption or a big number): "At 30 cents per review, checking every order by hand is cheapest." Update the words, not just the picture.
  • Knob (action row, K.slider in s.act, set actHeight: 76): label with units, readable value, sensible step, a tick or note at the measured or typical value.

Steps

  1. The decision - the options and what each costs or risks, at one fixed sensible setting. No knob yet.
  2. What moves the answer - show the knob moving by itself (demo sweeping the slider) while the lines and dots respond; pause at the flip and label it.
  3. Your turn - the reader drags; the verdict updates live. Optionally a second knob or a toggle for an assumption (cost of a mistake).
  4. Where we really are - jump to the measured or realistic setting and state the conclusion, with the caveat about the assumptions.

Every step with a slider has demo() that sweeps it and idleDemo so GIFs and passive readers see the response.

Make it responsive and readable

  • Format each number once: one function turns the knob's value into text, and the slider readout, the verdict sentence and the chart label all call it. Two roundings of the same value ("14.1 cents" beside "At 14.0 cents") make readers distrust everything else.
  • Recompute and redraw on every input event; keep it under 16 ms (no heavy work, no layout thrash).
  • Move marks with short transitions (150 ms) or directly; long easing while dragging feels laggy.
  • Use one axis per chart. Two measures of different units get two charts, not a dual axis.
  • Log scale when the knob spans orders of magnitude (prices from 0.1 cent to 100 cents), and say "log scale".
  • Label lines directly at their right end; keep a legend too when there are more than two.

Example: when to stop repeating a task (illustrative numbers)

A team collects several attempts per task to train a model, and wants to stop after two attempts when they agree. Knob: the model's success rate p on a task (0 to 1). Model: probability that two attempts agree = p² + (1-p)²; probability that four attempts would have shown both outcomes = 1 - p⁴ - (1-p)⁴. Outcome chart: "groups that would have taught something" with and without early stopping, against p. Concrete view: 100 task groups as small rows of four dots, greyed when stopped early. Flip: the p at which early stopping throws away more useful groups than it saves calls. Verdict line updates with p.

Honesty

  • Label assumed values as assumptions on screen, next to the control that changes them.
  • Do not let the slider range suggest values the data rules out; mark the measured value.
  • If the data has uncertainty (a small sample), draw the outcome as a band, or say the threshold is approximate and why.

Individual skills in this repo

This repo contains 5 individual skills — each has its own dedicated page.

explainer-director

Plan an animated or interactive explainer before building it. Finds the one message, picks the form that teaches it best (step-by-step lesson, replay of a real system run, explorable what-if, every-item-is-a-dot chart, or guess-then-reveal), and writes a storyboard with one idea per step. Use this first whenever someone asks to visualize, animate, explain visually, make an interactive, a GIF, a LinkedIn visual, a Khan Academy style lesson, or "something engaging" from data, an experiment, a process, an agent or a system, even if they do not name a form. Then hand off to the matching skill (stepper-lesson, system-replay, explorable-model, unit-story, predict-reveal) and build with explainer-kit.

explainer-kit

Engine, styles (four built-in looks or a custom theme with the user's own brand colours and fonts) and quality checks for animated and interactive SVG explainers delivered as one self-contained HTML file (artifact page, claude.ai widget, or GIF/MP4). Provides a scaffold script, a small JavaScript engine (hand-drawn shapes, draw-in reveals, travelling dots, step lessons with fixed controls, a scrubbable timeline player, standalone one-view figures, unit-chart motion, sliders), a render check that walks every step at phone and desktop widths and flags overlaps, moving controls and errors, and a recorder that turns the explainer into MP4 and GIF. Use it whenever you build any animated diagram, step-by-step lesson, interactive explainer or explainer GIF, together with the form skill chosen by explainer-director.

stepper-lesson

Build a Khan Academy style step-by-step animated lesson that teaches one idea per step, with a Next button, short captions, and one or two steps the reader plays (tap, toggle, mini-game). Use when someone wants to teach how something works or why something changed to a newcomer - a concept, a mechanism, a rule, a workflow, a security trick, a statistics idea - as an interactive explainer, a "lesson", a walkthrough, or a GIF for social media. Pairs with explainer-director (plan) and explainer-kit (engine and checks).

system-replay

Build an animated replay of how a system runs - AI agents and subagents, an agent harness with tools and guardrails, a data pipeline, an API request path, a queue, a protocol - from recorded logs or traces (timestamps, spans, events) or from a designed demonstration run. Shows actors, calls travelling between them, waiting and blocking, hidden state like a context window or budget, and a live event log, on a timeline the reader can pause and scrub. Use when someone wants to visualize an agent trace, show who waited for whom, compare coordination patterns, explain how a harness or architecture works in motion, or turn run logs into an animation or GIF.

unit-story

Build an animated unit visualization where every item is its own mark - each test question, request, invoice, user or sample is a dot - and the dots move between arrangements (one pile, split by model, coloured by outcome, sorted) to tell a story about counts, composition and uncertainty. Includes showing small-sample uncertainty honestly with intervals and hypothetical outcome animations. Use when someone wants to visualize evaluation or benchmark results per item, compare models on a test set, show how many of N failed, explain why "0 out of N" or a small sample does not prove much, or make results tangible for a LinkedIn post, slide or README.

Skills relacionados