baldart 3.10.0 → 3.12.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 +57 -0
- package/README.md +10 -2
- package/VERSION +1 -1
- package/framework/.claude/agents/REGISTRY.md +2 -2
- package/framework/.claude/agents/code-reviewer.md +47 -11
- package/framework/.claude/agents/ui-expert.md +355 -43
- package/framework/.claude/commands/design-review.md +7 -0
- package/framework/.claude/skills/design-system-init/SKILL.md +232 -0
- package/framework/.claude/skills/design-system-init/scripts/component-spec.template.md +79 -0
- package/framework/.claude/skills/frontend-design/SKILL.md +124 -0
- package/framework/.claude/skills/motion-design/reference/accessibility-and-modern-apis.md +114 -0
- package/framework/.claude/skills/ui-design/SKILL.md +43 -0
- package/framework/agents/design-review.md +51 -0
- package/framework/agents/design-system-protocol.md +363 -0
- package/framework/agents/index.md +2 -0
- package/framework/docs/UPGRADE-3.12-UI-COHERENCE.md +268 -0
- package/package.json +1 -1
- package/src/commands/configure.js +21 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Upgrade to v3.12.0 — UI Excellence & Registry Coherence
|
|
2
|
+
|
|
3
|
+
> **Audience**: Claude (or a human operator) working inside a **consumer
|
|
4
|
+
> repo** (any project that installed BALDART via `npx baldart add` and just
|
|
5
|
+
> ran `npx baldart update` to v3.12.0). This document is the alignment
|
|
6
|
+
> walkthrough — it does not replace the CHANGELOG (which describes *what*
|
|
7
|
+
> changed in the framework); it tells you *what to do* in this specific
|
|
8
|
+
> project to align an existing graphic organization with the new discipline.
|
|
9
|
+
>
|
|
10
|
+
> Run this once per project after updating to v3.12.0. It is idempotent —
|
|
11
|
+
> re-running on an already-aligned project produces an empty backlog.
|
|
12
|
+
|
|
13
|
+
## What changed in one paragraph
|
|
14
|
+
|
|
15
|
+
The `ui-expert` agent received a major upgrade (UI states taxonomy,
|
|
16
|
+
Performance Gates, modern CSS, AI-era patterns, 60+ categorized red flags),
|
|
17
|
+
and the registry-first discipline gained a **post-intervention coherence
|
|
18
|
+
gate**: every UI task that introduces, modifies, or surfaces a primitive or
|
|
19
|
+
token must reconcile the registry (`INDEX.md` + `components/<Name>.md` +
|
|
20
|
+
`tokens-reference.md`) **in the same change**. Drift can no longer wait for
|
|
21
|
+
Monday's `ds-drift` routine — it must be resolved at introduction. Three
|
|
22
|
+
layers now enforce coherence: per-task (in `ui-expert` / `ui-design` /
|
|
23
|
+
`frontend-design`) → per-merge (`code-reviewer`) → weekly safety net
|
|
24
|
+
(`ds-drift`). The full text-of-record lives in
|
|
25
|
+
`.framework/framework/agents/design-system-protocol.md` § "Post-Intervention
|
|
26
|
+
Coherence Check".
|
|
27
|
+
|
|
28
|
+
## Step 0 — Should you even run this walkthrough?
|
|
29
|
+
|
|
30
|
+
Run only if all three are true. Otherwise, exit cleanly.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
[ ] baldart.config.yml has features.has_design_system: true
|
|
34
|
+
[ ] paths.design_system points to an existing directory
|
|
35
|
+
[ ] That directory contains at least an INDEX.md
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If `has_design_system: false` → there is nothing to align. The new gates
|
|
39
|
+
short-circuit. Optionally consider bootstrapping a registry via
|
|
40
|
+
`/design-system-init` (skill ships with v3.11.0+).
|
|
41
|
+
|
|
42
|
+
If `has_design_system: true` but `paths.design_system` does not exist or is
|
|
43
|
+
empty → run `/design-system-init` first; come back to this walkthrough
|
|
44
|
+
after.
|
|
45
|
+
|
|
46
|
+
## Step 1 — Surface the current state (no edits yet)
|
|
47
|
+
|
|
48
|
+
Before touching anything, build a snapshot. Do the four scans below and
|
|
49
|
+
emit one finding per item. **Do not fix anything yet** — fixing without a
|
|
50
|
+
baseline produces churn and hides the size of the gap.
|
|
51
|
+
|
|
52
|
+
### 1.1 — Silent primitives (`DS_INDEX_DRIFT` baseline)
|
|
53
|
+
|
|
54
|
+
Goal: find components that exist in the source tree but are NOT documented
|
|
55
|
+
in `INDEX.md`.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# List candidate primitives in the project (adjust glob to match the project)
|
|
59
|
+
find $(yq '.paths.components_primitives' baldart.config.yml) \
|
|
60
|
+
-maxdepth 2 -type f \( -name "*.tsx" -o -name "*.vue" -o -name "*.svelte" \)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For each filename `<Name>.tsx`, grep `INDEX.md` for `<Name>` (case-sensitive).
|
|
64
|
+
Anything not found is a silent primitive. Record name + path + estimated
|
|
65
|
+
broadness (broadly-useful vs. surface-specific). Output:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
SILENT_PRIMITIVES:
|
|
69
|
+
- Badge | components/ui/Badge.tsx | broadly-useful
|
|
70
|
+
- PriceTag | components/marketing/Price.tsx | surface-specific
|
|
71
|
+
...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 1.2 — Stale specs (`DS_COMPONENT_STALE` baseline)
|
|
75
|
+
|
|
76
|
+
For each `${paths.design_system}/components/<Name>.md`:
|
|
77
|
+
|
|
78
|
+
1. Locate the source file for `<Name>`.
|
|
79
|
+
2. Compare the spec's documented props/variants against the source's actual
|
|
80
|
+
exported types/props. Use `codebase-architect` if the project has LSP
|
|
81
|
+
enabled — it does this cheaply via go-to-definition.
|
|
82
|
+
3. Spec older than the source's last edit in git AND with mismatch on
|
|
83
|
+
props/variants → `DS_COMPONENT_STALE`.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
STALE_SPECS:
|
|
87
|
+
- Button.md | source mtime 2026-04-12, spec mtime 2026-01-05
|
|
88
|
+
| spec missing variants: "danger-outline", "icon-only"
|
|
89
|
+
| spec missing prop: leftIcon
|
|
90
|
+
...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 1.3 — Hardcoded tokens (`DS_TOKENS_DRIFT` baseline)
|
|
94
|
+
|
|
95
|
+
Scan the codebase for values that bypass `tokens-reference.md`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Hardcoded hex/rgb in styled code (adjust path to actual sources)
|
|
99
|
+
grep -RInE '#[0-9a-fA-F]{3,8}\b|rgba?\([^)]*\)' \
|
|
100
|
+
$(yq '.paths.components_root' baldart.config.yml) \
|
|
101
|
+
--include='*.tsx' --include='*.css' --include='*.scss'
|
|
102
|
+
|
|
103
|
+
# Hardcoded box-shadow tuples
|
|
104
|
+
grep -RInE 'box-shadow:\s*[^v;]+;' \
|
|
105
|
+
$(yq '.paths.components_root' baldart.config.yml)
|
|
106
|
+
|
|
107
|
+
# Spacing values outside the scale (heuristic: any odd or > 64 px literal)
|
|
108
|
+
grep -RInE '(padding|margin|gap|inset)[^:]*:\s*[0-9]+px' \
|
|
109
|
+
$(yq '.paths.components_root' baldart.config.yml)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For each hit, classify:
|
|
113
|
+
- **Tokenizable** — exact value matches an existing token → trivial replace
|
|
114
|
+
- **Missing token** — value would belong to the system but no token exists →
|
|
115
|
+
propose adding to `tokens-reference.md`
|
|
116
|
+
- **Justified one-off** — surface-specific value with a documented reason →
|
|
117
|
+
leave + add a code comment citing the exception
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
HARDCODED_TOKENS:
|
|
121
|
+
- tokenizable: 37 hits across 12 files
|
|
122
|
+
- missing-token: 8 hits (suggest 3 new tokens)
|
|
123
|
+
- justified-one-off: 2 hits
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 1.4 — Overlay drift (only if `.baldart/overlays/ui-expert.md` exists)
|
|
127
|
+
|
|
128
|
+
The v3.12.0 base `ui-expert.md` now defines authoritatively things the
|
|
129
|
+
overlay may have previously codified. Likely conflict points:
|
|
130
|
+
|
|
131
|
+
| Overlay section likely to conflict | Why |
|
|
132
|
+
|---|---|
|
|
133
|
+
| Custom "Red Flags" list | Base now has 60+ categorized red flags — overlay items may be duplicates or contradictions |
|
|
134
|
+
| Custom workflow steps | Base now has step 10 (Review) and step 12 (Design) as BLOCKING completion gates — overlay must not skip them |
|
|
135
|
+
| Custom token rules | Base now references the Reference Tables in `design-system-protocol.md` — overlay numeric scales should defer to the protocol |
|
|
136
|
+
| Custom motion guidance | Base now delegates to `motion-design` skill — overlay should point there, not redefine durations/easings |
|
|
137
|
+
|
|
138
|
+
Read `.baldart/overlays/ui-expert.md` and report each section that:
|
|
139
|
+
- Uses `## [OVERRIDE]` marker on a section the base now owns
|
|
140
|
+
authoritatively (red flags, workflow steps, expertise enumeration).
|
|
141
|
+
- Uses `## [APPEND]` to add red flags that are now in the base set
|
|
142
|
+
(duplicates).
|
|
143
|
+
- Hardcodes scales / thresholds / durations the new protocol tables now
|
|
144
|
+
declare canonically.
|
|
145
|
+
|
|
146
|
+
Output:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
OVERLAY_DRIFT:
|
|
150
|
+
- [OVERRIDE] Your Expertise — conflicts with expanded base (consider [APPEND] instead)
|
|
151
|
+
- [APPEND] Red Flags — 4 of 6 items now in base list (deduplicate)
|
|
152
|
+
- hardcoded motion duration 250ms — defer to motion-design timing tables
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 1.5 — Emit the baseline report
|
|
156
|
+
|
|
157
|
+
Save the four sections above as:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
${paths.references_dir:-docs/references}/ds-coherence-baseline-YYYYMMDD.md
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Present a short summary to the user (totals per finding type + estimated
|
|
164
|
+
size of the reconciliation work). **Stop here for user confirmation** before
|
|
165
|
+
proceeding to Step 2.
|
|
166
|
+
|
|
167
|
+
## Step 2 — Prioritize reconciliation
|
|
168
|
+
|
|
169
|
+
Not all findings are equal. Rank them so the user gets quick wins first.
|
|
170
|
+
|
|
171
|
+
| Priority | Criteria | Action |
|
|
172
|
+
|---|---|---|
|
|
173
|
+
| **P0** | Silent primitive used in ≥ 3 places AND broadly-useful | Add INDEX entry + scaffold full `components/<Name>.md` spec |
|
|
174
|
+
| **P0** | Hardcoded token (tokenizable) in the design-system entry-point file or in a primitive | Replace with the existing token reference inline |
|
|
175
|
+
| **P1** | Silent primitive used in 1–2 places, broadly-useful | Add INDEX entry + stub spec (`status: needs-review`) |
|
|
176
|
+
| **P1** | Stale spec on a primitive used by ≥ 3 features | Update spec to match source |
|
|
177
|
+
| **P1** | Missing-token (hardcoded value that should be a token) used > 5 times | Propose new token + update `tokens-reference.md` + replace inline |
|
|
178
|
+
| **P2** | Surface-specific silent primitive | Add INDEX entry with `scope: local` + 2-line note |
|
|
179
|
+
| **P2** | Stale spec on a rarely-used primitive | Update spec OR open follow-up card |
|
|
180
|
+
| **P3** | Justified one-off hardcoded value | Add inline code comment citing the exception |
|
|
181
|
+
| **P3** | Overlay-base conflict that does not break the new gates | Refactor overlay to use `[APPEND]` instead of `[OVERRIDE]` |
|
|
182
|
+
|
|
183
|
+
Convert the prioritized findings into the project's backlog format. If
|
|
184
|
+
`features.has_backlog: true`:
|
|
185
|
+
|
|
186
|
+
- One card per P0 item.
|
|
187
|
+
- One card per **group** of P1 items (e.g. "Reconcile 8 stale specs in
|
|
188
|
+
`components/forms/`").
|
|
189
|
+
- One catch-all card for P2/P3 batched cleanup.
|
|
190
|
+
|
|
191
|
+
If no backlog feature → emit a markdown checklist under
|
|
192
|
+
`${paths.references_dir}/ds-coherence-followups-YYYYMMDD.md` and present it
|
|
193
|
+
to the user.
|
|
194
|
+
|
|
195
|
+
## Step 3 — Quick wins (apply now, with user approval)
|
|
196
|
+
|
|
197
|
+
Apply only the items that are **truly trivial and reversible**:
|
|
198
|
+
|
|
199
|
+
- Inline replacement of `tokenizable` hardcoded values (the token already
|
|
200
|
+
exists; the change is a pure substitution).
|
|
201
|
+
- Adding INDEX entries for surface-specific silent primitives (no spec
|
|
202
|
+
needed beyond the scope: local note).
|
|
203
|
+
- Removing overlay `[APPEND]` items that exactly duplicate the new base
|
|
204
|
+
red flags.
|
|
205
|
+
|
|
206
|
+
Group them in **one commit per category** (`chore(ds): replace hardcoded
|
|
207
|
+
tokens with existing references`, `docs(ds): index surface-specific
|
|
208
|
+
primitives`, etc.) so the diff is reviewable.
|
|
209
|
+
|
|
210
|
+
Anything more substantial (new specs, new tokens, overlay refactors, stale
|
|
211
|
+
spec updates) → backlog cards, not inline edits. Resist the urge to "just
|
|
212
|
+
clean it up while you're there" — that turns the alignment into a
|
|
213
|
+
multi-day refactor.
|
|
214
|
+
|
|
215
|
+
## Step 4 — Verify the new gates fire correctly
|
|
216
|
+
|
|
217
|
+
After the quick wins land, pick **one** small UI task that touches a
|
|
218
|
+
primitive (e.g. add a variant to an existing Button) and run it end-to-end:
|
|
219
|
+
|
|
220
|
+
1. Invoke `ui-expert` or the relevant skill.
|
|
221
|
+
2. Make the code change.
|
|
222
|
+
3. Observe that the agent's final output explicitly reports the
|
|
223
|
+
Post-Intervention Coherence Check result — either "no findings" or one
|
|
224
|
+
of the `DS_*_DRIFT` codes.
|
|
225
|
+
|
|
226
|
+
If the agent silently skips this step → the upgrade didn't propagate to
|
|
227
|
+
this project. Check:
|
|
228
|
+
|
|
229
|
+
- `npx baldart status` confirms v3.12.0 installed.
|
|
230
|
+
- `.framework/framework/agents/design-system-protocol.md` contains the
|
|
231
|
+
"Post-Intervention Coherence Check" section.
|
|
232
|
+
- `.framework/framework/.claude/agents/ui-expert.md` has step 10 (Review)
|
|
233
|
+
and step 12 (Design).
|
|
234
|
+
|
|
235
|
+
If any of those is stale → `npx baldart update` again, then re-test.
|
|
236
|
+
|
|
237
|
+
## Step 5 — Establish the rhythm
|
|
238
|
+
|
|
239
|
+
Going forward, the operator (you, or future Claude instances on this
|
|
240
|
+
project):
|
|
241
|
+
|
|
242
|
+
- Treats the coherence check at end-of-task as **non-negotiable**, same
|
|
243
|
+
category as "tests pass". A UI task without the coherence-check report
|
|
244
|
+
is incomplete.
|
|
245
|
+
- Treats `DS_*_DRIFT` findings surfaced by `code-reviewer` as merge
|
|
246
|
+
blockers — they indicate the upstream check was skipped.
|
|
247
|
+
- Reads the weekly `ds-drift` routine report when it lands and treats any
|
|
248
|
+
finding there as a **process bug** (somewhere the upstream gates were
|
|
249
|
+
bypassed), not just a content fix.
|
|
250
|
+
|
|
251
|
+
## Reference points (resolved by `npx baldart update`)
|
|
252
|
+
|
|
253
|
+
After update, these files exist locally and are authoritative:
|
|
254
|
+
|
|
255
|
+
| Concern | File |
|
|
256
|
+
|---|---|
|
|
257
|
+
| What "coherence check" means + decision matrix | `.framework/framework/agents/design-system-protocol.md` § "Post-Intervention Coherence Check" |
|
|
258
|
+
| Numeric reference tables (type / contrast / spacing / density) | `.framework/framework/agents/design-system-protocol.md` § "Reference Tables (embed)" |
|
|
259
|
+
| Token cascade primitive → semantic → component | `.framework/framework/agents/design-system-protocol.md` § "Token Cascade" |
|
|
260
|
+
| Upgraded `ui-expert` (states taxonomy, red flags, gates) | `.framework/framework/.claude/agents/ui-expert.md` |
|
|
261
|
+
| Code-reviewer rule 8 (merge gate) | `.framework/framework/.claude/agents/code-reviewer.md` § "Design System Compliance" rule 8 |
|
|
262
|
+
| `ui-design` Step H (design-time gate) | `.framework/framework/.claude/skills/ui-design/SKILL.md` |
|
|
263
|
+
| Performance Gates (CWV 2026, LCP/INP/CLS) | `.framework/framework/.claude/skills/frontend-design/SKILL.md` § "Performance Gates" |
|
|
264
|
+
| Motion + reduced-motion + View Transitions | `.framework/framework/.claude/skills/motion-design/reference/accessibility-and-modern-apis.md` |
|
|
265
|
+
| Weekly safety net | `.framework/framework/routines/ds-drift.routine.yml` |
|
|
266
|
+
|
|
267
|
+
The framework files are symlinked, so reading them via the paths above
|
|
268
|
+
gets the live, current version.
|
package/package.json
CHANGED
|
@@ -522,6 +522,27 @@ async function interactivePrompts(merged, detected) {
|
|
|
522
522
|
merged.features[key] = await promptForKey(question, proposedDefault, 'confirm');
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
+
// ---- Design-system bootstrap hint (since v3.11.0) ---------------------
|
|
526
|
+
// If the user said YES to has_design_system but autodetect found no path
|
|
527
|
+
// (i.e. they WANT a registry but it doesn't exist yet), surface the
|
|
528
|
+
// bootstrap skill so they don't end up with a flag that points at nothing.
|
|
529
|
+
// If they said NO, plant a soft pointer for the future.
|
|
530
|
+
if (merged.features.has_design_system === true && !detected.paths.design_system) {
|
|
531
|
+
UI.info(
|
|
532
|
+
'No design-system path was detected on disk. After configure, run\n' +
|
|
533
|
+
' /design-system-init (or invoke the skill)\n' +
|
|
534
|
+
'to scaffold INDEX.md + tokens-reference.md + per-component specs at\n' +
|
|
535
|
+
'docs/design-system/. The registry-first protocol (ui-expert, ui-design,\n' +
|
|
536
|
+
'frontend-design, /design-review) needs these files to enforce coherence.'
|
|
537
|
+
);
|
|
538
|
+
} else if (merged.features.has_design_system === false) {
|
|
539
|
+
UI.info(
|
|
540
|
+
'has_design_system=false — UI work will rely only on ui_guidelines.md.\n' +
|
|
541
|
+
'When you want visual coherence + component reuse enforced project-wide,\n' +
|
|
542
|
+
'run /design-system-init to scaffold a registry from your existing code.'
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
|
|
525
546
|
// Path prompts — only ask for paths whose feature is enabled and value missing
|
|
526
547
|
UI.section('Paths (autodetected — confirm or override)');
|
|
527
548
|
const pathPrompts = [
|