Skip to content

Switchain Services — System Documentation

Entry point for describing the running system (contexts, states, events, flows, integrations). Rules and coding standards live in docs/conventions/ — this tree is for describing what the system is and does.

Canonical rule: everything descriptive lives under docs/system/. packages/ stays pure code.

Progressive disclosure

Three hops max from any question to its answer:

  1. Level 0 (this page) — global index of tables with links.
  2. Level 1 — overview of a context, app, or section.
  3. Level 2 — detail, self-contained (one state machine, one flow, one runbook).

Catalogs

System-level topics

Predictable paths

DocumentPath
Context overviewdocs/system/contexts/<ctx>/readme.md
Events for a contextdocs/system/contexts/<ctx>/events.md
State machinedocs/system/state-machines/<slug>.md
App overviewdocs/system/apps/<app>/readme.md
Cross-context flowdocs/system/events/flows/<slug>.md
Runbookdocs/system/runbooks/<slug>.md
External integrationdocs/system/integrations/<kind>/<name>.md

Slugs are always kebab-case of the enum, entity, or app name as it appears in TypeScript.

Templates

Document templates live in _templates/. The create-doc skill routes new system docs to the matching template.