baldart 5.0.1 → 5.2.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/README.md +6 -6
  3. package/VERSION +1 -1
  4. package/framework/.claude/agents/CHANGELOG.md +90 -0
  5. package/framework/.claude/agents/REGISTRY.md +5 -5
  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/senior-researcher.md +166 -151
  9. package/framework/.claude/agents/ui-expert.md +4 -10
  10. package/framework/.claude/agents/ui-quality-critic.md +27 -11
  11. package/framework/.claude/skills/design-system-init/CHANGELOG.md +5 -0
  12. package/framework/.claude/skills/design-system-init/SKILL.md +2 -2
  13. package/framework/.claude/skills/e2e-review/CHANGELOG.md +5 -0
  14. package/framework/.claude/skills/e2e-review/SKILL.md +2 -2
  15. package/framework/.claude/skills/frontend-design/CHANGELOG.md +20 -0
  16. package/framework/.claude/skills/frontend-design/SKILL.md +39 -216
  17. package/framework/.claude/skills/gamification-design/CHANGELOG.md +5 -0
  18. package/framework/.claude/skills/gamification-design/SKILL.md +2 -2
  19. package/framework/.claude/skills/prd/CHANGELOG.md +16 -0
  20. package/framework/.claude/skills/prd/SKILL.md +1 -1
  21. package/framework/.claude/skills/prd/references/discovery-phase.md +5 -1
  22. package/framework/.claude/skills/prd/references/research-phase.md +32 -12
  23. package/framework/.claude/skills/research/CHANGELOG.md +9 -0
  24. package/framework/.claude/skills/research/SKILL.md +94 -0
  25. package/framework/.claude/skills/research/assets/report-compare.template.md +50 -0
  26. package/framework/.claude/skills/research/assets/report-decision.template.md +42 -0
  27. package/framework/.claude/skills/research/assets/report-deep.template.md +61 -0
  28. package/framework/.claude/skills/research/assets/report-regulatory.template.md +44 -0
  29. package/framework/.claude/skills/research/references/playbook.md +112 -0
  30. package/framework/.claude/skills/research/scripts/rebuild-research-index.mjs +77 -0
  31. package/framework/.claude/skills/ui-design/CHANGELOG.md +60 -1
  32. package/framework/.claude/skills/ui-design/SKILL.md +127 -75
  33. package/framework/.claude/skills/ui-design/references/anti-slop.md +106 -0
  34. package/framework/.claude/skills/ui-design/references/craft-standards.md +259 -0
  35. package/framework/.claude/skills/ui-design/references/design-brief.md +92 -0
  36. package/framework/.claude/skills/ui-design/references/design-directions.md +188 -0
  37. package/framework/.claude/skills/ui-design/references/evaluation.md +125 -165
  38. package/framework/.claude/skills/ui-design/references/generation.md +125 -92
  39. package/framework/.claude/skills/ui-design/references/inventory.md +9 -2
  40. package/framework/.claude/skills/ui-design/scripts/craft-check.mjs +248 -0
  41. package/framework/agents/component-manifest-schema.md +1 -1
  42. package/framework/agents/design-system-protocol.md +6 -6
  43. package/framework/agents/index.md +3 -0
  44. package/framework/agents/research-protocol.md +228 -0
  45. package/framework/agents/skills-mapping.md +42 -23
  46. package/framework/docs/PROJECT-CONFIGURATION.md +28 -5
  47. package/framework/templates/baldart.config.template.yml +6 -0
  48. package/framework/templates/research-index.template.md +13 -0
  49. package/framework/templates/research-sources.CHANGELOG.md +14 -0
  50. package/framework/templates/research-sources.template.md +31 -0
  51. package/package.json +1 -1
  52. package/src/commands/configure.js +27 -1
  53. package/src/commands/doctor.js +82 -0
  54. package/src/commands/update.js +48 -1
  55. package/src/utils/__tests__/classify-divergence.test.js +42 -0
  56. package/src/utils/git.js +45 -9
  57. package/src/utils/research-library.js +92 -0
  58. package/src/utils/symlinks.js +3 -0
