visualize-ui-states
Skill0 starsChanged 5 days agoMITView on GitHub
Build or refine a standalone, screenshot-based flowchart of an app’s reachable UI states. Use for requests to map screens and transitions, consolidate duplicate screenshots, group data variants, or improve React Flow layout and arrow routing.
In this repository11 other files it gives its agents.
- babysitSkill
- dashboard-uiSkill
- lab-notebookSkill
- oliverspec-applySkill
- oliverspec-babysitSkill
- oliverspec-exploreSkill
- oliverspec-factorySkill
- oliverspec-proposeSkill
- oliverspec-scopeSkill
- oliverspec-shipSkill
- ui-auditSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Use native React Flow pan and zoom.
- Distinctive: line 36
Keep the full transition records alongside the graph.
- Distinctive: line 38
When loaded data chooses a variant, merge the arrival paths into one visible arrowhead at the group boundary.
- Distinctive: line 40
When an action determines a specific variant, land on that screenshot.
- Distinctive: line 63
Check reachability from supported entry points and verify each underlying transition is represented exactly once among the displayed arrows.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Visualize UI States
Build a standalone React Flow map with all reachable screenshots visible at once. Keep the map separate from the production app. Use the project's existing build setup or Vite for a standalone React Flow map. The canvas shows the screenshots, group headings, and transition arrows. Zoom scales the same content continuously.
Canvas defaults
- Group screens by page. Use one heading for the page, including a page with only one screen. When a page consists of a single variant group, one frame and heading can serve both. Give a nested group a short descriptive name. Individual screen names belong in hover tooltips and image alt text.
- Draw page and variant frames with the same neutral-gray fill, border, corner radius, padding, and heading typography. Align the heading with the left edge of its content. A starting palette is Tailwind neutral-50 for the canvas, neutral-100 for frames, neutral-300 for outlines, and neutral-800 for text. Route colors identify destinations. Round the screenshots and let each image fill its card.
- Render frame backgrounds behind arrows and headings above even the highlighted arrows. Give only the heading text a small opaque backing matching the frame. Keep the heading layer transparent to pointer events so arrows can still be traced.
- Use native React Flow pan and zoom. A two-finger slide pans on both axes and a pinch zooms around the pointer. Enable
panOnScrollandzoomOnPinchwithzoomOnScroll={false}. Mouse dragging also pans.
Decide what earns a screenshot
Start at the app’s real entry points. Follow routes, rendered branches, and action handlers through success, failure, retry, cancel, and back navigation. Record the source, action, condition, and destination of each transition. Preserve origin-dependent returns, such as closing a detail view to the list that opened it. Use available fixtures or tests to reproduce each state after confirming how the app reaches it.
| Observation | Map treatment |
| A screen, dialog, permission blocker, or persistent error gives the user a different task or recovery action | Capture the view and connect the actions available there. |
| Typing enables Save, a request shows a spinner or progress percentage, or a card shows swipe feedback | Use one screenshot of the underlying view, preferably with its action visible. Draw the committed action directly to each outcome. A failed Save that leaves the form editable can loop back to the form. |
| The same destination shows an empty list, active items, or archived items according to its data | Group representative variants side by side. Keep variants that change meaningful content or available actions. Repeated records, sample copy, and arbitrary counts usually need one example. |
| A story depicts a component in isolation, an unreachable combination, or simulated OS chrome | Omit it from an in-app map. Investigate isolated nodes for missing incoming transitions or genuine secondary entry points. Removing production code requires separate evidence and task scope. |
Compare route aliases with the same fixture, including available actions and return destinations. Merge routes that render the same task and preserve their entry and transition conditions in the model.
For an async operation that offers its own task, such as canceling or resuming a transfer, capture that actionable view when relevant. Apply the same decision rule on revisions. When merging nodes, redirect their meaningful incoming and outgoing actions, remove the typing or animation edges, and retire redundant map screenshots.
Capture and connect
Capture screenshots from the running app or an existing preview that renders the actual screen. Reuse Storybook stories or other deterministic fixtures when the project provides them. Use any screenshot or browser tool permitted by the project, including built-in captures or screenshots supplied by the user. For new captures, use a consistent viewport and wait for the expected content, fonts, and images. For overlays, check dismissal and whether visible controls behind them still accept clicks. For animated overlays, wait until the distinguishing content is fully visible. A selector or text match can succeed during the fade. When an outcome is expensive to reach, seed a supported fixture or saved state one action before it, perform the real action, and verify the resulting screen. Keep one stable screenshot ID per mapped state. A story can supply several captures, and several stories may represent one state.
Keep the full transition records alongside the graph. Derive displayed arrows from them so layout changes preserve reachability and action conditions. For grouped variants:
- When loaded data chooses a variant, merge the arrival paths into one visible arrowhead at the group boundary.
- Compare each action, condition, and outcome across members. A shared branch can leave the enclosing frame when every member supports it, even if a different outcome of that action is member-specific. Start member-only branches at their eligible screenshots. Bundle identical displayed endpoints while preserving every underlying action and condition.
- When an action determines a specific variant, land on that screenshot. For example, archiving the last active item can land on the archived-only variant.
- Use a compact charcoal pill with light text beside the pointer. For screens, show the screen name. For arrows, use a short action phrase that follows the cursor. Include a condition when it distinguishes branches, such as “Remove the last item.” Keep the pill at a constant reading size during zoom, give it viewport-edge clearance, let pointer events pass through it, and dismiss it on exit or pan. Keep action and condition text in edge metadata and accessible names. When highlighting a route, carry the highlight along its shared segment to the destination arrowhead.
Lay out the map
Use React Flow for the standalone canvas. Include the full first heading and any incoming arrow tracks in the opening bounds. A reload after panning, pinching, or following a deep link restores that opening viewport. Direct navigation to a screen or group link focuses its target. Place views from the same page together, side by side where space permits. Rank forward transitions from top to bottom using the longest dependency chain. With A → B, B → C, A → C, and A → D, put B and D on the same layer and C below. Set aside return edges and self-loops during ranking, then draw them back in.
Use orthogonal routing throughout the map. Draw horizontal and vertical runs and round only the 90-degree corners. Use a consistent small radius (SHOP uses 9 map units), capped at half the shorter adjoining run. Keep aligned connections straight. Apply the same geometry to local branches, return paths, self-loops, shared stems, hover strokes, and hit areas. Reorder siblings to reduce crossings. Route long or backward arrows around screenshots on separate lanes. Size the gaps for the lanes they actually carry. Check that a reader can trace each arrow to its destination at both overview and reading zoom.
Direct routes between neighboring screens
Allocate the ports at both ends of a clear gap together. For A → B and B → A between side-by-side screens, put the outbound arrow on one horizontal lane and the return arrow on another. Give each lane the same height on both facing edges. For stacked screens, use two matching columns. Reserve these lanes before routing longer edges. Leave enough room between lanes to hover either arrow independently.
When arrows cross, try matching the port order, swapping lanes, or moving a port along the same screen edge. Add a bend only where a screenshot, heading, or reserved route actually blocks a direct connection. If a bend is necessary, keep the lane order through the gap. Preserve each transition’s source, destination, direction, and hover label.
Route joins and self-loops
For a shared arrival, give the arrowhead one straight stem perpendicular to the destination. Run one incoming route into the upstream end in the same direction. Bring other routes into the side at separate, perpendicular T-junctions. Choose the side of each junction from the routed approach around obstacles. Keep feeders from crossing back over the stem or each other near the merge. Reserve clear approach lanes and space between the last junction and the marker. Size the stem and gutter for the number of arrivals. Draw its stroke once. When a branch is highlighted, trace the stem from its junction to the tip. Stop crossing halos short of joins so they leave the ink continuous. End the painted shaft inside the arrowhead so its cap cannot protrude past the tip at hover width.
Construct the full route through its port stubs before rounding the bends. Constrain the first and last routing steps so a path cannot reverse over its stub. A retry loop needs separate ports, two rounded turns and enough depth for a straight landing. Include every separately rendered segment when checking the finished SVG.
Verify and deliver
- Check reachability from supported entry points and verify each underlying transition is represented exactly once among the displayed arrows. Test conditional exits and fixed destinations when collapsing a group or removing a state.
- Build the map and open the delivered version using any browser permitted by the project. Compare the rendered screenshots and arrows against the model. Verify that a diagonal two-finger slide changes both viewport offsets at a constant scale, that pinching changes scale around the pointer, and that highlighting works. Hover the actual image hit area, slide along an arrow, then move to the background. React Flow can disable pointer events on non-interactive nodes, so exercise the real pointer path. Verify the tooltip changes content, follows the cursor along the edge, and clears. Trace a local branch, a long return, and a retry loop. Each should consist of axis-aligned runs with compact rounded elbows. Check for duplicate arrowheads, ambiguous overlaps, and paths running through screenshots.
- For React Flow maps, evaluate scripts/audit-rendered-map.js in the rendered page. It returns screenshot IDs, edge IDs, and detected image or routing issues. Mark separately drawn inlet or arrowhead paths with a stable
data-transition-segmentvalue so the audit also checks those strokes. It checks mounted DOM elements, so render the full graph for this check or verify virtualized sections separately. Run the script as plain JavaScript in the page context, using the browser’s developer console or an available evaluation API. The bundled audits use browser DOM and SVG APIs. Compare its inventory with the expected model to catch missing edges or nodes. For a grouped page, trace a shared arrival to its single arrowhead, a member-only action from its eligible screenshot, and a fixed outcome to its destination screenshot. Compare the rendered SVG endpoints with the screenshot bounds for the member-specific cases. An edge can keep its expected ID while attaching to the wrong sibling. - Run scripts/audit-route-joints.js on the same rendered canvas. Give each branch with a separate stem a
data-joins-segmenton the edge path or its enclosing group, naming the stem’sdata-transition-segment. Compare the audited join count with the modeled attachments. Resolve reported sweeping curves, gaps, abrupt turns, misaligned or crowded taps, and short arrowhead landings. For routes across a clear gap, mark the edge with a commondata-lane-corridorfor the unordered pair anddata-lane-axisofxfor horizontal travel oryfor vertical. Check the audited lane count against the clear facing pairs in the model. The same audit flags detours, misaligned ports, and overlapping lanes. Inspect a two-way pair, a busy inlet, and a self-loop at reading zoom. Hover each direction separately. Treat an uncovered join or a visible kink as a failed check. - Inspect a nested group beside its page frame. Compare their rendered fill, border, radius, typography, and heading insets. Check a heading where an arrow passes underneath, both at rest and highlighted. After panning and zooming away, reload and check the opening position. Open a deep link directly, reload that same URL, and check both destinations.
- Give the user a working link to the map, focused on the affected area when revising it. If the requested deliverable includes an offline copy, verify that copy independently.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

