From formal-specification
Generates state machine diagrams from behavior descriptions for lifecycle and workflow modeling. Supports PlantUML, Mermaid, XState formats with optional C# or TypeScript implementations.
npx claudepluginhub melodic-software/claude-code-plugins --plugin formal-specificationThis skill is limited to using the following tools:
Create state machine diagrams from behavior descriptions with optional implementation code.
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.
Generates Mermaid diagrams for flowcharts, sequence diagrams, state diagrams, class diagrams, ERDs, and system architectures to visualize complex concepts and processes.
Share bugs, ideas, or general feedback.
Create state machine diagrams from behavior descriptions with optional implementation code.
/state-diagram "order lifecycle from creation to delivery"
/state-diagram "user account states" format=mermaid
/state-diagram "payment processing workflow" implementation=csharp
/state-diagram "document approval process" format=xstate implementation=typescript
Parse the description to identify:
Load the state-machine-design skill for:
Extract states from the description:
Map state changes:
Create the state machine diagram in chosen format:
If implementation requested:
Deliver:
@startuml
title Entity State Machine
[*] --> Initial : Create
state Initial {
Initial : entry / initialize
}
Initial --> Active : Activate [isValid]
Active --> Completed : Complete
Completed --> [*]
@enduml
stateDiagram-v2
[*] --> Initial : Create
Initial --> Active : Activate
Active --> Completed : Complete
Completed --> [*]
import { createMachine } from 'xstate';
const machine = createMachine({
id: 'entity',
initial: 'initial',
states: {
initial: {
on: { ACTIVATE: 'active' }
},
active: {
on: { COMPLETE: 'completed' }
},
completed: {
type: 'final'
}
}
});
/state-diagram "e-commerce order from draft to delivered or cancelled" implementation=csharp
Output:
/state-diagram "document approval with review, revision, and approval stages" format=mermaid
Output:
/state-diagram "user account lifecycle including verification and suspension" format=xstate implementation=typescript
Output:
| Type | Description |
|---|---|
| Initial | Starting point (filled circle) |
| Normal | Regular state |
| Final | End point (circled dot) |
| Composite | Contains sub-states |
| History | Remembers last sub-state |
| Element | Description |
|---|---|
| Event | Trigger for transition |
| Guard | Condition [isValid] |
| Action | Side effect / notify |
The command integrates with: