Skill Tracer
Skills › Archify › archify › README.md

README.md

104 lines · archify/renderers/lifecycle/README.md at a406594

Open on GitHub
1# Lifecycle Renderer
2
3Render `diagram_type: "lifecycle"` JSON files into the standard Archify HTML
4template.
5
6```bash
7node archify/renderers/lifecycle/render-lifecycle.mjs input.lifecycle.json output.html
8```
9
10The renderer validates input against `archify/schemas/lifecycle.schema.json`
11with the bundled standalone validator. No dependency installation is required.
12If `output.html` is omitted, the renderer uses the required `meta.output` value
13from the JSON file.

Lifecycle Renderer

Render diagram_type: "lifecycle" JSON files into the standard Archify HTML template.

node archify/renderers/lifecycle/render-lifecycle.mjs input.lifecycle.json output.html

The renderer validates input against archify/schemas/lifecycle.schema.json with the bundled standalone validator. No dependency installation is required. If output.html is omitted, the renderer uses the required meta.output value from the JSON file.

Raw lines 1 to 14
15## Input
17```json
19 "schema_version": 3,
20 "diagram_type": "lifecycle",
21 "meta": { "title": "Deployment Release Lifecycle", "output": "deployment-release.html" },
22 "mainPath": ["queued", "building", "verifying", "ready", "live"],
23 "states": [],
24 "transitions": [],
25 "cards": []
27```
29A complete example lives at `archify/examples/deployment-release.lifecycle.json`.
31- `mainPath` is the happy path from the initial state. Every consecutive pair
32 needs a transition; the first such transition is drawn as the main row.
33- `states[]` carry meaning only: `id`, `type`, `label`, optional `sublabel`,
34 `tag`, `step`, `icon`, `brand` and `sources`.
35- `transitions[]` carry `from`, `to`, optional `id`, `label`, `note` and
36 `variant`. There are no routing or label-position controls.

Input

{
  "schema_version": 3,
  "diagram_type": "lifecycle",
  "meta": { "title": "Deployment Release Lifecycle", "output": "deployment-release.html" },
  "mainPath": ["queued", "building", "verifying", "ready", "live"],
  "states": [],
  "transitions": [],
  "cards": []
}

A complete example lives at archify/examples/deployment-release.lifecycle.json.

  • mainPath is the happy path from the initial state. Every consecutive pair needs a transition; the first such transition is drawn as the main row.
  • states[] carry meaning only: id, type, label, optional sublabel, tag, step, icon, brand and sources.
  • transitions[] carry from, to, optional id, label, note and variant. There are no routing or label-position controls.
Raw lines 15 to 37
38## Layout
40The geometry follows from the structure alone:
42| Element | Placement |
43|---------|-----------|
44| Main path | One left-to-right row. Each gap fits its transition label. The first state receives the UML initial marker. |
45| Loops and skips | A transition between two non-consecutive main-path states (or back to an earlier one, or a self-transition) is an arc above the row. Shorter arcs nest inside longer ones; ports order so an outer riser never crosses an inner arc. |
46| Other states | One row per distance from the main path. A state starts under the states it connects to in the row above; overlapping states pack side by side. |
47| Between rows | Orthogonal routes through a shared gap. Horizontal runs take separate tracks, chosen to minimise crossings; near-vertical routes snap straight or widen to a readable jog. |
48| Shared exits | A target with exactly one group of identical label, note and variant from at least two main-path phases shares an exit: consecutive phases receive a dashed composite frame, as in a UML superstate; non-consecutive phases share a bus with junction dots. Other exits keep separate connectors and their own labels. If several groups qualify for the same target, all exits stay separate. |
49| Same lower row | Neighbours connect side to side, parallel transitions fanning out around the shared edge (at most five per pair of states). Dense parallel labels and notes increase their lane spacing and the height of that lower row to keep clear; other pairs loop under the row. |
50| Labels | Above main-path arrows, on arc and loop runs, otherwise beside the segment next to the lower state. Every label keeps clear of other routes, states and labels; if one cannot, lower-row and route spacing grow and layout repeats, for at most five rounds. Main-path gaps stop growing before their minimum row width exceeds the text readability budget; gaps still fit their transition text. |
52Every route carries a crossover halo, so an unavoidable crossing (for example,
53two overlapping loops) stays legible. Lines are orthogonal with rounded corners.
54Keep a distinct note on its original transition. Do not remove or copy notes to
55make different exits qualify for sharing. The final width and label-clearance
56checks still apply after layout retries.

Layout

The geometry follows from the structure alone:

ElementPlacement
Main pathOne left-to-right row. Each gap fits its transition label. The first state receives the UML initial marker.
Loops and skipsA transition between two non-consecutive main-path states (or back to an earlier one, or a self-transition) is an arc above the row. Shorter arcs nest inside longer ones; ports order so an outer riser never crosses an inner arc.
Other statesOne row per distance from the main path. A state starts under the states it connects to in the row above; overlapping states pack side by side.
Between rowsOrthogonal routes through a shared gap. Horizontal runs take separate tracks, chosen to minimise crossings; near-vertical routes snap straight or widen to a readable jog.
Shared exitsA target with exactly one group of identical label, note and variant from at least two main-path phases shares an exit: consecutive phases receive a dashed composite frame, as in a UML superstate; non-consecutive phases share a bus with junction dots. Other exits keep separate connectors and their own labels. If several groups qualify for the same target, all exits stay separate.
Same lower rowNeighbours connect side to side, parallel transitions fanning out around the shared edge (at most five per pair of states). Dense parallel labels and notes increase their lane spacing and the height of that lower row to keep clear; other pairs loop under the row.
LabelsAbove main-path arrows, on arc and loop runs, otherwise beside the segment next to the lower state. Every label keeps clear of other routes, states and labels; if one cannot, lower-row and route spacing grow and layout repeats, for at most five rounds. Main-path gaps stop growing before their minimum row width exceeds the text readability budget; gaps still fit their transition text.

