/mattpocock-skills:ux-statesfrom mattpocock-skills
Design and specify a comprehensive UI state matrix (empty, loading, optimistic UI, error recovery, accessibility, and localization) for frontend components or user flows. Use when designing, reviewing, or implementing user interfaces.
Ships in mattpocock-skills. 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.
Every user interface exists in more states than just the ideal "happy path" with complete data. This skill enforces a disciplined state matrix for every user-facing component or flow before code is written or merged.
When designing, specifying, prototyping, or implementing a frontend surface, systematically define all six dimensions:
<button>, <dialog>, <nav>). Use aria-expanded, aria-busy, and aria-live regions for dynamic state updates.When generating a UI state specification, format the output as a Markdown table:
### UI State Matrix: <Component / Flow Name>
| State Dimension | Visual & Interaction Behavior | Technical Invariant |
| --- | --- | --- |
| **Empty (First Use)** | Centered illustration, explanatory message, "Create First Item" button | Displays when `items.length === 0` and `filter === null` |
| **Empty (No Results)** | "No matches for '{query}'", "Clear filters" link | Displays when `items.length === 0` and `filter !== null` |
| **Loading (Initial)** | Skeleton cards matching exact grid dimensions | Prevents layout shift during `isLoading` |
| **Loading (Refetch)** | Subtle spinner on action button; existing list dimmed | `isFetching && !isLoading` |
| **Optimistic Action** | Toggle state flips instantly; item badge updates | Local cache update with rollback snapshot |
| **Mutation Failure** | Rollback badge, show warning toast with "Retry" action | Catch block executes cache rollback |
| **Partial Error** | Widget card displays error icon and "Reload widget" button | Isolated React/Component ErrorBoundary |
| **Accessibility (a11y)** | Keyboard trap in modal; `aria-live="polite"` on status changes | WCAG AA compliance, focus restored to trigger |
| **Copy & Overflow** | Title truncates at 2 lines with tooltip; numbers localized via `Intl` | CSS `line-clamp: 2`, i18n key `dashboard.title` |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub op3616windows/skills --plugin mattpocock-skills48 skills in this plugin
/ask-mattAsk which skill or flow fits your situation. A router over the skills in this repo./chief-of-staffPursue a long-running goal in a single session by co-ordinating subagents./claude-handoffHand the current conversation off to a fresh background agent that picks up the work immediately./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./code-reviewReview the changes since a fixed point (commit, branch, tag, or merge-base) along three axes: Standards (does the code follow this repo's documented coding standards?), Spec (does the code match what the originating issue/spec asked for?), and Security (does the code introduce AppSec or privacy vulnerabilities?). Runs all three reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X"./diagnosing-bugsDiagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.