@adia-ai/adia-ui-forge 0.8.5 → 0.8.6

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 (53) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +11 -0
  3. package/README.md +13 -4
  4. package/agents/a2ui-builder.corpus.json +35 -0
  5. package/agents/a2ui-builder.md +37 -0
  6. package/agents/component-author.corpus.json +40 -0
  7. package/agents/component-author.md +10 -1
  8. package/agents/framework-reviewer.corpus.json +35 -0
  9. package/agents/{framework-verifier.md → framework-reviewer.md} +15 -7
  10. package/agents/release-builder.corpus.json +39 -0
  11. package/agents/release-builder.md +39 -0
  12. package/agents/routing-corpus.json +38 -38
  13. package/commands/release.md +5 -3
  14. package/package.json +1 -1
  15. package/skills/adia-a2ui/SKILL.md +27 -6
  16. package/skills/adia-a2ui/evals/routing-corpus.json +36 -29
  17. package/skills/adia-a2ui/references/zettel-calibration.md +5 -5
  18. package/skills/adia-author/SKILL.md +15 -8
  19. package/skills/adia-author/evals/routing-corpus.json +39 -218
  20. package/skills/adia-author/references/authoring-cycle.md +19 -0
  21. package/skills/adia-author/references/code-style.md +0 -1
  22. package/skills/adia-author/references/llm-bridge.md +7 -0
  23. package/skills/adia-author/references/worked-example.md +18 -2
  24. package/skills/adia-deploy/SKILL.md +33 -18
  25. package/skills/adia-deploy/evals/routing-corpus.json +33 -142
  26. package/skills/adia-dogfood/SKILL.md +10 -3
  27. package/skills/adia-dogfood/evals/routing-corpus.json +30 -142
  28. package/skills/adia-dogfood/references/admin-shell-anatomy.md +1 -1
  29. package/skills/adia-gen-review/SKILL.md +18 -7
  30. package/skills/adia-gen-review/evals/routing-corpus.json +30 -142
  31. package/skills/adia-gen-review/scripts/gen-review-decompose.mjs +5 -0
  32. package/skills/adia-llm-internals/SKILL.md +10 -6
  33. package/skills/adia-llm-internals/evals/routing-corpus.json +33 -142
  34. package/skills/adia-llm-internals/references/bridge-facade.md +2 -2
  35. package/skills/adia-llm-internals/references/streaming-sse.md +1 -1
  36. package/skills/adia-release/SKILL.md +40 -17
  37. package/skills/adia-release/evals/routing-corpus.json +35 -0
  38. package/skills/adia-release/references/changelog-discipline.md +14 -8
  39. package/skills/adia-release/references/cut-procedure.md +48 -28
  40. package/skills/adia-release/references/independent-package-release.md +1 -1
  41. package/skills/adia-release/scripts/insert-stub.mjs +1 -1
  42. package/skills/adia-release/scripts/release-pack.mjs +42 -14
  43. package/skills/adia-site-docs/SKILL.md +6 -1
  44. package/skills/adia-site-docs/evals/routing-corpus.json +35 -173
  45. package/skills/adia-ssr/SKILL.md +32 -14
  46. package/skills/adia-ssr/evals/routing-corpus.json +32 -136
  47. package/skills/adia-ssr/references/consumer-workarounds.md +33 -15
  48. package/skills/adia-ssr/references/failure-shapes.md +49 -7
  49. package/skills/adia-ssr/references/guard-patterns.md +41 -0
  50. package/skills/adia-ssr/references/status-ledger.md +5 -7
  51. package/skills/adia-ssr/references/test-without-linkedom.md +28 -12
  52. package/agents/a2ui-engineer.md +0 -26
  53. package/agents/release-engineer.md +0 -26
@@ -1,11 +1,16 @@
1
1
  ---
2
2
  name: adia-a2ui
3
3
  description: >-
4
- Maintains the A2UI pipeline (packages/a2ui/): chunk corpus, compose
5
- strategies, calibration, evals, the a2ui MCP. Use when asked to author/fix
6
- chunks, tune STRONG_MATCH, lift eval fails, change MCP tools, run pipeline
7
- ops, or when a component's A2UI contract can't express a content shape.
8
- NOT for app screens (adia-compose).
4
+ Maintains the A2UI pipeline (packages/a2ui/): the harvested chunk corpus,
5
+ compose strategies (zettel, chunk-zettel, free-form, monolithic), retrieval,
6
+ validator, calibration, evals, the a2ui MCP server. Use when asked to
7
+ author/harvest/fix chunks, tune STRONG_MATCH or zettel thresholds, validate
8
+ an A2UI document, diagnose an eval gap/regression or lift a semantic fail,
9
+ add or change MCP tools (generate_ui, compose_from_chunks,
10
+ check_anti_patterns, refine_composition), scan anti-patterns, run pipeline
11
+ ops, or when a component's A2UI contract can't express a content shape. NOT
12
+ for app screens (adia-compose), runtime gen-UI app features (adia-genui),
13
+ primitive authoring (adia-author), or gallery scoring (adia-gen-review).
9
14
  disable-model-invocation: false
