baldart 4.72.0 → 4.73.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 CHANGED
@@ -5,6 +5,22 @@ All notable changes to BALDART will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.73.0] - 2026-06-25
9
+
10
+ **Mockup→code fidelity: let the implementer actually SEE the mockup, and carry the intent a flat list loses.** A recurring complaint: a detailed mockup (Claude Design / Figma) is handed to `/prd`, then `/new` ships something that is not 1:1 with the design. The obvious diagnosis — "the PRD's visual mapping is too weak, add a mockup-understanding agent" — was **refuted** by an adversarial pass: the visual data largely already exists (`mockup_analysis` captures affordances + traceability + states + DS violations; `component_bindings` propagates region→component to the implementer), and a parallel machine-readable `design-spec` artifact would be a second SSOT that drifts from the mockup and would feed the verifier a textual proxy instead of the pixels (a bias `visual-fidelity-verifier` explicitly forbids). The **actual driver**: the `/new` UI briefing passes the mockup as a *path* and says "Read the design.html file" — but for a binary PNG/Figma mockup nothing ever instructs the (multimodal) `ui-expert` to **load the image into its context**. The implementer was building from text, never looking at the design.
11
+
12
+ **MINOR** — adds capability; **no new `baldart.config.yml` key** (rides on the existing `features.has_design_system`), so the schema-change propagation rule does NOT apply. The new `component_bindings[].props` is an **optional** sub-field — legacy cards omit it and the validator (which keys on the `C`-profile top-level field) is unaffected. On a non-multimodal tool (Codex) the image-load instruction degrades to a harmless no-op and the structured fields carry the intent.
13
+
14
+ ### Changed
15
+
16
+ - **The `/new` UI briefing loads the mockup IMAGE multimodally** (`framework/.claude/skills/new/references/implement.md` § "Design Reference"). The instruction now branches on the file type of `links.design`: an IMAGE (`.png`/`.jpg`/`.jpeg`/`.webp`/`.pdf`, or a `mockups/*.png` canonical path) is **`Read` directly** so it renders into the agent's context (pixels = fidelity target); an `.html` keeps the existing read-as-text behaviour. The briefing also now surfaces `component_bindings[].props`/`variant` (exact variant intent) and the card's responsive ACs (breakpoint behaviour a single-viewport image cannot show) as the structured complement to the image.
17
+ - **`mockup_analysis` schema enriched in-place with the four dimensions a flat affordance list + a single static image lose** (`framework/.claude/skills/prd/references/discovery-phase.md` § "Mockup analysis schema"). Each `screens[]` entry gains four OPTIONAL fields: `layout` (compact nesting sketch — the hierarchy), `component_props` (key props/variant legible per component — the reuse-vs-`reuse-variant` signal), `states` (richer `states_visible` mapping each state→the AC that mandates it; an untraced state is a Discovery gap by the same rule as an untraced affordance), and `responsive` (breakpoint behaviour). "Omit rather than guess" discipline extended to all four.
18
+ - **Component Reconciliation consumes the enrichment and persists it** (`framework/.claude/skills/prd/references/ui-design-phase.md` § "Component Reconciliation"). `REUSE+VARIANT` detection now compares `mockup_analysis.component_props` against the component's spec HEAD (props the spec doesn't cover ⇒ variant), and the persist step carries resolved props into `component_bindings[].props` and lifts `responsive` notes into the UI card's `acceptance_criteria` as testable ACs.
19
+
20
+ ### Added
21
+
22
+ - **`component_bindings[].props` card sub-field** (`framework/agents/card-schema.md` § `component_bindings`) — the optional resolved props/variant each region must use, the exact-variant intent a static image leaves ambiguous; `ui-expert` implements it verbatim. Sub-field of the existing `C`-profile `component_bindings`, so no validator/matrix change.
23
+
8
24
  ## [4.72.0] - 2026-06-25
9
25
 
10
26
  **Session-id provenance on PRDs and cards — trace an implementation bug back to the chat history that produced it.** When `/new` ships a card that turns out wrong, there was no link from the card back to *which Claude Code session* planned it (`/prd`) or implemented it (`/new`/`/new2`) — so you couldn't reopen the transcript to see the steps the session took (or skipped). Now every card carries an optional `provenance` block recording the session UUID for each lifecycle stage, and the PRD frontmatter records its authoring session. Resolve the chat history at `~/.claude/projects/*/<session-id>.jsonl` (the UUID is globally unique — no project slug needed). This turns "this feature is broken, why?" into a concrete pointer at the planning/implementation conversation, for improving the framework from real runs.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.72.0
1
+ 4.73.0
@@ -111,9 +111,32 @@
111
111
 
112
112
  ### Design Reference (UI cards only — include if card has links.design)
