@adia-ai/adia-ui-factory 0.2.2 → 0.2.4

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 (95) hide show
  1. package/.claude-plugin/plugin.json +12 -3
  2. package/.mcp.json +1 -1
  3. package/CHANGELOG.md +12 -0
  4. package/README.md +24 -1
  5. package/bin/adia-scaffold +93 -13
  6. package/package.json +1 -1
  7. package/references/shell-embed.md +10 -0
  8. package/references/spa-architecture.md +7 -0
  9. package/skills/adia-ui-kit/CHANGELOG.md +41 -0
  10. package/skills/adia-ui-kit/SKILL.md +442 -0
  11. package/skills/adia-ui-kit/assets/figma-make/guidelines/Guidelines.md +87 -0
  12. package/skills/adia-ui-kit/assets/figma-make/guidelines/components.md +142 -0
  13. package/skills/adia-ui-kit/assets/figma-make/guidelines/styles.md +118 -0
  14. package/skills/adia-ui-kit/assets/figma-make/guidelines/tokens.md +120 -0
  15. package/skills/adia-ui-kit/assets/team-scaffold/archive-README.md +30 -0
  16. package/skills/adia-ui-kit/assets/team-scaffold/drafts-README.md +57 -0
  17. package/skills/adia-ui-kit/assets/team-scaffold/inbox-README.md +76 -0
  18. package/skills/adia-ui-kit/assets/team-scaffold/outbox-README.md +46 -0
  19. package/skills/adia-ui-kit/assets/team-scaffold/team-root.README.md +51 -0
  20. package/skills/adia-ui-kit/assets/team-scaffold/tickets-README.md +208 -0
  21. package/skills/adia-ui-kit/assets/team-scaffold/tickets-REGISTRY.md +81 -0
  22. package/skills/adia-ui-kit/assets/templates/AGENTS.template.md +128 -0
  23. package/skills/adia-ui-kit/assets/templates/CLAUDE.template.md +1 -0
  24. package/skills/adia-ui-kit/assets/templates/FEEDBACK-OMISSIONS-DEFENSE.template.md +150 -0
  25. package/skills/adia-ui-kit/assets/templates/FEEDBACK.template.md +213 -0
  26. package/skills/adia-ui-kit/assets/templates/RESPONSE.template.md +114 -0
  27. package/skills/adia-ui-kit/assets/templates/figma-make-guidelines.md +90 -0
  28. package/skills/adia-ui-kit/evals/adversarial-content-trust.json +83 -0
  29. package/skills/adia-ui-kit/evals/evals.json +55 -0
  30. package/skills/adia-ui-kit/evals/routing-corpus.json +121 -0
  31. package/skills/adia-ui-kit/evals/teach-routing-cases.json +92 -0
  32. package/skills/adia-ui-kit/references/capabilities.md +245 -0
  33. package/skills/adia-ui-kit/references/catalog-lookup.md +186 -0
  34. package/skills/adia-ui-kit/references/changelog-archive/CHANGELOG-v1.md +8 -0
  35. package/skills/adia-ui-kit/references/changelog-archive/CHANGELOG-v2.md +3585 -0
  36. package/skills/adia-ui-kit/references/changelog-archive/CHANGELOG-v3.md +1899 -0
  37. package/skills/adia-ui-kit/references/common-gotchas-consumer.md +522 -0
  38. package/skills/adia-ui-kit/references/component-literacy.md +291 -0
  39. package/skills/adia-ui-kit/references/composition.md +245 -0
  40. package/skills/adia-ui-kit/references/correction-loop.md +462 -0
  41. package/skills/adia-ui-kit/references/css-policy.md +343 -0
  42. package/skills/adia-ui-kit/references/decision-model.md +158 -0
  43. package/skills/adia-ui-kit/references/diagnostic-output.md +57 -0
  44. package/skills/adia-ui-kit/references/docs-catalog.md +239 -0
  45. package/skills/adia-ui-kit/references/exclusions.md +225 -0
  46. package/skills/adia-ui-kit/references/feedback-authoring.md +466 -0
  47. package/skills/adia-ui-kit/references/figma-make.md +244 -0
  48. package/skills/adia-ui-kit/references/flows-auth.md +307 -0
  49. package/skills/adia-ui-kit/references/flows-content.md +206 -0
  50. package/skills/adia-ui-kit/references/flows-data.md +348 -0
  51. package/skills/adia-ui-kit/references/flows-interaction.md +181 -0
  52. package/skills/adia-ui-kit/references/flows-shells.md +336 -0
  53. package/skills/adia-ui-kit/references/gap-detection.md +266 -0
  54. package/skills/adia-ui-kit/references/harness.md +284 -0
  55. package/skills/adia-ui-kit/references/loading-protocol.md +406 -0
  56. package/skills/adia-ui-kit/references/local-link.md +198 -0
  57. package/skills/adia-ui-kit/references/mcp.md +401 -0
  58. package/skills/adia-ui-kit/references/migration.md +116 -0
  59. package/skills/adia-ui-kit/references/mission.md +194 -0
  60. package/skills/adia-ui-kit/references/mode-routing.md +298 -0
  61. package/skills/adia-ui-kit/references/patterns-agent.md +223 -0
  62. package/skills/adia-ui-kit/references/patterns-data.md +1065 -0
  63. package/skills/adia-ui-kit/references/patterns-forms.md +223 -0
  64. package/skills/adia-ui-kit/references/patterns-layout.md +326 -0
  65. package/skills/adia-ui-kit/references/patterns-recipes.md +1416 -0
  66. package/skills/adia-ui-kit/references/patterns-shells.md +1097 -0
  67. package/skills/adia-ui-kit/references/patterns-traits.md +259 -0
  68. package/skills/adia-ui-kit/references/patterns-wiring.md +339 -0
  69. package/skills/adia-ui-kit/references/pev-rationale.md +137 -0
  70. package/skills/adia-ui-kit/references/reasoning-gate.md +146 -0
  71. package/skills/adia-ui-kit/references/reasoning-methodologies.md +112 -0
  72. package/skills/adia-ui-kit/references/recon.md +192 -0
  73. package/skills/adia-ui-kit/references/rendering-model.md +431 -0
  74. package/skills/adia-ui-kit/references/response-authoring.md +398 -0
  75. package/skills/adia-ui-kit/references/session-log-schema.md +203 -0
  76. package/skills/adia-ui-kit/references/session-log-template.md +118 -0
  77. package/skills/adia-ui-kit/references/setup.md +652 -0
  78. package/skills/adia-ui-kit/references/skill-hygiene.md +135 -0
  79. package/skills/adia-ui-kit/references/spec-to-ui-reasoning.md +394 -0
  80. package/skills/adia-ui-kit/references/state.md +229 -0
  81. package/skills/adia-ui-kit/references/teach-protocol.md +421 -0
  82. package/skills/adia-ui-kit/references/theme.md +142 -0
  83. package/skills/adia-ui-kit/references/version-check.md +69 -0
  84. package/skills/adia-ui-kit/scripts/audit-decision-trace.mjs +198 -0
  85. package/skills/adia-ui-kit/scripts/audit-kit-roster.mjs +366 -0
  86. package/skills/adia-ui-kit/scripts/changelog-archive.mjs +126 -0
  87. package/skills/adia-ui-kit/scripts/check-adia-versions.py +404 -0
  88. package/skills/adia-ui-kit/scripts/run-skill-evals.mjs +358 -0
  89. package/skills/adia-ui-kit/scripts/validate-session-log.mjs +242 -0
  90. package/skills/adia-ui-kit/skill.json +102 -0
  91. package/skills/adia-ui-migration/CHANGELOG.md +47 -0
  92. package/skills/adia-ui-migration/SKILL.md +381 -0
  93. package/skills/adia-ui-migration/skill.json +29 -0
  94. package/skills/adia-ui-spa/SKILL.md +1 -1
  95. package/skills/adia-ui-verify/SKILL.md +2 -2
