Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

state_machine

/state_machine

Tworzy poprawny JSON maszyny stanów dla uml-mcp, potem go sprawdza i generuje obraz PNG lub interaktywną stronę HTML.

Repozytorium
uml-mcp ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

95/ 100Klasa: dobry
Format20 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Tworzy poprawny JSON maszyny stanów dla uml-mcp, potem go sprawdza i generuje obraz PNG lub interaktywną stronę HTML.

Oryginalny opis (EN)

Writes valid state_machine JSON for uml-mcp (diagram_type=state_machine, bundled plugin statechart). Use when the user asks for a state machine or statechart (order lifecycle, traffic light, UI flow) to read or step through; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).

Jak działa

  1. Example prompt
  2. Notation tips
  3. Styling
  4. Example source
Sekcje z nagłówków SKILL.md, w oryginale · 34 linii, 293 słów
Podgląd SKILL.md
---
name: state_machine
description: >-
  Writes valid state_machine JSON for uml-mcp (diagram_type=state_machine, bundled plugin statechart). Use when the user asks for a state machine or statechart (order lifecycle, traffic light, UI flow) to read or step through; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).
---

# state_machine diagram (uml-mcp plugin `statechart`)

**`diagram_type`:** `state_machine`  
**Backend:** `plugin:statechart` (bundled with uml-mcp, on by default)  
**Output formats:** html, svg

State machine (statechart) from XState-like JSON: compound and parallel states, initial, final and history states, guarded transitions with actions. html is a simulator (fire events, step log, undo); svg is a static image

Load the workflow skill [uml-mcp-diagrams](../uml-mcp-diagrams/SKILL.md) and the focused guide `skill://uml-mcp-guides/statechart/SKILL.md`. This file is notation only; it does not add an MCP tool.

## Example prompt

> Model our order lifecycle as a state machine: checkout with address and payment steps, packing and invoicing in parallel, cancelled and delivered as final states.

## Notation tips

- XState-like JSON: `id`, `title`, `initial`, `context`, `states`. Each state: `on` (`EVENT: target` or `{target, guard, actions}`, or a list of guarded alternatives), `entry`, `exit`, `type` (`atomic`, `compound`, `parallel`, `final`, `history`), `initial`, `states`, `description`, `onDone`.
- Every compound state needs `initial`; a parallel state has none (all regions start).
- Targets: a sibling name, a dotted path (`checkout.payment`), `.child`, or `#id.path`. A transition with no target runs its actions and stays (drawn inside the state).
- `{"type": "history"}` in a compound remembers the last step; target it to resume (`"history": "deep"` for nested steps).
- Guards are labels: the simulator shows one button per guarded alternative.
- `direction`: `LR` (default) or `TB`. `validate_uml` warns about unreachable states.

## Styling

Pass **`theme`** (`auto`, `dark` or `light`) to `generate_uml` / `generate_uml_image`, or set it in the source. `auto` follows the reader's system in the HTML page and is dark in static SVG and PNG.

## Example source

```json
{"id":"order","title":"Order lifecycle","initial":"cart","context":{"items":0,"total":0},"states":{"cart":{"description":"The shopper is still adding items.","on":{"ADD_ITEM":{"actions":["addItem"]},"CHECKOUT":{"target":"checkout","guard":"hasItems"}}},"checkout":{"initial":"address","entry":["startTimer"],"exit":["stopTimer"],"description":"Address, then payment. Help keeps your place.","states":{"address":{"on":{"NEXT":"payment"}},"payment":{"on":{"BACK":"address","PAY":[{"target":"#order.fulfilment","guard":"cardOk","actions":["charge"]},{"target":"declined","guard":"cardDeclined"}]}},"declined":{"on":{"RETRY":"payment"}},"hist":{"type":"history"}},"on":{"HELP":"help","CANCEL":"cancelled"}},"help":{"description":"A support chat; resuming returns to the same checkout step.","on":{"RESUME":"checkout.hist"}},"fulfilment":{"type":"parallel","description":"Packing and invoicing run at the same time.","onDone":"delivered","states":{"packing":{"initial":"picking","states":{"picking":{"on":{"PACKED":"packed"}},"packed":{"type":"final"}}},"invoice":{"initial":"drafting","states":{"drafting":{"on":{"SEND":"sent"}},"sent":{"type":"final"}}}},"on":{"CANCEL":{"target":"cancelled","actions":["refund"]}}},"delivered":{"type":"final","entry":["notifyCustomer"]},"cancelled":{"type":"final"}}}
```

Wersje

W bazie nie ma innych skilli o nazwie state_machine.

Migawka bazy z 13.11.2026 · wersja paczki de6e5b743dc8 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95archify_architecture
    Pisze poprawny JSON przeglądu architektury dla uml-mcp i generuje z niego obraz PNG albo interaktywną stronę HTML.
  • 95c4_model
    Pisze poprawny JSON modelu C4 dla uml-mcp, od kontekstu systemu przez kontenery po komponenty, i generuje z niego diagram PNG lub HTML.
  • 100statechart
    Sprawdza model TLA+ systemu przechodzącego przez stany i rysuje statechart Mermaid, pokazując błąd jako ścieżkę przez stany.
  • 100stately
    Modeluje przepływ jako interaktywny statechart Stately, sprawdza niezmienniki i szuka ukrytych maszyn stanów w kodzie.
  • 100statechart
    Weryfikuje model TLA+ procesu ze stanami i rysuje statechart w Mermaid, pokazując błąd jako ścieżkę przez stany.
  • 100statechart
    Sprawdza model TLA+ systemu i rysuje statechart Mermaid, pokazując najkrótszą ścieżkę do każdego stanu łamiącego regułę.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.