What does arch-storyboard do?
One HTML file, no network, no runtime libraries. The arch-storyboard npm package runs ELK once at build time; the file it writes holds a vanilla Web Animations player that reads the baked geometry and the spec data.
When to use / not use
- Use: an architecture that changes over time; current → target; step-by-step walkthrough; request/response and agent flows; CHANGED/UNCHANGED parts.
- Do not use: static diagrams, UML or sequence diagrams, user stories, editable diagrams.
Find arch-storyboard
Every command runs the package through npx (Node 20 or later), found where it already is, once, before the first command. Read the project's root package.json first.
-
The project's own. When
package.jsonlists arch-storyboard, run that one: write each command witharch-storyboardfor[email protected], and--no --offlinefor--yes. When it is older than1.0.1, say so, with the project's own command to upgrade (npm install --save-dev [email protected]), and stop. If npx says it is missing, ask the user to install the project's dependencies, and stop. -
This version, already on the machine:
npx --no --offline --loglevel=error [email protected] --versionIt uses no network. When it prints
1.0.1, run the commands as written. -
Not there: ask before downloading. Say what and from where: the npm package
[email protected]and its one dependencyelkjs(the layout engine, used only at build time), about 8 MB unpacked, from the npm registry. Offer to install it into the project (npm install --save-dev [email protected]) or to let npx fetch it once, and run neither until the user picks one.
Workflow
- Gather the nodes, connections and story from the user, or from the code/docs they point to. Settle the open story questions first with
references/interview.md. Decide layout intent yourself:layer,order,ports,group,size,spread,gap. - Write
spec.json(data only — never coordinates or routes as x/y). Seereferences/spec-schema.md. - Validate:
npx --yes --loglevel=error [email protected] validate spec.json— names the failing JSON path and the fix. - Build:
npx --yes --loglevel=error [email protected] build spec.json out/— validates, runs ELK once, checks geometry and text, writesout/index.html. - Verify (optional):
npx --yes --loglevel=error [email protected] verify spec.json out/ --shots shots/— headless Chrome at 1280 px; seereferences/quality-gates.md. It needs Python 3 with Pillow, numpy and playwright, and Chrome. Ask before installing any of them, and skip the step when the user declines; report that the build passed its own geometry and text checks but was not verified in a browser. - Deliver
out/index.html(copy it to the caller's requested path) plus the spec. Never patch generated HTML to hide a defect: fix the spec, a hint or the runtime, then rebuild.
Export (optional)
npx --yes --loglevel=error [email protected] export spec.json svg/ writes one standalone SVG per step (step-1.svg, step-2.svg, ...) for documents and slides; the files carry their own styling and make no external request. Add --png for a PNG per step: it needs Python 3 with playwright and Chrome, so ask before installing either, and deliver the SVGs when the user declines.
Authoring rules
- Nodes carry
size,layer,order,port sides,kindand optional group membership. ELK decides positions and routes. A group that spans layers uses"spanLayers": true; its box is computed from its member cards at build time. - Text must fit at build time: short single-line titles/sub-lines; no runtime wrapping or measurement.
- All visual semantics are data:
traffic(packet colour/shape/fill/icon/trail),edgeKinds(colour/dash/width),kinds(node colour/icon),badgeRules,legend. A new traffic kind, entity or step needs no code change. - Request and response must differ by shape or fill, not colour alone.
- Steps hold captions, appearance/ghost state, badges and status chips. Journeys are ordered node
routes; the build resolves them to baked hops. Timing can be seconds or"journeyId.start|turn|end"withoffset.
Critique loop (optional, at most 3 rounds)
Screenshot every step (verify --shots), look at the images, then fix only spec hints (order, gaps, port sides, sizes, text) and rebuild. Stop after 3 rounds; report anything still imperfect.
References
references/interview.md— the questions to settle before writing a spec.references/spec-schema.md— every field, short example, validator errors and fixes.references/layout-hints.md— what works in ELK, what is ignored, and the build's geometry checks.references/visual-language.md— data-driven packets/edges/badges/chips/legend and accessibility.references/quality-gates.md— text measurement, scale, pacing, verification commands and claim limits.
Defaults you can rely on
- Output: one HTML file, typically 30–60 KB; build well under 3 s.
- Loop target: 45–90 s at 1×; durations come from path length and
pacing.speed. - URLs:
?step=Nstarts at step N;?step=N&paused&t=3.2freezes a repeatable frame for screenshots/tests. Keyboard: Space, ←, →.prefers-reduced-motionstarts paused. - Dependency:
elkjs(EPL-2.0) is a build-time dependency only and is not in the HTML. Document this to users; no runtime licences are shipped. - Claim only what the second, non-lane-aligned fixture and the verifier actually demonstrate. Headless Chrome at 1280/1920 px is the tested browser/viewport; other browsers and smaller viewports are not tested.