baldart 5.1.0 → 5.2.1

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +3 -3
  3. package/VERSION +1 -1
  4. package/framework/.claude/agents/CHANGELOG.md +45 -0
  5. package/framework/.claude/agents/REGISTRY.md +2 -2
  6. package/framework/.claude/agents/coder.md +3 -3
  7. package/framework/.claude/agents/remotion-animator-orchestrator.md +4 -3
  8. package/framework/.claude/agents/ui-expert.md +4 -10
  9. package/framework/.claude/agents/ui-quality-critic.md +27 -11
  10. package/framework/.claude/skills/design-system-init/CHANGELOG.md +5 -0
  11. package/framework/.claude/skills/design-system-init/SKILL.md +2 -2
  12. package/framework/.claude/skills/e2e-review/CHANGELOG.md +5 -0
  13. package/framework/.claude/skills/e2e-review/SKILL.md +2 -2
  14. package/framework/.claude/skills/frontend-design/CHANGELOG.md +20 -0
  15. package/framework/.claude/skills/frontend-design/SKILL.md +39 -216
  16. package/framework/.claude/skills/gamification-design/CHANGELOG.md +5 -0
  17. package/framework/.claude/skills/gamification-design/SKILL.md +2 -2
  18. package/framework/.claude/skills/ui-design/CHANGELOG.md +60 -1
  19. package/framework/.claude/skills/ui-design/SKILL.md +127 -75
  20. package/framework/.claude/skills/ui-design/references/anti-slop.md +106 -0
  21. package/framework/.claude/skills/ui-design/references/craft-standards.md +259 -0
  22. package/framework/.claude/skills/ui-design/references/design-brief.md +92 -0
  23. package/framework/.claude/skills/ui-design/references/design-directions.md +188 -0
  24. package/framework/.claude/skills/ui-design/references/evaluation.md +125 -165
  25. package/framework/.claude/skills/ui-design/references/generation.md +125 -92
  26. package/framework/.claude/skills/ui-design/references/inventory.md +9 -2
  27. package/framework/.claude/skills/ui-design/scripts/craft-check.mjs +248 -0
  28. package/framework/.claude/skills/worktree-manager/CHANGELOG.md +19 -0
  29. package/framework/.claude/skills/worktree-manager/SKILL.md +29 -8
  30. package/framework/.claude/skills/worktree-manager/scripts/merge-worktree.sh +25 -3
  31. package/framework/agents/component-manifest-schema.md +1 -1
  32. package/framework/agents/design-system-protocol.md +6 -6
  33. package/framework/agents/index.md +1 -0
  34. package/framework/agents/skills-mapping.md +25 -23
  35. package/framework/docs/PROJECT-CONFIGURATION.md +5 -5
  36. package/package.json +1 -1
  37. package/src/commands/configure.js +1 -1
  38. package/src/utils/__tests__/classify-divergence.test.js +42 -0
  39. package/src/utils/git.js +45 -9