@@ -0,0 +1,652 @@
1
+ # §Setup — Cold-start harness (raw Vite + vanilla JS)
2
+
3
+ > **Loading note.** Reference bundle extracted from `SKILL.md` per the
4
+ > §LoadingProtocol inversion contract (v2.20.2+). Load via
5
+ > `skill_view(name='adia-ui-kit', file_path='references/setup.md')`
6
+ > when you're scaffolding a new AdiaUI project from scratch (raw Vite
7
+ > + vanilla JS) OR you need the 8-step cold-start checklist with
8
+ > verification gates. Skip if §Setup is already done and the cold-start
9
+ > checkpoint is green (the agent harness should track this).
10
+
11
+ Everything you need to go from `npm create vite@latest my-app` to working
12
+ AdiaUI components in the browser. All steps below are required — skipping
13
+ any one produces silent failures (blank icons, un-styled components,
14
+ missing tags). Step 0 is a manifest gate that prevents the loudest failure
15
+ class (vite "could not be resolved" / "Are they installed?").
16
+
17
+ ### Step 0 — Verify the manifest (before composing or authoring imports)
18
+
19
+ Before writing any source code that imports `@adia-ai/*`, confirm the
20
+ manifest declares the deps. The check is one grep and one `node -e`:
21
+
22
+ ```bash
23
+ # (a) Source imports — are there any?
24
+ grep -rEn "from ['\"]@adia-ai/" --include='*.ts' --include='*.js' \
25
+ --include='*.tsx' --include='*.jsx' --include='*.vue' --include='*.svelte' \
26
+ src/ 2>/dev/null | wc -l
27
+
28
+ # (b) Manifest declarations — what's in package.json?
29
+ node -e "const p=require('./package.json'); const deps={...p.dependencies, ...p.devDependencies}; const adia=Object.entries(deps).filter(([k])=>k.startsWith('@adia-ai/')); console.log(JSON.stringify(Object.fromEntries(adia), null, 2))"
30
+ ```
31
+
32
+ | (a) imports | (b) declarations | What to do |
33
+ |---|---|---|
34
+ | 0 | 0 | Fresh repo — proceed to Step 1 |
35
+ | N>0 | M>0 (matching) | Manifest healthy — proceed to compose |
36
+ | **N>0** | **{}** | **HALT — manifest gap (Gap class 0). Surface to operator.** |
37
+ | 0 | M>0 | Imports were removed; sweep declarations next cleanup (low priority) |
38
+
39
+ If (a)>0 and (b) is empty: **do not author further imports**. The next
40
+ `npm run dev` will halt with "could not be resolved" on the bare
41
+ specifiers — vite's message says "Are they installed?" but they were
42
+ never *declared*. `npm install` (no args) won't fix it — it honors the
43
+ manifest, which says nothing. Surface the gap with the install command
44
+ from Step 1, citing a sibling consumer's reference dep shape (e.g.
45
+ `claims-ui-v8/package.json` for the AdiaUI consumer set).
46
+
47
+ **Why this is Step 0, not Step 1:** the install in Step 1 *can* be
48
+ done by the agent, but only after the operator has confirmed the dep
49
+ set is intended for this repo. Authoring imports against an empty
50
+ manifest creates source that won't start; surface the gap before that
51
+ happens. See `SKILL.md §GapDetection Gap class 0` for the canonical
52
+ worked example (claims-ui-v9, 2026-05-23).
53
+
54
+ ### Step 0.5 — CDN-only consumption (HTML-first, no bundler)
55
+
56
+ If the user is building a CodePen demo, a marketing page, a third-party tutorial, or any "drop into static HTML" scenario, **skip the npm install path entirely**. Since v0.6.30, both `@adia-ai/web-components` and `@adia-ai/web-modules` ship pre-flattened + minified bundles via jsdelivr/unpkg. Three tags get you a working page:
57
+
58
+ ```html
59
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.css">
60
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.css">
61
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/everything.min.js"></script>
62
+ ```
63
+
64
+ **Version-pin policy:** use `@0.6` (floating-minor) as the default — picks up patch releases automatically while staying inside the v0.6.x lockstep. For an absolute pin substitute `@0.6.32` (current lockstep). Avoid `@latest` (volatile across MAJOR/MINOR bumps). All 9 `@adia-ai/*` packages move together in lockstep; the version you pick must be consistent across both `web-components` and `web-modules` links.
65
+
66
+ The "everything" bundle (v0.6.32: ~1 MB raw / ~330 KB Brotli) registers **all 100+ primitives + a2ui-runtime + all 17 module-tier shells/parts** (admin-shell + 10 admin-* children, chat-shell + 6 chat-* children, editor-shell + 6 editor-* children, simple-shell + 2 simple-* children, theme-panel, a2ui-root). **Pick ONE JS bundle path** — mixing `everything.min.js` with a separate `web-components.min.js` causes `customElements.define` to throw dup-name errors.
67
+
68
+ > **⚠️ v0.6.32 bundle correctness milestone.** Pre-v0.6.32, `everything.min.js` was shells-only (~750 KB, primitives missing) — using `<button-ui>` / `<card-ui>` / etc. would silently fail to upgrade. v0.6.32 is the first version where the bundle actually registers all 100+ primitives. **Pin to `@0.6.32` or floating `@0.6`** — do **not** pin to `@0.6.31` or earlier or you'll get blank pages where primitives should be.
69
+
70
+ > **⚠️ icons-manifest.js requirement (v0.6.32+).** Icons rendered via `<*-ui icon="…">` are loaded lazily from `@phosphor-icons/core` at runtime, gated by `dist/icons-manifest.js` (256 KB, 1512 regular icons + 5 weights). This manifest is **bundled into `everything.min.js`** but must be present at `@adia-ai/web-components@0.7.13+/dist/icons-manifest.js` for the standalone `web-components.min.js` path. Pre-v0.6.32 the manifest was missing from the published tarball → icons silently rendered as blank.
71
+
72
+ Choice tree:
73
+
74
+ | Use case | Bundle path |
75
+ |---|---|
76
+ | CodePen / marketing / drop-into-HTML | `@adia-ai/web-modules@0.7/dist/everything.min.js` (single file, all 100+ primitives + 17 shells/parts + icon manifest baked in) |
77
+ | Primitives only, no shells | `@adia-ai/web-components@0.7/dist/web-components.min.js` (must be paired with `dist/icons-manifest.js` co-load) |
78
+ | One specific shell + primitives | `web-components.min.js` + ONE `dist/<cluster>/<shell>.min.js` (e.g. `@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.js`, `dist/chat/chat-shell.min.js`, `dist/editor/editor-shell.min.js`, `dist/simple/simple-shell.min.js`) |
79
+ | Real app with Vite/webpack | **Don't use these bundles** — `npm install` + tree-shake is tighter |
80
+
81
+ Then skip to authoring — Steps 1-8 below are for npm-installed consumers; the CDN path doesn't need them.
82
+
83
+ Full CDN reference: [ui-kit.exe.xyz/site/getting-started/cdn-usage](https://ui-kit.exe.xyz/site/getting-started/cdn-usage).
84
+
85
+ ---
86
+
87
+ ### Step 1 — Install packages
88
+
89
+ ```bash
90
+ npm install @adia-ai/web-components @adia-ai/web-modules @phosphor-icons/core
91
+ ```
92
+
93
+ - `@adia-ai/web-components` — 95 `*-ui` primitive elements
94
+ - `@adia-ai/web-modules` — composite shells (admin / chat / editor / simple) **plus the A2UI render surface `<canvas-ui>` depends on**
95
+ - `@phosphor-icons/core` — SVG icon assets (required for the icon loader)
96
+
97
+ > **`@adia-ai/web-modules` is needed for more than shells.** The default
98
+ > `@adia-ai/web-components` barrel (`import '@adia-ai/web-components'`, Step 2)
99
+ > registers `<canvas-ui>`, the A2UI render surface, which needs the renderer
100
+ > (`a2ui-root`) from `@adia-ai/web-modules`. On `@adia-ai/web-components`
101
+ > **≤ 0.6.43** this was a *static* cross-package import, so the barrel failed
102
+ > to build for a primitives-only app that omitted `web-modules` — a hard
103
+ > Vite/rolldown `UNRESOLVED_IMPORT … web-modules/runtime/a2ui-root` at first
104
+ > `npm run dev` (FEEDBACK-81). **v0.6.44 decouples it** (`<canvas-ui>`
105
+ > loads the renderer lazily + guarded), so a true primitives-only app may then
106
+ > omit `web-modules`. **Until you're on the fixed build, keep all three
107
+ > installed** — which Step 1 already does. Do **not** trim `web-modules`
108
+ > (Step 6) on ≤ 0.6.43 unless you also drop `canvas` from your imports.
109
+
110
+ ### Step 2 — Wire the entry file
111
+
112
+ Replace the contents of `src/main.js` (or `main.ts`) with:
113
+
114
+ ```js
115
+ // ── 1. Design tokens + component CSS ──
116
+ import '@adia-ai/web-components/css'; // all primitive CSS
117
+
118
+ // ── 2. Register all *-ui tags ──
119
+ import '@adia-ai/web-components'; // side-effect: defines 95 custom elements
120
+
121
+ // ── 3. Shell CSS (REQUIRED when using admin / chat / editor / simple) ──
122
+ // Import the shell CSS for every shell tag you use — `<admin-shell>` etc.
123
+ // **do not self-import their layout CSS**, so omitting these imports
124
+ // produces an unstyled stacked-divs layout with no error. The package
125
+ // exports map uses `./<cluster>/*.css` (resolves to `./<cluster>/*/*.css`):
126
+ // import '@adia-ai/web-modules/shell/admin-shell.css';
127
+ // import '@adia-ai/web-modules/chat/chat-shell.css';
128
+ // import '@adia-ai/web-modules/editor/editor-shell.css';
129
+ // import '@adia-ai/web-modules/simple/simple-shell.css';
130
+ // (Pitfall: the tag is `<admin-shell>`, not `<app-shell>` — there is no
131
+ // umbrella `app-shell` tag in `@adia-ai/web-modules`.)
132
+
133
+ // ── 4. Register shells via per-cluster subpaths ──
134
+ // **Do NOT** use the full `@adia-ai/web-modules` barrel — at v0.6.7+ it
135
+ // re-exports broken in-repo absolute paths from `chat/chat-shell.js`
136
+ // (e.g. `import '/packages/web-components/components/code/code.js'`)
137
+ // that fail in any consumer Vite build. Import only the clean
138
+ // per-cluster subpaths you actually need:
139
+ import '@adia-ai/web-modules/shell'; // registers admin-shell + children
140
+ // import '@adia-ai/web-modules/chat'; // registers chat-shell (if needed)
141
+ // import '@adia-ai/web-modules/editor'; // registers editor-shell
142
+ // import '@adia-ai/web-modules/simple'; // registers simple-shell
143
+
144
+ // ── 5. Icon loader (REQUIRED — see step 3 below) ──
145
+ import { installIconLoadersForRegistered } from '@adia-ai/web-components/core/icons';
146
+
147
+ // Vite glob — relative path from main.js (works in Vite 7 rollup AND Vite 8
148
+ // rolldown). The `@`-scoped form (`@phosphor-icons/core/assets/regular/*.svg`)
149
+ // works in Vite 7 but is REJECTED by Vite 8 rolldown ("Invalid glob — must
150
+ // start with '/' or './'"). The relative form is portable across both.
151
+ //
152
+ // IMPORTANT: wrap the globs in a per-weight map (`{ regular, bold, … }`).
153
+ // AdiaUI primitives stamp icons at MULTIPLE weights — e.g. `<select-ui multiple>`
154
+ // stamps the chip-remove glyph as `<icon-ui name="x" weight="bold">`. A
155
+ // regular-only map leaves bold lookups unresolved (blank icon + `[icon-ui] …
156
+ // weight="bold" not found`). Phosphor names non-regular files
157
+ // `<name>-<weight>.svg` under `assets/<weight>/`; load the weights your
158
+ // primitives use — `bold` is the common one (a few stamp `fill`/`thin`).
159
+ // Passing a flat glob (no weight key) is auto-promoted to `regular` in
160
+ // v0.6.15+ with a one-time warn, and silently fails pre-v0.6.15.
161
+ installIconLoadersForRegistered({
162
+ regular: import.meta.glob(
163
+ '../node_modules/@phosphor-icons/core/assets/regular/*.svg',
164
+ { query: '?raw', import: 'default', eager: true }
165
+ ),
166
+ bold: import.meta.glob(
167
+ '../node_modules/@phosphor-icons/core/assets/bold/*.svg',
168
+ { query: '?raw', import: 'default', eager: true }
169
+ ),
170
+ });
171
+ ```
172
+
173
+ **CSS order matters:** tokens + component CSS before any markup renders.
174
+ **Icon loader must run after `import '@adia-ai/web-components'`** —
175
+ `installIconLoadersForRegistered` reads `static requiredIcons` from
176
+ registered elements, so the elements must be defined first.
177
+
178
+ ### Step 3 — Icon loader in depth
179
+
180
+ Icons in AdiaUI are Phosphor SVGs loaded on demand. Components internally
181
+ call `getIcon(name)` — if no loader is installed, `getIcon` returns an
182
+ empty string and the icon slot is silently blank. This is the most common
183
+ setup mistake.
184
+
185
+ **`installIconLoadersForRegistered` (recommended):**
186
+
187
+ Inspects `static requiredIcons` on every registered custom element class
188
+ and installs loaders only for the icons those elements actually use. No
189
+ manual list to maintain — add new components, icon set updates automatically.
190
+
191
+ ```js
192
+ import { installIconLoadersForRegistered } from '@adia-ai/web-components/core/icons';
193
+
194
+ // Vite glob — package-relative path (NOT /node_modules/...)
195
+ // Wrap the globs in a per-weight map. Load every weight your primitives stamp —
196
+ // `bold` is the common non-regular case (`<select-ui multiple>` chip-remove x),
197
+ // with a few `fill`/`thin`. Phosphor files: `assets/<weight>/<name>-<weight>.svg`.
198
+ // Flat globs (no weight key) are auto-promoted to `regular` in v0.6.15+ (one-time
199
+ // warn) but silently fail on prior versions.
200
+ installIconLoadersForRegistered({
201
+ regular: import.meta.glob(
202
+ '../node_modules/@phosphor-icons/core/assets/regular/*.svg',
203
+ { query: '?raw', import: 'default', eager: true }
204
+ ),
205
+ bold: import.meta.glob(
206
+ '../node_modules/@phosphor-icons/core/assets/bold/*.svg',
207
+ { query: '?raw', import: 'default', eager: true }
208
+ ),
209
+ });
210
+ ```
211
+
212
+ > **Pitfall: `@`-scoped vs relative globs (Vite 7 → Vite 8 break).**
213
+ > Pre-v0.6.7 docs (and AdiaUI's own monorepo source) used the
214
+ > `@`-scoped form `'@phosphor-icons/core/assets/regular/*.svg'`. That
215
+ > form works in Vite 7 (rollup-based) but is **rejected by Vite 8
216
+ > rolldown** with `Invalid glob: must start with '/' or './'`. The
217
+ > portable form — `'../node_modules/@phosphor-icons/core/assets/regular/*.svg'`,
218
+ > a path relative to the consuming file — works in both Vite 7 and
219
+ > Vite 8. Use the relative form everywhere unless you've explicitly
220
+ > pinned to Vite 7. AdiaUI's own monorepo source still uses
221
+ > `/node_modules/...` (root-absolute); **do not copy that** into a
222
+ > consumer project — root-absolute globs return empty in external
223
+ > projects and all icons render blank.
224
+
225
+ **Manual / minimal bundle (if you know exactly which icons you need):**
226
+
227
+ ```js
228
+ import { installIconLoaders } from '@adia-ai/web-components/core/icons';
229
+
230
+ installIconLoaders({
231
+ regular: import.meta.glob(
232
+ '../node_modules/@phosphor-icons/core/assets/regular/{caret-up-down,x,check,warning}.svg',
233
+ { query: '?raw', import: 'default', eager: true }
234
+ ),
235
+ });
236
+ ```
237
+
238
+ > **Pitfall: static glob brace-lists.** Vite resolves glob patterns at
239
+ > build time, not runtime. If you add a component later that needs an icon
240
+ > not in your brace-list, it renders blank with no error. Use
241
+ > `installIconLoadersForRegistered` to avoid maintaining this list.
242
+
243
+ **Single icon (framework consumers, no bundler glob):**
244
+
245
+ ```js
246
+ import { registerIcon } from '@adia-ai/web-components/core/icons';
247
+ import caretSvg from '@phosphor-icons/core/assets/regular/caret-up-down.svg?raw';
248
+ registerIcon('caret-up-down', caretSvg);
249
+ ```
250
+
251
+ ### Step 4 — Minimal `index.html`
252
+
253
+ ```html
254
+ <!doctype html>
255
+ <html lang="en">
256
+ <head>
257
+ <meta charset="UTF-8" />
258
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
259
+ <title>My App</title>
260
+ </head>
261
+ <body>
262
+ <card-ui>
263
+ <header slot="header">
264
+ <span slot="heading">Hello AdiaUI</span>
265
+ </header>
266
+ <section>
267
+ <col-ui gap="md">
268
+ <field-ui label="Name">
269
+ <input-ui placeholder="Your name"></input-ui>
270
+ </field-ui>
271
+ <button-ui text="Submit" variant="primary"></button-ui>
272
+ </col-ui>
273
+ </section>
274
+ </card-ui>
275
+
276
+ <script type="module" src="/src/main.js"></script>
277
+ </body>
278
+ </html>
279
+ ```
280
+
281
+ > **Shell app?** If your app uses `<admin-shell>`, `<chat-shell>`,
282
+ > `<editor-shell>`, or `<simple-shell>`, do **NOT** author shell markup
283
+ > from memory in this step. Load [`patterns-shells.md`](patterns-shells.md)
284
+ > BEFORE writing any shell element in `index.html` — the pre-author bundle
285
+ > gate applies here exactly as it does during §Compose. The component yaml
286
+ > sidecars (e.g.
287
+ > `node_modules/@adia-ai/web-modules/shell/admin-sidebar/admin-sidebar.yaml`)
288
+ > are also authoritative for slot names and attribute values. Authoring
289
+ > from memory at Step 4 produces silent failures — e.g. `slot="sidebar"`
290
+ > on `<admin-sidebar>` (the substrate queries `[slot="leading"]`; mismatched
291
+ > slot fails the lookup and breaks toggle/resize with no console output).
292
+ > See FEEDBACK-56 (claims-ui-v10 cold-start, 2026-05-23) for the canonical
293
+ > 7-error trace this gate prevents.
294
+
295
+ ### Step 5 — Vite config (minimal, external consumer)
296
+
297
+ A raw `npm create vite@latest` project has a working `vite.config.js` by
298
+ default. For AdiaUI no special aliases are needed — everything resolves
299
+ via the package `exports` map.
300
+
301
+ > **⚠️ 0.6.44 only — `optimizeDeps.exclude` needed to boot.** On
302
+ > `@adia-ai/web-components@0.7.13`, the default barrel registers `<canvas-ui>`,
303
+ > whose lazy A2UI-renderer import used a *relative* cross-package path that Vite
304
+ > can't resolve once it pre-bundles `web-components` into `node_modules/.vite/deps/`
305
+ > — `npm run dev` fails with a `[vite:import-analysis] Failed to resolve import
306
+ > "…/web-modules/runtime/a2ui-root/a2ui-root.js"` overlay + blank page (FEEDBACK-85).
307
+ > Until you're on the fix, add:
308
+ > ```ts
309
+ > // vite.config.ts
310
+ > export default defineConfig({
311
+ > optimizeDeps: { exclude: ['@adia-ai/web-components', '@adia-ai/web-modules'] },
312
+ > });
313
+ > ```
314
+ > **0.6.45+ switches `<canvas-ui>` to a bare specifier — this exclude is then
315
+ > unnecessary; remove it.**
316
+
317
+ Only add a proxy if your app calls an LLM backend:
318
+
319
+ ```js
320
+ // vite.config.js
321
+ import { defineConfig } from 'vite';
322
+
323
+ export default defineConfig({
324
+ server: {
325
+ proxy: {
326
+ '/api': {
327
+ target: 'http://localhost:3456',
328
+ changeOrigin: true,
329
+ },
330
+ },
331
+ },
332
+ });
333
+ ```
334
+
335
+ > **Do not copy the in-repo Vite aliases** (`@core`, `@components`, `@llm`,
336
+ > `@styles`). Those resolve paths inside the AdiaUI monorepo source tree.
337
+ > External consumers import from `@adia-ai/web-components` — the package
338
+ > exports map handles resolution.
339
+
340
+ ### Step 6 — Component registration (advanced)
341
+
342
+ The barrel import in step 2 auto-registers all 95 elements. For fine-grained
343
+ control:
344
+
345
+ **Per-component** (tree-shaking):
346
+
347
+ ```js
348
+ import '@adia-ai/web-components/components/button';
349
+ import '@adia-ai/web-components/components/button.css';
350
+ import '@adia-ai/web-components/components/card';
351
+ import '@adia-ai/web-components/components/card.css';
352
+ ```
353
+
354
+ **Conflict-safe** (multiple packages sharing a page):
355
+
356
+ ```js
357
+ import { defineIfFree } from '@adia-ai/web-components/core';
358
+ defineIfFree('button-ui', MyExtendedButton); // no-op if already defined
359
+ ```
360
+
361
+ **Class-only** (test isolation / subclassing, no auto-register):
362
+
363
+ ```js
364
+ import { UISlider } from '@adia-ai/web-components/components/slider/class';
365
+ class MySlider extends UISlider { /* … */ }
366
+ customElements.define('my-slider', MySlider);
367
+ ```
368
+
369
+ ### Step 7 — TypeScript
370
+
371
+ Zero config since v0.6.0 — `npm install` and types resolve automatically
372
+ via `exports.types` in each package.
373
+
374
+ ```ts
375
+ import type { UIButton } from '@adia-ai/web-components';
376
+ const btn = document.querySelector('button-ui') as UIButton;
377
+ btn.text = 'Click'; // typed string
378
+ ```
379
+
380
+ If your `tsconfig.json` predates `"moduleResolution": "bundler"`:
381
+
382
+ ```json
383
+ { "compilerOptions": { "moduleResolution": "bundler" } }
384
+ ```
385
+
386
+ A2UI message/component types:
387
+
388
+ ```ts
389
+ import type { A2UIMessage, A2UIComponent } from '@adia-ai/a2ui-runtime/schema';
390
+ ```
391
+
392
+ ### Step 8 — Agent harness bootstrap (`AGENTS.md` + `CLAUDE.md`)
393
+
394
+ If the consumer project has **no agent-entry file** (no `AGENTS.md`,
395
+ no `CLAUDE.md`, no `.cursor/rules`, no `WARP.md` etc.), create them as
396
+ part of cold-start. Future agent sessions (Claude Code, Cursor,
397
+ Windsurf, Hermes, OpenAI Codex, any harness that auto-loads project
398
+ context) need an entry point that names which skill to defer to and
399
+ records project-specific decisions.
400
+
401
+ **Decision branch — pre-existing `AGENTS.md`:**
402
+
403
+ If `AGENTS.md` already exists when you reach this step, do NOT silently
404
+ skip. Branch:
405
+
406
+ 1. **Check whether it contains a `## Skill` section pointing at this
407
+ skill** (grep for `adia-ui-kit` in the file). If yes — it was
408
+ previously scaffolded; the bootstrap is already in place. Skip.
409
+ 2. **If no `## Skill` section** (the common case for a hand-rolled file
410
+ from an earlier session): **rewrite from the template**, preserving
411
+ any project-specific content (AdiaUI quirks, known bugs, decisions)
412
+ by moving it into the template's `## Project-specific decisions`
413
+ block. **Do not append** — the template structure relies on section
414
+ ordering, and appending produces duplicate-section drift.
415
+ 3. **Note the rewrite in your session summary** so the operator can
416
+ audit which sections moved where.
417
+
418
+ The rewrite is the right answer because `AGENTS.md` without a `## Skill`
419
+ pointer means every future session starts cold — no skill auto-load, no
420
+ ticket pipeline commands, no install verification shortcut. Closes
421
+ claims-ui-v2 FB-03.
422
+
423
+ **The pattern:**
424
+
425
+ ```
426
+ <project-root>/
427
+ ├── CLAUDE.md # 1-line pointer: `@AGENTS.md`
428
+ ├── AGENTS.md # canonical agent contract
429
+ └── .agents/
430
+ ├── skills/ # optional: vendored project-specific skills
431
+ └── team/ # optional: ticket pipeline (drafts/outbox/inbox/archive)
432
+ ```
433
+
434
+ **`CLAUDE.md`** is a single line that points at `AGENTS.md`:
435
+
436
+ ```
437
+ @AGENTS.md
438
+ ```
439
+
440
+ Claude Code, Cursor, and several other harnesses honor the `@<file>`
441
+ include syntax — they pull in `AGENTS.md` content as if it were
442
+ written inline. This avoids duplicating content across multiple
443
+ harness-specific files. Other harnesses (Hermes, OpenAI Codex,
444
+ WARP, etc.) read `AGENTS.md` directly per the
445
+ [`AGENTS.md` convention](https://agents.md). Two files, one
446
+ canonical source.
447
+
448
+ **`AGENTS.md`** is the consumer's agent contract. Scaffold from
449
+ the template at `assets/templates/AGENTS.template.md` in this
450
+ skill. Replace the `{{PLACEHOLDER}}` markers:
451
+
452
+ | Placeholder | Replace with |
453
+ |---|---|
454
+ | `{{PROJECT_NAME}}` | the consumer project's name (e.g. `Claims UI`) |
455
+ | `{{PROJECT_NAME_KEBAB}}` | kebab-case form for ticket filenames (e.g. `claims-ui`) |
456
+ | `{{PROJECT_DESCRIPTION_ONE_LINER}}` | one-sentence description |
457
+ | `{{STACK}}` | e.g. "Vite + TypeScript + `@adia-ai/web-components`" |
458
+ | `{{SKILL_PATH}}` | absolute path to this skill's SKILL.md |
459
+ | `{{SKILL_PATH_DIR}}` | absolute path to the skill folder (for `scripts/` references) |
460
+ | `{{SKILL_VERSION}}` | optional pin (e.g. `2.8.0`) — leave blank if floating |
461
+ | `{{SKILL_COMMIT}}` | optional commit SHA — leave blank if floating |
462
+ | `{{ADIA_AI_VERSION}}` | installed `@adia-ai/*` version (e.g. `0.6.32`) |
463
+ | `{{PROJECT_SPECIFIC_DECISIONS}}` | project-specific choices (rendering mode, theme posture, data layer, etc.) |
464
+ | `{{DATE}}` | YYYY-MM-DD of last review |
465
+
466
+ **Why this works:**
467
+
468
+ - Future agent sessions get loaded with `AGENTS.md` before any
469
+ context-gathering steps — they don't need to be told "go read
470
+ the AdiaUI skill". The pointer is in their auto-loaded layer.
471
+ - Project-specific decisions live in `AGENTS.md`, not in the
472
+ skill — the skill stays portable; the project keeps its own
473
+ conventions findable.
474
+ - The skill is loaded by **path reference**, not by copy. When the
475
+ skill updates, every consumer's agent sessions pick up the new
476
+ procedures automatically.
477
+ - The `@AGENTS.md` pointer pattern means harness-specific files
478
+ (`CLAUDE.md`, `.cursor/rules`, `WARP.md`, etc.) stay tiny — one
479
+ line. No drift across harnesses.
480
+
481
+ **Scaffold command** (from your consumer project root):
482
+
483
+ ```bash
484
+ # Replace SKILL_DIR with your actual skill path
485
+ SKILL_DIR=/Users/<you>/Projects/gen-ui-kit/.agents/skills/adia-ui-kit
486
+
487
+ cp "$SKILL_DIR/assets/templates/AGENTS.template.md" AGENTS.md
488
+ cp "$SKILL_DIR/assets/templates/CLAUDE.template.md" CLAUDE.md
489
+
490
+ # Then edit AGENTS.md to fill in the placeholders.
491
+ ```
492
+
493
+ **Pitfall: do NOT vendor the skill into the consumer project.** Some
494
+ agents will try to copy the whole `adia-ui-kit/` folder into the
495
+ consumer's `.agents/skills/`. That forks the skill — updates won't
496
+ propagate. The right shape is **path reference** from `AGENTS.md`,
497
+ not vendoring.
498
+
499
+ **Pitfall: do NOT pin the skill version in `AGENTS.md`** unless the
500
+ consumer explicitly wants reproducibility-over-currency. The skill's
501
+ versioning is conservative (PATCH for doc fixes, MINOR for new
502
+ sections, MAJOR for shape changes); floating reference is the
503
+ default sensible choice.
504
+
505
+ **If multiple harnesses are in use** (e.g. consumer team uses Claude
506
+ Code AND Cursor AND Hermes):
507
+
508
+ ```
509
+ <project-root>/
510
+ ├── AGENTS.md # canonical
511
+ ├── CLAUDE.md # `@AGENTS.md`
512
+ ├── .cursor/rules # `@AGENTS.md` (Cursor convention varies; check docs)
513
+ └── WARP.md # `@AGENTS.md`
514
+ ```
515
+
516
+ Each harness-specific file is a single-line pointer. The contract
517
+ lives in `AGENTS.md` once.
518
+
519
+ ### §Setup checklist
520
+
521
+ - [ ] `@phosphor-icons/core` in `package.json` dependencies
522
+ - [ ] `@adia-ai/web-modules` installed — needed for shells **and** for
523
+ `<canvas-ui>` (the default `web-components` barrel registers it). On
524
+ `web-components ≤ 0.6.43`, omitting `web-modules` breaks the build even
525
+ with zero shell tags (FEEDBACK-81); v0.6.44+ lazy-loads it so a
526
+ true primitives-only app may then omit it.
527
+ - [ ] CSS imported before markup renders (`@adia-ai/web-components/css`)
528
+ - [ ] Shell CSS imported for each shell tag used (e.g.
529
+ `@adia-ai/web-modules/shell/admin-shell.css`) — required, not optional.
530
+ **Use the single-segment form** (one segment after `/shell/`): the
531
+ exports map wildcard `./shell/*.css → ./shell/*/*.css` resolves it
532
+ internally. The three-segment form
533
+ (`@adia-ai/web-modules/shell/admin-shell/admin-shell.css`) mirrors
534
+ the on-disk path but is blocked by the exports map at Vite 8 /
535
+ Rolldown build time with no correction hint.
536
+ - [ ] Per-cluster shell registration import used (e.g.
537
+ `@adia-ai/web-modules/shell`), NOT the full `@adia-ai/web-modules`
538
+ barrel (broken at v0.6.7+ — chat-shell.js has in-repo absolute paths)
539
+ - [ ] **Cluster barrel, not per-component path.** `@adia-ai/web-modules/shell`
540
+ (the cluster barrel, `shell/index.js`) registers three custom element
541
+ classes: `AdminShell`, `AdminSidebar`, and `AdminCommand`. The
542
+ superficially similar `@adia-ai/web-modules/shell/admin-shell`
543
+ (per-component path, `shell/admin-shell/admin-shell.js`) registers
544
+ **only `AdminShell`**. The CSS-only bespoke children (`admin-content`,
545
+ `admin-topbar`, `admin-page`, etc.) need no JS registration, but
546
+ `AdminSidebar` does — it owns the `[data-resize]` drag-handle wiring
547
+ and the `.toggle()` / `.collapse()` / `.expand()` public API that
548
+ `AdminShell` calls to forward `[data-sidebar-toggle]` clicks.
549
+ **Symptom:** the sidebar renders correctly (CSS targets by tag name)
550
+ but the toggle button does nothing and the resize handle is inert —
551
+ `AdminShell` calls `sidebar.toggle()` on an unregistered element and
552
+ silently fails (no error). The path looks more tree-shakeable than the
553
+ cluster barrel, which is why it's a plausible mistake; resist it.
554
+ *claims-ui regression 2026-05-23: introduced when a consumer prompt
555
+ specified `shell/admin-shell` for "shell primitives registration"; the
556
+ sidebar rendered correctly but toggle/resize were silently broken until
557
+ the user reported the issue.*
558
+ - [ ] If `<admin-sidebar resizable>` is used: a `<div data-resize></div>`
559
+ direct child is present — without it `resizable` is a silent no-op
560
+ (no drag handle, no warning). Unlike `collapsible`, `resizable`
561
+ requires this author-supplied handle child.
562
+ - [ ] Barrel import runs before `installIconLoadersForRegistered`
563
+ - [ ] Icon loader glob uses `'../node_modules/@phosphor-icons/…'`
564
+ (relative form) — `'@phosphor-icons/…'` is rejected by Vite 8 rolldown
565
+ - [ ] Icon loader map includes the **`bold`** weight (not just `regular`) —
566
+ primitives stamp bold glyphs (e.g. `<select-ui multiple>` chip-remove `x`);
567
+ a regular-only map renders those blank + warns. Add `fill`/`thin` too if a
568
+ primitive you use needs them.
569
+ - [ ] No in-repo Vite aliases copied (`@core`, `@components`, `@llm`, `@styles`)
570
+ - [ ] (0.6.44 only) `optimizeDeps.exclude: ['@adia-ai/web-components', '@adia-ai/web-modules']`
571
+ in `vite.config.ts` — without it the 0.6.44 `<canvas-ui>` relative-import breaks
572
+ Vite dep pre-bundling and the app won't boot (FEEDBACK-85). Remove on 0.6.45+.
573
+ - [ ] Ran `scripts/check-adia-versions.py` from your consumer root —
574
+ 9-package lockstep aligned + installed ≥ latest published (see
575
+ §VersionCheck below)
576
+ - [ ] (Dev-only) If linking to `chat-ui` sources via `file:`, all 9
577
+ `@adia-ai/*` packages are linked (not a subset) — see §LocalLink
578
+ - [ ] (Optional) If using a shell, decide explicit-import vs `/with-css`
579
+ opt-in path — see §CSSPolicy "Opt-in `/with-css` variants"
580
+ - [ ] Agent harness bootstrap created — `AGENTS.md` + `CLAUDE.md`
581
+ pointer at project root (only if the project had no agent-entry
582
+ file). Scaffold from `assets/templates/AGENTS.template.md` +
583
+ `CLAUDE.template.md`; see §Setup Step 8 above.
584
+
585
+ ---
586
+
587
+ ### Verify the install matches what the skill describes — see §VersionCheck (canonical heading in SKILL.md)
588
+
589
+ > The §VersionCheck procedure was promoted back to SKILL.md as an H2
590
+ > anchor (v2.20.2 follow-up) so the broken-section-reference check
591
+ > resolves cleanly. The canonical body lives in SKILL.md §VersionCheck.
592
+ > The text below is the historical extract — kept for reference but
593
+ > not the source of truth.
594
+
595
+ **Why this gate exists.** The 9 `@adia-ai/*` packages ship in lockstep,
596
+ and skill guidance is version-sensitive (e.g. §F-014/F-015 docs the
597
+ bare-barrel bug that only affects v0.6.7 consumers; v0.6.8+ fixes it).
598
+ Before trusting a stale install, run:
599
+
600
+ ```bash
601
+ scripts/check-adia-versions.py
602
+ ```
603
+
604
+ (Path relative to the consumer project that has this skill installed.
605
+ If running from another consumer, pass `--root /path/to/consumer`.)
606
+
607
+ The script reports three sources side-by-side: **installed**
608
+ (node_modules), **declared** (package.json), **latest** (npm registry).
609
+ It classifies drift and exits non-zero when something needs attention.
610
+
611
+ **Exit codes**
612
+
613
+ - `0` — install is clean: lockstep aligned, declarations match installs,
614
+ and installed ≥ latest published (or you used `--offline`).
615
+ - `1` — drift detected. The text output names every package + suggests
616
+ the fix (`npm install @adia-ai/X@latest`, `npm install`, or wipe +
617
+ reinstall to repair split lockstep).
618
+ - `2` — unrecoverable (no `package.json` or no `node_modules` at root).
619
+
620
+ **Status legend**
621
+
622
+ | Marker | Meaning | Fix |
623
+ |---|---|---|
624
+ | ✓ ok | installed == declared, matches latest | — |
625
+ | ⚠ stale | installed < latest published | `npm install @adia-ai/<pkg>@latest` |
626
+ | ⚠ split | lockstep broken — packages disagree on version | wipe `node_modules` + lockfile, reinstall |
627
+ | ⚠ undeclared | user-facing package installed but not in package.json | add to `dependencies` |
628
+ | ⚠ uninstalled | declared but missing from node_modules | `npm install` |
629
+ | ⓘ ahead | installed > latest published (dev cut / local tarball) | informational, not an error |
630
+
631
+ **Flags**
632
+
633
+ - `--offline` — skip `npm view` (no network). Still verifies lockstep
634
+ + declared vs. installed; just can't tell you about staleness.
635
+ - `--json` — machine-readable for agent harnesses.
636
+ - `--root <path>` — explicit consumer root (default: cwd).
637
+
638
+ **When to run it**
639
+
640
+ - Once at the start of any new project work (cold-start gate).
641
+ - After any `npm install` or `npm update` involving `@adia-ai/*`.
642
+ - Before filing a feedback ticket — version coherence is required
643
+ evidence (see §FeedbackDiscipline principle 4 "verify before
644
+ claiming").
645
+ - When a piece of skill guidance contradicts your install (the script
646
+ tells you which side is stale).
647
+
648
+ **Monorepo-root behavior.** The script auto-detects the `@adia-ai/*`
649
+ source monorepo via the `workspaces` field and suppresses "undeclared"
650
+ warnings there (workspaces aren't external deps). The "ⓘ ahead" status
651
+ is also expected in the monorepo when you've bumped sources but not yet
652
+ published.