@@ -0,0 +1,61 @@
1
+ ---
2
+ id: RES-YYYYMMDD-slug
3
+ title: ""
4
+ category: architecture
5
+ tags: []
6
+ profile: deep
7
+ nature: scientific
8
+ stack_signature: ""
9
+ date: YYYY-MM-DD
10
+ valid_until: YYYY-MM-DD
11
+ status: current
12
+ questions: []
13
+ sources_count: 0
14
+ related: []
15
+ ---
16
+
17
+ RESEARCH_OUTPUT_PATH: <this file's path>
18
+ REUSE: NEW | DELTA -> <prior report path> <!-- a FULL_REUSE run writes the pointer stub (SECTION=reuse), not this template -->
19
+
20
+ # <Title>
21
+
22
+ <!-- Full §0–§11 contract — VERBATIM in senior-researcher.md § OUTPUT.
23
+ Every section opens with a 2–5 bullet Key Takeaways block. -->
24
+
25
+ ## §0 Retrieval Index
26
+ <keyword> → §N.M …
27
+
28
+ ## §1 Table of Contents
29
+
30
+ ## §2 Executive Summary
31
+ <!-- 10–20 bullets covering the entire report -->
32
+
33
+ ## §3 Problem Framing and Scope
34
+
35
+ ## §4 Research Landscape / Taxonomy
36
+ <!-- structured by approach, not by time -->
37
+
38
+ ## §5 Comparative Analysis
39
+ <!-- consistent axes: performance, cost, complexity, risk, robustness, maturity, adoption -->
40
+
41
+ ## §6 Key Findings
42
+ <!-- claims + citations + evidence labels -->
43
+
44
+ ## §7 Recommendation
45
+ <!-- one primary path + 1–2 alternatives, rationale, "when not to use" -->
46
+
47
+ ## §8 Risks & Limitations
48
+ <!-- gaps, conflicting evidence, unknowns -->
49
+
50
+ ## §9 Evidence Map
51
+ <!-- claim → sources → section IDs -->
52
+
53
+ ## §10 Annotated Bibliography
54
+ <!-- links/DOIs/arXiv IDs, dated, evidence-labeled -->
55
+
56
+ ## §11 Appendix
57
+ ### Search Log
58
+ | query | date/context | rationale | chosen (why) | rejected (why) |
59
+ |---|---|---|---|---|
60
+ ### Structured Reading Notes
61
+ ### Glossary
@@ -0,0 +1,44 @@
1
+ ---
2
+ id: RES-YYYYMMDD-slug
3
+ title: ""
4
+ category: regulatory
5
+ tags: []
6
+ profile: regulatory
7
+ nature: regulatory
8
+ stack_signature: ""
9
+ date: YYYY-MM-DD
10
+ valid_until: YYYY-MM-DD # regulatory TTL is SHORT (6 months) — rules move
11
+ status: current
12
+ questions: []
13
+ sources_count: 0
14
+ related: []
15
+ ---
16
+
17
+ RESEARCH_OUTPUT_PATH: <this file's path>
18
+ REUSE: NEW | DELTA -> <prior report path> <!-- a FULL_REUSE run writes the pointer stub (SECTION=reuse), not this template -->
19
+
20
+ # <Title>
21
+
22
+ **Jurisdiction(s):** <named explicitly — a regulatory report without one is invalid>
23
+
24
+ ## Summary & applicability
25
+
26
+ <does this regime apply to the project at all, and through which activities>
27
+
28
+ ## Obligation checklist
29
+
30
+ <!-- Obligations cite the PRIMARY legal text; implementation notes may cite secondary. -->
31
+
32
+ | # | Requirement | Source (primary) | Deadline / threshold | Implementation note |
33
+ |---|---|---|---|---|
34
+ | 1 | | [Reg Art. N] | | |
35
+
36
+ ## Sanctions & risk
37
+
38
+ ## Contradictions & Unknowns
39
+
40
+ <!-- diverging regulator guidance, pending rulings, transition periods -->
41
+
42
+ ## Sources
43
+
44
+ - [Source Year] <official title> — <url> (<date>) [STRONG]
@@ -0,0 +1,112 @@
1
+ # Research playbook — step-by-step detail
2
+
3
+ Companion to `SKILL.md`. Rules live in `agents/research-protocol.md` (cited by
4
+ SECTION); this playbook covers execution mechanics only.
5
+
6
+ ## 1. Scoping
7
+
8
+ Goal: a research brief precise enough that the worker never has to guess.
9
+ Skip entirely when the request already pins topic + purpose + constraints.
10
+
11
+ Ask AT MOST 3 of these (AskUserQuestion, one round):
12
+
13
+ - **Purpose** — "Decidere tra opzioni? Survey completa? Confronto puntuale?
14
+ Vincolo normativo?" → maps 1:1 to `PROFILE=` (decision/deep/compare/regulatory).
15
+ - **Nature** — scientific / dev / regulatory / ux / market → picks the source
16
+ policy row. Infer it when obvious ("paper su CRDT" = scientific;
17
+ "best practice Next.js" = dev) — ask only when ambiguous.
18
+ - **Constraints** — jurisdiction (regulatory), budget/timeline (market),
19
+ must-include candidates (compare).
20
+
21
+ Then assemble the brief: 1–3 research questions, stack signature
22
+ (`{{stack.framework}} + {{stack.database}} + {{stack.auth_provider}}`, empty
23
+ segments omitted), known internal context worth passing.
24
+
25
+ ## 2. Routing
26
+
27
+ One line to the user before launching, e.g.:
28
+ `Routing: PROFILE=compare, nature=dev (fonti: official docs → GitHub issues → engineering blogs). Library: 1 possibile riuso.`
29
+
30
+ Heuristics:
31
+
32
+ | Signal in the request | Profile |
33
+ |---|---|
34
+ | "quale scegliere", "ci serve per decidere", feeds a plan/PRD | `decision` |
35
+ | "survey", "stato dell'arte", "letteratura", open-ended learning | `deep` |
36
+ | exactly 2+ named candidates ("X vs Y") | `compare` |
37
+ | law/standard/compliance named or implied | `regulatory` |
38
+
39
+ `DEPTH=` (deep only): default 1. Suggest 2 when the topic is broad AND the
40
+ user asked for thoroughness; 3 only on explicit request (each level multiplies
41
+ cost).
42
+
43
+ ## 3. Reuse check
44
+
45
+ Per `SECTION=reuse` — the skill runs the lookup itself (INDEX.md only, never
46
+ walk the report dirs) so the user decides BEFORE a worker is paid for:
47
+
48
+ - Hit + fresh + same stack → propose **FULL_REUSE**: show the report path +
49
+ its Executive Summary/Recommendation; done if accepted.
50
+ - Hit but stale/stack-drifted → propose **DELTA**: the spawn prompt names the
51
+ prior report path and instructs "update only what expired; `related:` link".
52
+ - No hit → **NEW**.
53
+
54
+ The worker re-runs its own pre-flight anyway (BINDING in the agent) — the two
55
+ never conflict because both apply the same SECTION=reuse rules; the skill's
56
+ pass just moves the decision to the human.
57
+
58
+ ## 4. Launch
59
+
60
+ Spawn prompt skeleton (one per sub-question):
61
+
62
+ ```
63
+ PROFILE=<x> [DEPTH=<n>]
64
+ FILING=orchestrator — do not append INDEX rows; the skill files reports.
65
+ Research brief: <question(s)>
66
+ Stack signature: <sig>
67
+ Internal context: <paths / findings worth reading first>
68
+ Reuse decision from library lookup: NEW | DELTA (prior: <path>)
69
+ OUTPUT CONTRACT (mandatory):
70
+ Write the full report to: <pre-allocated path per SECTION=library>
71
+ First line: RESEARCH_OUTPUT_PATH: <that path>
72
+ Return COMPACT per your Return Contract.
73
+ ```
74
+
75
+ - Pre-allocate ids `RES-<YYYYMMDD>-<slug>`; two sub-questions same day → make
76
+ slugs distinct (never rely on a suffix race).
77
+ - Parallel fan-out (Claude): all spawns in ONE message. Codex: sequential
78
+ by-name spawns (`agents/runtime-portability-protocol.md`), same prompts.
79
+ - Foreground when the user is waiting; background (`run_in_background: true` +
80
+ `BACKGROUND_RUN=true` first line) only when the user asked to keep working.
81
+
82
+ ## 5. Filing
83
+
84
+ For each spawn: file exists at the pre-allocated path → frontmatter parses and
85
+ carries `id/category/tags/valid_until` → append its INDEX row (this skill is
86
+ the ONLY INDEX writer during the run). Failures:
87
+
88
+ - Missing file → re-read the worker's return; if it died, offer one relaunch
89
+ of THAT sub-question (never the whole batch).
90
+ - Frontmatter invalid → fix mechanically from the report content (id/path are
91
+ known; category from the pre-allocation; tags from the questions).
92
+ - INDEX drift (row exists, file moved, duplicate id) → run
93
+ `scripts/rebuild-research-index.mjs <research_dir>` and report what changed.
94
+
95
+ ## 6. Matrix loop
96
+
97
+ On `## SOURCE_MATRIX_CANDIDATE` in any report, per `SECTION=sources`:
98
+
99
+ 1. Show the candidate (nature, change, source, tier, evidence).
100
+ 2. Offer BOTH, independently: (a) apply now to `SOURCES.md` under
101
+ `## Local additions` (append a row — never touch the default matrix
102
+ section); (b) print the report's ready-to-paste BALDART prompt for the
103
+ maintainer session.
104
+ 3. Never apply silently; never emit candidates the report didn't contain.
105
+
106
+ ## Recovery
107
+
108
+ - Session died mid-run → `/research status` surfaces reports on disk that lack
109
+ INDEX rows (rebuild script reconciles) and pre-allocated paths never written
110
+ (relaunch those sub-questions only).
111
+ - Library missing entirely → `npx baldart doctor` (`create-research-dir`),
112
+ then resume.
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * rebuild-research-index.mjs — deterministic INDEX.md reconciliation.
4
+ *
5
+ * Report frontmatter is the source of truth; INDEX.md is a regenerable view
6
+ * (research-protocol.md SECTION=library). Walks the category subdirectories
7
+ * (never _archive/), parses each report's frontmatter, and rewrites the INDEX
8
+ * table — preserving the header block above the table. Zero dependencies.
9
+ *
10
+ * Usage: node rebuild-research-index.mjs <research_dir> [--check]
11
+ * --check exit 1 (printing the diff summary) instead of writing.
12
+ */
13
+
14
+ import fs from 'node:fs';
15
+ import path from 'node:path';
16
+
17
+ const CATEGORY_DIRS = ['architecture', 'integrations', 'regulatory', 'ux-patterns', 'algorithms', 'tooling'];
18
+
19
+ const dir = process.argv[2];
20
+ const checkOnly = process.argv.includes('--check');
21
+ if (!dir || !fs.existsSync(dir)) {
22
+ console.error('Usage: node rebuild-research-index.mjs <research_dir> [--check]');
23
+ process.exit(2);
24
+ }
25
+
26
+ function parseFrontmatter(text) {
27
+ const m = text.match(/^---\n([\s\S]*?)\n---/);
28
+ if (!m) return null;
29
+ const out = {};
30
+ for (const line of m[1].split('\n')) {
31
+ const kv = line.match(/^(\w+):\s*(.*)$/);
32
+ if (!kv) continue;
33
+ let v = kv[2].trim().replace(/^["']|["']$/g, '');
34
+ if (v.startsWith('[') && v.endsWith(']')) {
35
+ v = v.slice(1, -1).split(',').map((s) => s.trim().replace(/^["']|["']$/g, '')).filter(Boolean).join(', ');
36
+ }
37
+ out[kv[1]] = v;
38
+ }
39
+ return out;
40
+ }
41
+
42
+ const rows = [];
43
+ const problems = [];
44
+ for (const cat of CATEGORY_DIRS) {
45
+ const catAbs = path.join(dir, cat);
46
+ if (!fs.existsSync(catAbs)) continue;
47
+ for (const f of fs.readdirSync(catAbs).filter((f) => f.endsWith('.md')).sort()) {
48
+ const rel = path.join(cat, f);
49
+ let fm;
50
+ try { fm = parseFrontmatter(fs.readFileSync(path.join(catAbs, f), 'utf8')); }
51
+ catch { problems.push(`${rel}: unreadable`); continue; }
52
+ if (!fm || !fm.id) { problems.push(`${rel}: missing frontmatter/id`); continue; }
53
+ if (fm.status === 'superseded') { problems.push(`${rel}: status superseded but not in _archive/`); continue; }
54
+ rows.push(`| ${fm.id} | ${fm.title || ''} | ${fm.category || cat} | ${fm.profile || ''} | ${fm.tags || ''} | ${fm.date || ''} | ${fm.valid_until || ''} | ${rel} |`);
55
+ }
56
+ }
57
+ rows.sort();
58
+
59
+ const indexPath = path.join(dir, 'INDEX.md');
60
+ const existing = fs.existsSync(indexPath) ? fs.readFileSync(indexPath, 'utf8') : '';
61
+ const tableStart = existing.search(/^\| id \|/m);
62
+ const header = tableStart >= 0
63
+ ? existing.slice(0, tableStart)
64
+ : '# Research Library — INDEX\n\n';
65
+ const headerRow = '| id | title | category | profile | tags | date | valid_until | path |\n|----|-------|----------|---------|------|------|-------------|------|\n';
66
+ const next = header + headerRow + rows.join('\n') + (rows.length ? '\n' : '');
67
+
68
+ if (next === existing) {
69
+ console.log(`INDEX.md in sync (${rows.length} report(s)).`);
70
+ } else if (checkOnly) {
71
+ console.error(`INDEX.md out of sync: ${rows.length} report(s) on disk.`);
72
+ process.exit(1);
73
+ } else {
74
+ fs.writeFileSync(indexPath, next, 'utf8');
75
+ console.log(`INDEX.md rebuilt: ${rows.length} report(s).`);
76
+ }
77
+ for (const p of problems) console.warn(`WARN ${p}`);
@@ -2,9 +2,68 @@
2
2
 
3
3
  Formato: [Keep a Changelog](https://keepachangelog.com/) · [SemVer](https://semver.org/).
4
4
 
5
+ ## 2.0.0 — 2026-07-03
6
+
7
+ **The local design studio.** Root-level refactor (framework v5.2.0): the
8
+ skill absorbs top-of-the-line design intelligence distilled from
9
+ [impeccable](https://github.com/pbakaus/impeccable) (Apache-2.0),
10
+ [taste-skill](https://github.com/Leonxlnx/taste-skill) (MIT) and
11
+ [open-design](https://github.com/nexu-io/open-design) (Apache-2.0), and stops
12
+ depending on superseded external skills. Public step contract A–H is
13
+ UNCHANGED (the `/prd` 3a–3e mapping still holds).
14
+
15
+ - **BREAKING — external-skill dependencies removed**: `ui-ux-pro-max`
16
+ (Prerequisite 6, dropped — replaced by the internal references),
17
+ `huashu-design` (optional prototype engine, dropped — the engine rules now
18
+ live in `references/generation.md`), `frontend-design` (linked skill,
19
+ retired to a router at framework level).
20
+ - **NEW Step C.0 — Design Read & Direction Lock** (`references/design-brief.md`):
21
+ register (brand/product), regime (in-context/exploration), the three dials
22
+ (VARIANCE/MOTION/DENSITY), two-altitude slop test, scene sentence,
23
+ color-commitment axis, anti-references, ONE-question ambiguity rule,
24
+ rotation check. Persisted in the state file.
25
+ - **NEW `references/design-directions.md`**: 12-direction aesthetic menu,
26
+ color commitment axis, reflex-reject lists (LILA rule, premium-consumer
27
+ beige ban, cream/sand band, serif discipline, font reflex pool + rotation).
28
+ - **NEW `references/craft-standards.md`**: always-on craft rules (tracking
29
+ table, three-weight system, color proportions + accent rationing ≤2/screen,
30
+ layout-family diversity, 8-state taxonomy + loading thresholds, Laws-of-UX
31
+ numbers, 100/300/500 motion rule, curve-vs-spring) — numeric ranges cite
32
+ `design-system-protocol.md` § Reference Tables. **Canonical new home of the
33
+ Performance Gates (CWV 2026), Modern CSS and Form-quality sections**
34
+ migrated from the retired `frontend-design` generator.
35
+ - **NEW `references/anti-slop.md`**: the Tells catalog — absolute bans,
36
+ rationed patterns (eyebrow ≤ ceil(sections/3), etc.), layout/copy tells,
37
+ every ban with a declared-override path.
38
+ - **NEW `scripts/craft-check.mjs`**: deterministic anti-slop/craft gate
39
+ (~22 rules, zero deps, `--json`, `--strict-palette`), run by the generator
40
+ as self-check and by Step D as Gate 0. Identical on Claude and Codex.
41
+ - **Step D rewritten** (`references/evaluation.md`): Gate 0 (craft-check,
42
+ fail-fast, output hidden from lenses) + **Lens A = `ui-quality-critic`**
43
+ (true evaluator diversity — a different agent definition, rubric SSOT in
44
+ `design-system-protocol.md` § Design Quality Rubric) + **Lens B = fresh
45
+ `ui-expert`** (brief/context conformance B1–B5, evidence-cited scoring,
46
+ worst-sustained-band). Honest **degraded mode** on non-multimodal runtimes
47
+ (mandatory `⚠️ DEGRADED` banner). Max 5 iterations unchanged.
48
+ - **Generation rewritten** (`references/generation.md`): token-first scaffold
49
+ (project tokens embedded in `:root` — the mockup speaks the project token
50
+ language, mirroring the Claude Design channel), `data-region` annotations
51
+ (surgical iteration + deterministic inventory join), real-content
52
+ discipline (image source ladder, copy self-audit, states-as-content),
53
+ responsive-by-construction (375px is evaluated), generator craft self-check.
54
+ - **Routing fix**: frontmatter `description` rewritten to win skill routing
55
+ for design/prototype/restyle work (explicit supersession of
56
+ `frontend-design`/`ui-ux-pro-max`; IT+EN triggers; explicit NOT-list →
57
+ `/ui-implement`, `ui-expert`, `/motion-design`).
58
+ - **Runtime portability**: new § citing
59
+ `agents/runtime-portability-protocol.md` (spawn/decision-gate bindings);
60
+ Codex degradation documented instead of silent.
61
+ - Codex parity: **portable** (same SKILL.md bundle; zero-dep script; visual
62
+ lenses degrade honestly with banner).
63
+
5
64
  ## 1.1.0 — 2026-07-02
6
65
 
7
- - **Analysis-profile contract (framework v4.94.0)**: Step B adjacent-UI analysis passes `PROFILE=ui OUTPUT=terse` to `codebase-architect` (registry-cascade-first per `framework/agents/analysis-profiles.md`).
66
+ - **Analysis-profile contract (framework v4.94.0)**: Step B adjacent-UI analysis passes `PROFILE=ui OUTPUT=terse` a `codebase-architect` (registry-cascade-first per `framework/agents/analysis-profiles.md`).
8
67
 
9
68
  ## 1.0.0 — 2026-07-01
10
69