@@ -1,171 +1,131 @@
1
- # Evaluation Phase Criteri e Rubric per il Valutatore
2
-
3
- > Stylistic identity (design philosophy, theming pairing rules) and project
4
- > language resolve from `baldart.config.yml`. See
5
- > `framework/agents/project-context.md` § 4. Project-specific stricter
6
- > thresholds live in `.baldart/overlays/ui-design.md` § Evaluation.
7
-
8
- Questo file definisce come valutare i mockup HTML. Il valutatore è un agente SEPARATO dal generatore (pattern GAN ref: Anthropic "Harness Design for Long-Running Apps").
9
-
10
- **Principio fondamentale:** chi genera non si auto-valuta. La separazione generatore/valutatore
11
- elimina il bias sistematico di auto-approvazione.
12
-
13
- ## Ruolo del Valutatore
14
-
15
- 1. Riceve i file HTML generati (`option-a.html`, `option-b.html`, `option-c.html`).
16
- 2. Apre ciascuno in browser via Playwright (`webapp-testing` skill).
17
- 3. Prende screenshot e valuta contro i criteri sotto.
18
- 4. Produce un report strutturato con punteggi e verdetto.
19
- 5. Se FAIL: rimanda al generatore con feedback specifico.
20
-
21
- ## Criteri di Valutazione (7 dimensioni)
22
-
23
- Ogni criterio ha un punteggio 1-5 con soglie hard.
24
-
25
- ### C1 Context Fidelity
26
-
27
- Lo shell UI circostante (sidebar, header, nav) e fedele alle screenshot reali della piattaforma.
28
-
29
- | Score | Descrizione |
30
- |-------|-------------|
31
- | 1 | Shell completamente assente o inventato |
32
- | 2 | Shell presente ma layout/colori significativamente diversi |
33
- | 3 | Shell riconoscibile, alcune discrepanze di dettaglio |
34
- | 4 | Shell fedele, differenze minori trascurabili |
35
- | 5 | Shell indistinguibile dagli screenshot reali |
36
-
37
- ### C2 — Layout & Spacing
38
-
39
- Spacing, allineamento, nessun overflow/clipping, proporzioni responsive.
40
-
41
- | Score | Descrizione |
42
- |-------|-------------|
43
- | 1 | Overflow visibile, elementi sovrapposti, layout rotto |
44
- | 2 | Allineamento inconsistente, spacing irregolare |
45
- | 3 | Layout funzionale, qualche disallineamento minore |
46
- | 4 | Layout pulito, spacing coerente, nessun overflow |
47
- | 5 | Layout perfetto, gerarchia visiva chiara, breathing room bilanciato |
48
-
49
- ### C3 — Design System Compliance
50
-
51
- `identity.design_philosophy` applicato secondo `${paths.ui_guidelines}` e le regole di `${paths.design_system}/` (quando `features.has_design_system: true`). Se `design_philosophy` è vuoto, valuta solo l'aderenza alle linee guida del progetto.
52
-
53
- | Score | Descrizione |
54
- |-------|-------------|
55
- | 1 | Sembra un template generico, nessuna aderenza alla design philosophy |
56
- | 2 | Tracce di philosophy ma applicazione parziale o sbagliata |
57
- | 3 | Philosophy parziale, mix di elementi corretti e generici |
58
- | 4 | Philosophy coerente, dettagli minori fuori spec |
59
- | 5 | Perfettamente aderente a `${paths.ui_guidelines}` in ogni elemento |
60
-
61
- ### C4 Typography & Readability
62
-
63
- Gerarchia leggibile, dimensioni font corrette, nessuna riga orfana o testo tagliato.
64
-
65
- | Score | Descrizione |
66
- |-------|-------------|
67
- | 1 | Testo illeggibile, gerarchia assente |
68
- | 2 | Testo leggibile ma gerarchia piatta o inconsistente |
69
- | 3 | Gerarchia base presente, qualche problema di peso/dimensione |
70
- | 4 | Gerarchia chiara, font scale corretto, buona leggibilita |
71
- | 5 | Tipografia impeccabile, gerarchia enfatizza il contenuto giusto |
72
-
73
- ### C5Completeness
74
-
75
- Tutti gli elementi UI presenti e correttamente renderizzati. No icone mancanti, placeholder rotti, sezioni vuote, o lorem ipsum dove dovrebbe esserci testo reale nella lingua del progetto (`identity.language`).
76
-
77
- | Score | Descrizione |
78
- |-------|-------------|
79
- | 1 | Sezioni mancanti, placeholder visibili, layout incompleto |
80
- | 2 | La maggior parte degli elementi presenti, alcuni placeholder/mancanze |
81
- | 3 | Tutto presente, qualche dettaglio visivamente grezzo |
82
- | 4 | Completo e curato, tutti gli stati rappresentati |
83
- | 5 | Ogni elemento e pixel-perfect, inclusi empty/loading/error states |
84
-
85
- ### C6 Integration Clarity
86
-
87
- Elementi nuovi/modificati chiaramente marcati e visivamente coerenti con gli elementi
88
- circostanti esistenti.
89
-
90
- | Score | Descrizione |
91
- |-------|-------------|
92
- | 1 | Impossibile distinguere cosa e nuovo vs esistente |
93
- | 2 | Marker presenti ma confusi, nuovo sembra disconnesso |
94
- | 3 | Marker chiari, integrazione visiva accettabile |
95
- | 4 | Marker chiari, nuovo si integra naturalmente con l'esistente |
96
- | 5 | Perfetta integrazione + distinzione: nuovo e ovvio ma coerente |
97
-
98
- ### C7 Polish (production-readiness)
99
-
100
- Sembra production-ready, non un wireframe grezzo. Qualcuno vedendo questo dovrebbe
101
- pensare "e un design reale" non "e una bozza".
102
-
103
- | Score | Descrizione |
104
- |-------|-------------|
105
- | 1 | Wireframe grezzo, box grigi, nessun dettaglio visivo |
106
- | 2 | Aspetto da prototipo, manca rifinitura |
107
- | 3 | Decente, sembra un mockup funzionale ma non rifinito |
108
- | 4 | Curato, sembra quasi pronto per la produzione |
109
- | 5 | Indistinguibile da un design professionale finito |
110
-
111
- ## Soglie Hard (FAIL se violate)
112
-
113
- - **Nessun criterio sotto 2** — qualsiasi 1 = FAIL immediato
114
- - **Media complessiva >= 3.5** — sotto = FAIL
115
- - **C1 (Context Fidelity) >= 3** — il mockup DEVE essere in-context
116
- - **C3 (Design System) >= 3** quando `identity.design_philosophy` è impostato — DEVE rispettare la philosophy del progetto
117
-
118
- L'overlay del progetto può aggiungere soglie più strette (es. C3 >= 4) — vedi `.baldart/overlays/ui-design.md` § Evaluation.
119
-
120
- ## Contrast Check (MUST — ZERO TOLERANCE)
121
-
122
- Oltre ai 7 criteri, il valutatore DEVE eseguire un check contrasto:
123
-
124
- - Per ogni elemento con `bg-*`, verificare che esista un `text-*` esplicito
125
- - Se `features.multi_tenant_theming: true`: themed primary bg DEVE usare il text-token accoppiato per il tenant secondo la regola di pairing del progetto (vedi `${paths.design_system}/patterns/` o overlay)
126
- - Ratio minimo: 4.5:1 testo normale, 3:1 testo grande
127
-
128
- Violazione contrasto = FAIL indipendentemente dai punteggi.
129
-
130
- ## Formato Report di Valutazione
131
-
132
- Salva in `/tmp/prd-design-<slug>/evaluation-report.md`:
1
+ # Evaluation — Step D: deterministic gate + two independent lenses
2
+
3
+ The generator never grades its own output. Step D runs three independent
4
+ checks per iteration; none of them is performed by the generating agent:
5
+
6
+ | # | Check | Who | What it judges |
7
+ |---|---|---|---|
8
+ | Gate 0 | `scripts/craft-check.mjs` | deterministic script | The mechanical anti-slop/craft subsetbinary, zero model cost |
9
+ | Lens A | Design quality | **`ui-quality-critic`** agent (multimodal, per option) | *Is this good design?* — the 10-dimension Design Quality Rubric (SSOT: `framework/agents/design-system-protocol.md` § "Design Quality Rubric") |
10
+ | Lens B | Brief & context conformance | **fresh `ui-expert` instance** (NOT the generator) | *Is this the right design for THIS brief in THIS product?* — rubric below |
11
+
12
+ This split exists because a mockup can be beautiful and wrong (Lens B
13
+ catches it), correct and mediocre (Lens A catches it), or both and still
14
+ mechanically sloppy (Gate 0 catches it). Lens A uses a *different agent
15
+ definition* than the generator real evaluator diversity, not just a fresh
16
+ context of the same taste (the self-grading antipattern, framework v4.61.0).
17
+
18
+ ## Pipeline per iteration
19
+
20
+ 1. **Gate 0 — craft-check (fail-fast).** Run
21
+ `node <skill_dir>/scripts/craft-check.mjs option-*.html [--strict-palette]`
22
+ (strict in exploration regime). Any blocker → straight back to the
23
+ generator with the JSON findings; do NOT spend model evaluation on a
24
+ mechanically failing option. Gate 0 output is **not shown to the lenses**
25
+ (they judge clean candidates without anchoring).
26
+ 2. **Screenshot capture.** Playwright CLI headless (`webapp-testing` /
27
+ `playwright-skill`): per option, 1440×900 AND 375×812
28
+ (`viewport_role: mobile`). Capture the states strip too when present.
29
+ Read every screenshot you capture — a screenshot you didn't read doesn't
30
+ count.
31
+ 3. **Lens A `ui-quality-critic`, one spawn per option** (parallel where
32
+ the runtime allows; sequentially by name on Codex spawn mapping per
33
+ `framework/agents/runtime-portability-protocol.md`). Payload (its input
34
+ contract, mockup-flavored):
35
+
36
+ ```json
37
+ {
38
+ "card_id": "mockup:<slug>",
39
+ "route": "mockup:<slug>/option-<x>",
40
+ "viewport": { "width": 1440, "height": 900 },
41
+ "implementation_screenshot_path": "/tmp/prd-design-<slug>/shots/option-<x>-1440.png",
42
+ "states_screenshots": { "mobile": ".../option-<x>-375.png" },
43
+ "tolerance": "<features.e2e_review.fidelity_tolerance || 'balanced'>"
44
+ }
45
+ ```
46
+
47
+ Plus `design_system_index_path` / `tokens_reference_path` /
48
+ `ui_guidelines_path` when configured. It returns per-dimension scores +
49
+ severity-tagged findings (JSON).
50
+ 4. **Lens B — fresh `ui-expert` instance** with the context screenshots, the
51
+ Design Read, the discovery excerpt, the reuse list, and the rubric below.
52
+ It reads the mockup screenshots AND the HTML source (Lens B is the
53
+ conformance reviewer reading source is allowed here, unlike the critic).
54
+ 5. **Merge + verdict** (orchestrator, criteria below). FAIL → one
55
+ consolidated, actionable feedback packet to the generator (findings only,
56
+ each with region anchor via `data-region` and a concrete fix hint).
57
+ Re-generate re-evaluate. **Max 5 iterations per option**; after 5,
58
+ proceed with the best iteration and record residual findings honestly in
59
+ the report.
60
+
61
+ ## Lens B rubric (mockup-specific, 1–5 each)
62
+
63
+ | Criterion | Judges | Hard floor |
64
+ |---|---|---|
65
+ | **B1 Context fidelity** *(in-context regime only)* | Shell (sidebar/header/nav) faithful to the real screenshots; new work visually native to the platform | ≥ 4 |
66
+ | **B2 Brief completeness** | Everything the discovery/brief scopes is present; required states rendered; no orphan interactive element (Functional Traceability, `design-system-protocol.md`); every `data-region` maps to scoped content | ≥ 3 |
67
+ | **B3 Integration clarity** | NEW/CHANGED markers present and precise; changed-page runs show the whole page | ≥ 3 |
68
+ | **B4 Direction execution** | The option executes ITS declared direction/hypothesis with conviction — judged against the C.0 Design Read, not against the evaluator's taste. A timid half-direction fails; deliberate restraint in product register does not | ≥ 3 |
69
+ | **B5 Copy & language** | Copy self-audit clean (`anti-slop.md` § Copy tells), correct `identity.language`, register-appropriate voice | ≥ 3 |
70
+
71
+ Scoring discipline (binding):
72
+
73
+ - **Cite evidence for every score** "B1=3 because the sidebar collapses the
74
+ workspace switcher that exists in context-2.png" beats "feels off".
75
+ Numbers without evidence are rejected by the orchestrator.
76
+ - **The score is the worst sustained band, never the average-up.**
77
+ - **No grade inflation**: 4 means strong, not acceptable.
78
+ - **Don't punish appropriate conservatism** (product register earns
79
+ familiarity; see `design-brief.md` § Register).
80
+ - **Don't invent defects to demonstrate iteration.** A confident "first pass
81
+ clean, shipping" beats a fake fix.
82
+
83
+ ## Verdict (per option)
84
+
85
+ **PASS** requires ALL of:
86
+
87
+ 1. Gate 0: zero blockers (warnings are allowed but listed in the report).
88
+ 2. Lens A: `quality_score ≥ 0.70`, zero `critical` findings, and the
89
+ color/contrast dimension carries no `major`+ finding (contrast is
90
+ zero-tolerance it also surfaces via Gate 0 and B1).
91
+ 3. Lens B: every criterion ≥ its hard floor.
92
+
93
+ Anything else FAIL with the consolidated feedback packet.
94
+
95
+ ## Degraded mode (no multimodal lens available)
96
+
97
+ On a runtime where screenshots cannot be judged visually (e.g. a
98
+ non-multimodal Codex session), do not fake the lenses:
99
+
100
+ - Run Gate 0 (unchanged it is deterministic).
101
+ - Replace Lens A+B with a **source-level review** by a fresh `ui-expert`
102
+ instance against `craft-standards.md` + `anti-slop.md` + the Design Read
103
+ (token compliance, structure, states presence, copy audit — everything
104
+ legible from HTML).
105
+ - Prefix the report AND the user presentation with the mandatory banner:
106
+ `⚠️ DEGRADED: source-level evaluation only (no visual lens) — review the
107
+ options visually in the browser before choosing.`
108
+
109
+ A silent degraded evaluation is a failed evaluation.
110
+
111
+ ## Report format
112
+
113
+ Save to `/tmp/prd-design-<slug>/evaluation-report.md`:
133
114
 