113
113
  Design file: [path from card's links.design field]
114
- Read the design.html file and use it as the **visual reference** for your
115
- implementation (layout, spacing, hierarchy, copy). The design was approved by
116
- the user your implementation MUST match its appearance.
114
+
115
+ **Load the mockup into your context branch on the file type:**
116
+ - If `links.design` resolves to an IMAGE (`.png` / `.jpg` / `.jpeg` /
117
+ `.webp` / `.pdf`, or the card points at a `mockups/*.png` canonical path):
118
+ you are multimodal — **`Read` the mockup image file path directly**. `Read`
119
+ renders the image visually into your context (the native multimodal
120
+ mechanism). The mockup's PIXELS are the fidelity target: study layout,
121
+ spacing, hierarchy, density, color, and the relative position of every
122
+ region. Do NOT implement from the filename or a textual guess — you MUST
123
+ actually load and look at the image. (On a non-multimodal tool the `Read`
124
+ degrades to no-op text; fall back to the structured fields below.)
125
+ - If `links.design` is an `.html` file: **Read the design.html file** and use
126
+ it as the visual reference.
127
+
128
+ Use it as the **visual reference** for your implementation (layout, spacing,
129
+ hierarchy, copy). The design was approved by the user — your implementation
130
+ MUST match its appearance.
131
+
132
+ **Structured design intent (when present on the card).** The image shows the
133
+ static look at one viewport; these fields cover what a single image cannot:
134
+ - `component_bindings[].props` / `variant` — the exact props/variant each
135
+ region must use (e.g. `SectionHeader {depth: 0}`, `DataTable {density:
136
+ comfortable}`). Implement them verbatim; do not eyeball a variant.
137
+ - the card's responsive acceptance criteria — breakpoint behaviour the
138
+ single-viewport mockup does not show (e.g. "≤640px: table collapses to
139
+ card-list"). These are testable ACs, not optional polish.
117
140
 
118
141
  **The mockup is a visual reference, NOT a license to re-create components.**
119
142
  When the card carries `component_bindings` (the `/prd` Component Reconciliation
@@ -1122,11 +1122,24 @@ mockup_analysis:
1122
1122
  purpose: <one line — what this screen lets the user do>
1123
1123
  components:
1124
1124
  - <component name from ${paths.design_system}/INDEX.md if matched, else free-form>
1125
+ layout: # OPTIONAL — compact nesting sketch (the hierarchy a flat list loses)
1126
+ - region: <e.g. "page-header">
1127
+ component: <component or free-form for this region>
1128
+ contains: [<child region/component>, …] # omit for leaf regions
1129
+ component_props: # OPTIONAL — key props/variants legible from the mockup, per component
1130
+ - component: <e.g. "SectionHeader">
1131
+ props: {<prop>: <value>} # e.g. {depth: 0} · {density: comfortable, selectable: true}
1125
1132
  affordances: # interactive + iconographic artifacts visible in the mockup
1126
1133
  - label: <e.g. "Export CSV button", "bell icon", "Filters tab">
1127
1134
  traces_to: <US-id / AC-id / discovery dimension this artifact serves — or "" if none yet>
1128
1135
  classification: backed | decorative | orphan
1129
1136
  states_visible: [empty, loading, error, success, default]
1137
+ states: # OPTIONAL — richer form: map each visible state to the AC that mandates it
1138
+ - state: <loading | empty | error | success | default>
1139
+ traces_to: <AC-id — or "" if no AC mandates it yet (a Discovery gap, see below)>
1140
+ representation: <one line, e.g. "skeleton rows ×5", "EmptyState, copy 'Nessun ordine'">
1141
+ responsive: # OPTIONAL — breakpoint behaviour a single-viewport mockup cannot show
1142
+ - <e.g. "≤640px: DataTable collapses to card-list; header shows back button">
1130
1143
  copy_excerpts:
1131
1144
  - <verbatim text visible in the mockup, max ~10 strings per screen>
1132
1145
  gaps:
@@ -1148,11 +1161,21 @@ mockup_analysis:
1148
1161
  - Omit `copy_excerpts` for screens that have no readable text (icon-only).
1149
1162
  - Omit `states_visible` for screens that show only the default state — do not
1150
1163
  invent states the mockup doesn't show.
1164
+ - `layout`, `component_props`, `states`, and `responsive` are OPTIONAL
1165
+ enrichments. Fill them when the mockup makes them legible — they carry exactly
1166
+ the intent a flat affordance list and a single static image lose (nesting
1167
+ hierarchy, the exact component variant, state→AC mapping, breakpoint
1168
+ behaviour). Omit a field rather than guess; never invent a breakpoint,
1169
+ prop, or nesting the mockup doesn't actually show (same rule as `states_visible`).
1170
+ These feed the Component Reconciliation (reuse vs `reuse-variant`) and the
1171
+ `/new` implementer briefing — they are how visual intent survives to code.
1151
1172
 
1152
1173
  **Gap discipline:** every entry in `gaps[]` MUST become either a Discovery question
1153
1174
  or an explicit non-question (recorded in Discovery Log as "skipped — outside
1154
1175
  mockup scope"). Gaps that remain unresolved by the end of Discovery block PRD
1155
- writing in Step 4.
1176
+ writing in Step 4. A `states[]` entry with `traces_to: ""` is a gap by the same
1177
+ rule — a visible state no AC mandates must be resolved in Discovery (gain an AC,
1178
+ or be confirmed cosmetic), exactly like an untraced affordance.
1156
1179
 
1157
1180
  **Affordance discipline (Functional Traceability):** classify every interactive
1158
1181
  or iconographic artifact the mockup shows. The mockup is a fidelity target, not
@@ -158,7 +158,10 @@ Before invoking `ui-design`:
158
158
  - **REUSE** — an existing component (or a closed-family canonical member) covers
159
159
  it. Record the exact component. *No question asked — this is the silent path.*
160
160
  - **REUSE+VARIANT** — an existing component covers it but the mockup needs a
161
- prop/variant not yet in its spec.
161
+ prop/variant not yet in its spec. The `mockup_analysis.component_props` for
162
+ this component is the signal: compare the legible props against the
163
+ component's spec HEAD — props the spec doesn't cover ⇒ this is a VARIANT,
164
+ not a plain REUSE.
162
165
  - **NEW** — genuinely no match.
163
166
  5. **Ask ONLY on ambiguity** (`REUSE+VARIANT` and `NEW` — never on plain REUSE).
164
167
  One consolidated `AskUserQuestion` per ambiguous element, in the
@@ -179,7 +182,12 @@ Before invoking `ui-design`:
179
182
  - Into each affected card → the `component_bindings` block (see
180
183
  `agents/card-schema.md`): `region → component (reuse | new) [+ variant]`. This
181
184
  is the authority `ui-expert` implements against (the mockup becomes a visual
182
- reference, not a license to re-create).
185
+ reference, not a license to re-create). **Carry the resolved props** from
186
+ `mockup_analysis.component_props` into `component_bindings[].props` so the
187
+ exact-variant intent reaches the implementer (a single static image leaves it
188
+ ambiguous). Likewise, lift any `mockup_analysis.screens[].responsive` notes
189
+ into the UI card's `acceptance_criteria` as testable responsive ACs — the
190
+ mockup cannot show breakpoint behaviour at one viewport.
183
191
  - Into the manifest → when the user confirms a new standard / closure, the
184
192
  component's `canonical_for` / `use_when` / `selection_closed` are written (via
185
193
  `/design-system-init` enrich or `doc-reviewer`), so `baldart ds-gate` enforces
@@ -222,7 +230,7 @@ Pass the resolved inventory to `ui-design`:
222
230
  ```
223
231
  ### Component Reconciliation (resolved)
224
232
  REUSE — bind region → existing component:
225
- - [region] → [Component] — [path] — [variant if any]
233
+ - [region] → [Component] — [path] — [variant if any] — [props if any]
226
234
 
227
235
  NEW (governed) — confirmed with user:
228
236
  - [region] → [NewComponent] — role: [family@context] — standard: [yes/no] — closed: [yes/no]
@@ -148,6 +148,7 @@ component_bindings:
148
148
  action: reuse # reuse | reuse-variant | new
149
149
  variant: "" # when action: reuse-variant
150
150
  role: "page-header@depth-0" # when it maps a Selection-Policy role
151
+ props: {depth: 0} # optional — exact props the region must use (from mockup_props)
151
152
  - region: "row actions"
152
153
  component: IconButton
153
154
  action: reuse
@@ -159,6 +160,14 @@ that finds a `component_bindings` entry MUST honor it over any contrary reading
159
160
  the mockup; a UI card that went through `/prd` with `features.has_design_system:
160
161
  true` but lacks this field is under-specified (the reconciliation did not run).
161
162
 
163
+ `props` is **optional** — the resolved key props/variant the region must use,
164
+ lifted from the mockup analysis `component_props` during reconciliation (e.g.
165
+ `{depth: 0}`, `{density: comfortable}`). It carries the exact-variant intent a
166
+ single static image leaves ambiguous; `ui-expert` implements it verbatim. Omit it
167
+ when the mockup exposes no distinguishing props (the component's defaults apply).
168
+ Breakpoint behaviour the mockup cannot show at a single viewport lives in the
169
+ card's `acceptance_criteria` as testable responsive ACs, not here.
170
+
162
171
  ### `provenance` (session-id traceability — optional, skill-written)
163
172
 
164
173
  A small block that records **which Claude Code session produced the card**, so a card
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baldart",
3
- "version": "4.72.0",
3
+ "version": "4.73.0",
4
4
  "description": "Claude Agent Framework - Reusable framework for coordinating AI agents and humans in software projects",
5
5
  "bin": {
6
6
  "baldart": "./bin/baldart.js"