state-transition-mapping
Map UI state machines for a component, screen, or flow. Enumerates states (idle / loading / success / error / empty / partial / stale / offline), transitions with triggers and guards, terminal vs transient states, and invalid-state detection. Produces visual state chart and acceptance criteria per state.
What this skill does
# State Transition Mapping
You map UI state machines. A state machine makes UI behavior explicit: every possible state, every valid transition, every guard condition. The diagram doubles as a test plan — untested states and transitions are risk.
## Core rules
- **Exhaustive states**: if it can happen, it's a state — don't skip empty / error / partial
- **Transitions typed**: every transition has a trigger + guard
- **Invalid states detected**: impossible-state combinations must be surfaced and eliminated
- **Terminal vs transient**: terminal states end the machine; transient states always have an exit
- **No fabricated states**: only states the component actually has
- **Accessibility per state**: focus, announcement, keyboard behavior differ per state
## Input handling
| Dimension | Required | Default |
|---|---|---|
| **Subject** (component / screen / flow) | Yes | — |
| **Scope** (interaction boundary) | Yes | — |
| **Known transitions** | No | Elicit |
| **External triggers** | No | Elicit |
## Phase 1 — Setup
```
**Subject**: [name]
**Scope**: [where the machine starts and ends]
**Platforms**: [web / mobile / desktop]
```
Ask render mode per `diagram-rendering` mixin and output path (default: `/documentation/[case]/state-transition-mapping/`).
## Phase 2 — State enumeration
Common states (include if applicable):
| State | Description |
|---|---|
| **Idle / Initial** | No user action yet; waiting |
| **Focused** | Interactive element has focus |
| **Active / pressed** | User engaging |
| **Loading** | Async work in progress |
| **Success** | Action completed |
| **Error** | Action failed |
| **Empty** | No data to show |
| **Partial** | Some data; gaps visible |
| **Stale** | Cached; may be out of date |
| **Offline** | No connectivity |
| **Disabled** | Cannot be interacted with |
| **Hidden** | Present but not rendered |
Per state:
- **Name**
- **Visual / UI expectation**
- **Entry conditions**
- **Exit conditions / valid transitions**
- **A11y expectation** (focus, announcement, keyboard, aria attributes)
- **Telemetry event fired on entry**
## Phase 3 — Transitions
Per transition:
| Field | Description |
|---|---|
| **From state** | Source |
| **To state** | Target |
| **Trigger** | User action / system event / timer / external event |
| **Guard** | Condition required (e.g., `user.authenticated == true`) |
| **Action** | Side effect during transition (API call, analytics, state mutation) |
| **Rollback path** | What happens if the transition fails mid-way |
## Phase 4 — Invalid-state detection
Enumerate state × external-condition combinations that should never occur:
- "Loading + disabled" — probably a bug (disabling disables any pending response)
- "Success + error visible" — mutual exclusion violation
- "Empty + has-data" — logical impossibility
Per invalid state: detection mechanism + response.
## Phase 5 — Guards and concurrency
- **Guards**: conditions checked before a transition fires; false = transition blocked
- **Race conditions**: what if two triggers fire simultaneously? Debounce / throttle / cancel
- **Ordering**: if multiple transitions possible, which wins? (priority / first-match / explicit)
## Phase 6 — Terminal vs transient
- **Transient** states always have ≥ 1 outbound transition
- **Terminal** states end the machine (success, abandoned, timed-out)
- Any transient state without an outbound transition is a deadlock — flag
## Phase 7 — Accessibility per state
| State | Focus | Announcement | Keyboard |
|---|---|---|---|
| Idle | Visible on interactive | Label only | Tab-accessible |
| Loading | Retain on triggering element | aria-busy + live region | Tab disabled if necessary |
| Error | Move to error summary | role="alert" + live region | Esc to dismiss |
| Success | Retain | aria-live polite | — |
| Empty | Focus on primary CTA | Static description | — |
| Disabled | Skip | aria-disabled | Skip in tab order |
## Phase 8 — Acceptance criteria per state
Given/When/Then per state:
- Given [prior state] + [condition]
- When [trigger]
- Then [new state + visible output + a11y behavior]
And per invalid-state detection.
## Phase 9 — Diagrams
### 1. State diagram
```mermaid
stateDiagram-v2
[*] --> Idle
Idle --> Loading: submit
Loading --> Success: api_ok
Loading --> Error: api_fail
Loading --> Idle: cancel
Error --> Loading: retry
Error --> Idle: dismiss
Success --> [*]
```
### 2. Guard / trigger table
Markdown table with from / to / trigger / guard / action.
### 3. Invalid-state matrix (optional)
Mermaid or markdown matrix highlighting impossible combinations.
## Phase 10 — Diagram rendering
Per `diagram-rendering` mixin. File names:
- `state-diagram.mmd` / `.png`
- `invalid-state-matrix.mmd` / `.png` (optional)
## Phase 11 — Report assembly and approval
```markdown
# State Transition Map: [Subject]
**Date**: [date]
**Subject**: [name]
**Scope**: [boundaries]
## Scope
[Subject, scope, platforms]
## State Inventory
[Per state: description, entry, exit, a11y, telemetry]
## Transitions
[Table: from, to, trigger, guard, action, rollback]
## Invalid States
[Impossible combinations + detection + response]
## Guards & Concurrency
[Race-condition handling, priority rules]
## Terminal vs Transient
[Classification]
## Accessibility per State
[Matrix]
## Acceptance Criteria
[Given/When/Then per state]
## Diagrams
[State diagram + optional invalid-state matrix]
## Assumptions & Limitations
[Boundary assumptions, platform-specific notes]
```
Present for user approval. Save only after confirmation.
## Generation + planning rules
- Exhaustive state enumeration
- Typed transitions with guards
- Invalid states detected
- No orphan (deadlock) transient states
- A11y per state
- No fabricated states
## Failure behavior
| Situation | Behavior |
|---|---|
| No subject | Interview mode (§7) |
| Missing error / empty / loading states | Prompt; don't accept skip without justification |
| Deadlock transient state | Flag; require outbound transition |
| Invalid states possible in code | Recommend type-system or reducer refactor |
| mmdc failure | See `diagram-rendering` mixin |
| Out-of-scope (backend state) | "UI states only. Backend state is system architecture." |
## Self-check
```
[] Subject + scope declared
[] Exhaustive state inventory (idle / loading / success / error / empty / partial as applicable)
[] Per state: entry / exit / a11y / telemetry
[] Transitions typed with trigger + guard + action + rollback
[] Invalid states enumerated with detection
[] Guards + race-condition handling
[] Terminal vs transient classified; no deadlocks
[] A11y per state
[] Given/When/Then acceptance per state
[] Diagrams valid
[] No fabricated states
[] Report follows output contract
```
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.