@pilotspace/add 1.3.0 → 1.5.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.
@@ -0,0 +1,23 @@
1
+ /* tokens.sample.css — tokens.sample.json resolved to CSS custom properties.
2
+ The SINGLE source of token values. Literals live ONLY here; the kit and the
3
+ screens reference var(--semantic-*). Flip one --semantic-* line below and EVERY
4
+ screen that links this file re-renders the same way. */
5
+ :root {
6
+ /* primitive — raw values (the only literals in the whole sample) */
7
+ --primitive-color-blue-500: #3B82F6;
8
+ --primitive-color-slate-900: #0F172A;
9
+ --primitive-color-white: #FFFFFF;
10
+ --primitive-space-2: 8px;
11
+ --primitive-space-4: 16px;
12
+ --primitive-font-family-sans: "Inter", system-ui, sans-serif;
13
+ --primitive-font-weight-regular: 400;
14
+ --primitive-font-weight-bold: 700;
15
+
16
+ /* semantic — alias the primitives; THIS is the layer screens bind to.
17
+ Repoint one of these to re-theme every screen at once. */
18
+ --semantic-color-accent: var(--primitive-color-blue-500);
19
+ --semantic-color-text: var(--primitive-color-slate-900);
20
+ --semantic-color-surface: var(--primitive-color-white);
21
+ --semantic-space-inset-sm: var(--primitive-space-2);
22
+ --semantic-space-inset-md: var(--primitive-space-4);
23
+ }
@@ -0,0 +1,118 @@
1
+ # UDD wireframe + HTML mock — make the layout visible before build
2
+
3
+ `udd-tokens.md` says what a UI is *made of*; `udd-catalog.md` says what it is *built
4
+ from*. Both are abstract JSON. This doc closes the last gap design.md names: turn a
5
+ prototype tree into a **real, captured screen the human confirms BEFORE build** — so
6
+ the build matches the expected layout instead of discovering it.
7
+
8
+ Two stages, low-fi → hi-fi:
9
+
10
+ - **Stage A — wireframe**: a fast, low-fi *structural* map. No styling.
11
+ - **Stage B — HTML mock**: a self-contained screen the human (or a headless tool)
12
+ actually renders and screenshots. The image is the design-confirm evidence.
13
+
14
+ The engine never renders. This is a recommendation + a worked sample, tool-agnostic
15
+ (consistent with `udd-catalog.md`'s render recipe). A worked pair ships beside it —
16
+ `welcome.sample.html` + `settings.sample.html` — that you can open in any browser.
17
+
18
+ ## Stage A — wireframe (low-fi, structural)
19
+
20
+ A **wireframe** is a low-fidelity, *structural* map of one screen — regions and the
21
+ component **slots** inside them — derived directly from the prototype tree, **before**
22
+ any color, type scale, or spacing is decided. It answers "what goes where", not "what
23
+ it looks like".
24
+
25
+ Derive it mechanically from `prototypes/<name>.json`: each container element is a
26
+ region, each leaf element is a slot, the tree's nesting is the layout nesting. Keep it
27
+ in plain text or boxes — the point is speed and a shared structural picture, not paint.
28
+
29
+ Worked example: `wireframe.sample.txt` is the Stage-A map of the welcome screen
30
+ (`Screen > Card > {Text, Text, Button}`), with each slot mapped 1:1 to its prototype
31
+ element. No colors, no pixel values — those arrive in Stage B.
32
+
33
+ ## Stage B — HTML mock (hi-fi, self-contained, screenshot-able)
34
+
35
+ The mock is a real screen built from the design foundation in **four moves**:
36
+
37
+ 1. **Resolve `tokens.json`'s `semantic` layer → CSS custom properties.** Each
38
+ `{semantic.dotted.path}` alias becomes a `--semantic-dotted-path` variable in a
39
+ `:root` block. This file is the single source of token values — see
40
+ `tokens.sample.css`.
41
+ 2. **One kit class per `catalog.json` component.** Each component (Screen, Card, Text,
42
+ Button, …) gets exactly one CSS class whose every visual value is a `var(--…)` from
43
+ step 1 — never a literal. This is the reusable **kit** — see `kit.sample.css`.
44
+ 3. **Compose the prototype tree into HTML using the kit classes.** Walk
45
+ `prototypes/<name>.json`: each element becomes an HTML node carrying its
46
+ component's kit class; nesting follows `children`. Style nothing inline.
47
+ 4. **Populate with mock data.** Fill the `Text`/`Button` content from the prototype's
48
+ props (or representative stand-ins). The result is a **self-contained** screen —
49
+ *no network*: it links only local sibling files — that opens offline and a
50
+ **headless** tool can **screenshot** directly (Playwright, `html2image`,
51
+ an agent browser, or a SaaS renderer — pick one; the engine never renders).
52
+
53
+ `welcome.sample.html` is the worked Stage-B mock of `prototype.sample.json`.
54
+
55
+ ## Fast path — render via json-render (for JS-ecosystem projects)
56
+
57
+ Your `prototypes/<name>.json` is already a **json-render `Spec`** — the exact schema
58
+ `udd-catalog.md` pins. If your project renders json-render (React, Vue, Svelte, Solid,
59
+ React Native, …) you can skip the hand-authored kit and render the prototype through
60
+ your *real* catalog, so the mock **is** the product and cannot drift from it:
61
+
62
+ - **Render** — feed `prototype.json` into your `defineCatalog(…)` (see `udd-catalog.md`'s
63
+ "Render recipe"), or use a pre-built catalog such as `@json-render/shadcn` (36
64
+ shadcn/ui components) — no hand-written components for those stacks.
65
+ - **Capture** — `@json-render/image` renders a `Spec` straight to **PNG / SVG** (Satori,
66
+ no browser), a deterministic captured image with no headless-screenshot step. That
67
+ image is the same design-confirm evidence (see "Capture is evidence").
68
+
69
+ Trade-off — this is the *fast path*, not the floor. json-render needs the JS/npm
70
+ toolchain + a renderer package, so it does NOT cover a native (SwiftUI / Flutter / …)
71
+ project, and it has **no wireframe mode** (Stage A stays a separate, renderer-agnostic
72
+ structural artifact). When there is no toolchain, or the stack is not JS, the
73
+ self-contained HTML + CSS mock above is the universal default.
74
+
75
+ ## Reuse & consistency (by construction)
76
+
77
+ Screens compose **only** from the shared kit + token vars — never hand-styled per
78
+ screen. Because every screen links the *same* `tokens.sample.css` + `kit.sample.css`,
79
+ a single **semantic-token flip** (one line in `tokens.sample.css`) re-renders **every**
80
+ screen the same way. Reuse before invent: pull an existing kit class first; add a new
81
+ one only for a genuine new `catalog.json` component.
82
+
83
+ `settings.sample.html` is a SECOND screen that **reuses** the welcome kit classes
84
+ (screen/card/text/button) without redefining them — proving the consistency: flip
85
+ `--semantic-color-surface` once and both screens change together.
86
+
87
+ ## Capture is evidence
88
+
89
+ The screenshot of a Stage-B mock is **design-confirm evidence** — the human-facing
90
+ proof of beat 4 in `design.md`. Captures live at **`.add/design/captures/<name>.<ext>`**
91
+ (one per prototype) and are **attached or mentioned in the feature's `TASK.md`**
92
+ (alongside the §6 evidence), so the screen the human approved stays traceable from the
93
+ task that builds it. The recommended default capture engine for a json-render project is
94
+ **`@json-render/image`** (Satori → PNG/SVG, no browser); otherwise capture the
95
+ self-contained HTML mock headless. The engine never produces this image — it only
96
+ MEASURES presence (`add.py check` raises a never-red `missing_capture` WARN for a
97
+ prototype with no capture); the capture recipe is a recommendation, not an engine feature.
98
+
99
+ ## Binds (read-only)
100
+
101
+ This recipe **consumes** the UDD contracts and never reshapes them:
102
+
103
+ - `tokens.json` — the semantic layer is the source of the CSS variables (unchanged).
104
+ - `catalog.json` — its component set is the source of the kit classes (unchanged).
105
+ - `prototypes/<name>.json` — the json-render tree is the structure both stages walk
106
+ (unchanged; the frozen data contract is read-only — a change there is a separate
107
+ change-request).
108
+
109
+ The mock (`*.sample.html`) is the human-facing *visible* view; the frozen
110
+ `prototypes/<name>.json` tree is the *machine-checkable* record. They are two views of
111
+ one screen.
112
+
113
+ ## Ships byte-identical
114
+
115
+ `udd-wireframe.md` and its five sample files ship **byte-identical** in both template
116
+ trees (canonical `tooling/templates/` and the `_bundled` mirror) — enforced by
117
+ `test_bundle_parity`. A file present in one tree but missing from the other is a
118
+ `parity_break`.
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <!-- welcome.sample.html — Stage-B HTML mock of prototype.sample.json (the welcome screen).
3
+ Self-contained (no network): links only the local shared stylesheets. Composes ONLY
4
+ from the kit classes in kit.sample.css and styles nothing inline. A headless tool
5
+ screenshots this file directly; that image is the design-confirm evidence
6
+ (see udd-wireframe.md, "Capture is evidence"). -->
7
+ <html lang="en">
8
+ <head>
9
+ <meta charset="utf-8">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <title>Welcome — design mock</title>
12
+ <link rel="stylesheet" href="tokens.sample.css">
13
+ <link rel="stylesheet" href="kit.sample.css">
14
+ </head>
15
+ <body>
16
+ <!-- prototype tree: Screen > welcome-card(Card) > {title(Text), subtitle(Text), cta(Button)} -->
17
+ <main class="screen">
18
+ <section class="card">
19
+ <h1 class="text text--bold">Welcome to ADD</h1>
20
+ <p class="text text--regular">Spec-and-tests-first, render-ready.</p>
21
+ <button class="button" type="button">Get started</button>
22
+ </section>
23
+ </main>
24
+ </body>
25
+ </html>
@@ -0,0 +1,27 @@
1
+ WIREFRAME — welcome screen (Stage A · low-fi · pre-styling)
2
+ derived from: prototypes/welcome.json (Screen > Card > Text, Text, Button)
3
+
4
+ +--------------------------------------------------+
5
+ | SCREEN [region: full viewport] |
6
+ | |
7
+ | +--------------------------------------+ |
8
+ | | CARD [region: centered group] | |
9
+ | | | |
10
+ | | [ Text slot ] title (bold) | |
11
+ | | [ Text slot ] subtitle | |
12
+ | | [ Button slot ] primary CTA | |
13
+ | | | |
14
+ | +--------------------------------------+ |
15
+ | |
16
+ +--------------------------------------------------+
17
+
18
+ slots map one-to-one to prototype elements:
19
+ SCREEN -> Screen (root)
20
+ CARD -> Card (welcome-card)
21
+ Text -> Text (title, subtitle)
22
+ Button -> Button (cta)
23
+
24
+ notes:
25
+ - structure only — no color, no type scale, no spacing values yet
26
+ - styling arrives in Stage B (kit.sample.css bound to tokens.sample.css)
27
+ - confirm the STRUCTURE here is right before investing in the hi-fi mock