yadflow 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -11
- package/README.md +30 -5
- package/bin/yad.mjs +36 -1
- package/cli/docs.mjs +298 -0
- package/cli/manifest.mjs +6 -1
- package/cli/roster.mjs +164 -0
- package/cli/setup.mjs +128 -2
- package/package.json +3 -4
- package/skills/sdlc/config.yaml +19 -0
- package/skills/sdlc/install.sh +1 -1
- package/skills/sdlc/module-help.csv +4 -0
- package/skills/yad-connect-docs/SKILL.md +132 -0
- package/skills/yad-connect-docs/references/docs-registry.md +74 -0
- package/skills/yad-connect-repos/SKILL.md +4 -0
- package/skills/yad-connect-repos/references/hub-config.md +3 -1
- package/skills/yad-docs/SKILL.md +159 -0
- package/skills/yad-docs/references/data-mapping.md +75 -0
- package/skills/yad-docs/references/theme-map.md +69 -0
- package/skills/yad-docs/templates/app/README.md +31 -0
- package/skills/yad-docs/templates/app/eslint.config.js +23 -0
- package/skills/yad-docs/templates/app/index.html +17 -0
- package/skills/yad-docs/templates/app/package-lock.json +4030 -0
- package/skills/yad-docs/templates/app/package.json +35 -0
- package/skills/yad-docs/templates/app/public/favicon.svg +28 -0
- package/skills/yad-docs/templates/app/public/logo.svg +39 -0
- package/skills/yad-docs/templates/app/public/vite.svg +1 -0
- package/skills/yad-docs/templates/app/src/App.tsx +98 -0
- package/skills/yad-docs/templates/app/src/components/Auth/LoginPage.tsx +101 -0
- package/skills/yad-docs/templates/app/src/components/Canvas/AnimatedMessage.tsx +101 -0
- package/skills/yad-docs/templates/app/src/components/Canvas/ConnectionLine.tsx +90 -0
- package/skills/yad-docs/templates/app/src/components/Canvas/FlowCanvas.tsx +216 -0
- package/skills/yad-docs/templates/app/src/components/Canvas/SystemComponent.tsx +153 -0
- package/skills/yad-docs/templates/app/src/components/Controls/PlaybackBar.tsx +284 -0
- package/skills/yad-docs/templates/app/src/components/Controls/StepDetail.tsx +167 -0
- package/skills/yad-docs/templates/app/src/components/DetailPanel/HandlerLogicSnippet.tsx +41 -0
- package/skills/yad-docs/templates/app/src/components/DetailPanel/RequestPayloadPreview.tsx +46 -0
- package/skills/yad-docs/templates/app/src/components/DetailPanel/RightPanel.tsx +88 -0
- package/skills/yad-docs/templates/app/src/components/DetailPanel/StatusCard.tsx +76 -0
- package/skills/yad-docs/templates/app/src/components/DetailPanel/TriggerEventCard.tsx +45 -0
- package/skills/yad-docs/templates/app/src/components/DocLayout/DocPageShell.tsx +80 -0
- package/skills/yad-docs/templates/app/src/components/DocLayout/DocSectionCard.tsx +55 -0
- package/skills/yad-docs/templates/app/src/components/DocLayout/DocTableOfContents.tsx +79 -0
- package/skills/yad-docs/templates/app/src/components/DocLayout/RoleCard.tsx +67 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/ApiReferenceSection.tsx +108 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/CancelabilitySection.tsx +73 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/CriticalRunbookSection.tsx +177 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/DataMigrationSection.tsx +102 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/DbSchemaSection.tsx +98 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/DeploymentGuideSection.tsx +104 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/DriverIntegrationSection.tsx +127 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/ExecutiveSummarySection.tsx +69 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/FlowOverviewSection.tsx +73 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/FlowPathsChecklistSection.tsx +96 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/MiddlewareChainSection.tsx +107 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/MonitoringAlertingSection.tsx +106 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/NotificationLocalizationSection.tsx +102 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/PMRoadmapSection.tsx +133 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/PerformanceTestingSection.tsx +91 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/RiderIntegrationSection.tsx +99 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/SecuritySection.tsx +74 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/StatusMachineSection.tsx +90 -0
- package/skills/yad-docs/templates/app/src/components/DocSections/TestPlanSection.tsx +163 -0
- package/skills/yad-docs/templates/app/src/components/Logs/SystemLogsTerminal.tsx +126 -0
- package/skills/yad-docs/templates/app/src/components/Navigation/TopNavBar.tsx +90 -0
- package/skills/yad-docs/templates/app/src/components/Reference/BullMQJobsList.tsx +60 -0
- package/skills/yad-docs/templates/app/src/components/Reference/DecisionTreeView.tsx +49 -0
- package/skills/yad-docs/templates/app/src/components/Reference/DeeplinkActionsChips.tsx +69 -0
- package/skills/yad-docs/templates/app/src/components/Reference/DriverUIStatesTable.tsx +61 -0
- package/skills/yad-docs/templates/app/src/components/Reference/FeatureFlagMatrix.tsx +73 -0
- package/skills/yad-docs/templates/app/src/components/Reference/RiderUIStatesTable.tsx +61 -0
- package/skills/yad-docs/templates/app/src/components/Reference/RulesLegendPanel.tsx +217 -0
- package/skills/yad-docs/templates/app/src/components/Reference/StakeholderToggle.tsx +41 -0
- package/skills/yad-docs/templates/app/src/components/Reference/TroubleshootingSection.tsx +93 -0
- package/skills/yad-docs/templates/app/src/components/Sidebar/PathSelector.tsx +148 -0
- package/skills/yad-docs/templates/app/src/components/Sidebar/SidebarFooter.tsx +40 -0
- package/skills/yad-docs/templates/app/src/components/Sidebar/StepList.tsx +234 -0
- package/skills/yad-docs/templates/app/src/components/shared/Badge.tsx +28 -0
- package/skills/yad-docs/templates/app/src/components/shared/CommandPalette.tsx +213 -0
- package/skills/yad-docs/templates/app/src/components/shared/Icon.tsx +21 -0
- package/skills/yad-docs/templates/app/src/components/shared/Tooltip.tsx +42 -0
- package/skills/yad-docs/templates/app/src/data/components.ts +74 -0
- package/skills/yad-docs/templates/app/src/data/docSections.ts +231 -0
- package/skills/yad-docs/templates/app/src/data/paths.ts +2319 -0
- package/skills/yad-docs/templates/app/src/data/referenceData.ts +392 -0
- package/skills/yad-docs/templates/app/src/data/roles.ts +145 -0
- package/skills/yad-docs/templates/app/src/data/types.ts +79 -0
- package/skills/yad-docs/templates/app/src/hooks/useAnimationQueue.ts +41 -0
- package/skills/yad-docs/templates/app/src/hooks/usePlayback.ts +100 -0
- package/skills/yad-docs/templates/app/src/hooks/useStakeholderFilter.ts +10 -0
- package/skills/yad-docs/templates/app/src/index.css +121 -0
- package/skills/yad-docs/templates/app/src/main.tsx +13 -0
- package/skills/yad-docs/templates/app/src/pages/RoleSelectPage.tsx +34 -0
- package/skills/yad-docs/templates/app/src/pages/StakeholderDocPage.tsx +98 -0
- package/skills/yad-docs/templates/app/src/pages/SubPathDetailPage.tsx +282 -0
- package/skills/yad-docs/templates/app/src/store/useAuthStore.ts +42 -0
- package/skills/yad-docs/templates/app/src/store/useFlowStore.ts +197 -0
- package/skills/yad-docs/templates/app/src/utils/iconMap.ts +46 -0
- package/skills/yad-docs/templates/app/tsconfig.app.json +28 -0
- package/skills/yad-docs/templates/app/tsconfig.json +7 -0
- package/skills/yad-docs/templates/app/tsconfig.node.json +26 -0
- package/skills/yad-docs/templates/app/vite.config.ts +10 -0
- package/skills/yad-docs-overview/SKILL.md +131 -0
- package/skills/yad-docs-overview/references/pipeline-model.md +102 -0
- package/skills/yad-docs-sync/SKILL.md +99 -0
- package/skills/yad-docs-sync/references/staleness.md +81 -0
- package/skills/yad-hub-bridge/references/login-roster.md +1 -0
- package/docs/index.html +0 -1323
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yad-docs
|
|
3
|
+
description: 'Generates the per-epic interactive documentation site — a vendored React/Vite/Tailwind SPA with an animated flow canvas and role-based stakeholder doc pages — from the epic''s approved artifacts (epic, architecture, the locked contract, UI design, stories, code-context, test cases). Themes it from the design tokens, wires the docs.json base path, and drives `yad docs build/deploy` to publish to Pages (or build-only when no target). This is an OUTPUT ENRICHMENT, never a gated front state: it never mutates state.json steps, approvals, or the contract lock. Use when the user says "generate the docs site", "build the interactive docs", or "deploy the epic docs".'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SDLC — Author the Interactive Docs Site (per-epic, output enrichment)
|
|
7
|
+
|
|
8
|
+
**Goal:** Turn an epic's approved artifacts into a **living, interactive documentation site** — a
|
|
9
|
+
vendored React 19 + Vite 7 + Tailwind v4 SPA with an animated **flow canvas** (system components on a
|
|
10
|
+
canvas, animated messages, playback, a system-logs terminal, a right detail panel) and **role-based
|
|
11
|
+
stakeholder doc pages** (each lens → a set of doc sections). The shell is generic; the **content** is
|
|
12
|
+
generated entirely into `src/data/*.ts` and the theme into `src/index.css`.
|
|
13
|
+
|
|
14
|
+
This is an **output enrichment**, exactly like `design-links.json` / `test-links.json` — **NOT a gated
|
|
15
|
+
front state.** It **never** mutates `.sdlc/state.json` `steps[]`, `approvals.json`, or
|
|
16
|
+
`contract-lock.json`, and it never adds a `state.json` step. It reads the *approved* shape and renders
|
|
17
|
+
it; it never decides approval. When a docs target is connected (`yad-connect-docs` → `.sdlc/docs.json`)
|
|
18
|
+
the site is built + deployed; when none is, it is npm-built to a local `dist/` (build-only).
|
|
19
|
+
|
|
20
|
+
## Conventions
|
|
21
|
+
|
|
22
|
+
- `{project-root}` resolves from the project working directory (the **product hub**).
|
|
23
|
+
- Artifacts live under `{project-root}/epics/EP-<slug>/`. The generated site lives at
|
|
24
|
+
`epics/EP-<slug>/docs-site/`; its `dist/` and `node_modules/` are gitignored, the generated **source
|
|
25
|
+
is committed**.
|
|
26
|
+
- The shell template is `skills/yad-docs/templates/app/` — copied **verbatim**, never modified in place.
|
|
27
|
+
Generated data must satisfy the types in `src/data/types.ts`.
|
|
28
|
+
- The docs target is recorded in `{project-root}/.sdlc/docs.json` (`yad-connect-docs`). The per-epic
|
|
29
|
+
build manifest (the staleness baseline) is `epics/EP-<slug>/.sdlc/docs-build.json`.
|
|
30
|
+
- The actual data-file **generation** (reading artifacts → writing `src/data/*.ts`, theming
|
|
31
|
+
`index.css`) is the **AI step** inside this skill; the `yad docs` CLI only does the npm build +
|
|
32
|
+
platform deploy + staleness hashing.
|
|
33
|
+
- Speak in the configured `communication_language`; write documents in `document_output_language`.
|
|
34
|
+
|
|
35
|
+
## Inputs
|
|
36
|
+
|
|
37
|
+
- `epic` — `EP-<slug>` (ask if not provided).
|
|
38
|
+
- `action` — `generate` (default) | `refresh` | `deploy`.
|
|
39
|
+
- `login_gate` — `true` | `false` (default `false`). When on, the generated site gates behind a local
|
|
40
|
+
login screen (`useAuthStore`); default off (public docs).
|
|
41
|
+
|
|
42
|
+
## On Activation
|
|
43
|
+
|
|
44
|
+
### Step 1 — Resolve the epic + check the *shape* is approved (NOT the gate)
|
|
45
|
+
Resolve `EP-<slug>`. Read `.sdlc/state.json`. Require **at least** that the epic exists and its
|
|
46
|
+
`epic-review` step has `status == "done"` (so the docs never describe an *unapproved* shape) — but do
|
|
47
|
+
**NOT** require any specific `currentStep`. Docs are an enrichment that runs over whatever is approved
|
|
48
|
+
so far. **Never touch `approvals.json` or `contract-lock.json`.** If `epic-review` has not passed, stop
|
|
49
|
+
and point the user at the gate (`yad-review-gate`); do not render an unapproved epic.
|
|
50
|
+
|
|
51
|
+
### Step 1b — Open the authoring branch
|
|
52
|
+
Open the `docs/EP-<slug>` authoring branch per the shared procedure
|
|
53
|
+
(`../yad-epic/references/state-schema.md` → "Authoring branches"): git-safe (skip with a note if
|
|
54
|
+
`{project-root}` is not a git work tree), check out the branch if it exists, else create it from the
|
|
55
|
+
hub's default branch. Generate and commit the site source on it.
|
|
56
|
+
|
|
57
|
+
### Step 2 — Read the inputs (the data sources)
|
|
58
|
+
Load each artifact and note what it feeds (full table in `references/data-mapping.md`):
|
|
59
|
+
|
|
60
|
+
- `epic.md` → **ExecutiveSummary** + **PMRoadmap** sections.
|
|
61
|
+
- `architecture.md` → **system components** (`components.ts`) + **flow paths** + the **Deployment** and
|
|
62
|
+
**Security** doc sections.
|
|
63
|
+
- `contract.md` `CONTRACT-SURFACE` → **ApiReference** / **StatusMachine** / **DbSchema** — the
|
|
64
|
+
**authoritative** API source. The docs **cannot drift** from the locked contract; render the surface
|
|
65
|
+
exactly as locked (cross-check `contract-lock.json`'s hash matches, but never modify it).
|
|
66
|
+
- `ui-design.md` + `DESIGN.md` + `.sdlc/design-links.json` → flow-path **UI states**, the `index.css`
|
|
67
|
+
**theme**, and a **Screens** section (linking the design-tool frames when present).
|
|
68
|
+
- `stories/*.md` → **one FlowPath each** (acceptance criteria → animated `FlowStep` messages +
|
|
69
|
+
`sideEffects`).
|
|
70
|
+
- `.sdlc/repos.json` + `.sdlc/code-context/<repo>/code-map.md` (for each repo in `epic.repos`) → real
|
|
71
|
+
module/endpoint names that **enrich** the components. **Staleness:** if a repo's current HEAD ≠ its
|
|
72
|
+
registry `syncedHead`, **warn** and stamp `code-context: stale` in the manifest — suggest `yad repo
|
|
73
|
+
refresh <repo>` (a human decision); **never auto-refresh**.
|
|
74
|
+
- `test-cases.md` + `.sdlc/test-links.json` → the **TestPlan** section.
|
|
75
|
+
|
|
76
|
+
Greenfield-safe: any absent input (no design tool, no test cases, no repos) degrades that section to
|
|
77
|
+
empty/omitted with a note — never invent content.
|
|
78
|
+
|
|
79
|
+
### Step 3 — Generate the site into `epics/EP-<slug>/docs-site/`
|
|
80
|
+
Copy the shell from `templates/app/` **verbatim**, then:
|
|
81
|
+
|
|
82
|
+
1. **Generate `src/data/*.ts` deterministically** — `paths.ts`, `components.ts`, `roles.ts`,
|
|
83
|
+
`docSections.ts`, `referenceData.ts` (mapping in `references/data-mapping.md`). Sort by **stable
|
|
84
|
+
IDs** (story `S0N`, repo name, endpoint `method+path`), use a **fixed key order**, and write **NO
|
|
85
|
+
timestamps inside the data files** — so regenerating an unchanged input yields a byte-identical file
|
|
86
|
+
(the staleness hash depends on it). Data must satisfy `src/data/types.ts`
|
|
87
|
+
(`FlowPath`/`FlowStep`/`AnimatedMessage`/`SystemComponent`/`StakeholderView`, etc.).
|
|
88
|
+
2. **Derive stakeholder roles** (`roles.ts`) from the hub roster roles (`.sdlc/hub.json`) ∩ the yadflow
|
|
89
|
+
lens set (analyst / pm / architect / ux / dev / tester / reviewer / engineer) ∩ the stories' `repos:`
|
|
90
|
+
tags — each role → its relevant doc `sectionIds` + `relevantPathIds` (`references/data-mapping.md`).
|
|
91
|
+
3. **Theme the `:root` block of `src/index.css`** from the design tokens, by the 4-tier priority in
|
|
92
|
+
`references/theme-map.md`: **DESIGN.md → design.json/design-links.json palette → code-map tokens →
|
|
93
|
+
default theme** (stamp `theme: default` in the manifest when it falls through to the shell default).
|
|
94
|
+
Keep fonts Space Grotesk + Noto Sans and the `.glass-panel`/`.flow-grid`/`.code-block` utilities.
|
|
95
|
+
4. **Substitute the Vite base** from `.sdlc/docs.json` `basePath` (per-epic sites nest under
|
|
96
|
+
`/<repo>/epics/EP-<slug>/`). Read `docs.json` for the base path + target; if absent, default base
|
|
97
|
+
`/` and treat as build-only.
|
|
98
|
+
5. **Set the login-gate flag** (`login_gate`, default off).
|
|
99
|
+
|
|
100
|
+
### Step 4 — Write the build manifest (the staleness baseline)
|
|
101
|
+
Write `epics/EP-<slug>/.sdlc/docs-build.json` — the baseline `yad-docs-sync` compares against:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"builtAt": "<YYYY-MM-DD>",
|
|
106
|
+
"theme": "design.json | DESIGN.md | default",
|
|
107
|
+
"artifactHash": "<sha256 of epic.md + architecture.md + contract.md CONTRACT-SURFACE + ui-design.md + each story>",
|
|
108
|
+
"repoHeads": { "<repo>": "<HEAD sha>" },
|
|
109
|
+
"deployUrl": "<url or null>",
|
|
110
|
+
"templateVersion": "<shell template version>"
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Do **NOT** add a `state.json` step — docs are an enrichment, exactly like `design-links.json`.
|
|
115
|
+
Optionally record a `docs:` line in a `DOCS.md` index under the epic.
|
|
116
|
+
|
|
117
|
+
### Step 5 — Build / deploy (`action`)
|
|
118
|
+
- `action: generate` (default) — generate the source + manifest; stop. The CLI may npm-build to verify,
|
|
119
|
+
but no publish.
|
|
120
|
+
- `action: deploy` — drive **`yad docs deploy --epic <id>`**: it npm-builds the site (`npm ci && npm run
|
|
121
|
+
build` as a subprocess, like `yad-spec` shelling `npx repomix`), ensures the Pages CI workflow is
|
|
122
|
+
present, and reports the deploy URL (publish happens via CI). **Degrades** to the local `dist/` path
|
|
123
|
+
when no platform CLI / `target: "none"` (build-only).
|
|
124
|
+
|
|
125
|
+
### Step 6 — Stop. Report (NEVER auto-advance)
|
|
126
|
+
Report: the site path (`epics/EP-<slug>/docs-site/`), the data files produced, the **theme source** (or
|
|
127
|
+
the default-theme degrade), the **deploy URL** or "build-only", and the **staleness baseline**
|
|
128
|
+
(`docs-build.json`). **NEVER auto-advance, NEVER record approval — this is not a gate.** Note any
|
|
129
|
+
`code-context: stale` warning so the human can refresh the repo cache.
|
|
130
|
+
|
|
131
|
+
## Hard rules
|
|
132
|
+
|
|
133
|
+
- **Output enrichment, never a gate.** This skill **MUST NEVER** mutate `.sdlc/state.json` `steps[]`,
|
|
134
|
+
`approvals.json`, or `contract-lock.json`, and never adds a state step — exactly how `yad-ui` writes
|
|
135
|
+
`design-links.json` without changing the locked step shape.
|
|
136
|
+
- **Docs cannot drift from the locked contract.** The contract surface is the authoritative API source;
|
|
137
|
+
render it as locked. Never edit `contract-lock.json` or the contract here.
|
|
138
|
+
- **Deterministic generation.** Stable-ID sort, fixed key order, no timestamps inside `src/data/*.ts` —
|
|
139
|
+
so an unchanged input regenerates byte-identically and the staleness hash is meaningful.
|
|
140
|
+
- **Never auto-refresh a stale repo.** HEAD ≠ `syncedHead` ⇒ warn + stamp `code-context: stale`; the
|
|
141
|
+
refresh is a human decision (`yad repo refresh`).
|
|
142
|
+
- **Degrade gracefully.** No docs target → build-only (local `dist/`). No design tokens → default theme.
|
|
143
|
+
Absent inputs → omitted sections. No error — the site is additive.
|
|
144
|
+
- **Copy the shell verbatim.** Generate only `src/data/*.ts`, the `:root` of `index.css`, and the Vite
|
|
145
|
+
base. Never hand-edit `templates/app/`.
|
|
146
|
+
|
|
147
|
+
## Reference
|
|
148
|
+
- The deterministic DESIGN-token → CSS-custom-property mapping + 4-tier priority + default fallback:
|
|
149
|
+
`references/theme-map.md`.
|
|
150
|
+
- The full artifact → data-structure table, determinism rules, and role derivation:
|
|
151
|
+
`references/data-mapping.md`.
|
|
152
|
+
- The connected docs target + base-path resolution: `../yad-connect-docs/SKILL.md`.
|
|
153
|
+
- The design tokens this themes from: `../yad-connect-design/SKILL.md`.
|
|
154
|
+
- The code-context the data enriches: `../yad-connect-repos/SKILL.md`.
|
|
155
|
+
- The authoring pattern (front-state author that writes link artifacts without gating):
|
|
156
|
+
`../yad-ui/SKILL.md`.
|
|
157
|
+
- State schema + the "Authoring branches" procedure: `../yad-epic/references/state-schema.md`.
|
|
158
|
+
- The project overview site + the staleness/CI reconciler: `../yad-docs-overview/SKILL.md`,
|
|
159
|
+
`../yad-docs-sync/SKILL.md`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Data mapping — artifacts → `src/data/*.ts`
|
|
2
|
+
|
|
3
|
+
`yad-docs` copies the shell verbatim and **generates** the five data modules under `src/data/`. The
|
|
4
|
+
shell renders whatever these export, as long as it satisfies `src/data/types.ts`
|
|
5
|
+
(`FlowPath` / `FlowStep` / `AnimatedMessage` / `SystemComponent` / `StakeholderView` / `RoleConfig` /
|
|
6
|
+
`DocSectionConfig`). The generation is the AI step; it must be **deterministic** (rules at the bottom).
|
|
7
|
+
|
|
8
|
+
## Artifact → data-structure table
|
|
9
|
+
|
|
10
|
+
| Generated file | Exports | Fed by (artifact) | What maps |
|
|
11
|
+
|----------------|---------|-------------------|-----------|
|
|
12
|
+
| `components.ts` | `COMPONENTS: SystemComponent[]` | `architecture.md` system components + `code-map.md` module/endpoint names | each durable component → `{ id, label, icon, color, position, description }`; canvas `position` laid out deterministically; real module names from the code-map enrich `label`/`description`. |
|
|
13
|
+
| `paths.ts` | `FLOW_PATHS: FlowPath[]` | `stories/*.md` (one FlowPath each) + `architecture.md` flows | each story → one `FlowPath` (`id`, `label`, `icon`, `color`, `category`, `steps[]`); each acceptance criterion → a `FlowStep` whose `messages: AnimatedMessage[]` animate the request/response/event/job and whose `sideEffects` record jobs/notifications/pubsub. UI states (from `ui-design.md`) annotate each step. |
|
|
14
|
+
| `roles.ts` | `ROLES: RoleConfig[]` | hub roster (`.sdlc/hub.json`) + the yadflow lens set + stories' `repos:` tags | each stakeholder lens → `{ slug, label, shortLabel, icon, color, description, sectionIds, relevantPathIds }` (role derivation below). |
|
|
15
|
+
| `docSections.ts` | `DOC_SECTIONS: DocSectionConfig[]` | `epic.md`, `architecture.md`, `contract.md`, `ui-design.md`, `test-cases.md` | the ordered doc-section registry (`{ id, title, icon, iconColor, component }`); each section id is referenced from `roles.ts`. |
|
|
16
|
+
| `referenceData.ts` | the reference tables/payloads the doc-section components render | `contract.md` CONTRACT-SURFACE (authoritative) + `architecture.md` + `test-cases.md` | API reference rows, the status machine, the DB schema, feature flags, error codes, the test plan — the structured data behind the doc sections. |
|
|
17
|
+
|
|
18
|
+
## Section sources (the doc sections + their artifact)
|
|
19
|
+
|
|
20
|
+
| Doc section(s) | Artifact source |
|
|
21
|
+
|----------------|-----------------|
|
|
22
|
+
| ExecutiveSummary, PMRoadmap | `epic.md` |
|
|
23
|
+
| FlowOverview, system components, Deployment, Security | `architecture.md` |
|
|
24
|
+
| **ApiReference, StatusMachine, DbSchema** | `contract.md` **CONTRACT-SURFACE — authoritative, must not drift from `contract-lock.json`** |
|
|
25
|
+
| Rider/Driver/role UI states, Screens, the theme | `ui-design.md` + `DESIGN.md` + `design-links.json` |
|
|
26
|
+
| TestPlan, FlowPathsChecklist, ErrorCodes | `test-cases.md` + `test-links.json` |
|
|
27
|
+
|
|
28
|
+
Any absent input degrades its section to empty/omitted (greenfield-safe); never invent content. The
|
|
29
|
+
contract is rendered exactly as locked — the docs are a *view* of the locked surface, never a re-author.
|
|
30
|
+
|
|
31
|
+
## Role derivation (`roles.ts`)
|
|
32
|
+
|
|
33
|
+
A stakeholder role is generated for each lens that is **both** present in the hub roster **and** relevant
|
|
34
|
+
to this epic:
|
|
35
|
+
|
|
36
|
+
1. Start from the **yadflow lens set**: `analyst`, `pm`, `architect`, `ux`, `dev`, `tester`, `reviewer`,
|
|
37
|
+
`engineer`.
|
|
38
|
+
2. Intersect with the **hub roster** roles (`.sdlc/hub.json` `roster[].roles`) — only emit lenses the
|
|
39
|
+
team actually has (an unmapped lens is dropped, never invented).
|
|
40
|
+
3. For the `dev`/`engineer` lenses, **fan out per `repos:` tag** present across the epic's stories (e.g.
|
|
41
|
+
a `backend` dev role and a `mobile` dev role), so each repo audience gets its own integration view —
|
|
42
|
+
mirroring the reference site's per-app dev roles.
|
|
43
|
+
4. Each role maps to its relevant `sectionIds` (which doc sections it should see) + `relevantPathIds`
|
|
44
|
+
(which FlowPaths/stories touch it). Keep these stable: derive `relevantPathIds` from the stories
|
|
45
|
+
tagged with that role's repo, sorted by story id.
|
|
46
|
+
|
|
47
|
+
## Determinism rules (load-bearing — the data feeds `artifactHash`)
|
|
48
|
+
|
|
49
|
+
- **Sort by stable IDs:** stories by `S0N`, repos by name, endpoints by `method + path`, roles by lens
|
|
50
|
+
order above. Never sort by anything time- or order-of-discovery-dependent.
|
|
51
|
+
- **Fixed key order** in every emitted object (match the `types.ts` field order).
|
|
52
|
+
- **No timestamps inside `src/data/*.ts`.** Build/deploy times live only in `docs-build.json`.
|
|
53
|
+
- Colors/icons assigned to paths/components/roles come from the theme + a **fixed** lens→icon/color map
|
|
54
|
+
(Material Symbols names), not randomly — so regenerating an unchanged input yields a byte-identical
|
|
55
|
+
file, and the staleness hash only moves when an *artifact* actually moves.
|
|
56
|
+
- IDs are derived from the source IDs (story id → `FlowPath.id`, repo/module name → component `id`), never
|
|
57
|
+
freshly minted, so links stay stable across regenerations.
|
|
58
|
+
|
|
59
|
+
## The DocSection components are NOT purely data-driven — regenerate their content too
|
|
60
|
+
|
|
61
|
+
The vendored shell ships the reference app's `src/components/DocSections/*.tsx` **with hardcoded
|
|
62
|
+
booking-domain content inline** (e.g. `ApiReferenceSection.tsx` declares a literal `ENDPOINTS`
|
|
63
|
+
array). They are NOT yet wired to read everything from `referenceData.ts`. So generation has two
|
|
64
|
+
parts, both the AI step:
|
|
65
|
+
|
|
66
|
+
1. **Data files** — write `src/data/{paths,components,roles,docSections,referenceData}.ts` from the
|
|
67
|
+
artifacts (the table above).
|
|
68
|
+
2. **Section content** — for every section a role references, replace the inline constants inside the
|
|
69
|
+
matching `DocSections/<Name>Section.tsx` with this epic's content (or refactor the section to read
|
|
70
|
+
its rows from `referenceData.ts`). A section left with the reference's booking content is a bug —
|
|
71
|
+
the docs would describe the wrong system. The contract surface is the authoritative source for the
|
|
72
|
+
API/StatusMachine/DbSchema sections.
|
|
73
|
+
|
|
74
|
+
Keep both deterministic (sorted, fixed key order, no timestamps) so the build manifest hash only moves
|
|
75
|
+
when an artifact actually moves.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Theme map — DESIGN tokens → `index.css` `:root`
|
|
2
|
+
|
|
3
|
+
`yad-docs` themes only the **`:root` block** of the copied shell's `src/index.css` (and nothing else —
|
|
4
|
+
fonts, utilities, and the rest of the file stay verbatim). The shell's design system is a dark
|
|
5
|
+
CSS-custom-property theme; theming = overwriting the `:root` custom properties from the epic's design
|
|
6
|
+
tokens, deterministically. Fonts are always **Space Grotesk** (display / headings) + **Noto Sans**
|
|
7
|
+
(body), and the `.glass-panel` / `.flow-grid` / `.code-block` utilities and Material Symbols icon names
|
|
8
|
+
are untouched.
|
|
9
|
+
|
|
10
|
+
## 4-tier priority (first hit wins, per property)
|
|
11
|
+
|
|
12
|
+
For each custom property, resolve its value in this order and **stamp `theme:` in `docs-build.json`** to
|
|
13
|
+
the tier that supplied the palette:
|
|
14
|
+
|
|
15
|
+
1. **`DESIGN.md`** (`theme: DESIGN.md`) — the epic's hand/Impeccable-authored design-system tokens. The
|
|
16
|
+
richest source; use it when present.
|
|
17
|
+
2. **`design.json` / `design-links.json` palette** (`theme: design.json`) — the connected design tool's
|
|
18
|
+
palette (e.g. a Figma file's color styles read back).
|
|
19
|
+
3. **code-map tokens** (`theme: design.json`-tier fallback, noted) — brand/theme tokens captured in
|
|
20
|
+
`.sdlc/code-context/<repo>/code-map.md` for repos in `epic.repos`, so the site matches the built UI.
|
|
21
|
+
4. **default theme** (`theme: default`) — keep the shell's reference `:root` verbatim (the dark theme
|
|
22
|
+
below). Stamp `theme: default` so the degrade is visible.
|
|
23
|
+
|
|
24
|
+
A single missing token falls through to the next tier for **that token only** (the others can still come
|
|
25
|
+
from a higher tier); only a wholesale absence stamps `theme: default`.
|
|
26
|
+
|
|
27
|
+
## Token → custom-property mapping
|
|
28
|
+
|
|
29
|
+
Map design tokens onto these properties (the exact set the shell defines). Names match the reference
|
|
30
|
+
`index.css` — do not rename or add properties.
|
|
31
|
+
|
|
32
|
+
| Design token (role) | CSS custom property | Default (reference) |
|
|
33
|
+
|---------------------|---------------------|---------------------|
|
|
34
|
+
| page background | `--color-bg-primary` | `#141118` |
|
|
35
|
+
| raised surface | `--color-bg-secondary` | `#1e1a25` |
|
|
36
|
+
| higher surface | `--color-bg-tertiary` | `#2f2938` |
|
|
37
|
+
| brand wash | `--color-bg-brand-soft` | `#1a0244` |
|
|
38
|
+
| accent wash | `--color-bg-accent-soft` | `#25060e` |
|
|
39
|
+
| panel surface | `--color-surface-dark` | `#1e1a25` |
|
|
40
|
+
| highlighted surface | `--color-surface-highlight` | `#2f2938` |
|
|
41
|
+
| darkest surface (code blocks) | `--color-surface-darker` | `#0f0e13` |
|
|
42
|
+
| primary text | `--color-text-primary` | `#ffffff` |
|
|
43
|
+
| secondary text | `--color-text-secondary` | `#a8a4b2` |
|
|
44
|
+
| muted text | `--color-text-muted` | `#767284` |
|
|
45
|
+
| **primary brand** | `--color-primary` | `#6116da` |
|
|
46
|
+
| primary hover | `--color-primary-hover` | `#7a2ce0` |
|
|
47
|
+
| primary soft | `--color-primary-soft` | `#35087c` |
|
|
48
|
+
| **accent** | `--color-accent` | `#ff6490` |
|
|
49
|
+
| accent hover | `--color-accent-hover` | `#fb2576` |
|
|
50
|
+
| accent soft | `--color-accent-soft` | `#4f0520` |
|
|
51
|
+
| light border | `--color-border-light` | `#453c53` |
|
|
52
|
+
| default border | `--color-border-default` | `#342e40` |
|
|
53
|
+
| strong border | `--color-border-strong` | `#141118` |
|
|
54
|
+
|
|
55
|
+
### Derivation rules (deterministic)
|
|
56
|
+
- The two anchors are **`--color-primary`** and **`--color-accent`**; everything else derives from them
|
|
57
|
+
and the background ramp when a source supplies only a brand + accent.
|
|
58
|
+
- `*-hover` = the anchor lightened one step; `*-soft` = the anchor darkened/desaturated for washes.
|
|
59
|
+
Apply a **fixed** lightness delta (no randomness) so regeneration is byte-identical.
|
|
60
|
+
- The background ramp (`bg-primary` → `bg-tertiary` → `surface-*`) is darkest→lighter; preserve that
|
|
61
|
+
ordering when mapping a source's neutrals.
|
|
62
|
+
- Always emit the **full property set** in the **fixed order above** (matching the reference file), with
|
|
63
|
+
no trailing timestamp/comment — the theme contributes to the `artifactHash`, so determinism matters.
|
|
64
|
+
|
|
65
|
+
## Fonts + utilities (never themed)
|
|
66
|
+
Headings/`.font-display` → **Space Grotesk**; body/`.font-body` → **Noto Sans**. The `.glass-panel`,
|
|
67
|
+
`.flow-grid`, `.code-block`, scrollbar, and `.logs-scrollbar` utilities are copied verbatim from the
|
|
68
|
+
shell. Icons are **Material Symbols** names (e.g. `phone_iphone`, `terminal`, `bar_chart`) carried in
|
|
69
|
+
the data files, not the theme.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# yadflow docs site (template)
|
|
2
|
+
|
|
3
|
+
This is the **vendored shell** that the `yad-docs` / `yad-docs-overview` skills copy to generate an
|
|
4
|
+
interactive documentation site (an animated flow canvas + role-based stakeholder doc pages). It is a
|
|
5
|
+
React 19 + Vite 7 + Tailwind v4 + framer-motion + zustand + react-router app.
|
|
6
|
+
|
|
7
|
+
**You normally don't edit this template directly.** The skills copy it (to
|
|
8
|
+
`epics/EP-<slug>/docs-site/` for a feature, or `docs/sdlc-site/` for the SDLC overview) and then
|
|
9
|
+
**generate the content** into `src/data/*.ts` + the `DocSections/*` components, theme `src/index.css`
|
|
10
|
+
from the connected design system, and substitute the Vite `base` (the `__BASE_PATH__` token) from
|
|
11
|
+
`.sdlc/docs.json`.
|
|
12
|
+
|
|
13
|
+
## What is generated vs. fixed
|
|
14
|
+
|
|
15
|
+
- **Generated per site:** `src/data/{paths,components,roles,docSections,referenceData}.ts`, the
|
|
16
|
+
`:root` theme block of `src/index.css`, the referenced `DocSections/*` content, and the `base` path.
|
|
17
|
+
- **Fixed shell (copied verbatim):** `src/App.tsx`, `src/main.tsx`, the `components/` /
|
|
18
|
+
`hooks/` / `store/` infrastructure, and `src/data/types.ts` (the contracts the generated data
|
|
19
|
+
satisfies).
|
|
20
|
+
|
|
21
|
+
## Local commands
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm ci # or: npm install
|
|
25
|
+
npm run dev # local preview
|
|
26
|
+
npm run build # tsc -b && vite build → dist/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Build + deploy are normally driven by the CLI: `yad docs build|deploy|sync`. The login gate
|
|
30
|
+
(`DOCS_REQUIRE_LOGIN` in `src/store/useAuthStore.ts`) is **off by default** — it is presentational
|
|
31
|
+
only, never a security control; private docs rely on the repo / Pages access control.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(['dist']),
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
extends: [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
ecmaVersion: 2020,
|
|
20
|
+
globals: globals.browser,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
])
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Booking Flow Visualizer</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
|
11
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet" />
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|