Skills Prompts Hues

Popular categories

Agent skill · Jakub Krehel's Interface Skills

/state-machine See every state of a component on one throwaway page

state-machine gives you a workbench for a single component. The agent reads the code for every branch it can render, builds a scratch route that imports the real component, feeds each state with realistic mock data and adds a grouped switcher driven by a search parameter. The page stays up while you work and is removed in one step when you say so.

Works with

  • Agents supported by the skills CLI

When to use it

  • You are polishing a table or card and need to see its empty, loading and error states quickly.
  • Plan tiers, roles or feature flags change what a component shows.
  • Designers want to review states that are hard to reach in the running app.

How it works

  1. 1
    Pick one component

    The agent scopes the run to a single component and restates what it shows, where it renders and where its data comes from.

  2. 2
    List reachable states

    It reads the component and its data hooks for data, account and feature states, leaving out anything the code cannot reach and listing designed-but-missing states.

  3. 3
    Build the scratch route

    A route inside the app imports the untouched component, inherits the app's layout and providers and keeps fixtures and switcher in one folder.

  4. 4
    Feed data at the boundary

    Mock data enters through props or the app's own data seam, looks like real product data, and loading states stay pending until switched.

  5. 5
    Confirm and hand over

    Every state is loaded once to confirm the mock data appears, then the agent hands over the URL and stops.

What it steers the agent away from

  • Editing the component or adding branches just to display a state.
  • Placeholder data like three rows of test items that hides real layout problems.
  • Restyling the component on the scratch page or changing visuals unasked.

Install this skill

It installs with the Jakub Krehel's Interface Skills pack.

Agents supported by the skills CLIInstalls the whole collection; the README documents no other route.
npx skills add jakubkrehel/skills

Commands come from the author’s README; check it for changes before you run them.

Questions

How is it different from break?

state-machine shows one product state at a time for ongoing work, while break stacks worst-case scenarios on one page for a single inspection.

Does it work with Next.js server components?

Yes; the skill notes that the scratch page must be client code in Next so fixture data is not lost across the server boundary.

More guides from Jakub Krehel's Interface Skills

Also in this pack

All 14 skills →

Summary by trendhub. The skill itself lives in jakubkrehel/skills/skills/state-machine by Jakub Krehel (MIT); read the full, current text there.