Skip to content

/state-prototyping

State prototyping

Build an editable UI prototype with selectable, realistic application states, and review it before building it for real.

npx skills add Kevin-Umali/skills --skill state-prototyping

Kevin Umali · Updated Nov 23, 2026 · MIT · Release v0.1.3

View SKILL.md on GitHub

Try it

State
Version

Changes in default

Fictional contact form. Select a change to outline it.

Showing Default, after.

What it does

  • Builds real states (loading, empty, error, success, conflict) from fictional fixtures, with no live calls.
  • Wraps them in a review shell with searchable states, width and theme switching, and Before and After side by side.
  • Optionally outlines what changed, lists each change as a measured value like height 48px to 36px, and gives the reason.
  • Ships starters for plain HTML and for React on one shared core, plus scripts that set up and check a prototype.
  • Asks first: design references, helper skills and MCP servers, Before and After, and highlights.

When to use it

  • You want to see a screen in every state before it ships, and know why each change was made.
  • It scales to the task: a small component gets a handful of states and a short coverage note.
  • Skip it for a one-line style fix. It adds a review step, which is more than such a fix needs.

Pairs with

Skills and helpers it pairs with
NameUse for
tactile-designLayered, quiet product UI: hierarchy, forms, menus, light and dark
interaction-designMicrointeractions and feedback states
better-interfaceA ranked whole-interface review, then one domain each
emil-design-engMotion craft, naming, audits
transitions-devReady-made web transitions and tuning
shadcnProjects already on shadcn
ui-reviewCritique of a screen, flow or prototype

Invoke with

Claude Code/state-prototyping
Codex$state-prototyping

What the skill changed

I ran the skill on my own portfolio: three passes over 35 states, with one round of feedback between them. Stepping through the assistant state in both themes showed a hint at 1.73:1 contrast in dark mode, which became 4.5:1. A diff would not have shown it.

Before, recovered from the real source
After, the proposal I reviewed

The last pass applied five principles. Each row is a change the review list recorded with its reason.

Before and after, with the reason for each change
ChangeBefore, after and why
ProximityEven 16 to 28px gaps became 4 to 16px inside a group and 32 to 48px between groups. Distance says what belongs together.
ColourBlue on every link and button became blue only for primary buttons, the current nav item, hover and focus. Colour guides action.
White spaceSections 48 to 80px apart became one 112px rhythm. Room to read.
BalanceCards of varied height became equal heights with aligned titles and links.
ContinuityFive different column starts became one left edge and one right column start in every section.
The Changes panel. Each numbered badge on the After side matches an entry, and each entry carries a reason.

The story of why I built it is in the blog post.

Example prompts

Claude Code/state-prototyping table
CodexUse $state-prototyping to build a reviewable prototype of this UI and its meaningful states.

How it works

Install options

Install options
CommandWhat it does
npx skills add Kevin-Umali/skills --listSee what is available.
npx skills add Kevin-Umali/skills --skill state-prototypingInstall one skill.
npx skills add Kevin-Umali/skills -gInstall at user level instead of project level.
npx skills updatePull the latest.
npx skills remove state-prototypingRemove the skill.

Workflow

Six steps, scaled to the task.

  1. Explore. For an existing UI the agent runs the app and reads screens, design system, components, state owners, callbacks and error and recovery paths, down to the network, native and persistence boundaries. It builds a state inventory from that evidence. For a new UI it reads the design system and integration contracts and separates requested behavior from assumptions.
  2. Import the real UI. It imports production screens, dialogs, controls, styles and tokens, and replaces only data and side effects with typed fixtures and local callbacks. It never recreates markup. If something cannot be isolated, the state is marked unavailable and names the boundary.
  3. Model the states. Loading, empty, error, saving, stopped, success and conflict, plus labeled proposed states. Fixtures are fictional and deterministic, and pending states hold still. There are no live calls, native operations, credentials or persistence.
  4. Build the review shell. It runs init-prototype, which copies the shell and starters, then fills the state registry and frame pages.
  5. Think from three perspectives. User, developer and agent. The agent says which one drove each notable decision.
  6. Inspect. It runs the prototype locally and checks behavior: state selection, success and failure paths, modal focus and Escape, widths in both themes, and the console.