Every route carries a crossover halo, so an unavoidable crossing (for example, two overlapping loops) stays legible. Lines are orthogonal with rounded corners. Keep a distinct note on its original transition. Do not remove or copy notes to make different exits qualify for sharing. The final width and label-clearance checks still apply after layout retries.

Raw lines 38 to 57
58## Legend and state marks
60State color follows `states[].type`: active and start are cyan, waiting amber,
61decision purple, success green, failure rose, neutral and external slate. The
62first main-path state carries the initial marker; a state with no outgoing
63transition gets a double border as a final state. The default legend derives
64kinds from the rendered states, always lists the initial marker, and adds a
65non-interactive `final` entry when a final state exists. Supported
66`meta.legend.entries` keys, in stable order, are `start`, `active`, `waiting`,
67`decision`, `success`, `failure`, `neutral`, and `external`.
69State decorations share one top rail: the type sigil and `step` on the left and
70the brand mark at the right corner. Only states a reader should notice get a
71default sigil: `waiting` (hourglass), `decision` (diamond), `success` (check),
72`failure` (cross) and `external`; `start`, `active` and `neutral` states have
73none unless `icon` sets one, except as a final state, which gets a stop sigil
74so every outcome is marked. State width grows from 140px to 220px to fit its
75text at the preferred size (12px label, 9px sublabel, 8px tag) before the text
76shrinks.

Legend and state marks

State color follows states[].type: active and start are cyan, waiting amber, decision purple, success green, failure rose, neutral and external slate. The first main-path state carries the initial marker; a state with no outgoing transition gets a double border as a final state. The default legend derives kinds from the rendered states, always lists the initial marker, and adds a non-interactive final entry when a final state exists. Supported meta.legend.entries keys, in stable order, are start, active, waiting, decision, success, failure, neutral, and external.

State decorations share one top rail: the type sigil and step on the left and the brand mark at the right corner. Only states a reader should notice get a default sigil: waiting (hourglass), decision (diamond), success (check), failure (cross) and external; start, active and neutral states have none unless icon sets one, except as a final state, which gets a stop sigil so every outcome is marked. State width grows from 140px to 220px to fit its text at the preferred size (12px label, 9px sublabel, 8px tag) before the text shrinks.

Raw lines 58 to 77
78## Validation
80Schema violations exit non-zero with path-prefixed messages. The renderer also
81rejects duplicate state ids, unknown or repeated `mainPath` states, a
82`mainPath` step without a transition, unknown transition endpoints, state text
83that cannot fit the widest state, a canvas wider than its smallest text allows
84on a desktop (`lifecycle/too-wide`), and a label that cannot be placed after the
85spacing rounds (`lifecycle/label-unplaced`), and more than five parallel
86transitions between two neighbouring states
87(`lifecycle/crowded-side-transitions`). Each failure is a typed diagnostic
88with supported fixes.
90The final artifact check applies the shared composition gates (orthogonal
91segments, crossings, corridors, label clearance and route rhythm). Routes of one
92shared-exit bus declare `data-composition-junction`; they may share only that
93horizontal bus, the identical first tick from the same source port, and, when
94they end at the same state, the merged drop into it. Internal vertical runs
95remain subject to the corridor check.

Validation

Schema violations exit non-zero with path-prefixed messages. The renderer also rejects duplicate state ids, unknown or repeated mainPath states, a mainPath step without a transition, unknown transition endpoints, state text that cannot fit the widest state, a canvas wider than its smallest text allows on a desktop (lifecycle/too-wide), and a label that cannot be placed after the spacing rounds (lifecycle/label-unplaced), and more than five parallel transitions between two neighbouring states (lifecycle/crowded-side-transitions). Each failure is a typed diagnostic with supported fixes.

The final artifact check applies the shared composition gates (orthogonal segments, crossings, corridors, label clearance and route rhythm). Routes of one shared-exit bus declare data-composition-junction; they may share only that horizontal bus, the identical first tick from the same source port, and, when they end at the same state, the merged drop into it. Internal vertical runs remain subject to the corridor check.

Raw lines 78 to 96
97## Design rules
99- Treat the main path as the story: about six phases at most.
100- Put interruptions, waits and exits off the main path; the renderer places them.
101- Give an exit shared by several phases one label, such as “cancel”.
102- A recoverable failure needs a real transition back.
103- Use `success` for completion, `failure` for failure exits, `waiting` for
104 pauses, and `decision` for quality gates.

Design rules

  • Treat the main path as the story: about six phases at most.
  • Put interruptions, waits and exits off the main path; the renderer places them.
  • Give an exit shared by several phases one label, such as “cancel”.
  • A recoverable failure needs a real transition back.
  • Use success for completion, failure for failure exits, waiting for pauses, and decision for quality gates.
Raw lines 97 to 104