10
15
  user-invocable: true
11
16
  ---
@@ -73,7 +78,7 @@ Unmatched work defaults to pipeline-overview and re-classifies from there.
73
78
  Full structural gate after any pipeline change:
74
79
 
75
80
  ```bash
76
- node scripts/build/components.mjs --verify # "clean — N files up-to-date" (127 component dirs)
81
+ node scripts/build/components.mjs --verify # "clean — N files up-to-date" (the N is the gate; dir count drifts, don't pin it)
77
82
  npm run verify:traits # 100% coverage
78
83
  npm run smoke:engines
79
84
  npm run smoke:register-engine # 11/11
@@ -109,3 +114,19 @@ intent → retrieval (chunk / composition search)
109
114
  Every change touches exactly one stage; identify which before patching. History
110
115
  for any constant or decision lives in git and PR descriptions
111
116
  (`git log -S STRONG_MATCH_THRESHOLD -- packages/a2ui`).
117
+
118
+ ## Pipeline Change Record — the output contract
119
+
120
+ Every change reports:
121
+
122
+ | Field | Value |
123
+ | --- | --- |
124
+ | Stage touched | retrieval \| strategy engine (zettel/chunk-zettel/free-form/monolithic) \| composer \| validator \| MCP surface |
125
+ | Narrowest gate run | the specific check for the touched stage, + result |
126
+ | Full sequence | `npm run smoke:engines` + `npm run test:a2ui` result |
127
+ | Floors before → after | cov/avg/MRR (zettel) or cov/avg/F1 (free-form) or cov/avg (monolithic) |
128
+ | Re-baseline | no / yes — if yes, the PR that ratified the new floor |
129
+
130
+ Done when every row is filled and the cited gates are green. NOT done: a
131
+ floor number changed with no before/after comparison, or a threshold tweak
132
+ with no root-cause note for why the floor moved.
@@ -1,31 +1,38 @@
1
1
  {
2
- "skill": "adia-a2ui",
3
- "description": "Routing corpus — does a phrase route to adia-a2ui (the A2UI/gen-ui pipeline maintainer skill) or to a sibling/off-topic?",
4
- "minimums_per_spec": {
5
- "trigger_phrases": 10,
6
- "adversarial_phrases": 5
7
- },
8
- "phrases": [
9
- { "id": "t1", "phrase": "validate this A2UI document", "should_route_to_a2ui": true },
10
- { "id": "t2", "phrase": "harvest a chunk from this HTML demo", "should_route_to_a2ui": true },
11
- { "id": "t3", "phrase": "zettel coverage dropped after the last change", "should_route_to_a2ui": true },
12
- { "id": "t4", "phrase": "should this repeated subtree become its own chunk", "should_route_to_a2ui": true },
13
- { "id": "t5", "phrase": "tune the STRONG_MATCH threshold", "should_route_to_a2ui": true },
14
- { "id": "t6", "phrase": "run check_anti_patterns on this rendered HTML", "should_route_to_a2ui": true },
15
- { "id": "t7", "phrase": "refine composition with an OAuth row", "should_route_to_a2ui": true },
16
- { "id": "t8", "phrase": "MRR dropped in the chunk retrieval eval", "should_route_to_a2ui": true },
17
- { "id": "t9", "phrase": "add an MCP tool to the a2ui server", "should_route_to_a2ui": true },
18
- { "id": "t10", "phrase": "audit the training data corpus for drift", "should_route_to_a2ui": true },
19
- { "id": "t11", "phrase": "diagnose this eval gap and regression", "should_route_to_a2ui": true },
20
- { "id": "t12", "phrase": "run the MCP pipeline: generate_ui then validate_schema", "should_route_to_a2ui": true },
21
- { "id": "t13", "phrase": "lift a semantic fail under sixty", "should_route_to_a2ui": true },
22
- { "id": "t14", "phrase": "why did the composer emit composition-match instead of composition-synthesized", "should_route_to_a2ui": true },
23
- { "id": "a1", "phrase": "build a settings page from existing primitives", "should_route_to_a2ui": false, "expected_alternative": "adia-author" },
24
- { "id": "a2", "phrase": "add a slot to button-ui and update its yaml contract", "should_route_to_a2ui": false, "expected_alternative": "adia-author" },
25
- { "id": "a3", "phrase": "cut a release and bump the version tag", "should_route_to_a2ui": false, "expected_alternative": "adia-release" },
26
- { "id": "a4", "phrase": "score the generated UI quality in apps/genui", "should_route_to_a2ui": false, "expected_alternative": "adia-gen-review" },
27
- { "id": "a5", "phrase": "run a broad visual QA sweep across site and playgrounds", "should_route_to_a2ui": false, "expected_alternative": "adia-dogfood" },
28
- { "id": "a6", "phrase": "fix the @adia-ai/llm SSE adapter", "should_route_to_a2ui": false, "expected_alternative": "adia-llm" },
29
- { "id": "a7", "phrase": "explain how React state management works", "should_route_to_a2ui": false, "expected_alternative": "off-topic" }
30
- ]
2
+ "positives": [
3
+ "validate this A2UI document",
4
+ "harvest a chunk from this HTML demo",
5
+ "zettel coverage dropped after the last change",
6
+ "should this repeated subtree become its own chunk",
7
+ "tune the STRONG_MATCH threshold",
8
+ "run check_anti_patterns on this rendered HTML",
9
+ "refine composition with an OAuth row",
10
+ "MRR dropped in the chunk retrieval eval",
11
+ "add an MCP tool to the a2ui server",
12
+ "audit the training data corpus for drift",
13
+ "diagnose this eval gap and regression",
14
+ "run the MCP pipeline: generate_ui then validate_schema",
15
+ "lift a semantic fail under sixty",
16
+ "why did the composer emit composition-match instead of composition-synthesized"
17
+ ],
18
+ "negatives": [
19
+ "build a settings page from existing primitives",
20
+ "add a slot to button-ui and update its yaml contract",
21
+ "cut a release and bump the version tag",
22
+ "score the generated UI quality in apps/genui",
23
+ "run a broad visual QA sweep across site and playgrounds",
24
+ "fix the @adia-ai/llm SSE adapter",
25
+ "explain how React state management works",
26
+ "compose a settings screen from catalog primitives",
27
+ "mount gen-root and wire data resolvers for end users at runtime",
28
+ "edit the getting-started docs page on the site"
29
+ ],
30
+ "_measured": {
31
+ "as_of": "2026-07-18",
32
+ "scorer": "routing_eval.py (nonoun-plugins/forge)",
33
+ "f1": 0.783,
34
+ "precision": 1.0,
35
+ "recall": 0.643,
36
+ "exit_code": 0
37
+ }
31
38
  }
@@ -8,7 +8,7 @@ is calibrated against the held-out intent set or production telemetry.
8
8
 
9
9
  ## `STRONG_MATCH_THRESHOLD = 40`
10
10
 
11
- - **File**: `packages/a2ui/compose/strategies/zettel/generator-adapter.js:89`
11
+ - **File**: `packages/a2ui/compose/strategies/zettel/generator-adapter.js` (`grep -n STRONG_MATCH_THRESHOLD`)
12
12
  - **Raised**: 22 → 40 post-incident.
13
13
  - **Reason**: at 22, login-form / signup-form played verbatim too often →
14
14
  repetitive output. At 40, only near-perfect retrievals (chart-dashboard=48,
@@ -29,7 +29,7 @@ is calibrated against the held-out intent set or production telemetry.
29
29
 
30
30
  ## `STRONG_RETRIEVAL_SCORE = 8`
31
31
 
32
- - **File**: `chunk-synthesizer.js:31`
32
+ - **File**: `chunk-synthesizer.js` (`grep -n STRONG_RETRIEVAL_SCORE`)
33
33
  - **Scale**: corpus-size-**independent** absolute keyword score from
34
34
  `chunk-library.js#keywordScore()`: first name-word matches a token **+10**,
