@adia-ai/adia-ui-forge 0.1.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/.claude-plugin/plugin.json +3 -6
  2. package/CHANGELOG.md +27 -34
  3. package/README.md +35 -40
  4. package/agents/a2ui-engineer.md +22 -53
  5. package/agents/component-author.md +29 -0
  6. package/agents/framework-verifier.md +26 -0
  7. package/agents/release-engineer.md +21 -81
  8. package/agents/routing-corpus.json +293 -64
  9. package/bin/demo-postwrite-pattern-gate +94 -0
  10. package/bin/forge-lint +17 -2
  11. package/bin/sidecar-prewrite-guard +104 -0
  12. package/commands/deploy.md +9 -0
  13. package/commands/dogfood.md +10 -0
  14. package/commands/gen-review.md +9 -0
  15. package/commands/release.md +10 -0
  16. package/hooks/hooks.json +15 -0
  17. package/package.json +3 -6
  18. package/references/contracts/a2ui-mcp-surface.md +35 -0
  19. package/references/contracts/migration-guide-format.md +34 -0
  20. package/references/shared/content-trust.md +19 -74
  21. package/skills/adia-a2ui/SKILL.md +99 -0
  22. package/skills/{adia-ui-a2ui → adia-a2ui}/evals/routing-corpus.json +10 -10
  23. package/skills/adia-a2ui/references/anti-patterns.md +27 -0
  24. package/skills/adia-a2ui/references/chunk-authoring.md +71 -0
  25. package/skills/adia-a2ui/references/corpus-discipline.md +68 -0
  26. package/skills/adia-a2ui/references/eval-diagnostics.md +86 -0
  27. package/skills/adia-a2ui/references/format-extension-decisions.md +66 -0
  28. package/skills/adia-a2ui/references/leverage-rules.md +52 -0
  29. package/skills/adia-a2ui/references/mcp-pipeline-ops.md +83 -0
  30. package/skills/adia-a2ui/references/mcp-tool-reference.md +59 -0
  31. package/skills/adia-a2ui/references/pipeline-overview.md +115 -0
  32. package/skills/adia-a2ui/references/semantic-fail-lifting.md +74 -0
  33. package/skills/adia-a2ui/references/strategy-engines.md +109 -0
  34. package/skills/adia-a2ui/references/zettel-calibration.md +104 -0
  35. package/skills/adia-author/SKILL.md +112 -0
  36. package/skills/adia-author/evals/routing-corpus.json +222 -0
  37. package/skills/{adia-ui-authoring → adia-author}/references/anti-patterns.md +33 -4
  38. package/skills/{adia-ui-authoring → adia-author}/references/authoring-cycle.md +9 -11
  39. package/skills/adia-author/references/canonical-pattern-index.md +243 -0
  40. package/skills/{adia-ui-authoring → adia-author}/references/code-style.md +19 -21
  41. package/skills/adia-author/references/common-gotchas.md +129 -0
  42. package/skills/adia-author/references/composite-demo-protocol.md +271 -0
  43. package/skills/{adia-ui-authoring → adia-author}/references/css-patterns.md +19 -6
  44. package/skills/{adia-ui-authoring → adia-author}/references/lifecycle-patterns.md +1 -0
  45. package/skills/{adia-ui-authoring → adia-author}/references/llm-bridge.md +3 -5
  46. package/skills/{adia-ui-authoring → adia-author}/references/module-promotion.md +20 -38
  47. package/skills/{adia-ui-authoring → adia-author}/references/primitive-audit.md +2 -4
  48. package/skills/{adia-ui-authoring → adia-author}/references/shell-patterns.md +12 -18
  49. package/skills/{adia-ui-authoring → adia-author}/references/token-contract.md +5 -7
  50. package/skills/{adia-ui-authoring → adia-author}/references/worked-example.md +3 -3
  51. package/skills/{adia-ui-authoring → adia-author}/references/yaml-contract.md +3 -3
  52. package/skills/{adia-ui-authoring → adia-author}/scripts/build-canonical-pattern-index.mjs +3 -3
  53. package/skills/adia-deploy/SKILL.md +128 -0
  54. package/skills/{adia-ui-ops → adia-deploy}/references/deploy-playbooks.md +47 -30
  55. package/skills/adia-dogfood/SKILL.md +124 -0
  56. package/skills/adia-dogfood/references/admin-shell-anatomy.md +77 -0
  57. package/skills/adia-dogfood/references/app-shell-pitfalls.md +66 -0
  58. package/skills/adia-dogfood/references/card-anatomy-sweep.md +66 -0
  59. package/skills/adia-dogfood/references/html-attr-sweep.md +63 -0
  60. package/skills/adia-dogfood/references/native-leak-annotations.md +73 -0
  61. package/skills/adia-dogfood/references/visual-probe-triage.md +80 -0
  62. package/skills/{adia-ui-dogfood → adia-dogfood}/scripts/analyze.mjs +30 -14
  63. package/skills/adia-gen-review/SKILL.md +127 -0
  64. package/skills/adia-gen-review/references/corpus-html-patterns.md +279 -0
  65. package/skills/adia-gen-review/references/loop-protocol.md +216 -0
  66. package/skills/adia-gen-review/references/rubric-cosmetic.md +100 -0
  67. package/skills/adia-gen-review/references/rubric-decompose.md +101 -0
  68. package/skills/adia-gen-review/references/rubric-score.md +214 -0
  69. package/skills/{adia-ui-gen-review → adia-gen-review}/references/scores.schema.json +2 -2
  70. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-coverage-audit.mjs +4 -4
  71. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-decompose.mjs +10 -6
  72. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-status.mjs +5 -5
  73. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/validate-cycle-scores.mjs +5 -5
  74. package/skills/adia-llm-internals/SKILL.md +77 -0
  75. package/skills/{adia-ui-llm → adia-llm-internals}/references/adapter-contract.md +4 -2
  76. package/skills/{adia-ui-llm → adia-llm-internals}/references/add-a-provider.md +4 -5
  77. package/skills/{adia-ui-llm → adia-llm-internals}/references/bridge-facade.md +10 -3
  78. package/skills/{adia-ui-llm → adia-llm-internals}/references/browser-proxy-boundary.md +1 -1
  79. package/skills/{adia-ui-llm → adia-llm-internals}/references/model-registry.md +5 -3
  80. package/skills/{adia-ui-llm → adia-llm-internals}/references/streaming-sse.md +2 -2
  81. package/skills/adia-release/SKILL.md +72 -0
  82. package/skills/adia-release/references/changelog-discipline.md +119 -0
  83. package/skills/adia-release/references/cut-procedure.md +247 -0
  84. package/skills/adia-release/references/gates-catalog.md +222 -0
  85. package/skills/adia-release/references/independent-package-release.md +52 -0
  86. package/skills/adia-release/references/migration-guide-authoring.md +86 -0
  87. package/skills/adia-release/references/notes-authoring.md +90 -0
  88. package/skills/adia-release/references/recovery-paths.md +106 -0
  89. package/skills/{adia-ui-release → adia-release}/scripts/bump.mjs +27 -2
  90. package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +4 -1
  91. package/skills/{adia-ui-release → adia-release}/scripts/insert-stub.mjs +1 -1
  92. package/skills/{adia-ui-release → adia-release}/scripts/package-paths.mjs +6 -0
  93. package/skills/{adia-ui-release → adia-release}/scripts/promote-unreleased.mjs +1 -1
  94. package/skills/{adia-ui-release → adia-release}/scripts/release-pack.mjs +13 -21
  95. package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +5 -1
  96. package/skills/adia-site-docs/SKILL.md +68 -0
  97. package/skills/adia-site-docs/evals/audit-report.md +30 -0
  98. package/skills/adia-site-docs/evals/routing-corpus.json +176 -0
  99. package/skills/adia-site-docs/intent.md +72 -0
  100. package/agents/README.md +0 -209
  101. package/agents/author.md +0 -56
  102. package/agents/repo-steward.md +0 -56
  103. package/agents/spec-architect.md +0 -53
  104. package/agents/tech-lead.md +0 -57
  105. package/agents/verifier.md +0 -55
  106. package/bin/lib/audit-axes.mjs +0 -555
  107. package/bin/lib/dry-run-irreversible.mjs +0 -236
  108. package/bin/lib/run-skill-evals.mjs +0 -487
  109. package/bin/lib/teach-router.mjs +0 -250
  110. package/commands/adia-forge-a2ui.md +0 -10
  111. package/commands/adia-forge-author.md +0 -10
  112. package/commands/adia-forge-dogfood.md +0 -8
  113. package/commands/adia-forge-llm.md +0 -8
  114. package/commands/adia-forge-orient.md +0 -10
  115. package/commands/adia-forge-release.md +0 -8
  116. package/commands/adia-forge-review.md +0 -10
  117. package/references/shared/pev-rationale.md +0 -64
  118. package/references/shared/skill-conventions.md +0 -133
  119. package/skills/adia-ui-a2ui/CHANGELOG.md +0 -32
  120. package/skills/adia-ui-a2ui/SKILL.md +0 -243
  121. package/skills/adia-ui-a2ui/evals/adversarial-corpus.json +0 -75
  122. package/skills/adia-ui-a2ui/evals/teach-routing-cases.json +0 -100
  123. package/skills/adia-ui-a2ui/references/anti-patterns.md +0 -24
  124. package/skills/adia-ui-a2ui/references/chunk-authoring.md +0 -88
  125. package/skills/adia-ui-a2ui/references/corpus-discipline.md +0 -56
  126. package/skills/adia-ui-a2ui/references/eval-diagnostics.md +0 -127
  127. package/skills/adia-ui-a2ui/references/fragment-graph.md +0 -91
  128. package/skills/adia-ui-a2ui/references/mcp-pipeline-ops.md +0 -106
  129. package/skills/adia-ui-a2ui/references/mcp-tool-reference.md +0 -398
  130. package/skills/adia-ui-a2ui/references/pipeline-overview.md +0 -175
  131. package/skills/adia-ui-a2ui/references/semantic-fail-lifting.md +0 -120
  132. package/skills/adia-ui-a2ui/references/strategy-engines.md +0 -111
  133. package/skills/adia-ui-a2ui/references/teach-protocol.md +0 -220
  134. package/skills/adia-ui-a2ui/references/zettel-calibration.md +0 -93
  135. package/skills/adia-ui-a2ui/scripts/audit-a2ui-roster.mjs +0 -96
  136. package/skills/adia-ui-a2ui/scripts/teach-route.mjs +0 -157
  137. package/skills/adia-ui-a2ui/skill.json +0 -38
  138. package/skills/adia-ui-authoring/CHANGELOG.md +0 -32
  139. package/skills/adia-ui-authoring/SKILL.md +0 -256
  140. package/skills/adia-ui-authoring/assets/case-studies/admin-shell-decomposition.md +0 -101
  141. package/skills/adia-ui-authoring/assets/case-studies/maxtokens-32768-discovery.md +0 -109
  142. package/skills/adia-ui-authoring/assets/case-studies/theme-panel-promotion.md +0 -113
  143. package/skills/adia-ui-authoring/evals/adversarial-design-plan-gates.json +0 -138
  144. package/skills/adia-ui-authoring/evals/routing-corpus.json +0 -245
  145. package/skills/adia-ui-authoring/references/canonical-pattern-index.md +0 -179
  146. package/skills/adia-ui-authoring/references/common-gotchas.md +0 -93
  147. package/skills/adia-ui-authoring/references/composite-demo-protocol.md +0 -1084
  148. package/skills/adia-ui-authoring/references/teach-protocol.md +0 -428
  149. package/skills/adia-ui-authoring/scripts/audit-authoring-roster.mjs +0 -148
  150. package/skills/adia-ui-authoring/skill.json +0 -45
  151. package/skills/adia-ui-dogfood/CHANGELOG.md +0 -17
  152. package/skills/adia-ui-dogfood/README.md +0 -62
  153. package/skills/adia-ui-dogfood/SKILL.md +0 -866
  154. package/skills/adia-ui-dogfood/skill.json +0 -40
  155. package/skills/adia-ui-forge/SKILL.md +0 -88
  156. package/skills/adia-ui-forge/evals/routing-corpus.json +0 -30
  157. package/skills/adia-ui-gen-review/CHANGELOG.md +0 -108
  158. package/skills/adia-ui-gen-review/SKILL.md +0 -266
  159. package/skills/adia-ui-gen-review/references/loop-protocol.md +0 -712
  160. package/skills/adia-ui-gen-review/references/rubric-cosmetic.md +0 -144
  161. package/skills/adia-ui-gen-review/references/rubric-decompose.md +0 -117
  162. package/skills/adia-ui-gen-review/references/rubric-score.md +0 -249
  163. package/skills/adia-ui-gen-review/references/teach-protocol.md +0 -214
  164. package/skills/adia-ui-gen-review/skill.json +0 -23
  165. package/skills/adia-ui-llm/CHANGELOG.md +0 -25
  166. package/skills/adia-ui-llm/SKILL.md +0 -165
  167. package/skills/adia-ui-llm/evals/adversarial-corpus.json +0 -75
  168. package/skills/adia-ui-llm/evals/routing-corpus.json +0 -30
  169. package/skills/adia-ui-llm/evals/teach-routing-cases.json +0 -73
  170. package/skills/adia-ui-llm/references/teach-protocol.md +0 -78
  171. package/skills/adia-ui-llm/scripts/audit-llm-roster.mjs +0 -93
  172. package/skills/adia-ui-llm/scripts/teach-route.mjs +0 -119
  173. package/skills/adia-ui-llm/skill.json +0 -33
  174. package/skills/adia-ui-ops/CHANGELOG.md +0 -291
  175. package/skills/adia-ui-ops/SKILL.md +0 -401
  176. package/skills/adia-ui-ops/references/INDEX.md +0 -158
  177. package/skills/adia-ui-ops/references/audit-cadence.md +0 -263
  178. package/skills/adia-ui-ops/references/audit-patterns/archive-link-sweep.md +0 -96
  179. package/skills/adia-ui-ops/references/audit-patterns/audit-history-ledger.md +0 -162
  180. package/skills/adia-ui-ops/references/audit-patterns/browser-bundle-node-imports.md +0 -154
  181. package/skills/adia-ui-ops/references/audit-patterns/changelog-unreleased-bloat.md +0 -75
  182. package/skills/adia-ui-ops/references/audit-patterns/coverage-gaps.md +0 -187
  183. package/skills/adia-ui-ops/references/audit-patterns/entry-file-coverage.md +0 -122
  184. package/skills/adia-ui-ops/references/audit-patterns/format-hygiene.md +0 -217
  185. package/skills/adia-ui-ops/references/audit-patterns/lockstep-versioning.md +0 -113
  186. package/skills/adia-ui-ops/references/audit-patterns/memory-fragmentation.md +0 -180
  187. package/skills/adia-ui-ops/references/audit-patterns/orphan-detection.md +0 -202
  188. package/skills/adia-ui-ops/references/audit-patterns/pointer-validation.md +0 -180
  189. package/skills/adia-ui-ops/references/audit-patterns/redundancy-detection.md +0 -210
  190. package/skills/adia-ui-ops/references/audit-patterns/spec-dating-sweep.md +0 -91
  191. package/skills/adia-ui-ops/references/audit-patterns/stale-content.md +0 -182
  192. package/skills/adia-ui-ops/references/audit-patterns/staleness-tooling.md +0 -156
  193. package/skills/adia-ui-ops/references/audit-patterns/token-waste-detection.md +0 -196
  194. package/skills/adia-ui-ops/references/doc-types/adr-pattern.md +0 -210
  195. package/skills/adia-ui-ops/references/doc-types/architecture-md.md +0 -190
  196. package/skills/adia-ui-ops/references/doc-types/changelog.md +0 -183
  197. package/skills/adia-ui-ops/references/doc-types/decisions-log.md +0 -146
  198. package/skills/adia-ui-ops/references/doc-types/plan-roadmap.md +0 -182
  199. package/skills/adia-ui-ops/references/doc-types/postmortem-pattern.md +0 -206
  200. package/skills/adia-ui-ops/references/genres/prose-and-writing.md +0 -149
  201. package/skills/adia-ui-ops/references/guidance/context-budget.md +0 -137
  202. package/skills/adia-ui-ops/references/guidance/llm-doc-writing.md +0 -116
  203. package/skills/adia-ui-ops/references/guidance/reliability-dial.md +0 -186
  204. package/skills/adia-ui-ops/references/recipes/adr-introduction.md +0 -211
  205. package/skills/adia-ui-ops/references/recipes/audit-existing-repo.md +0 -234
  206. package/skills/adia-ui-ops/references/recipes/cold-start-harvest.md +0 -263
  207. package/skills/adia-ui-ops/references/recipes/concurrent-learnings-merge.md +0 -158
  208. package/skills/adia-ui-ops/references/recipes/continuous-learning-loop.md +0 -169
  209. package/skills/adia-ui-ops/references/recipes/external-reference-verification.md +0 -158
  210. package/skills/adia-ui-ops/references/recipes/findings-index-readout.md +0 -126
  211. package/skills/adia-ui-ops/references/recipes/greenfield-setup.md +0 -252
  212. package/skills/adia-ui-ops/references/recipes/harvest-repo-brain.md +0 -169
  213. package/skills/adia-ui-ops/references/recipes/import-repo-brain-harvest.md +0 -153
  214. package/skills/adia-ui-ops/references/recipes/memory-organization.md +0 -182
  215. package/skills/adia-ui-ops/references/recipes/recommend-then-validate.md +0 -199
  216. package/skills/adia-ui-ops/references/recipes/self-healing-hooks.md +0 -366
  217. package/skills/adia-ui-ops/references/recipes/skill-stewardship-loop.md +0 -113
  218. package/skills/adia-ui-ops/references/standards/agents-md-spec.md +0 -138
  219. package/skills/adia-ui-ops/references/standards/claude-md-convention.md +0 -123
  220. package/skills/adia-ui-ops/references/standards/cross-tool-matrix.md +0 -85
  221. package/skills/adia-ui-ops/references/standards/readme-conventions.md +0 -232
  222. package/skills/adia-ui-ops/references/teach-protocol.md +0 -215
  223. package/skills/adia-ui-ops/scripts/audit-ops-roster.mjs +0 -104
  224. package/skills/adia-ui-ops/skill.json +0 -65
  225. package/skills/adia-ui-release/CHANGELOG.md +0 -66
  226. package/skills/adia-ui-release/SKILL.md +0 -323
  227. package/skills/adia-ui-release/assets/case-studies/2026-05-20-batch-push-v0.6.14-v0.6.15.md +0 -144
  228. package/skills/adia-ui-release/assets/case-studies/2026-05-20-corpus-drift-remediation-v0.6.15.md +0 -155
  229. package/skills/adia-ui-release/assets/case-studies/2026-05-20-version-skip-correction-v0.6.12.md +0 -114
  230. package/skills/adia-ui-release/assets/case-studies/2026-05-21-author-from-scratch-v0.6.18.md +0 -139
  231. package/skills/adia-ui-release/assets/case-studies/2026-05-21-feedback37-retraction-v0.6.21.md +0 -124
  232. package/skills/adia-ui-release/assets/case-studies/2026-05-21-fn1-enrichment-pass-v0.6.19.md +0 -125
  233. package/skills/adia-ui-release/assets/case-studies/2026-05-21-stale-test-detection-v0.6.20.md +0 -142
  234. package/skills/adia-ui-release/assets/case-studies/2026-05-23-freshness-gate-recovery-v0.6.32.md +0 -97
  235. package/skills/adia-ui-release/assets/case-studies/2026-05-26-catalog-drift-recurring-v0.6.40.md +0 -147
  236. package/skills/adia-ui-release/assets/templates/stub-changelog.template.md +0 -22
  237. package/skills/adia-ui-release/evals/evals.json +0 -164
  238. package/skills/adia-ui-release/references/changelog-discipline.md +0 -250
  239. package/skills/adia-ui-release/references/cycle-happy-path.md +0 -520
  240. package/skills/adia-ui-release/references/exe-deploy.md +0 -149
  241. package/skills/adia-ui-release/references/gates-catalog.md +0 -778
  242. package/skills/adia-ui-release/references/independent-package-release.md +0 -129
  243. package/skills/adia-ui-release/references/ledger-discipline.md +0 -232
  244. package/skills/adia-ui-release/references/migration-guide-authoring.md +0 -174
  245. package/skills/adia-ui-release/references/multi-agent-baseline.md +0 -207
  246. package/skills/adia-ui-release/references/notes-authoring.md +0 -212
  247. package/skills/adia-ui-release/references/recovery-paths.md +0 -262
  248. package/skills/adia-ui-release/references/rollup-notes.md +0 -208
  249. package/skills/adia-ui-release/references/teach-protocol.md +0 -468
  250. package/skills/adia-ui-release/scripts/audit-gate-roster.mjs +0 -196
  251. package/skills/adia-ui-release/scripts/make-ledger.mjs +0 -200
  252. package/skills/adia-ui-release/skill.json +0 -77
  253. package/skills/dogfood-sweep/CHANGELOG.md +0 -37
  254. package/skills/dogfood-sweep/README.md +0 -105
  255. package/skills/dogfood-sweep/SKILL.md +0 -1000
  256. package/skills/dogfood-sweep/analyze.mjs +0 -600
  257. package/skills/dogfood-sweep/skill.json +0 -31
  258. /package/skills/{adia-ui-authoring → adia-author}/references/api-contract.md +0 -0
  259. /package/skills/{adia-ui-release → adia-release}/scripts/assert-monorepo-root.mjs +0 -0
