@adia-ai/adia-ui-forge 0.1.2 → 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.
- package/.claude-plugin/plugin.json +3 -6
- package/CHANGELOG.md +27 -26
- package/README.md +35 -40
- package/agents/a2ui-engineer.md +26 -0
- package/agents/component-author.md +29 -0
- package/agents/framework-verifier.md +26 -0
- package/agents/release-engineer.md +25 -0
- package/agents/routing-corpus.json +318 -0
- package/bin/demo-postwrite-pattern-gate +94 -0
- package/bin/forge-lint +17 -2
- package/bin/sidecar-prewrite-guard +104 -0
- package/commands/deploy.md +9 -0
- package/commands/dogfood.md +10 -0
- package/commands/gen-review.md +9 -0
- package/commands/release.md +10 -0
- package/hooks/hooks.json +15 -0
- package/package.json +3 -5
- package/references/contracts/a2ui-mcp-surface.md +35 -0
- package/references/contracts/migration-guide-format.md +34 -0
- package/references/shared/content-trust.md +19 -74
- package/skills/adia-a2ui/SKILL.md +99 -0
- package/skills/{adia-ui-a2ui → adia-a2ui}/evals/routing-corpus.json +10 -10
- package/skills/adia-a2ui/references/anti-patterns.md +27 -0
- package/skills/adia-a2ui/references/chunk-authoring.md +71 -0
- package/skills/adia-a2ui/references/corpus-discipline.md +68 -0
- package/skills/adia-a2ui/references/eval-diagnostics.md +86 -0
- package/skills/adia-a2ui/references/format-extension-decisions.md +66 -0
- package/skills/adia-a2ui/references/leverage-rules.md +52 -0
- package/skills/adia-a2ui/references/mcp-pipeline-ops.md +83 -0
- package/skills/adia-a2ui/references/mcp-tool-reference.md +59 -0
- package/skills/adia-a2ui/references/pipeline-overview.md +115 -0
- package/skills/adia-a2ui/references/semantic-fail-lifting.md +74 -0
- package/skills/adia-a2ui/references/strategy-engines.md +109 -0
- package/skills/adia-a2ui/references/zettel-calibration.md +104 -0
- package/skills/adia-author/SKILL.md +112 -0
- package/skills/adia-author/evals/routing-corpus.json +222 -0
- package/skills/{adia-ui-authoring → adia-author}/references/anti-patterns.md +33 -4
- package/skills/{adia-ui-authoring → adia-author}/references/authoring-cycle.md +9 -11
- package/skills/adia-author/references/canonical-pattern-index.md +243 -0
- package/skills/{adia-ui-authoring → adia-author}/references/code-style.md +19 -21
- package/skills/adia-author/references/common-gotchas.md +129 -0
- package/skills/adia-author/references/composite-demo-protocol.md +271 -0
- package/skills/{adia-ui-authoring → adia-author}/references/css-patterns.md +19 -6
- package/skills/{adia-ui-authoring → adia-author}/references/lifecycle-patterns.md +1 -0
- package/skills/{adia-ui-authoring → adia-author}/references/llm-bridge.md +3 -5
- package/skills/{adia-ui-authoring → adia-author}/references/module-promotion.md +22 -40
- package/skills/{adia-ui-authoring → adia-author}/references/primitive-audit.md +2 -4
- package/skills/{adia-ui-authoring → adia-author}/references/shell-patterns.md +12 -18
- package/skills/{adia-ui-authoring → adia-author}/references/token-contract.md +5 -7
- package/skills/{adia-ui-authoring → adia-author}/references/worked-example.md +3 -3
- package/skills/{adia-ui-authoring → adia-author}/references/yaml-contract.md +3 -3
- package/skills/{adia-ui-authoring → adia-author}/scripts/build-canonical-pattern-index.mjs +3 -3
- package/skills/adia-deploy/SKILL.md +128 -0
- package/skills/adia-deploy/references/deploy-playbooks.md +276 -0
- package/skills/adia-dogfood/SKILL.md +124 -0
- package/skills/adia-dogfood/references/admin-shell-anatomy.md +77 -0
- package/skills/adia-dogfood/references/app-shell-pitfalls.md +66 -0
- package/skills/adia-dogfood/references/card-anatomy-sweep.md +66 -0
- package/skills/adia-dogfood/references/html-attr-sweep.md +63 -0
- package/skills/adia-dogfood/references/native-leak-annotations.md +73 -0
- package/skills/adia-dogfood/references/visual-probe-triage.md +80 -0
- package/skills/{adia-ui-dogfood → adia-dogfood}/scripts/analyze.mjs +30 -14
- package/skills/adia-gen-review/SKILL.md +127 -0
- package/skills/adia-gen-review/references/corpus-html-patterns.md +279 -0
- package/skills/adia-gen-review/references/loop-protocol.md +216 -0
- package/skills/adia-gen-review/references/rubric-cosmetic.md +100 -0
- package/skills/adia-gen-review/references/rubric-decompose.md +101 -0
- package/skills/adia-gen-review/references/rubric-score.md +214 -0
- package/skills/{adia-ui-gen-review → adia-gen-review}/references/scores.schema.json +2 -2
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-coverage-audit.mjs +4 -4
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-decompose.mjs +10 -6
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-status.mjs +5 -5
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/validate-cycle-scores.mjs +5 -5
- package/skills/adia-llm-internals/SKILL.md +77 -0
- package/skills/{adia-ui-llm → adia-llm-internals}/references/adapter-contract.md +4 -2
- package/skills/{adia-ui-llm → adia-llm-internals}/references/add-a-provider.md +4 -5
- package/skills/{adia-ui-llm → adia-llm-internals}/references/bridge-facade.md +10 -3
- package/skills/{adia-ui-llm → adia-llm-internals}/references/browser-proxy-boundary.md +1 -1
- package/skills/{adia-ui-llm → adia-llm-internals}/references/model-registry.md +5 -3
- package/skills/{adia-ui-llm → adia-llm-internals}/references/streaming-sse.md +2 -2
- package/skills/adia-release/SKILL.md +72 -0
- package/skills/adia-release/references/changelog-discipline.md +119 -0
- package/skills/adia-release/references/cut-procedure.md +247 -0
- package/skills/adia-release/references/gates-catalog.md +222 -0
- package/skills/adia-release/references/independent-package-release.md +52 -0
- package/skills/adia-release/references/migration-guide-authoring.md +86 -0
- package/skills/adia-release/references/notes-authoring.md +90 -0
- package/skills/adia-release/references/recovery-paths.md +106 -0
- package/skills/{adia-ui-release → adia-release}/scripts/bump.mjs +27 -2
- package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +72 -6
- package/skills/{adia-ui-release → adia-release}/scripts/insert-stub.mjs +6 -4
- package/skills/adia-release/scripts/package-paths.mjs +50 -0
- package/skills/{adia-ui-release → adia-release}/scripts/promote-unreleased.mjs +4 -3
- package/skills/{adia-ui-release → adia-release}/scripts/release-pack.mjs +48 -27
- package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +15 -3
- package/skills/adia-site-docs/SKILL.md +68 -0
- package/skills/adia-site-docs/evals/audit-report.md +30 -0
- package/skills/adia-site-docs/evals/routing-corpus.json +176 -0
- package/skills/adia-site-docs/intent.md +72 -0
- package/bin/lib/audit-axes.mjs +0 -555
- package/bin/lib/dry-run-irreversible.mjs +0 -236
- package/bin/lib/run-skill-evals.mjs +0 -487
- package/bin/lib/teach-router.mjs +0 -250
- package/commands/adia-forge-a2ui.md +0 -10
- package/commands/adia-forge-author.md +0 -10
- package/commands/adia-forge-dogfood.md +0 -8
- package/commands/adia-forge-llm.md +0 -8
- package/commands/adia-forge-orient.md +0 -10
- package/commands/adia-forge-release.md +0 -8
- package/commands/adia-forge-review.md +0 -10
- package/references/shared/pev-rationale.md +0 -64
- package/references/shared/skill-conventions.md +0 -133
- package/skills/adia-ui-a2ui/CHANGELOG.md +0 -32
- package/skills/adia-ui-a2ui/SKILL.md +0 -243
- package/skills/adia-ui-a2ui/evals/adversarial-corpus.json +0 -75
- package/skills/adia-ui-a2ui/evals/teach-routing-cases.json +0 -100
- package/skills/adia-ui-a2ui/references/anti-patterns.md +0 -24
- package/skills/adia-ui-a2ui/references/chunk-authoring.md +0 -88
- package/skills/adia-ui-a2ui/references/corpus-discipline.md +0 -56
- package/skills/adia-ui-a2ui/references/eval-diagnostics.md +0 -127
- package/skills/adia-ui-a2ui/references/fragment-graph.md +0 -91
- package/skills/adia-ui-a2ui/references/mcp-pipeline-ops.md +0 -106
- package/skills/adia-ui-a2ui/references/mcp-tool-reference.md +0 -398
- package/skills/adia-ui-a2ui/references/pipeline-overview.md +0 -175
- package/skills/adia-ui-a2ui/references/semantic-fail-lifting.md +0 -120
- package/skills/adia-ui-a2ui/references/strategy-engines.md +0 -111
- package/skills/adia-ui-a2ui/references/teach-protocol.md +0 -220
- package/skills/adia-ui-a2ui/references/zettel-calibration.md +0 -93
- package/skills/adia-ui-a2ui/scripts/audit-a2ui-roster.mjs +0 -96
- package/skills/adia-ui-a2ui/scripts/teach-route.mjs +0 -157
- package/skills/adia-ui-a2ui/skill.json +0 -38
- package/skills/adia-ui-authoring/CHANGELOG.md +0 -32
- package/skills/adia-ui-authoring/SKILL.md +0 -256
- package/skills/adia-ui-authoring/assets/case-studies/admin-shell-decomposition.md +0 -101
- package/skills/adia-ui-authoring/assets/case-studies/maxtokens-32768-discovery.md +0 -109
- package/skills/adia-ui-authoring/assets/case-studies/theme-panel-promotion.md +0 -113
- package/skills/adia-ui-authoring/evals/adversarial-design-plan-gates.json +0 -138
- package/skills/adia-ui-authoring/evals/routing-corpus.json +0 -245
- package/skills/adia-ui-authoring/references/canonical-pattern-index.md +0 -179
- package/skills/adia-ui-authoring/references/common-gotchas.md +0 -93
- package/skills/adia-ui-authoring/references/composite-demo-protocol.md +0 -1084
- package/skills/adia-ui-authoring/references/teach-protocol.md +0 -428
- package/skills/adia-ui-authoring/scripts/audit-authoring-roster.mjs +0 -148
- package/skills/adia-ui-authoring/skill.json +0 -45
- package/skills/adia-ui-dogfood/CHANGELOG.md +0 -17
- package/skills/adia-ui-dogfood/README.md +0 -62
- package/skills/adia-ui-dogfood/SKILL.md +0 -866
- package/skills/adia-ui-dogfood/skill.json +0 -40
- package/skills/adia-ui-forge/SKILL.md +0 -88
- package/skills/adia-ui-forge/evals/routing-corpus.json +0 -30
- package/skills/adia-ui-gen-review/CHANGELOG.md +0 -108
- package/skills/adia-ui-gen-review/SKILL.md +0 -266
- package/skills/adia-ui-gen-review/references/loop-protocol.md +0 -712
- package/skills/adia-ui-gen-review/references/rubric-cosmetic.md +0 -144
- package/skills/adia-ui-gen-review/references/rubric-decompose.md +0 -117
- package/skills/adia-ui-gen-review/references/rubric-score.md +0 -249
- package/skills/adia-ui-gen-review/references/teach-protocol.md +0 -214
- package/skills/adia-ui-gen-review/skill.json +0 -22
- package/skills/adia-ui-llm/CHANGELOG.md +0 -25
- package/skills/adia-ui-llm/SKILL.md +0 -165
- package/skills/adia-ui-llm/evals/adversarial-corpus.json +0 -75
- package/skills/adia-ui-llm/evals/routing-corpus.json +0 -30
- package/skills/adia-ui-llm/evals/teach-routing-cases.json +0 -73
- package/skills/adia-ui-llm/references/teach-protocol.md +0 -78
- package/skills/adia-ui-llm/scripts/audit-llm-roster.mjs +0 -93
- package/skills/adia-ui-llm/scripts/teach-route.mjs +0 -119
- package/skills/adia-ui-llm/skill.json +0 -33
- package/skills/adia-ui-release/CHANGELOG.md +0 -23
- package/skills/adia-ui-release/SKILL.md +0 -295
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-batch-push-v0.6.14-v0.6.15.md +0 -144
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-corpus-drift-remediation-v0.6.15.md +0 -155
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-version-skip-correction-v0.6.12.md +0 -114
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-author-from-scratch-v0.6.18.md +0 -139
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-feedback37-retraction-v0.6.21.md +0 -124
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-fn1-enrichment-pass-v0.6.19.md +0 -125
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-stale-test-detection-v0.6.20.md +0 -142
- package/skills/adia-ui-release/assets/case-studies/2026-05-23-freshness-gate-recovery-v0.6.32.md +0 -97
- package/skills/adia-ui-release/assets/case-studies/2026-05-26-catalog-drift-recurring-v0.6.40.md +0 -147
- package/skills/adia-ui-release/assets/templates/stub-changelog.template.md +0 -22
- package/skills/adia-ui-release/evals/evals.json +0 -164
- package/skills/adia-ui-release/references/changelog-discipline.md +0 -250
- package/skills/adia-ui-release/references/cycle-happy-path.md +0 -520
- package/skills/adia-ui-release/references/exe-deploy.md +0 -149
- package/skills/adia-ui-release/references/gates-catalog.md +0 -778
- package/skills/adia-ui-release/references/ledger-discipline.md +0 -232
- package/skills/adia-ui-release/references/migration-guide-authoring.md +0 -174
- package/skills/adia-ui-release/references/multi-agent-baseline.md +0 -207
- package/skills/adia-ui-release/references/notes-authoring.md +0 -212
- package/skills/adia-ui-release/references/recovery-paths.md +0 -215
- package/skills/adia-ui-release/references/rollup-notes.md +0 -208
- package/skills/adia-ui-release/references/teach-protocol.md +0 -468
- package/skills/adia-ui-release/scripts/audit-gate-roster.mjs +0 -196
- package/skills/adia-ui-release/scripts/make-ledger.mjs +0 -179
- package/skills/adia-ui-release/skill.json +0 -75
- /package/skills/{adia-ui-authoring → adia-author}/references/api-contract.md +0 -0
- /package/skills/{adia-ui-release → adia-release}/scripts/assert-monorepo-root.mjs +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# §Teach protocol — mode 8
|
|
2
|
-
|
|
3
|
-
The extensibility binding for "make sure `adia-ui-llm` knows about X" / "train the skill on a new provider quirk" / "absorb this adapter pitfall into adia-ui-llm". This is the producer-side teach surface: it lands knowledge about MAINTAINING `@adia-ai/llm`, never about consuming it (consumer knowledge routes to the separate `adia-ui-factory` consumer skill).
|
|
4
|
-
|
|
5
|
-
The decision tree below is mechanized in `scripts/teach-route.mjs` (the authoritative routing); this prose mirrors the branches for human readers and adds worked examples + anti-patterns.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## The first question — does it land in the skill at all?
|
|
10
|
-
|
|
11
|
-
The skill is a CITATION layer, not a KNOWLEDGE layer. Much "new knowledge" about the LLM client is actually a **source edit**, not a skill edit:
|
|
12
|
-
|
|
13
|
-
- A new field in a provider's response mapping → edit `packages/llm/src/adapters/<name>.ts` (`parseResponse` / `parseStream`). The skill changes only if a cross-adapter RULE changed.
|
|
14
|
-
- A new model id → edit `packages/llm/src/models.ts`. The skill changes only if a registry rule changed (e.g. a new id-naming convention `detectProvider` must learn).
|
|
15
|
-
- A new default → edit the source map (`models.ts:DEFAULT_MODEL` or `llm-bridge.ts:DEFAULT_MODELS`). The skill cites the maps; it doesn't store the values.
|
|
16
|
-
|
|
17
|
-
If the payload is a fact the source already encodes (or should), the landing is the source — and the skill may not change at all. Land a skill patch only when the knowledge is a durable RULE, pitfall, or procedure a maintainer needs surfaced.
|
|
18
|
-
|
|
19
|
-
## The decision tree (branches)
|
|
20
|
-
|
|
21
|
-
First match wins. The landing is a reference file in this skill's `references/` directory (named bare below), or a non-reference landing (`(source)` / `(journal)` / `SKILL.md`). The mechanized router in `scripts/teach-route.mjs` emits the same target as a skill-root-relative path.
|
|
22
|
-
|
|
23
|
-
| Branch | Fires when the payload is about… | Landing |
|
|
24
|
-
| --- | --- | --- |
|
|
25
|
-
| `source-edit` | a per-adapter field/value the source encodes (response field, a model id, a default value) | `(source) packages/llm/src/...` — not a skill landing |
|
|
26
|
-
| `add-provider` | a new step or gotcha in adding a 4th provider | `add-a-provider.md` |
|
|
27
|
-
| `streaming` | the SSE parser, the `StreamChunk` protocol, a chunk-type, `[DONE]` / framing | `streaming-sse.md` |
|
|
28
|
-
| `model-registry` | the `MODELS` shape, `DEFAULT_MODEL`, `detectProvider` rules | `model-registry.md` |
|
|
29
|
-
| `bridge-facade` | `chat`/`streamChat`/`createClient`, `createAdapter`, the bridge, the stub, `maxTokens`, lazy-load | `bridge-facade.md` |
|
|
30
|
-
| `proxy-boundary` | smart vs passthrough proxy, the production-host path, key-in-browser safety | `browser-proxy-boundary.md` |
|
|
31
|
-
| `adapter-contract` | a cross-adapter shape rule, `usage` mapping, raw `stopReason`, `buildRequest` discipline (DEFAULT) | `adapter-contract.md` |
|
|
32
|
-
| `methodology` | a posture / mission shift or a new §SelfAudit axis | `SKILL.md` (inline) |
|
|
33
|
-
| `journal` | a one-off debugging arc story (NEGATIVE — not the skill) | `(journal)` |
|
|
34
|
-
|
|
35
|
-
`adapter-contract` is the default branch: an unclassified maintenance fact most often belongs with the adapter contract, and re-classifies from there.
|
|
36
|
-
|
|
37
|
-
## The five-step landing procedure
|
|
38
|
-
|
|
39
|
-
1. **Audit before patching.** Run `node scripts/audit-llm-roster.mjs` to confirm the skill is drift-free first; you don't want to land a patch on top of existing drift.
|
|
40
|
-
2. **Author the patch** in the branch's target file. Keep it a citation — name the `packages/llm/src/...` path + type, don't paste the code.
|
|
41
|
-
3. **Wire the activation surface.** If the patch adds a capability, add/adjust the §ColdStartTriage row or a §Posture line so the knowledge is reachable. An orphaned reference nobody routes to is dead weight.
|
|
42
|
-
4. **Version + CHANGELOG.** Bump `skill.json` + the SKILL.md frontmatter `version` together (one MINOR for a new rule/capability; one PATCH for a clarification — never bundle both into one bump), and prepend a CHANGELOG entry.
|
|
43
|
-
5. **Verify.** Run `node scripts/audit-llm-roster.mjs --strict` (0 drift) AND close the PEV loop — the underlying knowledge should be verifiable against the real package (`npm run build` + a `chat()` / stub round-trip). See `## §Plan-Execute-Verify` in SKILL.md.
|
|
44
|
-
|
|
45
|
-
## Anti-patterns
|
|
46
|
-
|
|
47
|
-
- **Append-only landing.** Tacking a paragraph onto the nearest file without checking whether it duplicates an existing rule or belongs in the source. Audit first.
|
|
48
|
-
- **Source duplication.** Restating what an adapter's `parseResponse` already encodes. If the source is the truth, cite it; don't copy it into prose that will drift.
|
|
49
|
-
- **Orphan triggers.** A new reference with no §ColdStartTriage row or posture line pointing at it.
|
|
50
|
-
- **Capability-menu lies.** A menu row promising a mode whose reference doesn't cover it.
|
|
51
|
-
- **MINOR + PATCH bundling.** Two unrelated changes in one version bump muddies the CHANGELOG.
|
|
52
|
-
- **One-way thinking.** The most common producer-side miss: the payload is actually CONSUMER knowledge ("how do I wire `<chat-shell-ui>`", "what proxy do I deploy"). That does not land here — it belongs to the `adia-ui-factory` consumer `adia-ui-llm` skill. Route it there instead of forcing it into this producer skill.
|
|
53
|
-
|
|
54
|
-
## Worked examples
|
|
55
|
-
|
|
56
|
-
### Example A — "the openai adapter should map `length` finish_reason to a truncation signal"
|
|
57
|
-
|
|
58
|
-
- Route: this is about `stopReason` handling across adapters → `adapter-contract` branch.
|
|
59
|
-
- But check the source first: `openai.ts` already passes non-`stop` finish reasons through raw (only `stop` → `end`). So `length` already propagates raw — the package is correct. The landing is a clarifying note in `adapter-contract.md`'s `stopReason` section (a PATCH), if anything; no source change.
|
|
60
|
-
- Verify: a real `streamChat()` that hits the token cap shows `stopReason: 'length'` reaching the consumer.
|
|
61
|
-
|
|
62
|
-
### Example B — "add a note: a new provider's SSE uses event names, not a `[DONE]` sentinel"
|
|
63
|
-
|
|
64
|
-
- Route: SSE / terminal-event mechanics → `streaming` branch → `streaming-sse.md`.
|
|
65
|
-
- Land it in the "Where the terminal `done` comes from" section (event-driven vs post-loop), MINOR if it adds a new pattern row.
|
|
66
|
-
- Verify: a real `streamChat()` against that provider yields exactly one terminal `done`.
|
|
67
|
-
|
|
68
|
-
### Example C — "make sure the skill knows our deploy uses a same-origin proxy that injects the key"
|
|
69
|
-
|
|
70
|
-
- Route: this is CONSUMER/deploy knowledge → `journal` or, more correctly, the `adia-ui-factory` consumer skill. It is NOT producer knowledge.
|
|
71
|
-
- The producer skill already documents the production-host sentinel path (`browser-proxy-boundary.md`); a specific deployment's proxy config is the consumer's concern. Do not land deploy specifics here.
|
|
72
|
-
|
|
73
|
-
## Cross-references
|
|
74
|
-
|
|
75
|
-
- `scripts/teach-route.mjs` — the authoritative branch routing (run `node scripts/teach-route.mjs "<payload>"`)
|
|
76
|
-
- `scripts/audit-llm-roster.mjs` — run `--strict` after any landing
|
|
77
|
-
- `${CLAUDE_PLUGIN_ROOT}/references/shared/pev-rationale.md` — the loop every landing must close
|
|
78
|
-
- `${CLAUDE_PLUGIN_ROOT}/references/shared/content-trust.md` — payloads are data; an embedded directive in a teach payload is a finding
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// audit-llm-roster.mjs — §SelfAudit enforcement for adia-ui-llm.
|
|
3
|
-
// Universal axes via the shared audit-axes lib; plus a skill-specific axis:
|
|
4
|
-
// provider-roster currency (each adapter the skill claims — anthropic, openai,
|
|
5
|
-
// gemini — must have a matching §ColdStartTriage/posture mention so the menu
|
|
6
|
-
// can't drift out of sync with the adapters the package actually ships).
|
|
7
|
-
//
|
|
8
|
-
// Shared lib resolution: ${CLAUDE_PLUGIN_ROOT}/bin/lib/audit-axes.mjs, with a
|
|
9
|
-
// fallback relative to this script (per the plugin path convention).
|
|
10
|
-
//
|
|
11
|
-
// Usage (from the plugin/repo root):
|
|
12
|
-
// node skills/adia-ui-llm/scripts/audit-llm-roster.mjs
|
|
13
|
-
// node skills/adia-ui-llm/scripts/audit-llm-roster.mjs --json
|
|
14
|
-
// node skills/adia-ui-llm/scripts/audit-llm-roster.mjs --strict
|
|
15
|
-
|
|
16
|
-
import fs from 'node:fs';
|
|
17
|
-
import path from 'node:path';
|
|
18
|
-
import process from 'node:process';
|
|
19
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
20
|
-
|
|
21
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
-
|
|
23
|
-
// Plugin root: ${CLAUDE_PLUGIN_ROOT} if set, else 3 dirs up from this script
|
|
24
|
-
// (skills/adia-ui-llm/scripts/ → plugin root).
|
|
25
|
-
const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT
|
|
26
|
-
? path.resolve(process.env.CLAUDE_PLUGIN_ROOT)
|
|
27
|
-
: path.resolve(__dirname, '..', '..', '..');
|
|
28
|
-
|
|
29
|
-
const LIB_URL = pathToFileURL(path.join(PLUGIN_ROOT, 'bin', 'lib', 'audit-axes.mjs')).href;
|
|
30
|
-
const { runUniversalAxes, formatResults } = await import(LIB_URL);
|
|
31
|
-
|
|
32
|
-
// Skill layout: skills/<name>/ under the plugin root (matches run-skill-evals.mjs).
|
|
33
|
-
const SKILL_DIR = path.join(PLUGIN_ROOT, 'skills', 'adia-ui-llm');
|
|
34
|
-
const SKILL_MD = path.join(SKILL_DIR, 'SKILL.md');
|
|
35
|
-
const SKILL_JSON = path.join(SKILL_DIR, 'skill.json');
|
|
36
|
-
|
|
37
|
-
// The provider adapters this skill maintains. Each MUST be referenced in
|
|
38
|
-
// SKILL.md so the cold-start menu / posture stays in sync with the package.
|
|
39
|
-
const PROVIDERS = ['anthropic', 'openai', 'gemini'];
|
|
40
|
-
|
|
41
|
-
function parseArgs(argv) {
|
|
42
|
-
return { json: argv.includes('--json'), strict: argv.includes('--strict') };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function readSafe(p) {
|
|
46
|
-
try { return fs.readFileSync(p, 'utf8'); } catch { return ''; }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function axisProviderRosterCurrency() {
|
|
50
|
-
const md = readSafe(SKILL_MD);
|
|
51
|
-
const findings = [];
|
|
52
|
-
for (const name of PROVIDERS) {
|
|
53
|
-
if (md.includes(name)) {
|
|
54
|
-
findings.push({ type: 'provider-present', message: `${name}: referenced in SKILL.md — correct`, name });
|
|
55
|
-
} else {
|
|
56
|
-
findings.push({
|
|
57
|
-
type: 'provider-missing',
|
|
58
|
-
message: `${name}: adapter is shipped by the package but not referenced in SKILL.md`,
|
|
59
|
-
name,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const driftCount = findings.filter(f => f.type !== 'provider-present').length;
|
|
64
|
-
return {
|
|
65
|
-
axis: 'providerRosterCurrency',
|
|
66
|
-
axis_num: 9,
|
|
67
|
-
status: driftCount > 0 ? 'drift' : 'ok',
|
|
68
|
-
findings,
|
|
69
|
-
summary: driftCount > 0 ? `${driftCount} provider(s) unreferenced` : 'all adapters referenced in SKILL.md',
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function main() {
|
|
74
|
-
const args = parseArgs(process.argv.slice(2));
|
|
75
|
-
const ctx = { skillDir: SKILL_DIR, skillMd: SKILL_MD, skillJson: SKILL_JSON, repoRoot: PLUGIN_ROOT };
|
|
76
|
-
const { results: universal } = runUniversalAxes(ctx);
|
|
77
|
-
const axis9 = axisProviderRosterCurrency();
|
|
78
|
-
const allResults = [...universal, axis9];
|
|
79
|
-
const driftCount = allResults.filter(r => r.status === 'drift').length;
|
|
80
|
-
|
|
81
|
-
if (args.json) {
|
|
82
|
-
console.log(JSON.stringify({ results: allResults, driftCount }, null, 2));
|
|
83
|
-
if (args.strict && driftCount > 0) process.exit(1);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
console.log(`[audit-llm-roster] adia-ui-llm §SelfAudit — ${driftCount} drifting axis/axes`);
|
|
88
|
-
console.log(formatResults(allResults));
|
|
89
|
-
if (driftCount === 0) console.log('\n✓ All clean.');
|
|
90
|
-
if (args.strict && driftCount > 0) process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
main();
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// teach-route.mjs — Mechanized §Teach decision tree for adia-ui-llm.
|
|
3
|
-
// Maps a "make sure the skill knows about X" payload to its landing target.
|
|
4
|
-
// Composes from the shared teach-router lib; the prose tree in
|
|
5
|
-
// references/teach-protocol.md mirrors these branches for human readers.
|
|
6
|
-
//
|
|
7
|
-
// Shared lib resolution: ${CLAUDE_PLUGIN_ROOT}/bin/lib/teach-router.mjs, with a
|
|
8
|
-
// fallback relative to this script.
|
|
9
|
-
//
|
|
10
|
-
// Usage (from the plugin/repo root):
|
|
11
|
-
// node skills/adia-ui-llm/scripts/teach-route.mjs "add a new provider adapter"
|
|
12
|
-
// node skills/adia-ui-llm/scripts/teach-route.mjs --list
|
|
13
|
-
// node skills/adia-ui-llm/scripts/teach-route.mjs --payload="<payload>" [--json]
|
|
14
|
-
|
|
15
|
-
import path from 'node:path';
|
|
16
|
-
import process from 'node:process';
|
|
17
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
18
|
-
|
|
19
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
|
|
21
|
-
const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT
|
|
22
|
-
? path.resolve(process.env.CLAUDE_PLUGIN_ROOT)
|
|
23
|
-
: path.resolve(__dirname, '..', '..', '..');
|
|
24
|
-
|
|
25
|
-
const LIB_URL = pathToFileURL(path.join(PLUGIN_ROOT, 'bin', 'lib', 'teach-router.mjs')).href;
|
|
26
|
-
const { buildRouter, describeRouter } = await import(LIB_URL);
|
|
27
|
-
|
|
28
|
-
// Branches: first match wins. `target` is the landing file (relative to skill
|
|
29
|
-
// root) — or "(source)" / "(journal)" / "SKILL.md" for non-reference landings.
|
|
30
|
-
// Mirrors the table in references/teach-protocol.md.
|
|
31
|
-
export const branches = [
|
|
32
|
-
{
|
|
33
|
-
id: 'source-edit',
|
|
34
|
-
label: 'Per-adapter field/value the source encodes (NOT a skill landing)',
|
|
35
|
-
match: [/response field/i, /model id/i, 'default value', /new field/i, 'source edit', 'parseresponse field'],
|
|
36
|
-
target: '(source) packages/llm/src/',
|
|
37
|
-
confidence: 'high',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'add-provider',
|
|
41
|
-
label: 'New step / gotcha in adding a 4th provider',
|
|
42
|
-
match: ['add a provider', 'add a new provider', '4th provider', 'fourth provider', 'new adapter step'],
|
|
43
|
-
target: 'references/add-a-provider.md',
|
|
44
|
-
confidence: 'high',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 'streaming',
|
|
48
|
-
label: 'SSE parser / StreamChunk protocol / chunk type',
|
|
49
|
-
match: ['sse', 'stream chunk', 'streamchunk', 'chunk type', '[done]', 'snapshot', 'streaming protocol', /stream(ing)? parser/i],
|
|
50
|
-
target: 'references/streaming-sse.md',
|
|
51
|
-
confidence: 'high',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'model-registry',
|
|
55
|
-
label: 'MODELS shape / DEFAULT_MODEL / detectProvider rule',
|
|
56
|
-
match: ['models catalog', 'model registry', 'default_model', 'detectprovider', 'detect provider', 'grouped options', 'chat-input'],
|
|
57
|
-
target: 'references/model-registry.md',
|
|
58
|
-
confidence: 'high',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: 'bridge-facade',
|
|
62
|
-
label: 'Facade / bridge / stub / maxTokens / lazy-load',
|
|
63
|
-
match: ['createadapter', 'create adapter', 'createclient', 'create client', 'bridge', 'stub', 'maxtokens', 'max tokens', 'lazy-load', 'lazy load', 'chatresult', 'chatopts'],
|
|
64
|
-
target: 'references/bridge-facade.md',
|
|
65
|
-
confidence: 'high',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: 'proxy-boundary',
|
|
69
|
-
label: 'Proxy flavors / production-host path / key-in-browser safety',
|
|
70
|
-
match: ['proxy', 'passthrough', 'smart proxy', 'proxyurl', 'production host', 'browser key', 'key in browser', 'cors'],
|
|
71
|
-
target: 'references/browser-proxy-boundary.md',
|
|
72
|
-
confidence: 'high',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: 'adapter-contract',
|
|
76
|
-
label: 'Cross-adapter shape rule / usage mapping / raw stopReason / buildRequest (DEFAULT)',
|
|
77
|
-
match: ['adapter contract', 'buildrequest', 'build request', 'usage mapping', 'stopreason', 'stop reason', 'parseresponse', 'adapter shape'],
|
|
78
|
-
target: 'references/adapter-contract.md',
|
|
79
|
-
confidence: 'medium',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: 'methodology',
|
|
83
|
-
label: 'Posture / mission shift or new §SelfAudit axis (inline SKILL.md)',
|
|
84
|
-
match: ['posture', 'methodology', 'principle', 'mission', 'new selfaudit axis', 'self-audit axis'],
|
|
85
|
-
target: 'SKILL.md',
|
|
86
|
-
confidence: 'medium',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: 'journal',
|
|
90
|
-
label: 'One-off arc story (NEGATIVE — journal, not the skill)',
|
|
91
|
-
match: ['arc story', 'debugging story', 'one-off', 'how i debugged', 'journal'],
|
|
92
|
-
target: '(journal)',
|
|
93
|
-
confidence: 'high',
|
|
94
|
-
},
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
export const router = buildRouter({ branches, defaultBranch: 'adapter-contract' });
|
|
98
|
-
|
|
99
|
-
// ─── CLI ──────────────────────────────────────────────────────────────────────
|
|
100
|
-
|
|
101
|
-
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
102
|
-
const args = process.argv.slice(2);
|
|
103
|
-
if (args.includes('--list')) {
|
|
104
|
-
console.log(describeRouter(router, branches));
|
|
105
|
-
process.exit(0);
|
|
106
|
-
}
|
|
107
|
-
const payloadFlag = args.find(a => a.startsWith('--payload='));
|
|
108
|
-
const payload = payloadFlag
|
|
109
|
-
? payloadFlag.slice('--payload='.length)
|
|
110
|
-
: args.filter(a => !a.startsWith('--')).join(' ');
|
|
111
|
-
if (!payload) {
|
|
112
|
-
console.error('Usage: node teach-route.mjs "<payload describing the new knowledge>"');
|
|
113
|
-
console.error(' node teach-route.mjs --payload="<payload>" [--json]');
|
|
114
|
-
console.error(' node teach-route.mjs --list');
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
const { branch, target, confidence, label } = router(payload);
|
|
118
|
-
console.log(JSON.stringify({ payload, branch, label, target, confidence }, null, 2));
|
|
119
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "adia-ui-llm",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Maintainer (PRODUCER) skill for @adia-ai/llm — the provider-agnostic LLM client at packages/llm/ that the adia-ui chat-shell and the A2UI generation pipeline depend on. Owns the provider adapters (anthropic / openai / gemini), the shared SSE parser, the model registry (models.ts), the unified chat() / streamChat() / createClient() facade, the createAdapter() bridge, the browser(proxyUrl)+Node duality, and StubLLMAdapter. Every mode names a real verify target (the built package, a real chat() round-trip, or the deterministic stub). Use whenever the user wants to ADD A PROVIDER ADAPTER / MODIFY AN ADAPTER / EVOLVE THE MODEL REGISTRY / WORK ON SSE STREAMING / CHANGE THE BRIDGE-FACADE CONTRACT / TOUCH THE BROWSER-PROXY BOUNDARY / FIX THE STUB. Triggers on \"add a new LLM provider\", \"fix the @adia-ai/llm SSE adapter\", \"the anthropic adapter drops cache tokens\", \"add a model to the registry\", \"streamChat yields a wrong chunk\", \"change chat()/streamChat()\", \"passthrough vs smart proxy\", \"stopReason normalization\", \"stub returns wrong A2UI\", \"teach adia-ui-llm\". Does NOT trigger for: WIRING the client into an app or chat box (CONSUMER side — the adia-ui-factory plugin's adia-ui-llm skill), generation-pipeline / corpus internals (adia-ui-a2ui), authoring web-components or the in-monorepo bridge surface against an unchanged client (adia-ui-authoring), cutting a release (adia-ui-release), or general LLM-streaming tutorials.",
|
|
5
|
-
"status": "stable",
|
|
6
|
-
"authors": ["kim.granlund"],
|
|
7
|
-
"codeowners": [],
|
|
8
|
-
"tags": ["adia-ui", "llm", "anthropic", "openai", "gemini", "sse", "streaming", "model-registry", "provider-adapter", "chat", "streamchat", "createadapter", "proxy", "stub", "provider-agnostic"],
|
|
9
|
-
"depends_on": [],
|
|
10
|
-
"peer_skills": ["adia-ui-authoring", "adia-ui-a2ui", "adia-ui-release", "adia-ui-gen-review", "adia-ui-dogfood"],
|
|
11
|
-
"environment": {
|
|
12
|
-
"portable": false,
|
|
13
|
-
"requires": ["the @adia-ai monorepo with packages/llm/ (src/adapters/{anthropic,openai,gemini,sse,index}.ts, src/models.ts, src/llm-bridge.ts, src/llm-stub.ts)"],
|
|
14
|
-
"rationale": "The @adia-ai/llm client source exists only in the @adia-ai monorepo; every verify command (npm run build for the package, a real chat()/streamChat() round-trip, the stub) and every audited source path (packages/llm/**) is substrate-side."
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"SKILL.md",
|
|
18
|
-
"CHANGELOG.md",
|
|
19
|
-
"skill.json",
|
|
20
|
-
"references/adapter-contract.md",
|
|
21
|
-
"references/streaming-sse.md",
|
|
22
|
-
"references/model-registry.md",
|
|
23
|
-
"references/bridge-facade.md",
|
|
24
|
-
"references/browser-proxy-boundary.md",
|
|
25
|
-
"references/add-a-provider.md",
|
|
26
|
-
"references/teach-protocol.md",
|
|
27
|
-
"scripts/audit-llm-roster.mjs",
|
|
28
|
-
"scripts/teach-route.mjs",
|
|
29
|
-
"evals/routing-corpus.json",
|
|
30
|
-
"evals/adversarial-corpus.json",
|
|
31
|
-
"evals/teach-routing-cases.json"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Changelog — `adia-ui-release` skill
|
|
2
|
-
|
|
3
|
-
## [0.1.0] stable — 2026-06-03
|
|
4
|
-
|
|
5
|
-
**Initial cut in the `adia-ui-forge` plugin.** Faithful, de-repo'd, self-contained port of the @adia-ai monorepo's maintainer `adia-ui-release` skill, with the former `adia-ui-migration` skill folded in as the producer-side migration-guide-authoring section. Preserves the release-engineering depth (the gate roster, recovery paths, peer-in-flight discipline, ledger schema, notes craft) — this is a port, not a rewrite.
|
|
6
|
-
|
|
7
|
-
### Ported
|
|
8
|
-
|
|
9
|
-
- **SKILL.md** — the mode menu (now 11 modes), §Mission, §Posture (load-on- demand + content-trust citing `${CLAUDE_PLUGIN_ROOT}/references/shared/`), §Plan-Execute-Verify (per-mode real-product verify table), §ReleaseInvariants, §LoadingProtocol, §Recon, §Teach (stub → `teach-protocol.md`), §SelfAudit, §FileMap, §Status.
|
|
10
|
-
- **11 references** — `cycle-happy-path.md`, `multi-agent-baseline.md`, `gates-catalog.md`, `recovery-paths.md`, `changelog-discipline.md`, `notes-authoring.md`, `rollup-notes.md`, `exe-deploy.md`, `ledger-discipline.md`, `teach-protocol.md`, plus the new `migration-guide-authoring.md` (the fold-in).
|
|
11
|
-
- **8 scripts** (pure Node, stdlib only, `node --check` clean) — `bump.mjs`, `promote-unreleased.mjs`, `insert-stub.mjs`, `tag-lockstep.mjs`, `dispatch-publish.mjs`, `make-ledger.mjs`, `release-pack.mjs`, `audit-gate-roster.mjs`.
|
|
12
|
-
- **9 case studies** (worked-example cycles) + the lockstep stub template + `evals/evals.json`.
|
|
13
|
-
|
|
14
|
-
### Folded in — `adia-ui-migration` (producer side)
|
|
15
|
-
|
|
16
|
-
The release skill now owns **producer-side** migration: mode 11 + §MigrationGuideAuthoring + `references/migration-guide-authoring.md` — authoring the `MIGRATION GUIDE.md` section when a cut breaks an API (before→after + audit grep + sweep recipe per item, manual-review classes for semantic flips, the version-coverage table, the in-repo sweep-verification audit) and sweeping the framework's own demo / playground / catalog surfaces. The **consumer** side (sweeping a downstream app against a published guide) deliberately stays in the separate consumer/app-author plugin; mode 11 declines + redirects for "migrate our app" requests.
|
|
17
|
-
|
|
18
|
-
### Scope discipline (de-repo)
|
|
19
|
-
|
|
20
|
-
- The portable release DISCIPLINE is the core. The @adia-ai monorepo's concrete **9-package lockstep**, **`check:*` gate roster**, and **`ui-kit.exe.xyz` demo-site deploy** are kept as the clearly-labeled **worked example** (header notes in `cycle-happy-path.md`, `gates-catalog.md`, `exe-deploy.md`; package/tag counts marked as the example in §ReleaseInvariants), NOT presented as universal gates.
|
|
21
|
-
- Absolute paths (`/Users/...`) stripped; `$REPO` / `${CLAUDE_PLUGIN_ROOT}` used instead. Shared-infra references point at `${CLAUDE_PLUGIN_ROOT}/references/shared/` (content-trust, pev-rationale, skill-conventions). Skill-owned script invocations point at `${CLAUDE_PLUGIN_ROOT}/skills/adia-ui-release/scripts/`.
|
|
22
|
-
- Instance data dropped: hardcoded repo slug → `--repo-slug <org>/<repo>` flag in `make-ledger.mjs` + `<org>/<repo>` placeholder in `ledger-discipline.md`; dated version-by-version skill history from the source's 1.x CHANGELOG dropped (durable knowledge + templates kept; the 9 case studies are retained as worked examples with absolute paths stripped).
|
|
23
|
-
- Excluded-skill cross-references rewritten: `adia-ui-kit` → "the consumer/app-author plugin"; `adia-ui-ops` / `exe-dev-ops` → "a long-running-ops concern (separate; not in this plugin)"; `dogfood-sweep` → the present sibling `adia-ui-dogfood`; `a2ui-pipeline` → the present sibling `adia-ui-a2ui`; monorepo-only docs (`VISION-extensibility.md`, `trainable-skill-ecosystem-design`) → the shared `skill-conventions.md` / `pev-rationale.md`.
|