35
35
  full-query substring **+5**, whole-word token in name **+3**, substring /
@@ -46,7 +46,7 @@ is calibrated against the held-out intent set or production telemetry.
46
46
 
47
47
  ## `PRE_SEARCH_LIMIT = 30`
48
48
 
49
- - **Files**: `chunk-synthesizer.js:32`, `chunk-refiner.js:32`
49
+ - **Files**: `chunk-synthesizer.js` + `chunk-refiner.js` (`grep -n PRE_SEARCH_LIMIT`)
50
50
  - **Reason**: token-budget mitigation — pre-filter the catalog before the LLM
51
51
  sees it; the full catalog per prompt would burn tens of thousands of tokens.
52
52
  - **Synthesizer**: kind-aware allocation —
@@ -61,7 +61,7 @@ is calibrated against the held-out intent set or production telemetry.
61
61
 
62
62
  ## `SCOPE_DRIFT_RATIO = 1.5` + `SCOPE_DRIFT_MIN_ACTUAL = 20`
63
63
 
64
- - **File**: `chunk-synthesizer.js:38-39` (exported)
64
+ - **File**: `chunk-synthesizer.js` (exported; `grep -n SCOPE_DRIFT`)
65
65
  - Composed envelope's component count > 1.5× the sum of bound chunks' counts