@@ -1,398 +0,0 @@
1
- # Reference: MCP tool reference — schemas + I/O contracts
2
-
3
- **Source:** Absorbed from the former `adia-ui-training` skill (§MCP tool map + its tool-reference doc) — Phase 3 rollup. **Used by:** mode 1 + mode 7 of `adia-ui-a2ui` (MCP pipeline run / MCP tool add or change). **Companion:** `mcp-pipeline-ops.md`.
4
-
5
- ---
6
-
7
- ## MCP tool map
8
-
9
- Defined in `packages/a2ui/mcp/server.js` and surfaced through the MCP client (Claude Code exposes them as `mcp__adia-ui__*`). Full input/output schemas are inlined below.
10
-
11
- ### Composition (intent → A2UI / HTML)
12
-
13
- | Tool | Purpose |
14
- | --- | --- |
15
- | `generate_ui` | Intent → A2UI messages. Mode = `instant` \| `thinking` \| `stream`. The default fragment-graph + LLM path. |
16
- | `compose_from_chunks` | Two-tier composer over the gen-UI chunk corpus. Tier 1 = retrieval-first (return matched chunk's HTML when score ≥ 8); Tier 2 = LLM mix-and-match: pick `{page, slot_bindings}` from a pre-filtered ~30 catalog. Validator enforces slot + chunk-kind contracts. Use when the intent is a known page-shape (auth flow, dashboard layout, error shell). |
17
- | `resolve_composition` | Materializes a chunk plan into HTML — same composer the synthesizer uses internally. Useful when authoring or testing a hand-written plan. |
18
- | `get_composition` | Inspect the composition tree (intent → fragment chain → component IDs) for a given executionId. |
19
-
20
- ### Multi-turn refinement
21
-
22
- | Tool | Purpose |
23
- | --- | --- |
24
- | `refine_composition` | Mutate a prior composition by intent — e.g. "add an OAuth row", "swap the password field for a passkey". Two-pass synthesis (locator → modifier); ops = `rebindSlot` / `appendToSlot` / `removeFromSlot` / `replacePage`; emitted as A2UI `updateComponents` messages. Requires the prior `state_id`. |
25
- | `get_state` | Read the current `{intent, html, plan, ops_history, parent_state_id, created_at}` for a `state_id`. Touches LRU recency. |
26
- | `report_issue` | First-class telemetry surface — write an immutable issue record under `.brain/audit-history/issues/`. Reporter values: `llm` (self-fire), `user` (consumer-fire), `auto` (engine failure path). Suppressed when evalMode is true. Distinct from `.tickets/` (curated work items — those are weekly-triage promotions of recurring issue patterns, see spec §11.5). |
27
-
28
- ### Chunk-corpus retrieval
29
-
30
- | Tool | Purpose |
31
- | --- | --- |
32
- | `search_chunks` | Keyword + cosine-blended search over the chunk corpus (`block / panel / page` kinds). Returns ranked chunk-name candidates. Filter by `kind` to constrain. |
33
- | `get_chunk` | Full record for one chunk (HTML, slot regions, nested chunks, metadata). |
34
- | `lookup_chunk` | Find chunks where `<component>` is the primary element (e.g. all chunks centered on `<table-ui>`). |
35
-
36
- ### Catalog inspection
37
-
38
- | Tool | Purpose |
39
- | --- | --- |
40
- | `lookup_component` | Catalog entry for a single component. |
41
- | `get_component_map` | Full catalog map (all components + props). |
42
- | `search_patterns` | Keyword search over the pattern library (legacy fragment-graph corpus, distinct from chunks). |
43
- | `classify_intent` | Free-text intent → UI-category taxonomy. |
44
- | `assemble_context` | Compose retrieval context for a given intent (the bundle the LLM sees pre-prompt). |
45
- | `get_traits` | Trait catalog (pressable, hoverable, focusable, etc.). |
46
- | `get_wiring_catalog` | A2UI wiring contract — createSurface / updateComponents / wireComponents. |
47
- | `get_fragment` | Inspect a single fragment from the fragment library (the atomic units used by the legacy synthesizer). |
48
- | `get_graph` | Pattern-and-fragment graph view (fragment leverage metrics). |
49
- | `get_quality_metrics` | Per-pattern quality scores from the feedback analyzer. |
50
- | `get_training_gaps` | Gap registry — intents with no good pattern match. |
51
- | `zettel_stats` | Zettel-engine corpus stats (coverage, avgScore, MRR). |
52
-
53
- ### Pipeline (validation, render, ingest)
54
-
55
- | Tool | Purpose |
56
- | --- | --- |
57
- | `validate_schema` | Structural + wiring checks on A2UI messages; returns weighted score. |
58
- | `check_anti_patterns` | HTML → anti-pattern report (see list below). |
59
- | `convert_html` | HTML → A2UI transpile (used by the editor's ingest modal). |
60
- | `import_pattern` | Register a new pattern at runtime. |
61
- | `run_eval` | Run the eval suite over the held-out intent set. |
62
- | `submit_feedback` | Post a quality score against an `executionId`. |
63
-
64
- ## Local scripts (thin wrappers over MCP)
65
-
66
- - `scripts/mcp-pipeline.cjs "<intent>"` — full pipeline in one shot. Generates → validates → renders → anti-pattern check → prints a combined report.
67
- - `scripts/mcp-call.cjs <tool> '<json-args>'` — single-tool call. Use when stepping through manually or inspecting an intermediate output.
68
- - `scripts/a2ui-to-html.cjs [file|stdin]` — renders A2UI message arrays to HTML using the gen-ui runtime. Useful between `validate_schema` and `check_anti_patterns` when you want to inspect the rendered markup.
69
-
70
- ---
71
-
72
- ## Full tool-reference
73
-
74
- Complete input/output schemas for the core gen-ui MCP tools.
75
-
76
- ---
77
-
78
- ## generate_ui
79
-
80
- Generate A2UI components from natural language.
81
-
82
- **Input:**
83
-
84
- ```json
85
- {
86
- "intent": "string (required) — description of UI to generate",
87
- "mode": "instant | thinking (optional, default: instant)"
88
- }
89
- ```
90
-
91
- **Output:**
92
-
93
- ```json
94
- {
95
- "executionId": "string — unique ID for feedback/multi-turn",
96
- "messages": [
97
- {
98
- "type": "updateComponents",
99
- "surfaceId": "default",
100
- "components": [
101
- { "id": "root", "component": "Card", "children": ["hdr", "sec"] },
102
- { "id": "hdr", "component": "Header", "children": ["title"] },
103
- { "id": "title", "component": "Text", "variant": "h3", "text": "Title" }
104
- ]
105
- }
106
- ],
107
- "validation": { "passed": true, "score": 95, "checks": [] },
108
- "suggestions": ["Add a footer with save button", "Consider tabs for multiple sections"]
109
- }
110
- ```
111
-
112
- ---
113
-
114
- ## validate_schema
115
-
116
- Validate A2UI messages against structural rules.
117
-
118
- **Input:**
119
-
120
- ```json
121
- {
122
- "messages": "string — JSON-encoded array of A2UI messages"
123
- }
124
- ```
125
-
126
- **Output:**
127
-
128
- ```json
129
- {
130
- "passed": true,
131
- "score": 95,
132
- "checks": [
133
- { "name": "hasRootComponent", "passed": true, "score": 1, "weight": 10, "detail": "Root component found" },
134
- { "name": "cardContentModel", "passed": false, "score": 0, "weight": 15, "detail": "Section at body-sec missing Column wrapper" }
135
- ]
136
- }
137
- ```
138
-
139
- **Checks (15 structural + 5 wiring):** | Check | Weight | What it validates | |-------|--------|-------------------| | `hasRootComponent` | 10 | Root component with id "root" exists | | `uniqueIds` | 10 | No duplicate component IDs | | `validChildren` | 10 | All child IDs reference existing components | | `cardContentModel` | 15 | Card > Header + Section > Column + Footer | | `correctSlotUsage` | 10 | Slots on correct elements | | `flatAdjacency` | 5 | No deep nesting (components use ID references) | | `noRawHTML` | 5 | No native HTML tags as component types | | `buttonProps` | 5 | Button has text prop | | `formFieldProps` | 5 | Form fields have name and label | | `textVariants` | 5 | Text components have valid variants | | `tabStructure` | 5 | Tabs only contain Tab children | | `noEmptyContainers` | 3 | Containers have children | | `actionSlots` | 3 | Footer buttons have slot="action" | | `headingHierarchy` | 3 | No skipped heading levels | | `noOrphans` | 3 | No unreferenced components |
140
-
141
- ---
142
-
143
- ## lookup_component
144
-
145
- Look up component API by type name.
146
-
147
- **Input:**
148
-
149
- ```json
150
- {
151
- "type": "string — Component type (Card, Button, TextField, etc.)",
152
- "level": "index | summary | reference (optional, default: reference)"
153
- }
154
- ```
155
-
156
- **Output (reference level):**
157
-
158
- ```json
159
- {
160
- "component": "card-ui",
161
- "description": "Container surface with...",
162
- "properties": {
163
- "elevation": { "type": "number", "enum": [0,1,2,3], "default": 1 },
164
- "size": { "type": "string", "enum": ["xs","sm","md","lg","xl"] }
165
- },
166
- "children": { "header": {}, "section": {}, "footer": {} },
167
- "tokens": { "--card-background": "..." },
168
- "events": {}
169
- }
170
- ```
171
-
172
- **Detail levels:**
173
-
174
- - `index` — type, tag, description only (~50 tokens)
175
- - `summary` — + properties, slots, events (~200 tokens)
176
- - `reference` — + children, tokens, patterns (~500 tokens)
177
-
178
- ---
179
-
180
- ## get_component_map
181
-
182
- Full catalog — all component types with tags.
183
-
184
- **Input:** `{}` (no args)
185
-
186
- **Output:** One line per component:
187
-
188
- ```text
189
- Row -> <row-ui>: Horizontal flex container
190
- Column -> <col-ui>: Vertical flex container
191
- Card -> <card-ui>: Container surface with elevation and variants
192
- ...
193
- ```
194
-
195
- ---
196
-
197
- ## search_patterns
198
-
199
- Search the pattern library.
200
-
201
- **Input:**
202
-
203
- ```json
204
- {
205
- "query": "string — search keywords",
206
- "semantic": "boolean (optional) — use LLM for conceptual matching",
207
- "remix": "boolean (optional) — compose new pattern from existing"
208
- }
209
- ```
210
-
211
- **Output (keyword):**
212
-
213
- ```json
214
- [
215
- {
216
- "name": "stat-cards",
217
- "description": "KPI grid with 4 stat cards",
218
- "domain": "dashboard",
219
- "template": []
220
- }
221
- ]
222
- ```
223
-
224
- ---
225
-
226
- ## classify_intent
227
-
228
- Classify natural language into a UI domain.
229
-
230
- **Input:**
231
-
232
- ```json
233
- {
234
- "text": "string — intent description"
235
- }
236
- ```
237
-
238
- **Output:**
239
-
240
- ```json
241
- {
242
- "domain": "forms",
243
- "confidence": 0.85,
244
- "keywords": ["login", "form", "email", "password"],
245
- "suggestedComponents": ["Card", "Header", "TextField", "Button", "FormContainer"]
246
- }
247
- ```
248
-
249
- **Domains:** `forms`, `dashboard`, `data`, `chat`, `settings`, `navigation`, `content`, `commerce`
250
-
251
- ---
252
-
253
- ## assemble_context
254
-
255
- Progressive-disclosure context assembly for LLM prompts.
256
-
257
- **Input:**
258
-
259
- ```json
260
- {
261
- "intent": "string — what the LLM needs to generate",
262
- "tier": "number 0-4 (optional, default: 1)"
263
- }
264
- ```
265
-
266
- **Budget tiers:** | Tier | Budget | Contents | |------|--------|----------| | 0 | ~200 tokens | Type names only | | 1 | ~1000 tokens | + properties, slots | | 2 | ~3000 tokens | + children, tokens, events | | 3 | ~8000 tokens | + patterns, examples | | 4 | unlimited | Full catalog dump |
267
-
268
- ---
269
-
270
- ## check_anti_patterns
271
-
272
- Check HTML against the anti-pattern registry.
273
-
274
- **Input:**
275
-
276
- ```json
277
- {
278
- "html": "string — HTML markup to check"
279
- }
280
- ```
281
-
282
- **Output:** Array of violations (empty if clean):
283
-
284
- ```json
285
- [
286
- {
287
- "name": "slotOnContainer",
288
- "description": "Slot attributes must go on children, not Header/Footer",
289
- "fix": "Move slot=\"heading\" from <header> to the Text child inside it"
290
- }
291
- ]
292
- ```
293
-
294
- ---
295
-
296
- ## get_traits
297
-
298
- Get the trait catalog.
299
-
300
- **Input:**
301
-
302
- ```json
303
- {
304
- "category": "string (optional) — filter by category"
305
- }
306
- ```
307
-
308
- **Categories:** `input-interaction`, `focus-keyboard`, `form-state`, `motion-animation`, `layout-positioning`, `observer`, `visual-effect`, `state-management`
309
-
310
- ---
311
-
312
- ## get_wiring_catalog
313
-
314
- Full wiring knowledge base.
315
-
316
- **Input:** `{}` (no args)
317
-
318
- **Output:**
319
-
320
- ```json
321
- {
322
- "controllers": [
323
- { "type": "FormController", "manages": "Validation, dirty/pristine", "commands": ["validate","reset","setFieldError"] }
324
- ],
325
- "handlers": [
326
- { "type": "submit-resource", "purpose": "POST/PUT/DELETE to resource URI", "required": ["uri","method"] }
327
- ],
328
- "refreshStrategies": ["once", "on-focus", "interval:{ms}", "stream", "on-action:{name}"],
329
- "valueSources": ["event-detail", "event-target", "model", "literal", "param"],
330
- "associationTypes": ["routes-to", "feeds", "shares-context", "depends-on", "triggers", "contains", "slots-into"]
331
- }
332
- ```
333
-
334
- ---
335
-
336
- ## convert_html
337
-
338
- Transpile HTML -> A2UI flat adjacency messages.
339
-
340
- **Input:**
341
-
342
- ```json
343
- {
344
- "html": "string — HTML markup",
345
- "mode": "instant | reasoning (optional, default: instant)"
346
- }
347
- ```
348
-
349
- `instant` uses rule-based mapping. `reasoning` uses LLM for complex layouts (requires API key).
350
-
351
- ---
352
-
353
- ## import_pattern
354
-
355
- Register a pattern in the runtime library.
356
-
357
- **Input:**
358
-
359
- ```json
360
- {
361
- "pattern": "string — JSON-encoded pattern object"
362
- }
363
- ```
364
-
365
- Pattern shape:
366
-
367
- ```json
368
- {
369
- "name": "login-basic",
370
- "description": "Simple login form",
371
- "domain": "forms",
372
- "template": [{"id":"root","component":"Card","children":["hdr","sec"]}],
373
- "components": ["Card","Header","TextField","Button"]
374
- }
375
- ```
376
-
377
- ---
378
-
379
- ## submit_feedback
380
-
381
- Submit quality feedback for the evolution engine.
382
-
383
- **Input:**
384
-
385
- ```json
386
- {
387
- "executionId": "string (required) — from generate_ui result",
388
- "rating": "number 1-5 (required)",
389
- "intentAlignment": "number 1-5 (optional)",
390
- "visualQuality": "number 1-5 (optional)",
391
- "componentChoice": "number 1-5 (optional)",
392
- "userEdited": "boolean (optional)",
393
- "editSummary": "string (optional)",
394
- "notes": "string (optional)",
395
- "shouldBePattern": "boolean (optional)",
396
- "suggestedName": "string (optional)"
397
- }
398
- ```
@@ -1,175 +0,0 @@
1
- # Reference: A2UI pipeline overview
2
-
3
- **Source:** Absorbed from the former `a2ui-pipeline` skill (Phase 3 rollup). **Used by:** mode 2 of `adia-ui-a2ui` (modify pipeline internals). **Companion:** `chunk-authoring.md`, `strategy-engines.md`, `mcp-tool-reference.md`.
4
-
5
- ---
6
-
7
- ## Project Location
8
-
9
- Project root (where `package.json` and `vite.config.js` live). Detect via `git rev-parse --show-toplevel` or look for `packages/a2ui/compose/`, `packages/a2ui/mcp/`, and `packages/web-components/`.
10
-
11
- ## First: Read the specs
12
-
13
- The canonical A2UI specs live under `docs/specs/`:
14
-
15
- - `a2ui-v0.9-catalog-guide.md` — catalog format + the A2UI v0.9 protocol.
16
- - `a2ui-editor.md` — live authoring tool spec (editor UX, doc model).
17
- - `genui-multiturn-architecture.md` — multi-turn refinement (state cache, refiner two-pass synthesis, issue-reporter, op format).
18
- - `genui-chunk-marker.md` + `genui-chunk-inventory-001.md` — chunk corpus (data-chunk authoring attributes, harvester, retrieval).
19
- - `package-architecture.md` — how `gen-ui`, `gen-ui-mcp`, `gen-ui-training`, `a2ui/utils`, and `web-components` relate.
20
-
21
- The chunk pipeline section lives in `docs/conventions/gen-ui-pipeline.md` — read that for the authoring-time attribute conventions, harvester wiring, and embedding-index lifecycle.
22
-
23
- For primitive/shell authoring (the artifacts chunks ultimately harvest from), see the sibling skill **adia-ui-authoring** (shells, layout, forms, data, agent, traits, wiring + the four-axis contract guard rails).
24
-
25
- ## Key Files
26
-
27
- ### Engine — orchestrators
28
-
29
- | File | Role |
30
- | --- | --- |
31
- | `packages/a2ui/compose/core/generator.js` | Top-level orchestrator — instant / thinking / stream modes; routes to fragment-graph or chunk-synthesis path depending on engine config |
32
- | `packages/a2ui/compose/strategies/registry.js` | In-process engine registry — `registerEngine(name, factory)`. Reserved names: `monolithic`, `zettel`, `mcp`, `monolithic-*` |
33
- | `packages/a2ui/compose/strategies/zettel/generate.js` | Zettel engine entry — composes via fragment graph + (optionally) chunk synthesis |
34
- | `packages/a2ui/compose/strategies/zettel/generator-adapter.js` | Glue between the engine API and the LLM adapter |
35
-
36
- ### Engine — fragment-graph path (the original Zettel pipeline)
37
-
38
- | File | Role |
39
- | --- | --- |
40
- | `packages/a2ui/compose/strategies/zettel/fragment-library.js` | Fragment catalog (≥29.9% reuse ratio invariant) — atomic units harvested by extract.js |
41
- | `packages/a2ui/compose/strategies/zettel/synthesizer.js` | Mix-and-match LLM composer — picks a pattern + binds fragments to its slots; pre-search filter ~30 candidates |
42
- | `packages/a2ui/compose/strategies/zettel/composer.js` | Materializer — substitutes fragment bindings into pattern HTML |
43
-
44
- ### Engine — chunk-corpus path (newer mix-and-match)
45
-
46
- | File | Role |
47
- | --- | --- |
48
- | `packages/a2ui/corpus/scripts/chunk-library.js` | Chunk catalog API — `getChunk()`, `searchChunks()` (keyword + cosine when embeddings available), `searchChunksAsync()`, `listChunksByKind()`, `getAllChunks()`. Reads `packages/a2ui/corpus/chunks/` + `_index.json` |
49
- | `packages/a2ui/compose/strategies/zettel/chunk-synthesizer.js` | Two-tier composer — (1) retrieval-first (return matched chunk's HTML when score ≥ 8); (2) LLM synthesis fallback that picks `{page, slot_bindings}` from a pre-filtered ~30 catalog |
50
- | `packages/a2ui/compose/strategies/zettel/chunk-composer.js` | Validator + materializer for chunk plans — enforces slot-name + chunk-kind contracts; substitutes slot regions with bound chunks' HTML |
51
- | `packages/a2ui/compose/strategies/zettel/chunk-refiner.js` | Multi-turn refinement engine — two-pass synthesis (locator → modifier), validator-driven retry loop. Op format: `rebindSlot` / `appendToSlot` / `removeFromSlot` / `replacePage`. Outputs A2UI `updateComponents` messages |
52
-
53
- ### Engine — multi-turn state + telemetry
54
-
55
- | File | Role |
56
- | --- | --- |
57
- | `packages/a2ui/compose/strategies/zettel/state-cache.js` | Bounded LRU keyed by `state_id` (default 64; `A2UI_STATE_CACHE_SIZE` env var). Stores `{intent, html, plan, ops_history, parent_state_id, created_at}` for the refiner chain |
58
- | `packages/a2ui/compose/strategies/zettel/session-store.js` | Per-session conversation context (intent history, prior compositions) |
59
- | `packages/a2ui/compose/strategies/zettel/issue-reporter.js` | First-class telemetry — `report_issue` MCP tool (LLM/user/auto reporters). Writes immutable JSON under `.brain/audit-history/issues/`; traces > 200KB spill to sidecar `.trace.json`. Distinct from `.tickets/` (curated work items) |
60
-
61
- ### Retrieval (catalog + analytics)
62
-
63
- | File | Role |
64
- | --- | --- |
65
- | `packages/a2ui/retrieval/pattern-library.js` | Hardcoded seed patterns + runtime `registerPattern()`, keyword search, synonym merging (ingest tops it up from `packages/a2ui/corpus/patterns/`) |
66
- | `packages/a2ui/retrieval/feedback/feedback-analyzer.js` | Reads JSONL feedback, aggregates by intent, finds weak/promotion candidates |
67
- | `packages/a2ui/retrieval/intent/intent-categorizer.js` | Maps free-text intents to ~25 UI categories (form/_, data/_, layout/_, agent/_, etc. — see `CATEGORY_RULES` table for the live list) |
68
- | `packages/a2ui/retrieval/feedback/gap-registry.js` | Persistent gap tracking (`packages/a2ui/corpus/gaps/registry.json`) |
69
- | `packages/a2ui/compose/core/reference.js` | Thin wrappers over retrieval/ exports |
70
-
71
- ### LLM bridge + adapters
72
-
73
- | File | Role |
74
- | --- | --- |
75
- | `packages/llm/llm-bridge.js` | createAdapter() — real LLM or stub fallback |
76
- | `packages/llm/*.js` | Provider adapters (MUST use relative imports, not Vite `@llm/` aliases) |
77
- | `scripts/load-env.mjs` | Shared .env loader for Node scripts |
78
-
79
- ### Corpus pipelines
80
-
81
- | File | Role |
82
- | --- | --- |
83
- | `packages/a2ui/corpus/scripts/extract.js` | HTML → A2UI JSON (describeTree + generateTags) |
84
- | `packages/a2ui/corpus/scripts/ingest.js` | JSON → pattern library (registerPattern with replace) |
85
- | `scripts/build/harvest-chunks.mjs` | `[data-chunk]` boundary walker — writes `packages/a2ui/corpus/chunks/<name>.json` + `_index.json`. Run via `npm run harvest:chunks` |
86
- | `packages/a2ui/corpus/scripts/run-pipeline.mjs` | Combined harvester → embeddings → ingest pipeline (Step 1 = chunks) |
87
- | `packages/a2ui/corpus/scripts/build-pattern-index.mjs` | Pattern embedding-index builder (`text-embedding-3-small`) |
88
-
89
- ### MCP server
90
-
91
- | File | Role |
92
- | --- | --- |
93
- | `packages/a2ui/mcp/server.js` | MCP stdio server, auto-ingests on startup. Hosts the `generate_ui` / `compose_from_chunks` / `refine_composition` / `report_issue` / `get_state` / `search_chunks` / `get_chunk` / `lookup_chunk` / `validate_schema` / `check_anti_patterns` / `submit_feedback` tool surface (full list: `mcp-tool-reference.md`) |
94
-
95
- ## Critical Rules
96
-
97
- 1. **Relative imports in `packages/llm/*.js`** — NEVER use `@llm/` aliases. They only work in the Vite browser context, not Node. Use `./anthropic.js` etc. Note that the repo-wide refactor rewrote all `@core`/`@components`/`@traits`/`@styles`/`@llm` aliases to relative paths so published consumers don't hit `ERR_MODULE_NOT_FOUND`; the Vite alias block in `vite.config.js` still exists but nothing in the codebase relies on it.
98
-
99
- 2. **load-env.mjs before any a2ui import** — Node doesn't read .env. Without it, createAdapter() silently returns StubLLMAdapter (canned 6-component Card).
100
-
101
- 3. **Metadata IS the search index** — Pattern descriptions and tags are what keyword search matches against. Bad metadata = invisible patterns. If you add patterns, make descriptions and tags rich.
102
-
103
- 4. **Two search paths**:
104
- - Instant mode: `searchBlocks()` → keyword only
105
- - Thinking mode: `searchBlocksSemantic()` → keyword + LLM reranking
106
-
107
- 5. **Instant mode gate**: tiered STRONG/WEAK/REJECTED matching lives in `generator.js`. Words ≥3 chars can match; `GATE_STOPS` filters boilerplate. Search the file for `searchBlocks(` / gate logic before tightening — line numbers drift.
108
-
109
- 6. **ingest.js: pages skip, chunks replace** — pages never overwrite hardcoded patterns (skips existing names). Chunks use `replace: true` so re-extraction updates stale chunk metadata.
110
-
111
- 7. **Chunk vs fragment paths are not interchangeable.** The fragment-graph synthesizer (`synthesizer.js` + `fragment-library.js`) operates on extracted fragment subtrees — atomic A2UI subtrees with strict reuse-ratio targets (≥29.9%). The chunk-synthesizer operates on `data-chunk`-marked HTML in `packages/a2ui/corpus/chunks/` — page/panel/block-kinded compositions with named slots. They share the same engine entry but consume different catalogs. Don't pipe one's catalog into the other's composer.
112
-
113
- 8. **Multi-turn refinements emit A2UI `updateComponents` messages, not new compositions.** The refiner mutates the plan via four ops (`rebindSlot` / `appendToSlot` / `removeFromSlot` / `replacePage`) and wraps each in a `updateComponents` message so the wire-format contract holds. The state-cache keys by `state_id` and chains through `parent_state_id` so refinement history reconstructs by walking the parent chain. Spec: `docs/specs/genui-multiturn-architecture.md`.
114
-
115
- 9. **issue-reporter is auto-fire-aware.** Engine failure paths call `autoReport(reason)` through `ctx.issueAccumulator`; this is suppressed when `ctx.evalMode` is true so eval runs don't pollute `.brain/audit-history/issues/`. When adding new failure paths in the engine, plumb the accumulator through; don't write directly to disk.
116
-
117
- ## Testing & Running
118
-
119
- ### Core
120
-
121
- ```bash
122
- npm run test:a2ui # smoke checks, no LLM calls
123
- npm run test:a2ui:full # + thinking mode (calls API)
124
- npm run test:evals # 5-dimension quality evals (instant mode)
125
- npm run test:evals:thinking # quality evals with LLM
126
- npm run test:evals:baseline # save baseline for regression detection
127
- npm run test:all # smoke + evals together
128
- npm run pipeline # extract + ingest
129
- npm run pipeline:stats # pattern counts by domain
130
- npm run generate "login form" # instant mode CLI
131
- npm run generate --thinking "dashboard with charts" # LLM mode
132
- npm run generate --html "login form" # output as AdiaUI HTML
133
- npm run feedback:report # quality trends, top gaps, promotion candidates
134
- npm run feedback:promote # run promotion check
135
- npm run smoke:engines # all registered engines
136
- npm run smoke:register-engine # in-process registration check
137
- npm run eval:diff -- --engine zettel # zettel coverage + avgScore floor
138
- ```
139
-
140
- ### Chunk-corpus pipeline
141
-
142
- ```bash
143
- npm run harvest:chunks # walk site/pages/** + corpus/exemplars → chunks/
144
- npm run harvest:chunks:dry # dry run
145
- npm run smoke:chunks # stub-LLM smoke (offline)
146
- npm run eval:chunk-synthesis # hold-out intents against real LLM
147
- npm run build:embeddings # patterns
148
- npm run build:embeddings:chunks # chunks
149
- npm run build:embeddings:all # both
150
- ```
151
-
152
- ### Multi-turn (refiner + state-cache + issue-reporter)
153
-
154
- ```bash
155
- npm run smoke:refine # chunk-refiner two-pass synthesis smoke
156
- npm run smoke:state-cache # bounded LRU + chain-back invariants
157
- npm run smoke:issues # issue-reporter LLM/user/auto paths
158
- npm run eval:refine-synthesis # multi-turn refinement quality
159
- ```
160
-
161
- ## Key Insight: Metadata IS the Search Index
162
-
163
- Pattern descriptions and tags are what keyword search matches against. The single biggest quality improvement came from enriching extract.js to derive descriptions from component structure (headings, labels, icons, button text) instead of using filenames. Went from 40% to 95% meaningful descriptions. When search quality degrades, check `describeTree()` and `generateTags()` in extract.js first.
164
-
165
- ## Subagent QA Checklist
166
-
167
- When subagents create training HTML, they consistently produce these bugs:
168
-
169
- 1. `slot="heading"` without `variant` (headings render unstyled)
170
- 2. `timeline-item-ui` with nested slots instead of `label`/`description`/`time` attributes
171
- 3. `table-ui` wrapping native `<table>` HTML (shows "No data" overlay — use plain `<div>` for static tables)
172
- 4. Footer buttons missing `block` or `style="flex:1"` (narrow CTAs in wide cards)
173
- 5. Star icons without `weight="fill"` (renders as outlines)
174
-
175
- The sibling skill **adia-ui-authoring** owns these audits (the four-axis contract guard rails plus token-contract audits).