/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-prototypingKevin Umali · Updated Nov 23, 2026 · MIT · Release v0.1.3
Try it
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
| Name | Use for |
|---|---|
tactile-design | Layered, quiet product UI: hierarchy, forms, menus, light and dark |
interaction-design | Microinteractions and feedback states |
better-interface | A ranked whole-interface review, then one domain each |
emil-design-eng | Motion craft, naming, audits |
transitions-dev | Ready-made web transitions and tuning |
shadcn | Projects already on shadcn |
ui-review | Critique of a screen, flow or prototype |
Invoke with
/state-prototyping$state-prototypingWhat 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.
The last pass applied five principles. Each row is a change the review list recorded with its reason.
| Change | Before, after and why |
|---|---|
| Proximity | Even 16 to 28px gaps became 4 to 16px inside a group and 32 to 48px between groups. Distance says what belongs together. |
| Colour | Blue on every link and button became blue only for primary buttons, the current nav item, hover and focus. Colour guides action. |
| White space | Sections 48 to 80px apart became one 112px rhythm. Room to read. |
| Balance | Cards of varied height became equal heights with aligned titles and links. |
| Continuity | Five different column starts became one left edge and one right column start in every section. |
The story of why I built it is in the blog post.
Example prompts
/state-prototyping tableUse $state-prototyping to build a reviewable prototype of this UI and its meaningful states.How it works
Install options
| Command | What it does |
|---|---|
npx skills add Kevin-Umali/skills --list | See what is available. |
npx skills add Kevin-Umali/skills --skill state-prototyping | Install one skill. |
npx skills add Kevin-Umali/skills -g | Install at user level instead of project level. |
npx skills update | Pull the latest. |
npx skills remove state-prototyping | Remove the skill. |
Workflow
Six steps, scaled to the task.
- 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.
- 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.
- 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.
- Build the review shell. It runs
init-prototype, which copies the shell and starters, then fills the state registry and frame pages. - Think from three perspectives. User, developer and agent. The agent says which one drove each notable decision.
- 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.
- What to prototype. If the request is vague, which screen or flow, new or existing UI, and which states matter.
- Design references. Found by
detect-context. Asked only if none are found or they conflict. - Helpers. Relevant skills and MCP servers. You can name your own, and “none” is valid.
- Before and After. For existing UI, a frozen Before beside an editable After. The default is one editable preview.
- 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-comparisonHighlights 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-highlightsLocking 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.
| Name | Use for |
|---|---|
devlibs | Search and read open-source UI components, with install plans per library |
ruixen-mcp | Search 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.
| Script | What it does |
|---|---|
detect-context.mjs [dir] | Finds frameworks and design references. Runs before the opening questions. |
init-prototype.mjs <dir> --stack vanilla|react | Copies 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. |
| Option | Effect |
|---|---|
--stack | vanilla for plain ES modules, react for React 18+ and TypeScript, both on one shared core |
--no-comparison | A single editable preview, with no Before frame, compare modes or highlights |
--no-highlights | Keeps a comparison but builds no outlines or Changes panel |
--states | Takes 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.