@adia-ai/adia-ui-factory 0.2.4 → 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 +5 -7
- package/.mcp.json +1 -1
- package/CHANGELOG.md +27 -67
- package/README.md +32 -53
- package/agents/app-architect.md +28 -0
- package/agents/routing-corpus.json +202 -0
- package/agents/screen-composer.md +27 -0
- package/bin/adia-lint +17 -2
- package/commands/adia-genui.md +5 -8
- package/commands/adia-migrate.md +5 -6
- package/commands/adia-orient.md +5 -10
- package/commands/adia-scaffold.md +7 -13
- package/commands/adia-verify.md +5 -6
- package/package.json +5 -6
- package/references/a2ui-mcp-tools.md +11 -8
- package/references/authoring-components.md +25 -1
- package/references/component-model.md +52 -4
- package/references/contracts/a2ui-mcp-surface.md +35 -0
- package/references/contracts/migration-guide-format.md +34 -0
- package/references/data-and-hydration.md +8 -5
- package/references/genui-a2ui.md +12 -6
- package/references/llm.md +22 -39
- package/references/migration.md +110 -36
- package/references/project-shapes.md +11 -13
- package/references/shell-admin.md +5 -2
- package/references/shell-chat.md +5 -3
- package/references/shell-editor.md +1 -1
- package/references/shell-embed.md +40 -26
- package/references/shell-simple.md +5 -2
- package/references/spa-architecture.md +28 -73
- package/references/ssr-integration.md +1 -1
- package/references/verification.md +8 -12
- package/skills/adia-compose/SKILL.md +52 -0
- package/skills/{adia-ui-kit → adia-compose}/assets/figma-make/guidelines/Guidelines.md +3 -3
- package/skills/{adia-ui-kit → adia-compose}/assets/figma-make/guidelines/components.md +1 -1
- package/skills/{adia-ui-kit → adia-compose}/assets/figma-make/guidelines/styles.md +1 -1
- package/skills/{adia-ui-kit → adia-compose}/assets/figma-make/guidelines/tokens.md +3 -3
- package/skills/{adia-ui-kit → adia-compose}/assets/templates/FEEDBACK.template.md +7 -7
- package/skills/{adia-ui-kit → adia-compose}/assets/templates/RESPONSE.template.md +6 -7
- package/skills/adia-compose/references/composition-traps.md +58 -0
- package/skills/adia-compose/references/feedback-discipline.md +20 -0
- package/skills/adia-compose/references/spec-to-ui-reasoning.md +158 -0
- package/skills/adia-data/SKILL.md +78 -0
- package/skills/adia-genui/SKILL.md +83 -0
- package/skills/adia-host/SKILL.md +119 -0
- package/skills/adia-llm/SKILL.md +36 -0
- package/skills/adia-migrate/SKILL.md +76 -0
- package/skills/adia-orient/SKILL.md +123 -0
- package/skills/adia-project/SKILL.md +83 -0
- package/skills/adia-shells/SKILL.md +74 -0
- package/skills/adia-verify/SKILL.md +43 -0
- package/skills/adia-verify/references/verification.md +42 -0
- package/commands/adia-compose.md +0 -10
- package/commands/adia-wire.md +0 -13
- package/skills/adia-ui-compose/SKILL.md +0 -57
- package/skills/adia-ui-data/SKILL.md +0 -62
- package/skills/adia-ui-factory/SKILL.md +0 -113
- package/skills/adia-ui-genui/SKILL.md +0 -74
- package/skills/adia-ui-kit/CHANGELOG.md +0 -41
- package/skills/adia-ui-kit/SKILL.md +0 -442
- package/skills/adia-ui-kit/assets/team-scaffold/archive-README.md +0 -30
- package/skills/adia-ui-kit/assets/team-scaffold/drafts-README.md +0 -57
- package/skills/adia-ui-kit/assets/team-scaffold/inbox-README.md +0 -76
- package/skills/adia-ui-kit/assets/team-scaffold/outbox-README.md +0 -46
- package/skills/adia-ui-kit/assets/team-scaffold/team-root.README.md +0 -51
- package/skills/adia-ui-kit/assets/team-scaffold/tickets-README.md +0 -208
- package/skills/adia-ui-kit/assets/team-scaffold/tickets-REGISTRY.md +0 -81
- package/skills/adia-ui-kit/assets/templates/AGENTS.template.md +0 -128
- package/skills/adia-ui-kit/assets/templates/CLAUDE.template.md +0 -1
- package/skills/adia-ui-kit/assets/templates/figma-make-guidelines.md +0 -90
- package/skills/adia-ui-kit/evals/adversarial-content-trust.json +0 -83
- package/skills/adia-ui-kit/evals/evals.json +0 -55
- package/skills/adia-ui-kit/evals/routing-corpus.json +0 -121
- package/skills/adia-ui-kit/evals/teach-routing-cases.json +0 -92
- package/skills/adia-ui-kit/references/capabilities.md +0 -245
- package/skills/adia-ui-kit/references/catalog-lookup.md +0 -186
- package/skills/adia-ui-kit/references/changelog-archive/CHANGELOG-v1.md +0 -8
- package/skills/adia-ui-kit/references/changelog-archive/CHANGELOG-v2.md +0 -3585
- package/skills/adia-ui-kit/references/changelog-archive/CHANGELOG-v3.md +0 -1899
- package/skills/adia-ui-kit/references/common-gotchas-consumer.md +0 -522
- package/skills/adia-ui-kit/references/component-literacy.md +0 -291
- package/skills/adia-ui-kit/references/composition.md +0 -245
- package/skills/adia-ui-kit/references/correction-loop.md +0 -462
- package/skills/adia-ui-kit/references/css-policy.md +0 -343
- package/skills/adia-ui-kit/references/decision-model.md +0 -158
- package/skills/adia-ui-kit/references/diagnostic-output.md +0 -57
- package/skills/adia-ui-kit/references/docs-catalog.md +0 -239
- package/skills/adia-ui-kit/references/exclusions.md +0 -225
- package/skills/adia-ui-kit/references/feedback-authoring.md +0 -466
- package/skills/adia-ui-kit/references/figma-make.md +0 -244
- package/skills/adia-ui-kit/references/flows-auth.md +0 -307
- package/skills/adia-ui-kit/references/flows-content.md +0 -206
- package/skills/adia-ui-kit/references/flows-data.md +0 -348
- package/skills/adia-ui-kit/references/flows-interaction.md +0 -181
- package/skills/adia-ui-kit/references/flows-shells.md +0 -336
- package/skills/adia-ui-kit/references/gap-detection.md +0 -266
- package/skills/adia-ui-kit/references/harness.md +0 -284
- package/skills/adia-ui-kit/references/loading-protocol.md +0 -406
- package/skills/adia-ui-kit/references/local-link.md +0 -198
- package/skills/adia-ui-kit/references/mcp.md +0 -401
- package/skills/adia-ui-kit/references/migration.md +0 -116
- package/skills/adia-ui-kit/references/mission.md +0 -194
- package/skills/adia-ui-kit/references/mode-routing.md +0 -298
- package/skills/adia-ui-kit/references/patterns-agent.md +0 -223
- package/skills/adia-ui-kit/references/patterns-data.md +0 -1065
- package/skills/adia-ui-kit/references/patterns-forms.md +0 -223
- package/skills/adia-ui-kit/references/patterns-layout.md +0 -326
- package/skills/adia-ui-kit/references/patterns-recipes.md +0 -1416
- package/skills/adia-ui-kit/references/patterns-shells.md +0 -1097
- package/skills/adia-ui-kit/references/patterns-traits.md +0 -259
- package/skills/adia-ui-kit/references/patterns-wiring.md +0 -339
- package/skills/adia-ui-kit/references/pev-rationale.md +0 -137
- package/skills/adia-ui-kit/references/reasoning-gate.md +0 -146
- package/skills/adia-ui-kit/references/reasoning-methodologies.md +0 -112
- package/skills/adia-ui-kit/references/recon.md +0 -192
- package/skills/adia-ui-kit/references/rendering-model.md +0 -431
- package/skills/adia-ui-kit/references/response-authoring.md +0 -398
- package/skills/adia-ui-kit/references/session-log-schema.md +0 -203
- package/skills/adia-ui-kit/references/session-log-template.md +0 -118
- package/skills/adia-ui-kit/references/setup.md +0 -652
- package/skills/adia-ui-kit/references/skill-hygiene.md +0 -135
- package/skills/adia-ui-kit/references/spec-to-ui-reasoning.md +0 -394
- package/skills/adia-ui-kit/references/state.md +0 -229
- package/skills/adia-ui-kit/references/teach-protocol.md +0 -421
- package/skills/adia-ui-kit/references/theme.md +0 -142
- package/skills/adia-ui-kit/references/version-check.md +0 -69
- package/skills/adia-ui-kit/scripts/audit-decision-trace.mjs +0 -198
- package/skills/adia-ui-kit/scripts/audit-kit-roster.mjs +0 -366
- package/skills/adia-ui-kit/scripts/changelog-archive.mjs +0 -126
- package/skills/adia-ui-kit/scripts/check-adia-versions.py +0 -404
- package/skills/adia-ui-kit/scripts/run-skill-evals.mjs +0 -358
- package/skills/adia-ui-kit/scripts/validate-session-log.mjs +0 -242
- package/skills/adia-ui-kit/skill.json +0 -102
- package/skills/adia-ui-llm/SKILL.md +0 -51
- package/skills/adia-ui-migrate/SKILL.md +0 -64
- package/skills/adia-ui-migration/CHANGELOG.md +0 -47
- package/skills/adia-ui-migration/SKILL.md +0 -381
- package/skills/adia-ui-migration/skill.json +0 -29
- package/skills/adia-ui-project/SKILL.md +0 -77
- package/skills/adia-ui-shells/SKILL.md +0 -62
- package/skills/adia-ui-spa/SKILL.md +0 -52
- package/skills/adia-ui-ssr/SKILL.md +0 -52
- package/skills/adia-ui-verify/SKILL.md +0 -44
- /package/skills/{adia-ui-kit → adia-compose}/assets/templates/FEEDBACK-OMISSIONS-DEFENSE.template.md +0 -0
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
# §MCP — Installing the AdiaUI MCP server
|
|
2
|
-
|
|
3
|
-
> **Loading note.** Reference bundle extracted from `SKILL.md` per the
|
|
4
|
-
> §LoadingProtocol inversion contract (v2.20.0+). Load via
|
|
5
|
-
> `skill_view(name='adia-ui-kit', file_path='references/mcp.md')` when
|
|
6
|
-
> you need to install/configure the AdiaUI MCP server for an agent IDE
|
|
7
|
-
> (Claude Desktop / Claude Code / Cursor / Windsurf). Skip if you're
|
|
8
|
-
> not setting up generative-UI tooling.
|
|
9
|
-
|
|
10
|
-
The AdiaUI MCP server (`@adia-ai/a2ui-mcp`) exposes 30 tools (v0.6.7+) for UI
|
|
11
|
-
generation, component discovery, validation, and corpus feedback to any
|
|
12
|
-
MCP-capable host: Claude Desktop, Claude Code, Cursor, Windsurf, and
|
|
13
|
-
any other client that speaks the stdio MCP protocol.
|
|
14
|
-
|
|
15
|
-
**This section is for wiring the MCP server into your AI client.**
|
|
16
|
-
For composing UI using the tools once connected, see `adia-ui-a2ui`.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
### 1. Install the package
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Global — exposes the `adiaui-mcp` CLI bin
|
|
24
|
-
npm install -g @adia-ai/a2ui-mcp
|
|
25
|
-
|
|
26
|
-
# Local — invoke via npx (no global install needed)
|
|
27
|
-
npm install @adia-ai/a2ui-mcp
|
|
28
|
-
|
|
29
|
-
# Verify it works
|
|
30
|
-
npx adiaui-mcp --version # or: adiaui-mcp --version (if global)
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
### 2. Set API keys
|
|
36
|
-
|
|
37
|
-
At least one LLM provider key is required for `generate_ui`. Set these
|
|
38
|
-
before starting the server:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Required — at least one
|
|
42
|
-
export ANTHROPIC_API_KEY=sk-ant-…
|
|
43
|
-
export OPENAI_API_KEY=sk-…
|
|
44
|
-
export GEMINI_API_KEY=AIza…
|
|
45
|
-
|
|
46
|
-
# Or add to a .env file in your project root
|
|
47
|
-
echo "ANTHROPIC_API_KEY=sk-ant-…" >> .env
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
The server reads `.env` at startup via `scripts/load-env.mjs`.
|
|
51
|
-
Keys cannot be changed while the server is running — restart to pick
|
|
52
|
-
up new values.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
### 3. Configure your MCP host
|
|
57
|
-
|
|
58
|
-
#### Claude Desktop
|
|
59
|
-
|
|
60
|
-
Config file location:
|
|
61
|
-
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
62
|
-
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"mcpServers": {
|
|
67
|
-
"adia-ui": {
|
|
68
|
-
"command": "npx",
|
|
69
|
-
"args": ["@adia-ai/a2ui-mcp"],
|
|
70
|
-
"env": {
|
|
71
|
-
"ANTHROPIC_API_KEY": "sk-ant-…",
|
|
72
|
-
"OPENAI_API_KEY": "sk-…"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Or with a global install:
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"mcpServers": {
|
|
84
|
-
"adia-ui": {
|
|
85
|
-
"command": "adiaui-mcp",
|
|
86
|
-
"env": {
|
|
87
|
-
"ANTHROPIC_API_KEY": "sk-ant-…"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Restart Claude Desktop after editing this file.
|
|
95
|
-
|
|
96
|
-
#### Claude Code (CLI)
|
|
97
|
-
|
|
98
|
-
Register in `.claude/settings.json` at your project root:
|
|
99
|
-
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"mcpServers": {
|
|
103
|
-
"adia-ui": {
|
|
104
|
-
"command": "npx",
|
|
105
|
-
"args": ["@adia-ai/a2ui-mcp"]
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Or from a local checkout:
|
|
112
|
-
|
|
113
|
-
```json
|
|
114
|
-
{
|
|
115
|
-
"mcpServers": {
|
|
116
|
-
"adia-ui": {
|
|
117
|
-
"command": "node",
|
|
118
|
-
"args": ["packages/a2ui/mcp/server.js"]
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
#### Cursor
|
|
125
|
-
|
|
126
|
-
Config file: `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project-local).
|
|
127
|
-
|
|
128
|
-
```json
|
|
129
|
-
{
|
|
130
|
-
"mcpServers": {
|
|
131
|
-
"adia-ui": {
|
|
132
|
-
"command": "npx",
|
|
133
|
-
"args": ["@adia-ai/a2ui-mcp"],
|
|
134
|
-
"env": {
|
|
135
|
-
"ANTHROPIC_API_KEY": "sk-ant-…"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
#### Windsurf
|
|
143
|
-
|
|
144
|
-
Config file: `~/.codeium/windsurf/mcp_config.json`
|
|
145
|
-
|
|
146
|
-
```json
|
|
147
|
-
{
|
|
148
|
-
"mcpServers": {
|
|
149
|
-
"adia-ui": {
|
|
150
|
-
"command": "npx",
|
|
151
|
-
"args": ["@adia-ai/a2ui-mcp"],
|
|
152
|
-
"env": {
|
|
153
|
-
"ANTHROPIC_API_KEY": "sk-ant-…"
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
#### Generic MCP host (any stdio-compatible client)
|
|
161
|
-
|
|
162
|
-
```json
|
|
163
|
-
{
|
|
164
|
-
"mcpServers": {
|
|
165
|
-
"adia-ui": {
|
|
166
|
-
"command": "npx",
|
|
167
|
-
"args": ["@adia-ai/a2ui-mcp"],
|
|
168
|
-
"env": {
|
|
169
|
-
"ANTHROPIC_API_KEY": "sk-ant-…"
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
The server speaks the MCP stdio transport — `command` + `args` is all
|
|
177
|
-
any compliant host needs. Adjust the key name (`adia-ui`) to whatever
|
|
178
|
-
your host uses for tool namespacing.
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
### 4. Verify the connection
|
|
183
|
-
|
|
184
|
-
Once configured and restarted, ask your AI client:
|
|
185
|
-
|
|
186
|
-
> "What AdiaUI tools are available?"
|
|
187
|
-
|
|
188
|
-
A connected server will list 30 tools (v0.6.7+). If it doesn't respond, check:
|
|
189
|
-
|
|
190
|
-
1. `npx @adia-ai/a2ui-mcp` runs without error in a terminal
|
|
191
|
-
2. API key environment variable is set and exported
|
|
192
|
-
3. The config file is valid JSON (no trailing commas)
|
|
193
|
-
4. Claude Desktop / Cursor / Windsurf was fully restarted after editing config
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
### 5. Core tools for UI generation
|
|
198
|
-
|
|
199
|
-
| Tool | What it does | When to use |
|
|
200
|
-
|---|---|---|
|
|
201
|
-
| `generate_ui` | Intent → A2UI messages + HTML | Primary generation tool |
|
|
202
|
-
| `lookup_component` | Look up a component's API by name | Before composing to verify props/slots |
|
|
203
|
-
| `get_component_map` | Full catalog of all 96 components | Discover what exists |
|
|
204
|
-
| `search_chunks` | Search the pre-authored chunk corpus | Find patterns matching an intent |
|
|
205
|
-
| `validate_schema` | Validate A2UI JSON against the schema | After generating, before rendering |
|
|
206
|
-
| `check_anti_patterns` | Scan rendered HTML for anti-patterns | Quality gate |
|
|
207
|
-
| `convert_html` | Convert existing HTML to A2UI JSON | Migrating existing markup |
|
|
208
|
-
| `classify_intent` | Detect the UI domain from a prompt | Debugging generation routing |
|
|
209
|
-
|
|
210
|
-
**New in v0.6.7:**
|
|
211
|
-
|
|
212
|
-
| Tool | What it does | When to use |
|
|
213
|
-
|---|---|---|
|
|
214
|
-
| `list_patterns` | Enumerate the corpus with optional `domain`/`category` filter | Browse, not search |
|
|
215
|
-
| `refine_ui` | Re-run monolithic generation with validation errors fed back to the LLM | After `validate_schema` fails |
|
|
216
|
-
| `server_status` | Report transport + sampling + corpus stats + version | Health check / observability |
|
|
217
|
-
|
|
218
|
-
**`generate_ui` parameters:**
|
|
219
|
-
|
|
220
|
-
```json
|
|
221
|
-
{
|
|
222
|
-
"intent": "A login page with email and password",
|
|
223
|
-
"engine": "monolithic",
|
|
224
|
-
"mode": "pro",
|
|
225
|
-
"sessionId": "optional — for multi-turn zettel refinement"
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
- `engine`: `"monolithic"` (default, pattern-match + LLM adapt) or `"zettel"` (fragment-graph composer)
|
|
230
|
-
- `mode`: `"pro"` (default, LLM + pattern), `"thinking"` (deep LLM), `"instant"` (fast pattern-only, no LLM)
|
|
231
|
-
- `sessionId`: pass the same ID across calls to mutate a prior canvas (zettel multi-turn only)
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
### 6. Gotchas
|
|
236
|
-
|
|
237
|
-
- **Corpus load is noisy.** The zettel engine prints corpus stats to
|
|
238
|
-
stderr on first invocation. Some MCP clients surface this as a warning;
|
|
239
|
-
it's normal.
|
|
240
|
-
- **Keys must be set before server start.** Changing env vars after
|
|
241
|
-
startup doesn't hot-reload — restart the server.
|
|
242
|
-
- **Multi-turn state is in-memory.** Restarting the server drops all
|
|
243
|
-
`sessionId` chains. Pass `currentCanvas` on resume if you need
|
|
244
|
-
continuity across restarts.
|
|
245
|
-
- **Score < 70 is still returned.** `generate_ui` doesn't auto-retry.
|
|
246
|
-
Check the `passed` boolean or `score` field in the response and
|
|
247
|
-
call `validate_schema` + `check_anti_patterns` to triage failures.
|
|
248
|
-
- **`adiaui-mcp` binary requires Node 22+.** The server uses
|
|
249
|
-
`import.meta.glob` and top-level await. Verify with `node --version`.
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### 7. Using the MCP tools inside a coding agent (Claude Code, Cursor, Hermes)
|
|
254
|
-
|
|
255
|
-
**The short answer:** register the local `server.js` once in your agent's
|
|
256
|
-
MCP config. Most tools work with zero API keys. Only `generate_ui` in
|
|
257
|
-
`pro` or `thinking` mode needs one — `instant` mode and all discovery/
|
|
258
|
-
validation tools work immediately with nothing.
|
|
259
|
-
|
|
260
|
-
#### Step 1 — Register the server (one-time, no npm install)
|
|
261
|
-
|
|
262
|
-
Add to `.claude/settings.json` (Claude Code), `.cursor/mcp.json`
|
|
263
|
-
(Cursor), or your host's equivalent:
|
|
264
|
-
|
|
265
|
-
```json
|
|
266
|
-
{
|
|
267
|
-
"mcpServers": {
|
|
268
|
-
"adia-ui": {
|
|
269
|
-
"command": "node",
|
|
270
|
-
"args": ["packages/a2ui/mcp/server.js"]
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
Restart the agent after saving. The server starts on demand — no
|
|
277
|
-
background process to manage.
|
|
278
|
-
|
|
279
|
-
#### Step 2 — Verify (ask the agent)
|
|
280
|
-
|
|
281
|
-
> "List the available AdiaUI MCP tools."
|
|
282
|
-
|
|
283
|
-
You should see 30 tools (v0.6.7+). If not, run `node packages/a2ui/mcp/server.js`
|
|
284
|
-
in a terminal and check for startup errors.
|
|
285
|
-
|
|
286
|
-
#### Step 3 — Use the tools natively
|
|
287
|
-
|
|
288
|
-
The agent calls these directly as tool invocations — no curl, no HTTP,
|
|
289
|
-
no scripts. The same way it calls any other MCP tool.
|
|
290
|
-
|
|
291
|
-
**All of these work with zero API keys:**
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
lookup_component("table-ui")
|
|
295
|
-
→ full prop/slot/event API from the yaml
|
|
296
|
-
|
|
297
|
-
get_component_map()
|
|
298
|
-
→ complete 95-component catalog
|
|
299
|
-
|
|
300
|
-
search_chunks("login form email password")
|
|
301
|
-
→ pre-authored chunk patterns matching the intent
|
|
302
|
-
|
|
303
|
-
validate_schema(messages)
|
|
304
|
-
→ { passed: true, score: 91, violations: [] }
|
|
305
|
-
|
|
306
|
-
check_anti_patterns(html)
|
|
307
|
-
→ [] (clean) or [{ rule, location, fix }]
|
|
308
|
-
|
|
309
|
-
convert_html(html)
|
|
310
|
-
→ A2UI JSON equivalent of existing markup
|
|
311
|
-
|
|
312
|
-
classify_intent("settings page with billing section")
|
|
313
|
-
→ { domain: "settings", confidence: 0.94 }
|
|
314
|
-
|
|
315
|
-
get_traits("button-ui")
|
|
316
|
-
→ pressable, focusable, ...
|
|
317
|
-
|
|
318
|
-
get_wiring_catalog()
|
|
319
|
-
→ available controller + handler bindings
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
**`generate_ui` with `mode: "instant"` — also zero API keys:**
|
|
323
|
-
|
|
324
|
-
```
|
|
325
|
-
generate_ui(intent: "login form with email and password", mode: "instant")
|
|
326
|
-
→ A2UI JSON + HTML from 96+ corpus pattern match
|
|
327
|
-
→ < 200ms, deterministic, no tokens spent
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
Use `instant` for scaffolding and exploration. Good enough for most
|
|
331
|
-
structural questions; lower quality than LLM modes on novel intents.
|
|
332
|
-
|
|
333
|
-
**`generate_ui` with `mode: "pro"` or `"thinking"` — currently needs its own key**
|
|
334
|
-
|
|
335
|
-
> **stdio mode (local IDE):** `generate_ui` uses the host's LLM automatically
|
|
336
|
-
> via MCP `sampling/createMessage` — no API key needed. The server sends
|
|
337
|
-
> messages to Claude Code / Cursor / Hermes and they run inference with
|
|
338
|
-
> their own model and return the result. Same model, same token budget,
|
|
339
|
-
> zero credentials to manage.
|
|
340
|
-
>
|
|
341
|
-
> **HTTP mode (deployed service):** no sampling-capable host is present,
|
|
342
|
-
> so API keys in `.env` are required. Add at least one:
|
|
343
|
-
|
|
344
|
-
```bash
|
|
345
|
-
ANTHROPIC_API_KEY=sk-ant-… # auto-detected first
|
|
346
|
-
OPENAI_API_KEY=sk-… # fallback
|
|
347
|
-
GEMINI_API_KEY=AIza… # fallback
|
|
348
|
-
LLM_PROVIDER=anthropic # optional — pin provider explicitly
|
|
349
|
-
LLM_MODEL=claude-haiku-4-5-20251001 # optional — pin model
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
The server reads `.env` at startup. If no key is found, `pro` mode
|
|
353
|
-
silently falls back to `instant`.
|
|
354
|
-
|
|
355
|
-
#### How an agent uses these in practice
|
|
356
|
-
|
|
357
|
-
```
|
|
358
|
-
User: "Build an admin claims UI."
|
|
359
|
-
|
|
360
|
-
Agent calls:
|
|
361
|
-
1. search_chunks("claims management admin table")
|
|
362
|
-
→ finds: claims-list-table, claim-status-badge, claim-detail-drawer
|
|
363
|
-
|
|
364
|
-
2. lookup_component("table-ui")
|
|
365
|
-
→ confirms: .columns and .data set via JS, always pair with table-toolbar-ui
|
|
366
|
-
|
|
367
|
-
3. generate_ui("claims list with status filter and detail drawer", mode: "instant")
|
|
368
|
-
→ scaffold HTML + A2UI JSON
|
|
369
|
-
|
|
370
|
-
4. validate_schema(result.messages)
|
|
371
|
-
→ { passed: true, score: 88 }
|
|
372
|
-
|
|
373
|
-
5. check_anti_patterns(result.html)
|
|
374
|
-
→ [] — no violations
|
|
375
|
-
|
|
376
|
-
Agent writes the output files.
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
No manual HTTP calls. No curl. The agent just uses the tools.
|
|
380
|
-
|
|
381
|
-
#### If MCP registration isn't possible — HTTP fallback
|
|
382
|
-
|
|
383
|
-
If your agent can make HTTP requests but can't use MCP tools directly:
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
npm run proxy # starts packages/llm/server.js on :3456
|
|
387
|
-
|
|
388
|
-
curl -X POST http://localhost:3456/api/generate \
|
|
389
|
-
-H "Content-Type: application/json" \
|
|
390
|
-
-d '{ "intent": "login form", "mode": "instant" }'
|
|
391
|
-
# → { messages: [...], validation: { score, passed }, elapsedMs }
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
#### Quick-reference — what needs what
|
|
395
|
-
|
|
396
|
-
| | Needs API key? | Needs server? |
|
|
397
|
-
|---|---|---|
|
|
398
|
-
| `lookup_component`, `get_component_map`, `search_chunks`, `validate_schema`, `check_anti_patterns`, `convert_html`, `classify_intent`, `get_traits`, `get_wiring_catalog` | No | Yes — `node packages/a2ui/mcp/server.js` |
|
|
399
|
-
| `generate_ui mode: instant` | No | Yes — same |
|
|
400
|
-
| `generate_ui mode: pro` / `thinking` | stdio: No (uses host LLM via sampling). HTTP: Yes — `.env` | Yes — same |
|
|
401
|
-
| Via npm package / Claude Desktop | Yes — `env:` in config | No — `npx` starts it |
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: migration
|
|
3
|
-
load-when: Migrating existing code: @agent-ui-kit to @adia-ai/* namespace rename, v0.4.x retired ADR-0024 shapes, between @adia-ai/* versions
|
|
4
|
-
load-size-tokens: ~1,500
|
|
5
|
-
required-for:
|
|
6
|
-
- version upgrades
|
|
7
|
-
- namespace migrations
|
|
8
|
-
- retired-shape sweeps
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# §Migration — Bringing existing code current
|
|
12
|
-
|
|
13
|
-
If you're inheriting a codebase that pre-dates the current
|
|
14
|
-
`@adia-ai/*@^0.6.0` lockstep, **migrate before adding features.** Don't
|
|
15
|
-
mix new component vocabulary into a tree that still has retired legacy
|
|
16
|
-
shapes — you'll re-rewrite later, the legacy shapes don't render, and
|
|
17
|
-
sweep tools can't tell the new code apart from author error.
|
|
18
|
-
|
|
19
|
-
### Canonical sources (do not duplicate — route to these)
|
|
20
|
-
|
|
21
|
-
This section is a **routing layer**. The mechanics live elsewhere:
|
|
22
|
-
|
|
23
|
-
| Source | What it gives you |
|
|
24
|
-
| ------------------------------------------------------ | ----------------------------------------------------------------------------------- |
|
|
25
|
-
| `.claude/docs/MIGRATION GUIDE.md` (note the space in the path) | Version-by-version BREAKING items, code diffs, search-and-replace recipes |
|
|
26
|
-
| `adia-ui-migration` skill (in `.agents/skills/`) | Mechanical sweep automation — grep audits, perl rewrites, verification gate calls |
|
|
27
|
-
| `.brain/adrs/0024-legacy-shell-shapes-retired.md` | The contract decision retiring legacy shell shapes in `0.4.0` (rationale + scope) |
|
|
28
|
-
| Per-package CHANGELOGs | Patch-level detail not in the consolidated guide |
|
|
29
|
-
|
|
30
|
-
**LLM directive:** When the user asks "migrate from X to Y" / "upgrade to
|
|
31
|
-
v0.Y.Z" / "what changed in v0.Y" / "we're on @agent-ui-kit and want to
|
|
32
|
-
move", **do not paste migration commands inline from memory.** Read
|
|
33
|
-
`.claude/docs/MIGRATION GUIDE.md` for the target version section, then invoke the
|
|
34
|
-
`adia-ui-migration` skill for the mechanical sweep. This skill names the
|
|
35
|
-
breaking-change surface (so the user knows what they're in for); it does
|
|
36
|
-
not own the sweep recipes.
|
|
37
|
-
|
|
38
|
-
### Migration surface (what you're in for, by source)
|
|
39
|
-
|
|
40
|
-
**From `@agent-ui-kit/*` (predecessor namespace):**
|
|
41
|
-
|
|
42
|
-
- Package rename: `@agent-ui-kit/web-components` → `@adia-ai/*`
|
|
43
|
-
9-package monorepo (`web-components`, `web-modules`, `llm`,
|
|
44
|
-
`a2ui-runtime`, `a2ui-compose`, `a2ui-corpus`, `a2ui-mcp`,
|
|
45
|
-
`a2ui-retrieval`, `a2ui-validator` — all in lockstep at `^0.6.0`).
|
|
46
|
-
- Base class: `AgentElement` / `AdiaElement` → `UIElement`.
|
|
47
|
-
- Design tokens: `--agent-*` → `--a-*` prefix.
|
|
48
|
-
- CSS import path: `@agent-ui-kit/web-components/dist/agent-ui.css` →
|
|
49
|
-
`@adia-ai/web-components/css`.
|
|
50
|
-
- Trait subpath: `@agent-ui-kit/web-components/traits` → registered
|
|
51
|
-
automatically via the barrel import (no separate import needed).
|
|
52
|
-
|
|
53
|
-
**From older `@adia-ai/*` versions — the two largest breaks:**
|
|
54
|
-
|
|
55
|
-
- **`0.0.20`** — Safari floor raise, deprecated alias removal (`variant="danger"`
|
|
56
|
-
was `variant="error"`), Phase 6 contract decisions. Most comprehensive
|
|
57
|
-
break in the `0.0.x` line.
|
|
58
|
-
- **`0.4.0`** — Legacy shell authoring shapes RETIRED across all 3 shell
|
|
59
|
-
hosts (admin / chat / editor). Consumers MUST use the bespoke
|
|
60
|
-
`<admin-shell>` / `<chat-shell>` / `<editor-shell>` vocabulary
|
|
61
|
-
established by ADR-0023 in `0.3.4`–`0.3.6`. Closes the ADR-0023 arc;
|
|
62
|
-
per ADR-0024.
|
|
63
|
-
|
|
64
|
-
**Smaller version-cut breaks (`0.6.x` line):**
|
|
65
|
-
|
|
66
|
-
- `0.6.0` — `stat-ui.{js,css}` filename rename to `stat.{js,css}`
|
|
67
|
-
(deep-importers only).
|
|
68
|
-
- `0.6.1` — `<link-ui>` token rename `--link-color-*` → `--link-fg-*`.
|
|
69
|
-
|
|
70
|
-
**Breaks on the `0.7.x` line:**
|
|
71
|
-
|
|
72
|
-
- `0.7.12` — **token-theme attribute renamed `data-theme` → `theme`** (BREAKING,
|
|
73
|
-
pre-1.0 PATCH cadence). `<html data-theme="ocean">` → `<html theme="ocean">`;
|
|
74
|
-
`[data-theme="…"]` selectors → `[theme="…"]`. Compound attrs (`data-theme-slug`,
|
|
75
|
-
`data-themed`, …) are untouched — sweep `data-theme` on a **word boundary**.
|
|
76
|
-
Converges with `<canvas-ui theme="…">` and the new `<theme-provider theme="…">`.
|
|
77
|
-
|
|
78
|
-
**Additive cuts that need no migration** (drop-in upgrades):
|
|
79
|
-
`0.0.5`–`0.0.11`, `0.0.12`–`0.0.19`, `0.0.21`, `0.3.0`–`0.3.6`,
|
|
80
|
-
`0.5.0`–`0.5.21`, `0.6.2`–`0.6.7`. See the version table at the top of
|
|
81
|
-
`MIGRATION GUIDE.md` for the full per-version classification.
|
|
82
|
-
|
|
83
|
-
### Workflow (when the user invokes migration)
|
|
84
|
-
|
|
85
|
-
1. **Identify source and target versions.** Ask if not obvious:
|
|
86
|
-
"What version is the codebase on? (Check `package.json` for
|
|
87
|
-
`@adia-ai/*` or `@agent-ui-kit/*` ranges.) What target version do you
|
|
88
|
-
want?"
|
|
89
|
-
2. **Read `.claude/docs/MIGRATION GUIDE.md`** for the target version section
|
|
90
|
-
(or merged span if the consumer is jumping multiple versions).
|
|
91
|
-
Re-state the breaking surface in your own words so the user can
|
|
92
|
-
confirm scope.
|
|
93
|
-
3. **Hand off to the `adia-ui-migration` skill** for the mechanical
|
|
94
|
-
sweep. That skill owns the grep audits, perl rewrites, and the
|
|
95
|
-
post-sweep verification gate. Don't re-implement it here.
|
|
96
|
-
4. **Verify in your app** — re-render the migrated screens and confirm they
|
|
97
|
-
mount + behave (a browser smoke against your dev server, or a manual pass).
|
|
98
|
-
Migration isn't done until *your* app renders clean. (`components.mjs
|
|
99
|
-
--verify` / `verify:traits` are the framework's *producer* gates — not
|
|
100
|
-
consumer commands.)
|
|
101
|
-
5. **Then proceed to §0** for new feature work on the now-current tree.
|
|
102
|
-
|
|
103
|
-
### Anti-patterns
|
|
104
|
-
|
|
105
|
-
- ❌ Pasting migration commands from memory without reading the guide
|
|
106
|
-
(versions drift; the guide is the source of truth).
|
|
107
|
-
- ❌ Adding new feature work to a codebase that still has retired legacy
|
|
108
|
-
shell shapes — the new code mixes with broken old code, sweep tools
|
|
109
|
-
can't tell them apart, and you'll re-rewrite later.
|
|
110
|
-
- ❌ Mixing source versions in `package.json` (`@adia-ai/web-components@^0.5.0`
|
|
111
|
-
+ `@adia-ai/web-modules@^0.6.0`) — the 9-package lockstep is normative,
|
|
112
|
-
cross-major drift breaks A2UI surface contracts.
|
|
113
|
-
- ❌ Skipping the verification gate and shipping. The gate catches
|
|
114
|
-
half-applied sweeps (e.g. CSS migrated but markup not, or vice versa).
|
|
115
|
-
|
|
116
|
-
---
|