134
115
  ```markdown
135
- # Evaluation Report — <slug>
116
+ # Evaluation Report — <slug> · iteration N · <date>
136
117
 
137
- Data: YYYY-MM-DD
138
- Iterazione: N
118
+ ## Option A — <direction name>
119
+ - Gate 0: PASS (2 warnings: off-scale-spacing ×1, img-no-dimensions ×1)
120
+ - Lens A (ui-quality-critic): quality_score 0.81 — findings: [1 major: spacing]
121
+ - Lens B: B1 4 · B2 4 · B3 5 · B4 4 · B5 4 (evidence per score)
122
+ - **Verdict: PASS**
139
123
 
140
- ## Option A<nome approccio>
141
-
142
- | Criterio | Score | Note |
143
- |----------|-------|------|
144
- | C1 Context Fidelity | X/5 | ... |
145
- | C2 Layout & Spacing | X/5 | ... |
146
- | C3 Design System | X/5 | ... |
147
- | C4 Typography | X/5 | ... |
148
- | C5 Completeness | X/5 | ... |
149
- | C6 Integration Clarity | X/5 | ... |
150
- | C7 Polish | X/5 | ... |
151
- | **Media** | **X.X/5** | |
152
- | Contrast Check | PASS/FAIL | ... |
153
-
154
- **Verdetto: PASS / FAIL**
155
- Feedback per il generatore: [se FAIL, cosa correggere specificamente]
156
-
157
- ## Option B — ...
158
- (stessa struttura)
159
-
160
- ## Option C — ...
161
- (stessa struttura)
124
+ ## Option B
125
+ - **Verdict: FAIL** → feedback packet: [each finding: region, expected,
126
+ actual, fix hint]
162
127
  ```