Opening questions

The agent asks once, states a default for everything else, and never blocks.

  1. What to prototype. If the request is vague, which screen or flow, new or existing UI, and which states matter.
  2. Design references. Found by detect-context. Asked only if none are found or they conflict.
  3. Helpers. Relevant skills and MCP servers. You can name your own, and “none” is valid.
  4. Before and After. For existing UI, a frozen Before beside an editable After. The default is one editable preview.
  5. Highlights. Needs a comparison. The default is yes when comparing.

With a structured question tool it makes one call of at most four questions. Without one, it sends a short message stating its defaults.

Compare modes

  • Before shows only the frozen production views.
  • After shows only the editable proposal.
  • Split shows both side by side. It is the default only when the stage is wide enough.
  • Slider puts a draggable divider between them, for small visual deltas on the same layout. It takes arrow keys.

Before is recovered from real source, never recreated. Both sides share the same state, theme and width. Without a comparison, the single preview is after/frame.html:

node scripts/init-prototype.mjs .state-prototype/billing --stack react --no-comparison

Highlights and reasons

With a comparison, quiet outlines sit on the innermost changed elements. A Changes panel lists each change as a measured value, so a button going from one height to another reads like this:

3  button #save
   height              48px → 36px
   background-color    #4338ca → #21201c
   Why: One black primary action says "do this next". Indigo had no brand behind it.

The agent writes notes.js as it works. notes has one line per change. reasons holds a selector-matched why for every change, from the user’s point of view. The Share menu copies a link, or the changes as Markdown or JSON.

Highlights are optional. To build none of it:

node scripts/init-prototype.mjs .state-prototype/billing --stack react --no-highlights

Locking areas

Per area, the agent inspects its states, critiques the main surfaces, then dialogs, then error and edge states. It reports a short Before, After and Why table, asks whether to lock or refine, and stops.

Saying “lock” adds the area to lockedAreas. A locked area is frozen, including through shared styles. If a new rule would touch a locked area, the agent says so and asks. When every area is locked, it reruns the full render check.

The shell and the product are separate designs. The agent keeps the preferred layout’s structure, navigation and workflow, and refines controls, hierarchy, feedback and motion.

Helpers

The agent uses only the helper skills and MCP servers you pick, reads each skill first, and never claims one it could not use. If one is missing, it explains its role and asks before installing or connecting it. Helpers do not authorize a redesign.

MCP servers the skill can offer
NameUse for
devlibsSearch and read open-source UI components, with install plans per library
ruixen-mcpSearch the Ruixen UI registry

Components from MCP servers belong to the prototype. Keep each component’s licence with its code, and never swap a product’s own components for them.

Scripts

Three Node scripts print JSON. The agent runs them without reading them.

Scripts
ScriptWhat it does
detect-context.mjs [dir]Finds frameworks and design references. Runs before the opening questions.
init-prototype.mjs <dir> --stack vanilla|reactCopies the shell, templates and frame pages, and sets the flags.
check-prototype.mjs [dir]Validates states.js and notes.js. Exit code 2 means problems.
Options of init-prototype
OptionEffect
--stackvanilla for plain ES modules, react for React 18+ and TypeScript, both on one shared core
--no-comparisonA single editable preview, with no Before frame, compare modes or highlights
--no-highlightsKeeps a comparison but builds no outlines or Changes panel
--statesTakes an array of state objects and writes states.js

Limits

  • It does not prove the feature works against a real backend. Fixtures show what the screen does with given data. Native, live and persisted behavior stay unverified, and the agent says so.
  • It does not replace testing the production build once the change is approved.
  • States that cannot be isolated without a production change are marked unavailable, such as “native file save is not available here”, instead of showing a fake success.
  • It adds a review step, which is more than a one-line style fix needs.