From harness-claude
Visualizes and inspects XState machines at design time and runtime using Stately Studio, @stately/inspect, and the VS Code extension.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:xstate-visualizationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Visualize and inspect XState machines at design time and runtime with Stately Studio, Inspector, and VS Code extension
Visualize and inspect XState machines at design time and runtime with Stately Studio, Inspector, and VS Code extension
// Add runtime inspection to a React app
import { createBrowserInspector } from '@stately/inspect';
const inspector = createBrowserInspector();
// Option 1: Global inspection (all actors)
import { useMachine } from '@xstate/react';
const [state, send] = useMachine(myMachine, {
inspect: inspector.inspect,
});
// Option 2: Inspect specific actors (v5)
import { createActor } from 'xstate';
const actor = createActor(myMachine, {
inspect: inspector.inspect,
});
actor.start();
// Node.js inspection (opens in browser)
import { createBrowserInspector } from '@stately/inspect';
const inspector = createBrowserInspector({
url: 'https://stately.ai/inspect',
});
// Pass inspector.inspect to actor options
Stately Studio features:
@stately/inspect setup:
npm install @stately/inspect
The inspector opens a new browser tab (or panel) showing the live statechart with:
VS Code extension:
createMachine to see an inline diagramDesign-first workflow:
What to look for in the visualization:
Production considerations: Disable the inspector in production builds. Use environment variables:
const inspector = process.env.NODE_ENV === 'development' ? createBrowserInspector() : undefined;
https://stately.ai/docs/inspector
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeDesigns finite state machines and statecharts for modeling entity lifecycles, workflows, and system behaviors using Harel semantics, PlantUML, and Mermaid notation.
Defines statecharts with XState's createMachine for explicit states, transitions, context, and events. Useful for modeling complex UI flows and preventing illegal state transitions.
Models complex UI flows as finite state machines with states, events, transitions, actions, and guards. Useful for forms, data fetching, authentication flows, and wizards.