storybook-chromatic-builder

storybook-chromatic-builder is a cursor rule for Cursor from jrpease/throughline. It costs 108 tokens per session (5,006 once invoked), scanned A, original, MIT.

A setup guide for Storybook, a tool that displays interface components in isolation, plus Chromatic, a service that compares screenshots to detect visual changes. It is designed for a monorepo, a repository containing multiple related packages, and can connect Figma designs to code when supported.

In plain words
What is it for?
Use it to create a component library in a UI package, generate stories, configure visual regression checks with Chromatic, and optionally connect Figma components with their code versions.
Why use it?
It helps teams build components against shared design tokens, document each component with stories, and notice accidental visual changes. It also lists the project files and design inputs required before setup.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions subagents.

Good fit Use it to create a component library in a UI package, generate stories, configure visual regression checks with Chromatic, and optionally connect Figma components with their code versions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/jrpease/throughline/storybook-chromatic-builder
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/jrpease/throughline

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for storybook-chromatic-builder

README.md
[![agentmods](https://agentmods.dev/badge/rules/jrpease/throughline/storybook-chromatic-builder/github.svg)](https://agentmods.dev/rules/jrpease/throughline/storybook-chromatic-builder)
Your own site
<a href="https://agentmods.dev/rules/jrpease/throughline/storybook-chromatic-builder"><img src="https://agentmods.dev/badge/rules/jrpease/throughline/storybook-chromatic-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for storybook-chromatic-builder

Your own site · 80×15
<a href="https://agentmods.dev/rules/jrpease/throughline/storybook-chromatic-builder"><img src="https://agentmods.dev/badge/rules/jrpease/throughline/storybook-chromatic-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,006 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.05006
Opus 5 $0.00054 $0.02503
Sonnet 5 $0.00022 $0.01001
Haiku 4.5 $0.00011 $0.00501

Measured 5d ago against content hash 01d07edf85b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

storybook-chromatic-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

adapters/cursor/.cursor/rules/storybook-chromatic-builder.mdc · 357 lines

How it starts

The opening of the file, as written. The whole thing — 357 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Storybook + Chromatic builder

Builds the code half of the component library: real components consuming the synced tokens, stories documenting them, Chromatic for visual regression, and Code Connect tying Figma to code when available.

Calibrate + prerequisites

Read user.codingLevel (.throughline/references/coding-level.md) and scale explanation. This skill needs:

  • A repo with the monorepo scaffold (repository-builder, at least local-git). Offer to run it if missing.
  • Synced tokens in packages/tokens (token-sync-layer) so components consume real token files. Offer to run sync if missing.
  • Figma components (components.built) with their slot contracts, so stories reflect the real component APIs.

Strongly recommend github stage so Chromatic's CI integration works; it can be set up locally first and wired to CI when the remote exists.

Step 1 — Stand up Storybook

Initialize Storybook in packages/ui (or the components package), configured for the framework the tokens were synced for (e.g. React + Vite for a shadcn/Tailwind system). Wire it to consume packages/tokens output so stories render with the real design tokens (import the generated CSS/theme). Checkpoint: confirm Storybook runs and shows the token-themed canvas.

Install the documentation scripts alongside the token scripts: copy the seven files and register the four npm scripts listed under Documentation scripts — install as a set in .throughline/scripts/README.md. adherence:check needs the repo's own values substituted in — the UI package's specifier for --package, and paths for --root/--system that match this repo's layout; registering it with the table's placeholders leaves a script that cannot run. That table is the single source of truth for what a consuming repo gets; do not restate the list here.

These are the documentation analog of tokens:validate; see .throughline/scripts/README.md. This copy is setup, not a forever-fork: /document-component re-checks these files' freshness on every run and refreshes them from the plugin when it has moved on.

Read the full file on GitHub · 357 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed · +3 lines 01d07edf85b6
  2. 9d ago First seen · 354 lines · 108 tokens per session scan A 7946ad75118e

Subscribe to this mod's changes

storybook-chromatic-builder is a cursor rule published in the GitHub repository jrpease/throughline (76 stars, last pushed 8d ago), licensed MIT. It adds 108 tokens to every session and 5,006 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.