66
66
  auto-fires a `scope-drift` issue — catches LLM creative expansion that
67
67
  hallucinates components beyond the bound chunks.
@@ -70,7 +70,7 @@ is calibrated against the held-out intent set or production telemetry.
70
70
 
71
71
  ## `DEFAULT_MAX_ATTEMPTS = 2`
72
72
 
73
- - **Files**: `chunk-refiner.js:31`, `chunk-synthesizer.js:33`
73
+ - **Files**: `chunk-refiner.js` + `chunk-synthesizer.js` (`grep -n DEFAULT_MAX_ATTEMPTS`)
74
74
  - Validator-driven retry budget. After 2 failed validations the engine emits
75
75
  `synthesis-failed`.
76
76
 
@@ -1,11 +1,18 @@
1
1
  ---
2
2
  name: adia-author
3
3
  description: >-
4
- Author or modify code inside the adia-ui monorepo — primitives, shells,
5
- demos, component yaml SoTs, the @adia-ai/llm bridge. Use when asked to add
6
- or edit a primitive, prop, slot, shell, or component CSS, promote inline
7
- UI to a module, or author a demo. NOT for composing app screens from
8
- primitives (adia-compose) or pipeline internals (adia-a2ui).
4
+ Author or modify AdiaUI framework source inside the monorepo — primitives
5
+ (packages/web-components), shells/composites (packages/web-modules), yaml
6
+ SoTs, demos. Use when asked to add a new primitive component, add or fix a prop/slot/
7
+ attribute/CSS variant, update a component's yaml, build or fix a shell
8
+ (chat-shell, admin-shell, editor-shell sidebar/pane/bespoke-tier
9
+ composition), promote or extract repeated inline content into a shared
10
+ module, audit a component's four-axis contract/token usage/lifecycle
11
+ (connected/disconnected symmetry) for drift, or author/write a demo or
12
+ examples.html for a component or composite. NOT for composing app screens
13
+ from primitives (adia-compose), A2UI pipeline internals (adia-a2ui),
14
+ @adia-ai/llm adapter/streaming/bridge internals (adia-llm-internals), or
15
+ site/pages docs pages (adia-site-docs).
9
16
  disable-model-invocation: false
10
17
  user-invocable: true
11
18
  ---
@@ -14,7 +21,9 @@ user-invocable: true
14
21
 
15
22
  Guard rails for code that lands INSIDE the adia-ui monorepo: primitives
16
23
  (`packages/web-components/`), shells and composites (`packages/web-modules/`),
17
- their `<name>.yaml` SoTs, the `@adia-ai/llm` bridge, and composite demos.
24
+ their `<name>.yaml` SoTs, and composite demos. `@adia-ai/llm` internals
25
+ (adapters, streaming, the bridge) are `adia-llm-internals`'s charter, not
26
+ this skill's — route there.
18
27
  Light-DOM is load-bearing: `slot=` attributes are decorative metadata,
19
28
  positioning is CSS by tag + ancestor + DOM order — never `::slotted()`,
20
29
  `::part()`, or shadow DOM. `.claude/docs/specs/component-token-contract.md`
