@adia-ai/adia-ui-forge 0.8.61 → 0.8.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +3 -3
- package/CHANGELOG.md +309 -274
- package/README.md +54 -18
- package/__init__.py +8 -8
- package/agents/a2ui-maintenance-agent.corpus.json +7 -7
- package/agents/a2ui-maintenance-agent.md +6 -6
- package/agents/a2ui-planner-agent.md +11 -11
- package/agents/demo-audit-agent.corpus.json +4 -4
- package/agents/demo-audit-agent.md +8 -9
- package/agents/framework-checker.md +10 -11
- package/agents/framework-planner-agent.md +9 -10
- package/agents/gen-ui-review-agent.corpus.json +4 -4
- package/agents/gen-ui-review-agent.md +8 -8
- package/agents/package-release-agent.corpus.json +4 -4
- package/agents/package-release-agent.md +9 -10
- package/agents/primitive-authoring-agent.corpus.json +1 -1
- package/agents/primitive-authoring-agent.md +5 -5
- package/agents/routing-corpus.json +46 -46
- package/codex.interface.json +1 -1
- package/commands/gen-ui-review.md +1 -1
- package/commands/package-release.md +2 -2
- package/package.json +1 -1
- package/plugin.yaml +2 -2
- package/prompts/gen-ui-review.md +1 -1
- package/prompts/package-release.md +2 -2
- package/references/contracts/a2ui-mcp-surface.md +7 -7
- package/references/contracts/migration-guide-format.md +6 -7
- package/references/shared/content-trust.md +3 -5
- package/skills/a2ui-maintenance/SKILL.md +13 -16
- package/skills/a2ui-maintenance/evals/evals.json +2 -2
- package/skills/a2ui-maintenance/evals/routing-corpus.json +1 -1
- package/skills/a2ui-maintenance/references/anti-patterns.md +10 -10
- package/skills/a2ui-maintenance/references/chunk-authoring.md +11 -12
- package/skills/a2ui-maintenance/references/corpus-discipline.md +13 -14
- package/skills/a2ui-maintenance/references/data-model-reactivity.md +22 -25
- package/skills/a2ui-maintenance/references/eval-diagnostics.md +21 -21
- package/skills/a2ui-maintenance/references/format-extension-decisions.md +12 -13
- package/skills/a2ui-maintenance/references/leverage-rules.md +6 -6
- package/skills/a2ui-maintenance/references/mcp-pipeline-ops.md +9 -10
- package/skills/a2ui-maintenance/references/mcp-tool-reference.md +11 -12
- package/skills/a2ui-maintenance/references/pipeline-overview.md +33 -38
- package/skills/a2ui-maintenance/references/semantic-fail-lifting.md +13 -14
- package/skills/a2ui-maintenance/references/strategy-engines.md +14 -16
- package/skills/a2ui-maintenance/references/surface-lifecycle.md +10 -11
- package/skills/a2ui-maintenance/references/zettel-calibration.md +14 -16
- package/skills/component-md-authoring/SKILL.md +20 -21
- package/skills/component-md-authoring/agents/openai.yaml +1 -1
- package/skills/cross-harness-authoring-standards/SKILL.md +19 -21
- package/skills/cross-harness-authoring-standards/agents/openai.yaml +1 -1
- package/skills/cross-harness-compatibility-standards/SKILL.md +34 -35
- package/skills/cross-harness-compatibility-standards/agents/openai.yaml +1 -1
- package/skills/demo-audit/SKILL.md +38 -38
- package/skills/demo-audit/evals/routing-corpus.json +1 -1
- package/skills/demo-audit/references/admin-shell-anatomy.md +21 -25
- package/skills/demo-audit/references/app-shell-pitfalls.md +11 -13
- package/skills/demo-audit/references/auto-fix-allowlist.md +3 -3
- package/skills/demo-audit/references/card-anatomy-sweep.md +10 -11
- package/skills/demo-audit/references/chat-shell-anatomy.md +25 -26
- package/skills/demo-audit/references/editor-shell-anatomy.md +25 -28
- package/skills/demo-audit/references/html-attr-sweep.md +12 -13
- package/skills/demo-audit/references/mode7-status-battery.md +4 -4
- package/skills/demo-audit/references/native-leak-annotations.md +8 -8
- package/skills/demo-audit/references/output-contract-worked-example.md +8 -8
- package/skills/demo-audit/references/probe-discipline-and-escalation.md +2 -2
- package/skills/demo-audit/references/visual-probe-triage.md +21 -23
- package/skills/gen-ui-review/SKILL.md +27 -27
- package/skills/gen-ui-review/agents/openai.yaml +1 -1
- package/skills/gen-ui-review/evals/routing-corpus.json +1 -1
- package/skills/gen-ui-review/references/corpus-html-patterns.md +28 -29
- package/skills/gen-ui-review/references/exit-gate-mechanics.md +5 -5
- package/skills/gen-ui-review/references/lookup-maintenance.md +2 -2
- package/skills/gen-ui-review/references/loop-protocol.md +25 -25
- package/skills/gen-ui-review/references/rubric-cosmetic.md +10 -10
- package/skills/gen-ui-review/references/rubric-decompose.md +15 -16
- package/skills/gen-ui-review/references/rubric-score.md +23 -24
- package/skills/gen-ui-review/references/scorecard-worked-examples.md +12 -12
- package/skills/gen-ui-review/references/scores.schema.json +2 -2
- package/skills/llm-client-maintenance/SKILL.md +12 -12
- package/skills/llm-client-maintenance/evals/routing-corpus.json +1 -1
- package/skills/llm-client-maintenance/references/adapter-contract.md +27 -27
- package/skills/llm-client-maintenance/references/add-a-provider.md +25 -25
- package/skills/llm-client-maintenance/references/bridge-facade.md +31 -31
- package/skills/llm-client-maintenance/references/browser-proxy-boundary.md +17 -17
- package/skills/llm-client-maintenance/references/model-registry.md +14 -14
- package/skills/llm-client-maintenance/references/streaming-sse.md +21 -21
- package/skills/package-release/SKILL.md +21 -23
- package/skills/package-release/evals/evals.json +2 -2
- package/skills/package-release/evals/routing-corpus.json +2 -2
- package/skills/package-release/references/authorization-model.md +6 -8
- package/skills/package-release/references/changelog-discipline.md +25 -27
- package/skills/package-release/references/cut-procedure.md +129 -136
- package/skills/package-release/references/gates-catalog.md +42 -43
- package/skills/package-release/references/independent-package-release.md +14 -15
- package/skills/package-release/references/invariants-detail.md +9 -9
- package/skills/package-release/references/mechanization.md +11 -12
- package/skills/package-release/references/migration-guide-authoring.md +20 -20
- package/skills/package-release/references/notes-authoring.md +20 -20
- package/skills/package-release/references/recovery-paths.md +28 -28
- package/skills/primitive-authoring/SKILL.md +19 -19
- package/skills/primitive-authoring/agents/openai.yaml +1 -1
- package/skills/primitive-authoring/evals/evals.json +2 -2
- package/skills/primitive-authoring/evals/routing-corpus.json +2 -2
- package/skills/primitive-authoring/references/INDEX.md +22 -22
- package/skills/primitive-authoring/references/anti-patterns.md +76 -77
- package/skills/primitive-authoring/references/api-contract.md +63 -65
- package/skills/primitive-authoring/references/authoring-cycle.md +47 -50
- package/skills/primitive-authoring/references/canonical-pattern-index.md +118 -118
- package/skills/primitive-authoring/references/code-style.md +50 -52
- package/skills/primitive-authoring/references/common-gotchas.md +23 -23
- package/skills/primitive-authoring/references/composite-demo-protocol.md +42 -45
- package/skills/primitive-authoring/references/css-patterns.md +97 -97
- package/skills/primitive-authoring/references/for-attribute-event-contract.md +12 -12
- package/skills/primitive-authoring/references/form-control-sizing.md +16 -18
- package/skills/primitive-authoring/references/lifecycle-patterns.md +42 -42
- package/skills/primitive-authoring/references/llm-bridge.md +21 -21
- package/skills/primitive-authoring/references/module-promotion.md +51 -51
- package/skills/primitive-authoring/references/primitive-audit.md +16 -16
- package/skills/primitive-authoring/references/shell-patterns.md +81 -81
- package/skills/primitive-authoring/references/svg-authoring.md +62 -66
- package/skills/primitive-authoring/references/token-contract.md +45 -49
- package/skills/primitive-authoring/references/trait-pages.md +8 -8
- package/skills/primitive-authoring/references/worked-example.md +39 -39
- package/skills/primitive-authoring/references/yaml-contract.md +139 -143
- package/skills/site-deployment/SKILL.md +25 -26
- package/skills/site-deployment/agents/openai.yaml +1 -1
- package/skills/site-deployment/evals/routing-corpus.json +1 -1
- package/skills/site-deployment/references/deploy-playbooks.md +51 -53
- package/skills/site-docs-authoring/SKILL.md +14 -14
- package/skills/site-docs-authoring/agents/openai.yaml +1 -1
- package/skills/site-docs-authoring/evals/evals.json +1 -1
- package/skills/site-docs-authoring/evals/routing-corpus.json +1 -1
- package/skills/site-docs-authoring/intent.md +18 -18
- package/skills/ssr-compatibility/SKILL.md +24 -25
- package/skills/ssr-compatibility/agents/openai.yaml +1 -1
- package/skills/ssr-compatibility/evals/evals.json +1 -1
- package/skills/ssr-compatibility/evals/routing-corpus.json +1 -1
- package/skills/ssr-compatibility/references/consumer-workarounds.md +22 -23
- package/skills/ssr-compatibility/references/failure-shapes.md +84 -91
- package/skills/ssr-compatibility/references/guard-patterns.md +54 -58
- package/skills/ssr-compatibility/references/status-ledger.md +17 -17
- package/skills/ssr-compatibility/references/test-without-linkedom.md +26 -27
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Promote inline → module
|
|
2
2
|
|
|
3
|
-
Use when you find the same UI block (markup + controller JS) authored in two or more consumers
|
|
3
|
+
Use when you find the same UI block (markup + controller JS) authored in two or more consumers, typically the docs shell (`site/`) and a playground (`playgrounds/<name>/`), and need to lift it into a single reusable element under `packages/web-modules/<cluster>/<name>/`.
|
|
4
4
|
|
|
5
|
-
This reference codifies the **5-phase arc** proven on `<theme-panel>`. Phases are independent commits
|
|
5
|
+
This reference codifies the **5-phase arc** proven on `<theme-panel>`. Phases are independent commits, trivially revertible.
|
|
6
6
|
|
|
7
7
|
> See [shell-patterns.md](shell-patterns.md) for the **different** activity of decomposing a single shell into a family of bespoke child elements per ADR-0023. This reference is for the _cross-cluster_ case where a single control surface (theme panel, command palette, future notification center, future user-menu) needs to live as one element used by many shells.
|
|
8
8
|
|
|
@@ -12,45 +12,45 @@ This reference codifies the **5-phase arc** proven on `<theme-panel>`. Phases ar
|
|
|
12
12
|
|
|
13
13
|
- A consumer-authored inline block appears (with non-trivial drift) in 2+ surfaces, AND
|
|
14
14
|
- The block has a stable, semi-public API surface (4–10 props at most), AND
|
|
15
|
-
- The bug-surface from drift is real (e.g. behavior B is wrong relative to behavior A
|
|
15
|
+
- The bug-surface from drift is real (e.g. behavior B is wrong relative to behavior A, playground "always shows 1,1" vs docs "reads computed").
|
|
16
16
|
|
|
17
17
|
## When NOT to use
|
|
18
18
|
|
|
19
|
-
- The duplication is ≤ 10 lines and has zero behavior drift
|
|
20
|
-
- The element is genuinely shell-internal (admin-only, chat-only)
|
|
21
|
-
- The block is a CSS-only template
|
|
22
|
-
- The block is a primitive (composes < 3 other primitives, no state)
|
|
19
|
+
- The duplication is ≤ 10 lines and has zero behavior drift, leave it inline.
|
|
20
|
+
- The element is genuinely shell-internal (admin-only, chat-only), use [shell-patterns.md](shell-patterns.md) instead.
|
|
21
|
+
- The block is a CSS-only template, promote to `catalog/ui-patterns/` not `packages/web-modules/`.
|
|
22
|
+
- The block is a primitive (composes < 3 other primitives, no state), promote to `packages/web-components/components/` instead.
|
|
23
23
|
|
|
24
24
|
## The 5-phase arc
|
|
25
25
|
|
|
26
26
|
Each phase = one commit. Each independently revertible. Verification gate runs at the end of every phase before the commit.
|
|
27
27
|
|
|
28
|
-
### Phase 1
|
|
28
|
+
### Phase 1, Author the element
|
|
29
29
|
|
|
30
|
-
1. `mkdir -p packages/web-modules/<cluster>/<name>` (new cluster, or under an existing one
|
|
30
|
+
1. `mkdir -p packages/web-modules/<cluster>/<name>` (new cluster, or under an existing one, see "Cluster placement" below).
|
|
31
31
|
2. Author **7 files** mirroring `web-modules/shell/admin-sidebar/`:
|
|
32
32
|
|
|
33
33
|
```text
|
|
34
|
-
<name>.yaml # source of truth
|
|
34
|
+
<name>.yaml # source of truth, schema + a2ui rules + keywords
|
|
35
35
|
<name>.js # UIElement subclass; light-DOM; imperative DOM stamping
|
|
36
36
|
<name>.css # two-block @scope pattern per component-token-contract.md
|
|
37
37
|
<name>.html # standalone demo (loads <name>.examples.html via fetch)
|
|
38
38
|
<name>.examples.html # the matrix consumed by the live demo
|
|
39
|
-
<name>.test.js # vitest happy-dom
|
|
40
|
-
<name>.a2ui.json # GENERATED
|
|
39
|
+
<name>.test.js # vitest happy-dom, minimum 15 specs
|
|
40
|
+
<name>.a2ui.json # GENERATED, never hand-edit
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
3. Wire the **4 package.json + barrel touchpoints**:
|
|
44
|
-
- `packages/web-modules/<cluster>/index.js
|
|
45
|
-
- `packages/web-modules/index.js
|
|
46
|
-
- `packages/web-modules/package.json` `exports
|
|
47
|
-
- `packages/web-modules/package.json` `files
|
|
48
|
-
- `packages/web-modules/package.json` `sideEffects
|
|
49
|
-
4. Regenerate catalog: `node scripts/build/components.mjs
|
|
44
|
+
- `packages/web-modules/<cluster>/index.js`, `export { Name } from './<name>/<name>.js';`
|
|
45
|
+
- `packages/web-modules/index.js`, add `export * from './<cluster>/index.js';`
|
|
46
|
+
- `packages/web-modules/package.json` `exports`, add `"./<cluster>": "./<cluster>/index.js"` + `"./<cluster>/*": "./<cluster>/*/*.js"`
|
|
47
|
+
- `packages/web-modules/package.json` `files`, add `"<cluster>/"`
|
|
48
|
+
- `packages/web-modules/package.json` `sideEffects`, add `"./<cluster>/**/*.js"`
|
|
49
|
+
4. Regenerate catalog: `node scripts/build/components.mjs`, produces `<name>.a2ui.json` + updates the aggregate corpus catalog.
|
|
50
50
|
5. **Gate** before commit:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
node scripts/build/components.mjs --verify # "clean
|
|
53
|
+
node scripts/build/components.mjs --verify # "clean, N files up-to-date"
|
|
54
54
|
npm run verify:traits # 100%
|
|
55
55
|
npm run smoke:engines # green
|
|
56
56
|
npm run smoke:register-engine # 11/11
|
|
@@ -58,9 +58,9 @@ Each phase = one commit. Each independently revertible. Verification gate runs a
|
|
|
58
58
|
npx vitest run packages/web-modules/<cluster>/<name>/<name>.test.js
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
### Phase 2
|
|
61
|
+
### Phase 2, Migrate primary consumer (typically `site/`)
|
|
62
62
|
|
|
63
|
-
The "full-fat" consumer
|
|
63
|
+
The "full-fat" consumer, the one with persistence, prefers-color-scheme listeners, etc. This is your reference behavior; replicate its full surface in the module.
|
|
64
64
|
|
|
65
65
|
1. Replace inline markup with single-tag composition:
|
|
66
66
|
|
|
@@ -80,7 +80,7 @@ The "full-fat" consumer — the one with persistence, prefers-color-scheme liste
|
|
|
80
80
|
# Expect zero hits.
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
4. **LS-key migration shim
|
|
83
|
+
4. **LS-key migration shim**, if the module uses a different storage namespace than the legacy controller, ship a one-shot read-old / write-new / drop-old block at the top of the consumer's boot script. Tested recipe:
|
|
84
84
|
|
|
85
85
|
```js
|
|
86
86
|
// ── One-shot LS migration (YYYY-MM-DD) ──
|
|
@@ -108,20 +108,20 @@ The "full-fat" consumer — the one with persistence, prefers-color-scheme liste
|
|
|
108
108
|
|
|
109
109
|
5. **Gate**: `node --check` the consumer JS, grep for stale `#`-ids, manual visual QA at `npm run dev` if the user agrees to a foreground dev session.
|
|
110
110
|
|
|
111
|
-
### Phase 3
|
|
111
|
+
### Phase 3, Migrate secondary consumer (typically a playground)
|
|
112
112
|
|
|
113
113
|
The "stripped" consumer. Same structural change minus persistence.
|
|
114
114
|
|
|
115
|
-
1. Same markup substitution
|
|
115
|
+
1. Same markup substitution, **omit `[persist]`** so the playground stays ephemeral and doesn't leak state into the primary consumer on the same origin.
|
|
116
116
|
2. Delete the controller blocks. Drop any `const html = document.documentElement;` that is now unused. Keep primitive imports needed by the module's stamped children (text-ui, divider-ui, slider-ui, field-ui, button-ui, etc.).
|
|
117
117
|
3. Update the playground's `spec/SPEC.md` ASCII diagram to show the new tag.
|
|
118
118
|
4. **Gate**: same as Phase 2.
|
|
119
119
|
|
|
120
|
-
### Phase 4
|
|
120
|
+
### Phase 4, Migrate the chunk corpus
|
|
121
121
|
|
|
122
122
|
The harvested training-corpus chunk (`packages/gen-ui/a2ui/corpus/chunks/<name>.json`) embeds the consumer's HTML as an escaped string. Update it so the LLM sees the new authoring shape.
|
|
123
123
|
|
|
124
|
-
1. **Preferred
|
|
124
|
+
1. **Preferred**, re-run the harvester:
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
127
|
npm run harvest:chunks
|
|
@@ -129,7 +129,7 @@ The harvested training-corpus chunk (`packages/gen-ui/a2ui/corpus/chunks/<name>.
|
|
|
129
129
|
|
|
130
130
|
Confirm `SOURCES` in `scripts/build/harvest-chunks.mjs` includes the consumer's directory (post-ADR-0026 it should include `site/pages`, `apps`, `playgrounds`, `catalog`).
|
|
131
131
|
|
|
132
|
-
2. **Fallback
|
|
132
|
+
2. **Fallback**, if the harvester source list excludes your consumer, edit the chunk JSON directly via a Python regex script. The pattern that worked for theme-panel:
|
|
133
133
|
|
|
134
134
|
```python
|
|
135
135
|
pat = re.compile(
|
|
@@ -147,25 +147,25 @@ The harvested training-corpus chunk (`packages/gen-ui/a2ui/corpus/chunks/<name>.
|
|
|
147
147
|
grep -l 'id="<old-id>"' packages/gen-ui/a2ui/corpus/chunks/*.json
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
4. **Gotcha
|
|
150
|
+
4. **Gotcha, hand-edit + later re-harvest**, if you used the fallback (step 2) AND a peer later adds your consumer's directory to harvester SOURCES, the next `harvest:chunks` run will overwrite your hand-edit with the live consumer HTML. Usually that's _good_ (the re-harvest captures the live state, including any post-edit consumer updates), but diff before assuming. Concrete example: theme-panel's `playground-app-shell.json` was hand-edited, then re-harvested after `playgrounds/` was added to SOURCES, the re-harvest captured the `<aside-ui>` → `<admin-sidebar>` bespoke conversion that the hand-edit missed.
|
|
151
151
|
5. **Gate**:
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
|
-
npm run test:a2ui # 22 pass
|
|
154
|
+
npm run test:a2ui # 22 pass, chunk loads
|
|
155
155
|
npm run smoke:chunks # tolerate pre-existing failures
|
|
156
156
|
# Optional (real-LLM, ~$2 per full eval):
|
|
157
157
|
npm run eval:diff -- --engine zettel # cov ≥ 40, avg ≥ 85
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
### Phase 5
|
|
160
|
+
### Phase 5, Release
|
|
161
161
|
|
|
162
162
|
Either ship as a standalone lockstep cut (per the sibling **package-release** skill), OR ride a bundled cut that the user is already coordinating. Either way:
|
|
163
163
|
|
|
164
|
-
1. **CHANGELOGs
|
|
165
|
-
2. **README
|
|
166
|
-
3. **Spec status
|
|
167
|
-
4. **Specs INDEX
|
|
168
|
-
5. **PR description
|
|
164
|
+
1. **CHANGELOGs**, `packages/web-modules/CHANGELOG.md` `[Unreleased]` (or the dated bump block if you're cutting now) + root `CHANGELOG.md`.
|
|
165
|
+
2. **README**, `packages/web-modules/README.md`: cluster table row, Layout tree entry, Quick start `import` line.
|
|
166
|
+
3. **Spec status**, `.claude/docs/specs/<name>-module.md` Status field flips `Draft, proposed` → `Active, shipped vN.M.P`, plus the phase-table tick.
|
|
167
|
+
4. **Specs INDEX**, `.claude/docs/specs/INDEX.md` row status column.
|
|
168
|
+
5. **PR description**, the arc's rationale, commit list, and verification table live in the PR description (history lives in git + PRs).
|
|
169
169
|
|
|
170
170
|
## Cluster placement decision (OD-001)
|
|
171
171
|
|
|
@@ -173,16 +173,16 @@ Either ship as a standalone lockstep cut (per the sibling **package-release** sk
|
|
|
173
173
|
| --- | --- |
|
|
174
174
|
| **A. New cluster** | The element is its own product axis; ≥ 2 credible siblings are foreseeable (e.g. `theme/` cluster: theme-panel today, theme-toggle + theme-preview tomorrow). Cost: 4 single-line edits (cluster `index.js`, root barrel, 3 `package.json` entries). |
|
|
175
175
|
| **B. Existing cluster** | The element fits a current family with no expansion plans. Pick the **most cross-cutting** cluster (`simple/`, `runtime/`) before a shell-specific one (`shell/`, `chat/`, `editor/`). |
|
|
176
|
-
| **C. Inside a shell cluster** | Almost never
|
|
176
|
+
| **C. Inside a shell cluster** | Almost never, fails if the element is consumed by _other_ shells. Use only when the element is structurally shell-bound. |
|
|
177
177
|
| **D. Promote to primitive** | Only if it composes < 3 other primitives. Most controls fail this test. |
|
|
178
178
|
|
|
179
|
-
**ADR prose drift
|
|
179
|
+
**ADR prose drift, don't trust an ADR's "Today's work" narrative for live paths.** ADR-0012 is the source for the primitives-vs-modules-vs-themes decision above, but its own "Today's work"/outcome-notes prose has drifted out from under its ratified Decision: that prose describes `packages/web-components/patterns/` as the shell/chat/editor/runtime source-clustering directory, but present-day `patterns/` holds 45+ usage-example dirs instead, source moved on to `packages/web-modules/{chat,editor,runtime,shell}/` per the later ADR-0015. The same drift claims `@adia-ai/web-themes` as a sibling workspace package; it never shipped that way, themes live under `packages/web-modules/theme/` as a subpath instead. An ADR's ratified **Decision** stays append-only-safe; its **"Today's work" / outcome-notes prose is not**, later reorganizations can strand it, and a reader following the literal directory claims today would git-mv into the wrong (docs-example) directory. Before executing a cluster-placement call cited from an ADR, verify the directory it names still matches the live tree (see "Path-rebase awareness" below) rather than trusting the ADR's narrative section verbatim.
|
|
180
180
|
|
|
181
|
-
**A second, distinct ADR-0012 correction
|
|
181
|
+
**A second, distinct ADR-0012 correction, the nav family's tier, and 4 retired element names (ADR-0087, partial supersession).** ADR-0012's "Today's work" cluster table and "What lives where today" table classified 6 nav elements (`<app-nav-ui>`, `<app-nav-group-ui>`, `<app-nav-item-ui>`, `<section-nav-ui>`, `<section-nav-group-ui>`, `<section-nav-item-ui>`) as modules-tier, living in `web-modules/shell/`. ADR-0015 corrected this same-day as "a misclassification ADR-0012 inherited from the patterns/ era": the nav family is primitives-tier, consolidated to 3 elements (`<nav-ui>`, `<nav-group-ui>`, `<nav-item-ui>`) in `web-components/components/`. Using ADR-0012's tables to classify a new nav-family element via the OD-001 decision table above would land it in modules-tier, wrong; nav elements are primitives per ADR-0015. ADR-0012's tables also named 4 element names since retired per ADR-0015's rename map: `<adia-chat-ui>` → `<chat-shell>`, `<adia-editor-ui>` → `<editor-shell>`, `<app-shell-ui>` → `<admin-shell>`, `<gen-ui>` → `<gen-root>`. ADR-0087 records this partial supersession formally (`supersedes: adr-0012`, scoped to these two tables only, the three-tier package model, the lateral-dependency rule, and the cluster boundaries all stand unchanged). Live authority: ADR-0015 itself, not ADR-0012's tables.
|
|
182
182
|
|
|
183
183
|
## Two rules from observed bugs
|
|
184
184
|
|
|
185
|
-
### OD-002
|
|
185
|
+
### OD-002, Absorb the standalone-button-next-door
|
|
186
186
|
|
|
187
187
|
When the original duplicated markup has a sibling button that conceptually belongs with the panel (e.g. `<button-ui #theme-toggle>` flipping `color-scheme` next to the `<popover-ui>` that contains the theme panel), **absorb it into the module behind a boolean attribute**, don't leave it next door. Two duplications collapse into zero.
|
|
188
188
|
|
|
@@ -195,7 +195,7 @@ Module shape:
|
|
|
195
195
|
|
|
196
196
|
The sibling button retires from consumer markup. Programmatic alternative stays available via `.apply({scheme})`.
|
|
197
197
|
|
|
198
|
-
### OD-003
|
|
198
|
+
### OD-003, Read computed values back into controls
|
|
199
199
|
|
|
200
200
|
When the module owns sliders that mirror CSS custom-property values that a _theme_ (or other parent) sets, the user mental model is "the slider shows the current value, regardless of how it got there." So on theme-change:
|
|
201
201
|
|
|
@@ -211,15 +211,15 @@ requestAnimationFrame(() => {
|
|
|
211
211
|
});
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
The `requestAnimationFrame` matters
|
|
214
|
+
The `requestAnimationFrame` matters, CSS application is async with attribute write; reading on the next frame guarantees the computed value reflects the new theme block.
|
|
215
215
|
|
|
216
216
|
The bug this fixes: a stripped-down playground variant that resets sliders to `1, 1` on theme click. Sliders then lie about the current value (`1.5` is the actual radius for `[theme="ocean"]`).
|
|
217
217
|
|
|
218
218
|
## Catalog-regeneration caution
|
|
219
219
|
|
|
220
|
-
`node scripts/build/components.mjs` reads ALL yamls in `packages/web-components/components/` AND `packages/web-modules/`, so a regenerated aggregate corpus catalog absorbs any uncommitted yaml changes elsewhere in the tree. **Don't stage the aggregate catalog** if it would bundle unrelated in-flight work; the per-component `<name>.a2ui.json` sidecar inside `packages/web-modules/<cluster>/<name>/` is sufficient on its own
|
|
220
|
+
`node scripts/build/components.mjs` reads ALL yamls in `packages/web-components/components/` AND `packages/web-modules/`, so a regenerated aggregate corpus catalog absorbs any uncommitted yaml changes elsewhere in the tree. **Don't stage the aggregate catalog** if it would bundle unrelated in-flight work; the per-component `<name>.a2ui.json` sidecar inside `packages/web-modules/<cluster>/<name>/` is sufficient on its own, that's what the per-component verify gate compares against.
|
|
221
221
|
|
|
222
|
-
A later `harvest:chunks` run over your consumer's directory supersedes any Phase-4 hand-edit with the live consumer HTML
|
|
222
|
+
A later `harvest:chunks` run over your consumer's directory supersedes any Phase-4 hand-edit with the live consumer HTML, usually strictly better (it captures shape updates the hand-edit missed); diff before assuming.
|
|
223
223
|
|
|
224
224
|
## Path-rebase awareness
|
|
225
225
|
|
|
@@ -244,7 +244,7 @@ apps/playgrounds/catalog layout.
|
|
|
244
244
|
|
|
245
245
|
## Pitfalls
|
|
246
246
|
|
|
247
|
-
1. **Skipping the `<name>.test.js` file.** Mandatory
|
|
247
|
+
1. **Skipping the `<name>.test.js` file.** Mandatory, peer references ([shell-patterns.md](shell-patterns.md)) demand a behavior test. Minimum coverage: stamp + connect, attribute reflection, primary user action, programmatic API, persistence on/off, disconnect cleanup. Target ≥ 15 specs; theme-panel ships 23.
|
|
248
248
|
2. **Forgetting one of the 4 `package.json` touchpoints.** Add to `exports` only, leave `files` out → `npm publish` ships a broken package (the directory isn't in the tarball). Add to `files` only, leave `sideEffects` out → bundlers tree-shake the `customElements.define()` call and the element silently never registers in production builds. All four are required.
|
|
249
249
|
3. **`[persist]` on by default.** Embedded demos silently mutate the docs shell's stored preferences (same origin). Default to ephemeral; flip `[persist]` on per-consumer.
|
|
250
250
|
4. **Editing the aggregate catalog by hand.** It's generated. Edit the `<name>.yaml` SoT and run `npm run build:components`.
|
|
@@ -266,10 +266,10 @@ apps/playgrounds/catalog layout.
|
|
|
266
266
|
|
|
267
267
|
## Cross-references
|
|
268
268
|
|
|
269
|
-
- [shell-patterns.md](shell-patterns.md)
|
|
270
|
-
- [authoring-cycle.md](authoring-cycle.md)
|
|
271
|
-
- [api-contract.md](api-contract.md)
|
|
272
|
-
- **package-release** (sibling skill)
|
|
273
|
-
- **a2ui-maintenance** (sibling skill)
|
|
274
|
-
- Spec: `.claude/docs/specs/package-architecture.md
|
|
275
|
-
- ADR-0012 / ADR-0023
|
|
269
|
+
- [shell-patterns.md](shell-patterns.md), bespoke shell-tier decomposition (ADR-0023; the _different_ activity)
|
|
270
|
+
- [authoring-cycle.md](authoring-cycle.md), the standard 5-step authoring cycle
|
|
271
|
+
- [api-contract.md](api-contract.md), prop naming, reflection, the legacy forms
|
|
272
|
+
- **package-release** (sibling skill), lockstep release cycle (Phase 5)
|
|
273
|
+
- **a2ui-maintenance** (sibling skill), chunk corpus harvest + smoke gates (Phase 4)
|
|
274
|
+
- Spec: `.claude/docs/specs/package-architecture.md`, three-tier package layout
|
|
275
|
+
- ADR-0012 / ADR-0023, decision labels: primitives-vs-modules-vs-themes and the bespoke shell pattern (history lives in git + PR descriptions)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Primitive Audit
|
|
1
|
+
# Primitive Audit, the §0 gate before any NEW primitive
|
|
2
2
|
|
|
3
|
-
**This is mandatory before _every_ new component or interactive surface in `packages/web-components/components/`.** Skipping it produces work that re-derives existing wiring, hits first-paint timing races (e.g. `input-ui[prefix]` falls back to literal text before the icon registry loads
|
|
3
|
+
**This is mandatory before _every_ new component or interactive surface in `packages/web-components/components/`.** Skipping it produces work that re-derives existing wiring, hits first-paint timing races (e.g. `input-ui[prefix]` falls back to literal text before the icon registry loads, `search-ui` was built precisely to hide that), creates asymmetry across the library, and burns user trust.
|
|
4
4
|
|
|
5
5
|
The audit takes 30 seconds. Do it.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
## Step 0
|
|
9
|
+
## Step 0, list the affordances
|
|
10
10
|
|
|
11
11
|
Take your spec / screenshot / user request and list each interactive affordance independently. For a "table header bar" like a table-toolbar, that's:
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ Take your spec / screenshot / user request and list each interactive affordance
|
|
|
18
18
|
|
|
19
19
|
Each line is a separate audit target.
|
|
20
20
|
|
|
21
|
-
## Step 1
|
|
21
|
+
## Step 1, inventory the library
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
ls packages/web-components/components/
|
|
@@ -26,7 +26,7 @@ ls packages/web-components/components/
|
|
|
26
26
|
|
|
27
27
|
Skim the names. Most affordances have a dedicated component already.
|
|
28
28
|
|
|
29
|
-
## Step 2
|
|
29
|
+
## Step 2, for each affordance, grep yamls
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
# Example: looking for an existing search-input primitive
|
|
@@ -41,9 +41,9 @@ grep -lE "menu|popover|dropdown" packages/web-components/components/*/*.yaml
|
|
|
41
41
|
|
|
42
42
|
Read every match's yaml top section (description + props + slots + events). Five minutes of reading saves an hour of re-implementation.
|
|
43
43
|
|
|
44
|
-
## Step 3
|
|
44
|
+
## Step 3, known-primitive map
|
|
45
45
|
|
|
46
|
-
Treat this as the default lookup table. **If your affordance maps to a row here, use that primitive
|
|
46
|
+
Treat this as the default lookup table. **If your affordance maps to a row here, use that primitive, do not roll your own.**
|
|
47
47
|
|
|
48
48
|
| Affordance | Primitive (NOT your own from scratch) |
|
|
49
49
|
| --- | --- |
|
|
@@ -60,7 +60,7 @@ Treat this as the default lookup table. **If your affordance maps to a row here,
|
|
|
60
60
|
| Inline code / shortcut hint | `kbd-ui` (NOT raw `<code>` / `<kbd>`) |
|
|
61
61
|
| Inline metric (label + value + change + trend) | `stat-ui` |
|
|
62
62
|
| Block of code with syntax highlighting | `code-ui` |
|
|
63
|
-
| Table data-cell formatting (badge, link, progress, date, etc.) | `cell-types.js` registry
|
|
63
|
+
| Table data-cell formatting (badge, link, progress, date, etc.) | `cell-types.js` registry, register a new type, don't render in column.render |
|
|
64
64
|
| Filter / sort / columns / search bar above a table | `table-toolbar-ui[for]` |
|
|
65
65
|
| Tabs + panels | `tabs-ui` + `tab-ui` |
|
|
66
66
|
| Modal / drawer / toast | `modal-ui` / `drawer-ui` / `toast-ui` |
|
|
@@ -68,13 +68,13 @@ Treat this as the default lookup table. **If your affordance maps to a row here,
|
|
|
68
68
|
| Avatar / avatar group | `avatar-ui` / `avatar-group-ui` |
|
|
69
69
|
| Color / calendar / OTP picker | `color-area-ui` / `calendar-picker-ui` / `otp-input-ui` |
|
|
70
70
|
| Stepper / timeline / progress / progress-row | `stepper-ui` / `timeline-ui` / `progress-ui` / `progress-row-ui` |
|
|
71
|
-
| Card with header / section / footer | `card-ui` (+ slot children)
|
|
71
|
+
| Card with header / section / footer | `card-ui` (+ slot children), don't roll a "panel" |
|
|
72
72
|
| Description-list (key/value) | `description-list-ui` |
|
|
73
73
|
| Tree / list / action-list | `tree-ui` / `list-ui` / `action-list-ui` |
|
|
74
74
|
|
|
75
75
|
If your affordance isn't in this table, run Step 2 again with better grep keywords. Only after those return nothing should you consider authoring something new.
|
|
76
76
|
|
|
77
|
-
## Step 4
|
|
77
|
+
## Step 4, when authoring IS warranted
|
|
78
78
|
|
|
79
79
|
If an affordance genuinely has no primitive (e.g. you're building the _first_ version of a new pattern), follow `chart-legend-ui` as the canonical "companion-bound-by-`[for]`" template:
|
|
80
80
|
|
|
@@ -82,15 +82,15 @@ If an affordance genuinely has no primitive (e.g. you're building the _first_ ve
|
|
|
82
82
|
- Resolve via `getRootNode().getElementById()`, fall back to first sibling of the right tag
|
|
83
83
|
- Listen to peer events for state sync
|
|
84
84
|
- Dispatch state changes back via `peer.<setter>` or `peer.<method>()`
|
|
85
|
-
- NEVER duplicate state in the companion
|
|
85
|
+
- NEVER duplicate state in the companion, peer remains source of truth
|
|
86
86
|
|
|
87
|
-
## Step 5
|
|
87
|
+
## Step 5, tone & token audit (mode 5 of this skill)
|
|
88
88
|
|
|
89
89
|
After the primitive audit passes, run the token audit at [token-contract.md](token-contract.md) to confirm:
|
|
90
90
|
|
|
91
91
|
- Two-block `@scope` pattern (tokens on `:where(:scope)`, styles on `:scope`)
|
|
92
92
|
- Zero raw colors (`grep -E '#[0-9a-fA-F]|rgb\(|hsl\(|oklch\(' <component>.css`)
|
|
93
|
-
- Match the canonical surface tokens of similar primitives
|
|
93
|
+
- Match the canonical surface tokens of similar primitives, for any popover that visually competes with `select-ui [slot="listbox"]`, copy its surface tokens exactly: `--a-canvas-bright`, `--a-ui-border`, `--a-radius`, `--a-bg-hover`, `--a-fg-hover`, `--a-fg-subtle`. Don't pick `--a-canvas` for floating menus, it's the L2 mid-tone surface, identical luminance in both schemes.
|
|
94
94
|
|
|
95
95
|
## Past failure (do not repeat)
|
|
96
96
|
|
|
@@ -98,7 +98,7 @@ A `table-toolbar-ui` initial implementation rolled its own from scratch:
|
|
|
98
98
|
|
|
99
99
|
- Hand-stamped `<input-ui prefix="magnifying-glass">` for search → "magnifying-glass" rendered as **literal text** because the icon registry hadn't resolved at first paint. `search-ui` already wraps input-ui with the right prefix + suffix + debounced `search` event.
|
|
100
100
|
- Hand-stamped `<label>` + `<span>` + `<input-ui>` for filter rows → `field-ui inline` is the canonical label+control pair, mints `id` + `[for]` automatically.
|
|
101
|
-
- Wrote `<text-ui display>` (invalid bare attr
|
|
101
|
+
- Wrote `<text-ui display>` (invalid bare attr, `display` is an enum value of `variant`, requires `<text-ui variant="display">`).
|
|
102
102
|
- Wrote popover surface as `--a-canvas` (washed-out mid-gray) instead of reading `select-ui`'s listbox tokens (`--a-canvas-bright`).
|
|
103
103
|
|
|
104
104
|
Caught only after user feedback. The audit takes 30 seconds. Do it.
|
|
@@ -117,5 +117,5 @@ Ask: "is there a higher-level primitive that wraps this?" 80% of the time yes. E
|
|
|
117
117
|
|
|
118
118
|
## Cross-references
|
|
119
119
|
|
|
120
|
-
- [authoring-cycle.md](authoring-cycle.md)
|
|
121
|
-
- [anti-patterns.md](anti-patterns.md)
|
|
120
|
+
- [authoring-cycle.md](authoring-cycle.md), the full 5-step authoring procedure (run AFTER this audit clears)
|
|
121
|
+
- [anti-patterns.md](anti-patterns.md), failure-mode catalogue (look up the rule a found primitive enforces)
|