163
128
 
164
- ## Loop di Iterazione
165
-
166
- 1. Generatore produce/aggiorna i file HTML.
167
- 2. Valutatore li apre in Playwright, screenshot, valuta.
168
- 3. Se FAIL: report con feedback → torna al generatore.
169
- 4. Se PASS: report finale → si procede con presentazione all'utente.
170
- 5. **Max 5 iterazioni per opzione.** Se ancora sotto soglia dopo 5, procedi con
171
- la versione migliore e annota i problemi residui nel report.
129
+ The report is internal quality control: per the presentation rule (SKILL.md
130
+ Step E) the user sees the options WITHOUT scores, rankings, or
131
+ recommendations except the DEGRADED banner, which is always surfaced.
@@ -1,72 +1,52 @@
1
- # Generation Phase Regole per il Generatore
2
-
3
- Questo file definisce come produrre i mockup HTML. Il generatore è l'agente (o persona) che crea le opzioni di design. NON si auto-valuta — la valutazione spetta a un agente separato (vedi [evaluation.md](evaluation.md)).
4
-
5
- > Paths and stylistic identity in this file resolve from `baldart.config.yml`.
6
- > See `framework/agents/project-context.md` § 4. Project-specific stylistic
7
- > defaults (e.g. forced design philosophy, hard-coded UI language) live in
8
- > `.baldart/overlays/ui-design.md`.
9
-
10
- ## Regola del Filesystem (ASSOLUTA — rispettare prima di tutto)
11
-
12
- Ogni file HTML generato DEVE essere scritto su disco con il tool `Write` PRIMA di aprirlo nel browser. Non è sufficiente mostrare il codice in un blocco inline.
13
-
14
- - Path di destinazione: `/tmp/prd-design-<slug>/option-a.html` (e varianti b, c).
15
- - Dopo la scrittura, apri nel browser di default (macOS):
16
- ```bash
17
- open /tmp/prd-design-<slug>/option-a.html
18
- ```
19
- (Linux: `xdg-open`. Windows: `start`.)
20
- - Il file esiste su disco → l'utente può interagire, ispezionare, condividere.
21
- - Solo codice inline → non verificabile, non apribile, non consegnabile.
22
-
23
- ## Skill HTML (OBBLIGATORIA)
24
-
25
- Invocare la skill `huashu-design` all'inizio della fase di generazione. Essa fornisce:
26
-
27
- - Junior Designer workflow (assunzioni + reasoning + placeholder → iterazioni)
28
- - App Prototype shell: per ogni iPhone include AppPhone state manager interattivo
29
- - Immagini reali da Wikimedia/Met/Unsplash (default per app prototype)
30
- - Tweaks panel per varianti di design in-page
31
- - Validazione Playwright click-test prima della consegna
32
- - Export animazioni → MP4/GIF quando necessario
33
-
34
- ## Prerequisiti
35
-
36
- 1. **MUST** invocare skill `huashu-design` (vedi sopra).
37
- 2. **MUST** leggere `${paths.ui_guidelines}` prima di generare qualsiasi cosa.
38
- 3. **MUST** eseguire il [Component Discovery](component-discovery.md) cascade completo.
39
- 4. **MUST** avere screenshot delle pagine reali dove la feature vivrà (context capture).
40
-
41
- ## Context Capture (obbligatorio)
42
-
43
- Prima di generare mockup:
44
-
45
- 1. Identifica 1-3 pagine dove la feature sarà integrata o adiacente.
46
- 2. Se `npm run dev` non è in esecuzione, avvialo.
47
- 3. Usa `webapp-testing` skill (Playwright CLI) per navigare e fare screenshot. Salva in `/tmp/prd-design-<slug>/context/`.
48
- 4. Questi screenshot sono il **riferimento visivo** — i mockup DEVONO integrarsi con sidebar, header, navigazione, theming e stile dei componenti reali.
49
- 5. Se le pagine richiedono auth, usa credenziali di test (verifica `MEMORY.md` o chiedi all'utente).
50
-
51
- ## Regole di Generazione dei 3 Mockup
52
-
53
- Produce 3 file HTML distinti con approcci di design diversi.
54
-
55
- ### Requisiti obbligatori per ogni file
56
-
57
- - **In-context**: ogni file DEVE includere lo shell UI esistente (sidebar, header, nav) che circonda l'area della feature. Riprodurre fedelmente il chrome della piattaforma basandosi sugli screenshot catturati.
58
- - **Contenuto nuovo nell'area principale**: chiaramente distinguibile dal chrome esistente.
59
- - **Stili reali**: usa gli stili dei componenti visibili negli screenshot (border radius, shadow style, button style, card style, colori, spacing).
60
- - **Pagina esistente modificata**: se la feature modifica una pagina esistente, mostra la pagina INTERA con le modifiche evidenziate (bordo tratteggiato attorno ai nuovi elementi).
61
- - **Self-contained**: CSS inline, Tailwind CDN, nessuna dipendenza esterna.
62
- - **Nomi file**: `option-a.html`, `option-b.html`, `option-c.html`.
63
- - **Rationale**: commento HTML in cima a ogni file che spiega l'approccio e come si integra con la UI esistente.
64
- - **Design philosophy**: applica `identity.design_philosophy` (es. "Neo-Brutalism", "Minimalist", "Glassmorphism") come definito in `${paths.ui_guidelines}` e nell'overlay del progetto. Se `design_philosophy` è vuoto, mantieni uno stile neutro coerente con gli screenshot.
65
- - **Lingua**: usa `identity.language` (BCP-47) per tutti i testi UI. Default `en` se non impostato.
66
- - **Marker**: segna aree nuove/cambiate con label floating in lingua del progetto, es. `NUOVO`/`MODIFICATO` (it) o `NEW`/`CHANGED` (en).
67
- - **3 differenze significative**: le opzioni devono differire in layout, gerarchia o pattern di interazione — non solo in colori.
68
-
69
- ### Scheletro HTML minimo
1
+ # Generation — rules for the Generator (Step C.1)
2
+
3
+ How to produce the mockup prototypes. The generator (the `ui-expert` agent,
4
+ spawned per `AGENTS.md` § delegation) creates the options; it NEVER evaluates
5
+ its own output evaluation belongs to Step D
6
+ ([evaluation.md](evaluation.md)).
7
+
8
+ > Paths and stylistic identity resolve from `baldart.config.yml`
9
+ > (`framework/agents/project-context.md` § 4). Project-specific mandates live
10
+ > in `.baldart/overlays/ui-design.md`.
11
+
12
+ ## Prerequisites (all BLOCKING)
13
+
14
+ 1. Step C.0 completed the Design Read is locked
15
+ ([design-brief.md](design-brief.md)) and each option has its assigned
16
+ direction (exploration) or layout/IA hypothesis (in-context).
17
+ 2. [craft-standards.md](craft-standards.md) and [anti-slop.md](anti-slop.md)
18
+ read — they are binding on every line of markup you write.
19
+ 3. Component Discovery cascade completed
20
+ ([component-discovery.md](component-discovery.md)) the reuse list is the
21
+ authority on what exists.
22
+ 4. Context screenshots captured (Step B) for in-context runs.
23
+
24
+ ## Filesystem rule (ABSOLUTE)
25
+
26
+ Every HTML file MUST be written to disk with the `Write` tool at
27
+ `/tmp/prd-design-<slug>/option-<x>.html` BEFORE being opened in a browser or
28
+ screenshotted. Inline code blocks are not a deliverable: not verifiable, not
29
+ openable, not shareable.
30
+
31
+ ## Token-first scaffold
32
+
33
+ The mockup must speak the project's token language — this is what makes the
34
+ downstream implement step (`/ui-implement`) near-1:1, exactly like a Claude
35
+ Design mockup authored against the project's tokens.
36
+
37
+ - **`features.has_design_system: true`**: extract the real tokens (colors,
38
+ spacing, radius, shadows, type) from `${paths.design_system}/tokens-reference.md`
39
+ / `${paths.global_styles}` and embed them as CSS custom properties in a
40
+ `:root` block at the top of each file. Style the mockup THROUGH those
41
+ variables a value that bypasses an existing token is a defect
42
+ (`DS_TOKENS_DRIFT`).
43
+ - **No design system**: define the option's direction tokens in `:root` with
44
+ **semantic names** (`--accent`, `--surface-2`, `--fg-muted` — never
45
+ `--blue-500`), derived from the chosen direction in
46
+ [design-directions.md](design-directions.md). This makes the option's
47
+ palette auditable and portable.
48
+
49
+ Scaffold skeleton:
70
50
 
71
51
  ```html
72
52
  <!DOCTYPE html>
@@ -74,36 +54,89 @@ Produce 3 file HTML distinti con approcci di design diversi.
74
54
  <head>
75
55
  <meta charset="UTF-8">
76
56
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
77
- <title>UI Design — <Feature Name></title>
57
+ <title>UI Design — <Feature> — Option <X>: <direction name></title>
78
58
  <script src="https://cdn.tailwindcss.com"></script>
79
59
  <style>
80
- html { scroll-behavior: smooth; }
60
+ :root { /* project tokens OR direction tokens — see above */ }
81
61
  </style>
82
62
  </head>
83
63
  <body>
84
- <!-- Existing UI shell (sidebar, header, nav) reproduced from screenshots -->
85
- <!-- New feature content in main area -->
64
+ <!--
65
+ OPTION <X> <direction / layout hypothesis name>
66
+ Design Read: <the locked one-liner from C.0>
67
+ Reuses: <components from discovery> · New: <proposed primitives>
68
+ Deliberate overrides of anti-slop bans (if any): <name them, or "none">
69
+ -->
70
+ ...
86
71
  </body>
87
72
  </html>
88
73
  ```
89
74
 
90
- ## Presentazione all'Utente
91
-
92
- Dopo che il valutatore ha approvato (vedi [evaluation.md](evaluation.md)):
93
-
94
- 1. **Apri tutti e 3 i file nel browser di default (OBBLIGATORIO):**
95
- ```bash
96
- open /tmp/prd-design-<slug>/option-a.html
97
- open /tmp/prd-design-<slug>/option-b.html
98
- open /tmp/prd-design-<slug>/option-c.html
99
- ```
100
- 2. Mostra screenshot inline come supplemento.
101
- 3. Per ogni opzione, elenca solo: nome dell'approccio e quali componenti esistenti riusa vs. crea nuovi. **NON dare valutazioni, punteggi, o suggerimenti su quale opzione scegliere. La scelta spetta all'utente.**
102
-
103
- ## Iterazione su Feedback Utente
75
+ ## Structural rules (every file)
76
+
77
+ - **`data-region` on every distinct region** (`<section data-region="order-list">`,
78
+ `data-region="filters-bar"`). This is the join key used by iteration
79
+ feedback ("change the filters-bar"), by the Step G inventory, and by
80
+ `/prd` Component Reconciliation → `component_bindings`. Region names are
81
+ stable across options and iterations.
82
+ - **In-context runs**: reproduce the existing UI shell (sidebar, header, nav)
83
+ faithfully from the context screenshots — the platform chrome frames the
84
+ new work. New/changed areas are clearly marked with a floating label in the
85
+ project language (`NUOVO`/`MODIFICATO` for `it`, `NEW`/`CHANGED` for `en`).
86
+ If the feature modifies an existing page, show the WHOLE page with changes
87
+ outlined (dashed border).
88
+ - **Self-contained**: inline CSS (+ Tailwind CDN), no build step. External
89
+ requests limited to fonts, Tailwind CDN, and image sources listed below.
90
+ - **Responsive by construction**: the evaluator screenshots 1440px AND 375px
91
+ (`viewport_role: mobile`, framework v4.71). Use fluid grids
92
+ (`auto-fit/minmax`), container-friendly layouts, `min-h-[100dvh]`. A mockup
93
+ that collapses at 375px FAILS evaluation — design it, don't hope.
94
+ - **Three genuinely different options**: exploration regime → three different
95
+ named directions; in-context regime → three different layout / hierarchy /
96
+ interaction structures. Color-only variations are a FAIL.
97
+
98
+ ## Content discipline (real content, no slop)
99
+
100
+ - **Copy is real**: written in `identity.language`, plausible for the domain,
101
+ audience-correct. Run the Copy Self-Audit (`anti-slop.md` § Copy tells)
102
+ before handing off. Realistic data, not `99.9%` (the Jane Doe rule).
103
+ **When `features.has_i18n: true`** the copy is a realistic *placeholder,
104
+ never the final string* — externalization happens at implement time
105
+ (`framework/agents/i18n-protocol.md`); the mockup is throwaway.
106
+ - **Images are real or honestly absent** — in priority order: (1) actual
107
+ project assets; (2) generated assets via the `visual-designer` agent /
108
+ `kie-ai` skill when configured; (3) seeded placeholders
109
+ `https://picsum.photos/seed/<descriptive-seed>/<w>/<h>`; (4) a labelled
110
+ placeholder block + one line telling the user what asset is needed.
111
+ **Verify every remote URL you didn't construct** — a guessed URL that 404s
112
+ ships as a broken image. Even minimalist pages need real imagery: a
113
+ pure-text page is not minimalism, it is incomplete work.
114
+ - **Logos**: real SVG marks (e.g. `https://cdn.simpleicons.org/<slug>`),
115
+ never text wordmarks styled to look like logos.
116
+ - **Icons**: monoline SVG (1.6–1.8px stroke) with `currentColor` — never
117
+ emoji.
118
+ - **States are content**: the primary surface of each option shows the
119
+ populated state; key components additionally show the states that carry
120
+ design decisions (empty / loading / error at minimum — the full 8-state
121
+ taxonomy in `craft-standards.md` § States). Render them inline (a states
122
+ strip below the main canvas is acceptable) so the evaluator and the
123
+ inventory can see them.
124
+ - **Section rhythm**: a section earns its place with a short headline
125
+ (≤ 8 words) + short support (≤ 25 words) + one visual OR one CTA. No data
126
+ dumps, no decoration-only sections.
127
+
128
+ ## Generator self-check (before submitting to Step D)
129
+
130
+ Run the deterministic gate yourself and fix every blocker — do not spend the
131
+ evaluator's pass on mechanical failures:
132
+
133
+ ```bash
134
+ node <skill_dir>/scripts/craft-check.mjs /tmp/prd-design-<slug>/option-*.html \
135
+ [--strict-palette] # exploration regime only
136
+ ```
104
137
 
105
- 1. L'utente sceglie un'opzione o chiede modifiche.
106
- 2. Applica le modifiche all'opzione scelta, passando gli screenshot di contesto come riferimento.
107
- 3. Sottometti al valutatore per ri-valutazione.
108
- 4. Una volta approvato dal valutatore, apri nel browser e mostra screenshot.
109
- 5. Ripeti fino ad approvazione esplicita dell'utente.
138
+ Then re-read each file once against the Pre-Flight essentials: hero fits the
139
+ viewport · H1 ≤ 2 lines · one spacing scale · accent 2 visible uses ·
140
+ every `bg-*` has its `text-*` · states present · copy self-audited · every
141
+ anti-slop override declared in the rationale comment. If a box cannot be
142
+ honestly ticked, the option is not done — fix it before handing off.
@@ -12,7 +12,10 @@ Dopo che l'utente ha approvato un'opzione di design (Step 3d nel workflow).
12
12
  ## Come produrlo
13
13
 
14
14
  1. Apri il `design.html` approvato.
15
- 2. Leggi la struttura HTML e identifica OGNI elemento UI distinto.
15
+ 2. Cammina le annotazioni `data-region` (ogni regione distinta del mockup ne
16
+ porta una — regola di generazione, v2.0.0) e dentro ciascuna identifica
17
+ OGNI elemento UI distinto. Le regioni sono la join key verso i
18
+ `component_bindings` della card (`agents/card-schema.md`).
16
19
  3. Produci l'inventario strutturato nel formato sotto.
17
20
 
18
21
  ## Formato
@@ -65,5 +68,9 @@ Source: ${paths.prd_dir}/<slug>/design.html (option <X>, approved <date>)
65
68
  ## Artefatti prodotti
66
69
 
67
70
  1. Copia l'HTML approvato in `${paths.prd_dir}/<slug>/design.html`.
68
- 2. Aggiorna il state file del PRD con l'inventario.
71
+ 2. Aggiorna il state file del PRD con l'inventario + il Design Read
72
+ dell'opzione scelta (direzione, register, dial — alimenta la rotation rule
73
+ della prossima esplorazione). **Run standalone** (nessun state file PRD):
74
+ scrivi inventario + Design Read in `<design-dir>/design-session.md`
75
+ accanto a `design.html`.
69
76
  3. Pulisci `/tmp/prd-design-<slug>/`.