@@ -30,7 +39,6 @@ wins any tie with this skill. Monorepo source read while authoring (yaml, CSS,
30
39
  | Shell / bespoke cluster child (`<admin-*>` `<chat-*>` `<editor-*>` `<simple-*>`) | [shell-patterns.md](references/shell-patterns.md) |
31
40
  | Promote repeated inline UI → shared module | [module-promotion.md](references/module-promotion.md) |
32
41
  | Contract / token / lifecycle drift audit on an existing component | [token-contract.md](references/token-contract.md) + [anti-patterns.md](references/anti-patterns.md) |
33
- | Extend `@adia-ai/llm` (provider, streaming, proxy) | [llm-bridge.md](references/llm-bridge.md) |
34
42
  | Demo for a composite/module — any `packages/web-modules/**/*.{examples,contents}.html` | [composite-demo-protocol.md](references/composite-demo-protocol.md) — NOT the primitive or promotion paths; they lack the canonical-survey discipline |
35
43
  | Convention question ("is this idiomatic?") | [code-style.md](references/code-style.md) — cite the rule, don't expand it inline |
36
44
 
@@ -82,7 +90,6 @@ citation mechanically on every web-modules demo write; the
82
90
  | Shell | render `packages/web-modules/<cluster>/<name>/<name>.html`; `node scripts/dev/audit-native-primitive-leak.mjs --include=<surface>`; `node scripts/dev/audit-shell-composition.mjs --include=<surface>` for `<admin-shell>` composites |
83
91
  | Inline → module promotion | source page renders identically post-refactor (visual sweep + DOM diff) + native-primitive-leak audit on the touched surface |
84
92
  | Drift audit | the findings report itself; gates run once a fix is applied |
85
- | LLM-bridge extension | a real client round-trip parses + returns (`npm run check:lockstep` + `npm run smoke:engines`) |
86
93
  | Composite demo | `npm run audit:demo-pattern-source:strict` + `npm run qa:design-coherence:strict` + (8b) `npm run qa:rendered-dom:emit -- --slug=<slug>` |
87
94
 
88
95
  Full structural-gate sequence after any primitive / shell / promotion work:
@@ -1,222 +1,43 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "name": "adia-author routing accuracy corpus",
4
- "version": "2.0.0",
5
- "purpose": "Routing-eval corpus for adia-author (adia-forge plugin). Each phrase declares whether adia-author SHOULD be the routing target. Scored by the estate's TF-IDF routing-eval runner against the skill's description (heuristic token overlap).",
6
- "scoring_notes": "Heuristic signal, not ground truth. Treat misroutes as a prompt to tighten the skill description, never as a reason to keyword-stuff it. Real harness routing is LLM-driven.",
7
- "license": "internal",
8
- "scope": "adia-author routing does this phrase activate adia-author?",
9
-
10
- "minimums_per_spec": {
11
- "trigger_phrases": 21,
12
- "adversarial_phrases": 6,
13
- "task_shapes_covered": "new-primitive, modify-primitive, shell, module-promotion, drift-audit, llm-bridge, composite-demo",
14
- "adversarial_fraction": "20%"
15
- },
16
-
17
- "phrases": [
18
- {
19
- "id": "author-new-primitive-01",
20
- "phrase": "add a new button-ui primitive component",
21
- "should_route_to_author": true,
22
- "expected_shape": "new-primitive",
23
- "rationale": "Canonical new-primitive task shape."
24
- },
25
- {
26
- "id": "author-new-primitive-02",
27
- "phrase": "build a new <toggle-ui> component from scratch",
28
- "should_route_to_author": true,
29
- "expected_shape": "new-primitive",
30
- "rationale": "'build a <foo-ui>' phrasing."
31
- },
32
- {
33
- "id": "author-new-primitive-03",
34
- "phrase": "create a new primitive web component in packages/web-components",
35
- "should_route_to_author": true,
36
- "expected_shape": "new-primitive",
37
- "rationale": "Explicit packages/web-components path mention."
38
- },
39
-
40
- {
41
- "id": "author-modify-01",
42
- "phrase": "add a new prop to table-ui",
43
- "should_route_to_author": true,
44
- "expected_shape": "modify-primitive",
45
- "rationale": "Modify existing primitive — add a prop."
46
- },
47
- {
48
- "id": "author-modify-02",
49
- "phrase": "fix the CSS in card-ui to handle the new bleed variant",
50
- "should_route_to_author": true,
51
- "expected_shape": "modify-primitive",
52
- "rationale": "Modify existing primitive CSS."
53
- },
54
- {
55
- "id": "author-modify-03",
56
- "phrase": "update the input-ui yaml to add a placeholder attribute",
57
- "should_route_to_author": true,
58
- "expected_shape": "modify-primitive",
59
- "rationale": "Update the yaml SoT for an existing primitive."
60
- },
61
-
62
- {
63
- "id": "author-shell-01",
64
- "phrase": "build the chat-shell composition with the new sidebar slot",
65
- "should_route_to_author": true,
66
- "expected_shape": "shell",
67
- "rationale": "Shell authoring."
68
- },
69
- {
70
- "id": "author-shell-02",
71
- "phrase": "author a new web-module shell at packages/web-modules/editor/editor-shell",
72
- "should_route_to_author": true,
73
- "expected_shape": "shell",
74
- "rationale": "Explicit web-modules + shell."
75
- },
76
- {
77
- "id": "author-shell-03",
78
- "phrase": "add a pane behaviour to admin-shell per the bespoke shell-tier convention",
79
- "should_route_to_author": true,
80
- "expected_shape": "shell",
81
- "rationale": "Bespoke shell-tier (ADR-0023 shape) work."
82
- },
83
-
84
- {
85
- "id": "author-promote-01",
86
- "phrase": "promote this inline content to a shared web-modules module",
87
- "should_route_to_author": true,
88
- "expected_shape": "module-promotion",
89
- "rationale": "Promote inline → module."
90
- },
91
- {
92
- "id": "author-promote-02",
93
- "phrase": "this content keeps repeating across apps, extract to a shared module",
94
- "should_route_to_author": true,
95
- "expected_shape": "module-promotion",
96
- "rationale": "Repetition trigger."
97
- },
98
- {
99
- "id": "author-promote-03",
100
- "phrase": "lift this billing-summary block from apps/saas to web-modules",
101
- "should_route_to_author": true,
102
- "expected_shape": "module-promotion",
103
- "rationale": "Lift inline page content to a reusable module."
104
- },
105
-
106
- {
107
- "id": "author-audit-01",
108
- "phrase": "audit the four-axis contract for table-ui",
109
- "should_route_to_author": true,
110
- "expected_shape": "drift-audit",
111
- "rationale": "Contract drift audit."
112
- },
113
- {
114
- "id": "author-audit-02",
115
- "phrase": "check the token usage in card-ui for drift",
116
- "should_route_to_author": true,
117
- "expected_shape": "drift-audit",
118
- "rationale": "Token audit procedure."
119
- },
120
- {
121
- "id": "author-audit-03",
122
- "phrase": "lifecycle audit on dropdown-ui — symmetric connected/disconnected?",
123
- "should_route_to_author": true,
124
- "expected_shape": "drift-audit",
125
- "rationale": "Lifecycle audit."
126
- },
127
-
128
- {
129
- "id": "author-llm-01",
130
- "phrase": "extend the LLM bridge to add a new provider",
131
- "should_route_to_author": true,
132
- "expected_shape": "llm-bridge",
133
- "rationale": "Extend @adia-ai/llm."
134
- },
135
- {
136
- "id": "author-llm-02",
137
- "phrase": "modify createAdapter in @adia-ai/llm to add chunk-shape support",
138
- "should_route_to_author": true,
139
- "expected_shape": "llm-bridge",
140
- "rationale": "Explicit createAdapter + @adia-ai/llm mention."
141
- },
142
- {
143
- "id": "author-llm-03",
144
- "phrase": "set up the LLM-bridge surface for a new tool-call provider",
145
- "should_route_to_author": true,
146
- "expected_shape": "llm-bridge",
147
- "rationale": "LLM-bridge trigger phrase."
148
- },
149
-
150
- {
151
- "id": "author-demo-01",
152
- "phrase": "author a demo for the billing-overview composite",
153
- "should_route_to_author": true,
154
- "expected_shape": "composite-demo",
155
- "rationale": "Composite-demo authoring."
156
- },
157
- {
158
- "id": "author-demo-02",
159
- "phrase": "compose the examples.html for dashboard-layout",
160
- "should_route_to_author": true,
161
- "expected_shape": "composite-demo",
162
- "rationale": "'compose examples.html for Y' trigger."
163
- },
164
- {
165
- "id": "author-demo-03",
166
- "phrase": "write the demo for <integrations-page-ui> in packages/web-modules/settings",
167
- "should_route_to_author": true,
168
- "expected_shape": "composite-demo",
169
- "rationale": "'write the demo for <module-ui>' + web-modules path."
170
- },
171
-
172
- {
173
- "id": "author-adv-01",
174
- "phrase": "compose this Figma mock into AdiaUI components for our consumer app",
175
- "should_route_to_author": false,
176
- "expected_alternative": "adia-compose (adia-factory plugin)",
177
- "rationale": "Adversarial — consumer-side composition (screens FROM existing primitives). The description NEG-fences it."
178
- },
179
- {
180
- "id": "author-adv-02",
181
- "phrase": "cut a release of the next version and publish the npm packages",
182
- "should_route_to_author": false,
183
- "expected_alternative": "adia-release",
184
- "rationale": "Adversarial — release territory."
185
- },
186
- {
187
- "id": "author-adv-03",
188
- "phrase": "tune the zettel composition coverage; eval is at 38%",
189
- "should_route_to_author": false,
190
- "expected_alternative": "adia-a2ui",
191
- "rationale": "Adversarial — a2ui pipeline internals (compose strategies, eval coverage)."
192
- },
193
- {
194
- "id": "author-adv-04",
195
- "phrase": "build a user profile card with avatar and edit actions",
196
- "should_route_to_author": false,
197
- "expected_alternative": "adia-compose (adia-factory plugin)",
198
- "rationale": "Adversarial — canonical consumer-composition task (build UI from intent)."
199
- },
200
- {
201
- "id": "author-adv-05",
202
- "phrase": "deploy the api service to the hosting platform",
203
- "should_route_to_author": false,
204
- "expected_alternative": "adia-deploy",
205
- "rationale": "Adversarial — deployment/ops territory."
206
- },
207
- {
208
- "id": "author-adv-06",
209
- "phrase": "explain how React hooks work",
210
- "should_route_to_author": false,
211
- "expected_alternative": null,
212
- "rationale": "Adversarial — generic framework knowledge; no AdiaUI skill should activate."
213
- }
2
+ "positives": [
3
+ "add a new button-ui primitive component",
4
+ "build a new <toggle-ui> component from scratch",
5
+ "create a new primitive web component in packages/web-components",
6
+ "add a new prop to table-ui",
7
+ "fix the CSS in card-ui to handle the new bleed variant",
8
+ "update the input-ui yaml to add a placeholder attribute",
9
+ "build the chat-shell composition with the new sidebar slot",
10
+ "author a new web-module shell at packages/web-modules/editor/editor-shell",
11
+ "add a pane behaviour to admin-shell per the bespoke shell-tier convention",
12
+ "promote this inline content to a shared web-modules module",
13
+ "this content keeps repeating across apps, extract to a shared module",
14
+ "lift this billing-summary block from apps/saas to web-modules",
15
+ "audit the four-axis contract for table-ui",
16
+ "check the token usage in card-ui for drift",
17
+ "lifecycle audit on dropdown-ui \u2014 symmetric connected/disconnected?",
18
+ "author a demo for the billing-overview composite",
19
+ "compose the examples.html for dashboard-layout",
20
+ "write the demo for <integrations-page-ui> in packages/web-modules/settings"
214
21
  ],
215
-
216
- "evaluator_notes": {
217
- "current_state": "27 cases (21 trigger + 6 adversarial). Each of the 7 task shapes has 3 trigger cases. The old corpus's 3 Teach-mode cases were dropped (skill-teaching is estate-level maintenance now, not a product-skill mode).",
218
- "promotion_criteria": "Promote to a CI gate (warn hard-fail) when F1 ≥ 0.85 on this corpus across 3+ consecutive runs without description edits.",
219
- "review_cadence": "Re-run on every adia-author description edit. Add 1-2 new cases per checkpoint reflecting newly-observed routing failure modes.",
220
- "known_limitations": "module-promotion and composite-demo phrases overlap semantically ('lift to web-modules' vs 'author demo for module') — the heuristic scorer may not disambiguate; the harness with file-path context will (the demo path pattern also fires the demo-postwrite-pattern-gate hook regardless of routing)."
22
+ "negatives": [
23
+ "compose this Figma mock into AdiaUI components for our consumer app",
24
+ "cut a release of the next version and publish the npm packages",
25
+ "tune the zettel composition coverage; eval is at 38%",
26
+ "build a user profile card with avatar and edit actions",
27
+ "deploy the api service to the hosting platform",
28
+ "explain how React hooks work",
29
+ "the gemini adapter is dropping usage tokens on streamed responses",
30
+ "fix the openai stopReason mapping in the llm client",
31
+ "extend the LLM bridge to add a new provider",
32
+ "modify createAdapter in @adia-ai/llm to add chunk-shape support",
33
+ "set up the LLM-bridge surface for a new tool-call provider"
34
+ ],
35
+ "_measured": {
36
+ "as_of": "2026-07-18",
37
+ "scorer": "routing_eval.py (nonoun-plugins/forge)",
38
+ "f1": 0.971,
39
+ "precision": 1.0,
40
+ "recall": 0.944,
41
+ "exit_code": 0
221
42
  }
222
43
  }
@@ -184,6 +184,24 @@ Before declaring the work done, run through this checklist. If anything fails, f
184
184
  - [ ] Cached DOM refs (`this.#fooEl`) are nulled in `disconnected()`.
185
185
  - [ ] Class declares `disconnected()` exactly once.
186
186
 
187
+ ## Step 4b — Author the yaml SoT (+ regenerate the sidecar)
188
+
189
+ A component isn't just its `.js`/`.css` — the `<name>.yaml` is the SOURCE OF
190
+ TRUTH the whole pipeline reads (docs site, A2UI registries, consumer
191
+ harnesses, `.d.ts` codegen). Every new primitive ships one; every prop/slot/
192
+ event change updates it. Field-by-field contract:
193
+ [yaml-contract.md](yaml-contract.md). Then regenerate — never hand-edit the
194
+ sidecar (`sidecar-prewrite-guard` blocks it anyway):
195
+
196
+ ```bash
197
+ npm run build:components # yaml → <name>.a2ui.json + catalog + .d.ts
198
+ node scripts/build/components.mjs --verify # "clean — N files up-to-date"
199
+ ```
200
+
201
+ A primitive also needs BOTH barrel registrations — the CSS `@import` in
202
+ `styles/components.css` AND the JS `export` in `components/index.js`
203
+ (`scripts/audit/check-components-js-barrel.mjs` gates the second).
204
+
187
205
  ## Step 5 — Run the project's verification gates
188
206
 
189
207
  Before committing, run the project's verify scripts. These catch the drift-shaped bugs the checklist can miss:
@@ -206,4 +224,5 @@ If a gate fails, fix before declaring done.
206
224
  - [lifecycle-patterns.md](lifecycle-patterns.md) — timers, observers, popovers, listener patterns
207
225
  - [anti-patterns.md](anti-patterns.md) — full failure-mode catalogue, file:line refs
208
226
  - [worked-example.md](worked-example.md) — badge-ui + counter-ui walkthroughs
227
+ - [yaml-contract.md](yaml-contract.md) — the `<name>.yaml` SoT schema (Step 4b)
209
228
  - [token-contract.md](token-contract.md) — token audit (post-implementation check)
@@ -319,7 +319,6 @@ For component source under `packages/web-components/components/**`, the gate is
319
319
  - [css-patterns.md](css-patterns.md) — full @scope + variant/mode CSS architecture
320
320
  - [lifecycle-patterns.md](lifecycle-patterns.md) — timers, observers, popovers, listeners
321
321
  - [token-contract.md](token-contract.md) — token audit procedure
322
- - [llm-bridge.md](llm-bridge.md) — extend @adia-ai/llm
323
322
  - [module-promotion.md](module-promotion.md) — promote inline → module
324
323
  - [anti-patterns.md](anti-patterns.md) — failure-mode catalogue with file:line refs
325
324
  - **adia-a2ui** (sibling skill) — generator / corpus / MCP pipeline
@@ -1,5 +1,12 @@
1
1
  # LLM Bridge extension — @adia-ai/llm
2
2
 
3
+ **Superseded 2026-07-18 — `@adia-ai/llm` internals are `adia-llm-internals`'s charter, not
4
+ `adia-author`'s.** That skill's references (`adapter-contract.md`, `streaming-sse.md`,
5
+ `model-registry.md`, `bridge-facade.md`, `browser-proxy-boundary.md`, `add-a-provider.md`)
6
+ are the current, maintained source — this file is kept only as a historical pointer and is
7
+ no longer linked from `adia-author`'s task-shape table or `code-style.md`. Route provider/
8
+ streaming/bridge work to `adia-llm-internals`.
9
+
3
10
  Use when adding a 4th provider, modifying `createAdapter()`, changing the streaming chunk shape, or extending `packages/llm/server.js`.
4
11
 
5
12
  This reference is about **modifying** the package. For day-to-day consumption (import + call), the README at `packages/llm/README.md` is sufficient.
@@ -8,12 +8,28 @@ A small inline container for status labels. Supports cosmetic variants (accent/s
8
8
 
9
9
  ### File layout
10
10
 
11
+ The REAL anatomy every shipped primitive carries (this example's code blocks
12
+ below show only the two hand-authored core files, but "copy the structure"
13
+ means all of these — the yaml SoT and its regenerated artifacts are not
14
+ optional):
15
+
11
16
  ```text
12
17
  packages/web-components/components/badge/
13
- badge.js
14
- badge.css
18
+ badge.yaml # SoT — props/slots/events contract (yaml-contract.md); edit FIRST
19
+ badge.class.js # the class, non-registering export (test isolation / subclassing)
20
+ badge.js # side-effect registration wrapper: import class + defineIfFree()
21
+ badge.css # @scope'd styles
22
+ badge.html # standalone demo page
23
+ badge.examples.html # docs-site examples
24
+ badge.examples.md # examples prose
25
+ badge.a2ui.json # GENERATED from the yaml (npm run build:components) — never hand-edit
26
+ badge.d.ts # GENERATED types
15
27
  ```
16
28
 
29
+ The code below collapses the class + registration into one `badge.js` for
30
+ reading compactness only — a real component splits them
31
+ (`badge.class.js` exports, `badge.js` registers).
32
+
17
33
  ### `badge.js`
18
34
 
19
35
  ```javascript