From harness-claude
Visualizes and inspects XState machines at design time with Stately Studio and runtime with Inspector and VS Code extension for designing, debugging transitions, sharing diagrams, and validating paths.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Visualize and inspect XState machines at design time and runtime with Stately Studio, Inspector, and VS Code extension
Generates full TypeScript type safety for XState machines using typegen (v4) and setup pattern (v5). Provides autocompletion for states/events/actions; resolves errors in guards/actions.
Designs finite state machines and statecharts for modeling entity lifecycles, workflows, and system behaviors using Harel semantics, PlantUML, and Mermaid notation.
Models complex UI flows as finite state machines with states, events, transitions, actions, and guards. Useful for forms, data fetching, authentication flows, and wizards.
Share bugs, ideas, or general feedback.
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