State graph
A way of designing software where the conditions it can be in are treated as the work, not as edge cases to handle later.
npx -y skills add mskayyali/Stateful --skill state-graphAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Render an existing Stateful v0.2 condition map as Mermaid, grouping lifecycle states, failures, interruptions, and surfaces while drawing only recorded typed relationships and styling confirmed scope. Use for visual overviews in STATEFUL.md, READMEs, reviews, or stakeholder discussions. Do not invent conditions or relationships, call the result an executable statechart, or render an unreadable 50-node graph without a cut.
SKILL.md
2.2 KB, as published. Nobody here has run it
Condition Graph
Render a view of the map. The JSON or confirmed tables remain the source of truth.
Procedure
- Read
state-map.json, thenSTATEFUL.md, then user-supplied tables in that order. - If no map exists, stop and recommend discovery; do not invent one while graphing.
- Choose the smallest useful cut:
- up to about 25 conditions: one diagram;
- larger maps: in-scope only, one lens, or separate diagrams by lens.
- Create a Mermaid
flowchart TB:- quote every label;
- group categories as Lifecycle, Failure, Interruption context, and Surface;
- style confirmed scope: solid
in, dashedout-with-implication, dimmedout; - draw only recorded relationships;
- label non-transition edges
interrupted by,re-enters as, orprojects to.
- State the cut and that the result is a condition-map view, not an executable statechart.
- Validate Mermaid syntax.
- Ask whether to return inline, write
state-graph.md, or embed under## GraphinSTATEFUL.md.
Output
```mermaid
flowchart TB
classDef inScope stroke-width:2px
classDef owi stroke-dasharray:5 5
classDef outScope opacity:0.4
subgraph Lifecycle
a["Dose overdue"]:::inScope
end
subgraph Interruption["Interruption context"]
i["Timezone changed"]:::inScope
end
a -->|"interrupted by"| i
```
Legend: solid = in · dashed = out-with-implication · dimmed = out
Cut: <description>
This is a condition-map view, not an executable statechart.
Failure modes
- Inventing arrows.
- Flattening typed relationships into unlabeled transitions.
- Treating surfaces or interruptions as lifecycle nodes.
- One unreadable graph for the entire map.
- Allowing the graph to become the source of truth.