/storybook-workbench:sb-flowsfrom Storybook Workbench
Maps app routes, navigation edges, and persistent nav chrome (sidebar/header/footer) into a flow graph. Detects under-extraction and traces deep edges through stores and services.
Ships in Storybook Workbench. 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.
A route list can't prove coverage; a flow graph needs edges and persistent nav sources
(sidebar/header/footer link from every screen and are invisible to a page-body sweep — the #1
audit miss). Load references/flow-capture.md before mapping.
SKILL=${CLAUDE_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}
CORE=${CLAUDE_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}
"$SKILL/scripts/extract-flows.sh" # 1. generic first pass → .storybook/flows.json (routes + edges + navSources)
"$CORE/scripts/scaffold-wrapper.sh" --flow # 2. AppFlowGraph + JourneyGraph (+ icons.tsx)
# 3. The app-graph the wrappers actually render (edges with ACTION labels, deep store/service
# tracing, role lanes, component lists). Copy the reference template, ADAPT its 3 marked blocks
# to this repo's router/nav/role-gate, then run it. It writes app-graph.json + component-pages.json.
cp "$SKILL/templates/extract-app-graph.mjs" .storybook/scripts/extract-app-graph.mjs # then edit ADAPT-1/2/3
node .storybook/scripts/extract-app-graph.mjs
Act on the sweep reminder the extractor prints when nav chrome exists. And if it prints
⚠ LIKELY UNDER-EXTRACTION, treat flows.json as a draft — the app navigates via an idiom
the script doesn't parse yet (the nanostores-class miss). Don't trust edgeCount: read the
unmatched call sites it lists, recover the real edges (a repo-local source-aware resolver beats more
regex), and fold general idioms back into extract-flows.sh. Full loop: references/flow-capture.md
→ "When extraction under-reports."
Deep edges (don't stop at the shallow pass). A nav fired from a store/service action (or a
deeply-nested feature component) has no screen of its own — its real origin is whoever calls it.
The template's moduleOrigins traces that re-export-aware (it follows barrels: a service
re-exported through a store is found via the store's import token), up the import graph to the routed
pages. This recovered real switchToHotel → scheduler edges that the shallow pass dropped. Verify in
references/flow-capture.md → "Deep-edge tracing".
VALIDATE — never hallucinate an empty edge. The contract: every edge has file:line provenance;
anything unattributable is recorded in unresolvedEdges/dynamicCallSites, not invented. After
running, check node -e the JSON: unresolvedEdges should be small and each reason honest (a 404
with no route, a genuinely dynamic dispatch), and spot-check a couple of module-trace edges against
the source. See references/flow-capture.md → "Validate the graph."
<AppFlowGraph graph={...}> — whole-app route map: role swimlanes, typed/colored edges,
coverage colouring, click-to-story. Feed an AppGraph derived from flows.json.<JourneyGraph journey={...}> — one flow's journey map (the Flows/* Docs index); each step
links to its per-state story by storyId. Ships a collapsed "how to add a flow" authoring hint by
default (suppress with hideAuthoringHint); the "what is this?" provenance banner is on by
default (a flow map is a report) — setProvenance(false) / __SB_WB_PROVENANCE__ = false hides it
everywhere, and hideIntro hard-suppresses it on one map. The
journey is a CURATED narrative — one persona's path across the captured graph — not a field in
flows.json (which holds the route nodes + edges AppFlowGraph draws).icons prop (pass lucide/project icons) — no emoji (CONTEXT.md
§wrapper-view-design).var(--color-foreground|surface|border-subtle|muted-foreground, <fallback>), so one .dark
flip re-skins the whole map light↔dark and the fallback keeps it rendering in a token-less app.
Only the data encodings stay literal — coverage dots and the per-EdgeKind hues are categorical,
not chrome. Don't replace the var() chrome with hardcoded colors.flows.json.navSources[], not just page bodies.flows.json.edges[].flows.json gives each route an
access (public/user/admin, a path heuristic) + roleSignals[] (the real guards). Verify access
against the guards, lay the graph out in role lanes (node.role = route.access), and audit the
crossings: can an anon reach a user route? a user reach an admin route? See flow-capture.md
→ "Step — explore roles."layout: 'fullscreen' + a desktop viewport AND a mobile
view; never the narrow centered canvas. Each documented state = its own full-width story.N · label, linked by storyId (see flow-capture.md).Append a finding, then sb-stories for each screen's states, or sb-audit to check coverage.
CONTEXT.md (opens in a new tab)agents/openai.yaml (opens in a new tab)decorators/withLayoutFrame.tsx (opens in a new tab)references/flow-capture.md (opens in a new tab)scripts/extract-flows.sh (opens in a new tab)scripts/scaffold-wrapper.sh (opens in a new tab)templates/extract-app-graph.mjs (opens in a new tab)wrappers/AppFlowGraph.tsx (opens in a new tab)wrappers/JourneyGraph.tsx (opens in a new tab)wrappers/ReportIntro.tsx (opens in a new tab)wrappers/icons.tsx (opens in a new tab)wrappers/resolve-paint.ts (opens in a new tab)wrappers/usage-index.tsx (opens in a new tab)wrappers/usage-stamp.tsx (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub strongeron/storybook-workbench --plugin storybook-workbench11 skills in this plugin
/sb-auditPeriodic Storybook audit — naming-drift survey, archived/decision-board review, lifecycle tagging, usage refresh. Use for 'audit my Storybook', 'find drift', 'show pending decisions', or a periodic catalog health check./sb-exploreIterate on a new or redesigned component in a sandboxed Explore story outside src/components/ (+ Figma), checked against a graduation gate. Use for 'prototype this', 'try a v2', 'explore from Figma', or net-new UI not ready to ship./sb-figmaThe Figma↔Storybook bridge, both directions, via the native Figma MCP. design→code: map foundation tokens (color/spacing/type) from Figma variables with design↔code parity + drift, and deliver approved Figma components (extract → build → embed), authoring stories via sb-stories' rules. code→design: build Code Connect mappings from components + stories + token parity + usage so Figma Dev Mode shows the real code. Use for 'sync my Figma tokens', 'map Figma variables to my design system', 'deliver this approved Figma design', 'check design↔code token parity', 'connect my components to Figma / code connect'. NOT for prototyping/iterating an undecided design (that's sb-explore)./sb-healthCheck design-system health for a React+Vite app — raw hex, undefined/unused tokens, scale gaps, DESIGN.md drift, and (opt-in) property→token-family misuse. Use for 'is my design system healthy', 'find raw colors', 'check tokens', or a mixed design system./sb-hubHub for the Storybook CSF3 bundle — diagnose a repo, orchestrate the audit→stories pipeline, or name the next sb-* step. Use for 'set up Storybook', 'audit my app', 'where do I start', 'what's next'./sb-inventoryAudit a React+Vite app for real-vs-slop components (by actual imports), the dominant design system, and real prop-value usage at call sites. Use for 'what components do I have', 'which are dead', 'audit this vibe-coded app'.Other plugins' skills for the same job