@sky.ui/mcp 0.0.1 → 0.0.2
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/README.md +191 -182
- package/data/chart-api-sections.json +4184 -4184
- package/data/reactivity-readme-snapshot.json +1 -1
- package/data/theme-authoring-contract.json +598 -598
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +40 -29
- package/dist/catalog.js.map +1 -1
- package/dist/cem.d.ts +1 -1
- package/dist/cem.d.ts.map +1 -1
- package/dist/cem.js +5 -11
- package/dist/cem.js.map +1 -1
- package/dist/docs-read.js +6 -6
- package/dist/docs.js +4 -4
- package/dist/framework-wrappers.d.ts.map +1 -1
- package/dist/framework-wrappers.js +4 -8
- package/dist/framework-wrappers.js.map +1 -1
- package/dist/mcp-runtime-status.js +2 -2
- package/dist/package-resolve.d.ts +10 -0
- package/dist/package-resolve.d.ts.map +1 -0
- package/dist/package-resolve.js +87 -0
- package/dist/package-resolve.js.map +1 -0
- package/dist/reactivity-info.d.ts.map +1 -1
- package/dist/reactivity-info.js +4 -11
- package/dist/reactivity-info.js.map +1 -1
- package/dist/server.js +4 -4
- package/dist/source-read.d.ts.map +1 -1
- package/dist/source-read.js +6 -10
- package/dist/source-read.js.map +1 -1
- package/dist/utils-suggestion-grounding.d.ts.map +1 -1
- package/dist/utils-suggestion-grounding.js +4 -11
- package/dist/utils-suggestion-grounding.js.map +1 -1
- package/docs/agent-recipe-example-site.md +91 -91
- package/docs/ai-design-mcp-blueprint.md +75 -75
- package/docs/cross-model-mcp-playbook.md +127 -127
- package/docs/example-site-and-mcp-training.md +82 -82
- package/docs/mcp-capability-status.md +51 -51
- package/docs/mcp-tooling-roadmap.md +36 -36
- package/docs/sky-chart-option-api.md +47 -47
- package/docs/starter-prompt.md +17 -17
- package/docs/theme-config-guide.md +178 -178
- package/docs/utils-usage-guide.md +112 -110
- package/docs/vue-wrapper-v-model.md +36 -36
- package/package.json +72 -63
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
# Cross-model MCP playbook (Sky UI)
|
|
2
|
-
|
|
3
|
-
**Purpose:** Run Sky UI MCP across LLMs with **fewer tokens**, **predictable tool use**, and **verifiable** correctness. Fill the tables as you validate each vendor.
|
|
4
|
-
|
|
5
|
-
**Reality check:** No assistant + MCP stack can guarantee **literal 100% accuracy for every framework and coding case**—models hallucinate, tools can return partial data (missing CEM, offline packages), and user code differs. Treat **“accuracy”** as **(a)** deterministic outputs for the same tool + inputs, **(b)** schema-valid shipped JSON, **(c)** golden tests on critical paths, **(d)** explicit fallbacks when data is missing.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 1. One-block router (paste once per session; keep short)
|
|
10
|
-
|
|
11
|
-
Use this verbatim or trim per model token limits. The same text ships as **`packages/mcp/docs/starter-prompt.md`**.
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
You MUST use Sky UI MCP tools as the only source for component names, imports, props, events, slots, and theme tokens. Do not invent tags or --sky-* names.
|
|
15
|
-
|
|
16
|
-
Styling priority (pages, layouts, shells): Prefer @sky.ui/utils utility classes on elements (`class` / `className`) for layout, spacing, typography, and colors. Use get_docs `packages/mcp/docs/utils-usage-guide.md` for setup; utility_classes (variant_prefixes, search_classes, check_class) for class names; get_theme (operation guide, then fields/field) for userTheme. Do NOT default to large hand-written plain CSS or unrelated CSS frameworks unless the user asks or a case truly cannot be expressed with utilities.
|
|
17
|
-
|
|
18
|
-
Order: (1) get_project_guide (kind installation | setup) (2) get_sky_component_docs with optional surface (3) get_component_usage for lit/react/vue (4) get_reactivity_layer for @sky.ui/reactivity (5) get_chart_usage for sky-chart (6) theme: get_theme operation guide → match_intent/fields/field/compose (7) layout/styling: utility_classes + utils-usage-guide via get_docs.
|
|
19
|
-
|
|
20
|
-
JSON payloads include `_skyUiMcp.truthLayer` and `agentMust`: obey them — confirm API facts with get_sky_component_docs.
|
|
21
|
-
|
|
22
|
-
If a tool returns code starting with JSON parse errors or empty arrays, say what is missing (e.g. install or build @sky.ui/core for `custom-elements.json`) and retry after suggesting the user fix the environment.
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 2. Low-token rules (tool choice)
|
|
28
|
-
|
|
29
|
-
| Goal | Prefer | Avoid |
|
|
30
|
-
|------|--------|--------|
|
|
31
|
-
| Single prop/event/slot/method slice | `get_sky_component_docs` + `surface` | Full docs when you only need one slice |
|
|
32
|
-
| Multiple components | `get_sky_component_docs` + `names[]` | Many sequential single-name calls |
|
|
33
|
-
| Theme JSON from user goals | `get_theme` `match_intent` → `compose` or `field` | Guessing ThemeConfig paths |
|
|
34
|
-
| Token names list | `get_theme` `variables` | Guessing `--sky-*` |
|
|
35
|
-
| Bundler wiring | `get_project_guide` (`kind: setup`) | Copying generic Vite docs from memory |
|
|
36
|
-
| React/Vue usage | `get_component_usage` | Hand-written wrappers from memory |
|
|
37
|
-
| Charts | `get_chart_usage` + `get_sky_component_docs` (`sky-chart`) | Inventing option keys |
|
|
38
|
-
| Page/layout styling | `utility_classes` + utils-usage-guide | Big ad-hoc CSS unless user opts out |
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## 3. Framework fast paths (minimal sequence)
|
|
43
|
-
|
|
44
|
-
### Lit (native web components)
|
|
45
|
-
|
|
46
|
-
| Step | Tool | Notes |
|
|
47
|
-
|------|------|-------|
|
|
48
|
-
| 1 | `get_project_guide` (`kind: installation`, `lit` or `vanilla`) | |
|
|
49
|
-
| 2 | `get_project_guide` (`kind: setup`, bundler param) | |
|
|
50
|
-
| 3 | `get_component_usage` (`lit`, component name) | |
|
|
51
|
-
| 4 | Split API: `get_sky_component_docs` + `surface` as needed | |
|
|
52
|
-
|
|
53
|
-
### React (`@sky.ui/react`)
|
|
54
|
-
|
|
55
|
-
| Step | Tool | Notes |
|
|
56
|
-
|------|------|-------|
|
|
57
|
-
| 1 | `get_project_guide` (`kind: installation`, `react`) | |
|
|
58
|
-
| 2 | `get_component_usage` (`react`) | |
|
|
59
|
-
| 3 | Split docs from core component name | |
|
|
60
|
-
|
|
61
|
-
### Vue (`@sky.ui/vue`)
|
|
62
|
-
|
|
63
|
-
| Step | Tool | Notes |
|
|
64
|
-
|------|------|-------|
|
|
65
|
-
| 1 | `get_project_guide` (`kind: installation`, `vue`) | |
|
|
66
|
-
| 2 | `get_component_usage` (`vue`) | |
|
|
67
|
-
| 3 | Split docs | |
|
|
68
|
-
|
|
69
|
-
### `@sky.ui/reactivity` only
|
|
70
|
-
|
|
71
|
-
| Step | Tool | Notes |
|
|
72
|
-
|------|------|-------|
|
|
73
|
-
| 1 | `get_reactivity_layer` (`operation: list_topics`) | |
|
|
74
|
-
| 2 | `get_reactivity_layer` (`get_topic`) | |
|
|
75
|
-
| 3 | Optional `get_docs` allowlisted README slice | |
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## 4. Accuracy guarantees you can enforce
|
|
80
|
-
|
|
81
|
-
| Mechanism | What it proves | Owner action |
|
|
82
|
-
|-----------|----------------|--------------|
|
|
83
|
-
| **Golden tests** | Same tool input → same JSON shape | `test/mcp/run-mcp-test.mjs`, `contract-golden.mjs` |
|
|
84
|
-
| **CEM present** (`npm run build:
|
|
85
|
-
| **`sky-ui://catalog/tools` resource** | Discover tool names | Kept in sync via `verify-mcp-tool-parity.mjs` |
|
|
86
|
-
| **Theme authoring contract** | Stable ThemeConfig paths + hooks | `get_theme` operations + `theme-authoring-contract.json` |
|
|
87
|
-
| **Tool errors (`isError: true`)** | `{ code, error, ...extras }` | `McpErrorCode` in `mcp-tool-errors.ts` |
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## 5. Known systemic gaps
|
|
92
|
-
|
|
93
|
-
| Gap | Symptom | Mitigation |
|
|
94
|
-
|-----|---------|------------|
|
|
95
|
-
| POST allowlist drift | 403 on valid tools | Build runs `verify-mcp-tool-parity.mjs` |
|
|
96
|
-
| Huge responses | Context blow-up | Use `surface`, limits, pagination |
|
|
97
|
-
| Offline / no CEM | AST-only or CEM-only docs | Build core; run from monorepo with source |
|
|
98
|
-
| Utils not installed | `utility_classes` uses snapshot | Shipped `utils-suggestion-snapshot.json` at MCP build |
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## 6. Model evaluation matrix (your team fills)
|
|
103
|
-
|
|
104
|
-
| Model / client | Stdio MCP | HTTP POST `/tool` | Notes |
|
|
105
|
-
|----------------|-----------|-------------------|-------|
|
|
106
|
-
| | ☐ | ☐ | |
|
|
107
|
-
|
|
108
|
-
**Smoke checklist per row:** `sky_components` (`list`, limit 5) → `get_sky_component_docs` (`surface: props`, `sky-button`) → `get_theme` (`operation: guide`) → `get_theme` (`match_intent`, phrase `brand color`) → `get_theme` (`variables`, `max_names` 50) → `utility_classes` (`check_class`, `p-4`).
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## 7. Improvement backlog
|
|
113
|
-
|
|
114
|
-
**Shipped (1.1.0):** Standard **9-tool** surface; `get_theme` guide/fields/field/match_intent/compose/variables; `get_reactivity_layer`; `get_chart_usage`; `utility_classes` snapshot fallback; docs aligned to new surface.
|
|
115
|
-
|
|
116
|
-
1. Expand golden tests as tools evolve.
|
|
117
|
-
2. Optional: richer component discovery heuristics without re-exposing removed guideline tools.
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 8. How to fetch this file via MCP
|
|
122
|
-
|
|
123
|
-
1. **`get_docs`** with path **`packages/mcp/docs/cross-model-mcp-playbook.md`**
|
|
124
|
-
2. Short session prompt: **`packages/mcp/docs/starter-prompt.md`**
|
|
125
|
-
3. **`crossModelPlaybookPath`** from **`get_theme`** `variables` response → **`get_docs`**
|
|
126
|
-
|
|
127
|
-
*Last updated: 2026-06 — 9-tool standard surface.*
|
|
1
|
+
# Cross-model MCP playbook (Sky UI)
|
|
2
|
+
|
|
3
|
+
**Purpose:** Run Sky UI MCP across LLMs with **fewer tokens**, **predictable tool use**, and **verifiable** correctness. Fill the tables as you validate each vendor.
|
|
4
|
+
|
|
5
|
+
**Reality check:** No assistant + MCP stack can guarantee **literal 100% accuracy for every framework and coding case**—models hallucinate, tools can return partial data (missing CEM, offline packages), and user code differs. Treat **“accuracy”** as **(a)** deterministic outputs for the same tool + inputs, **(b)** schema-valid shipped JSON, **(c)** golden tests on critical paths, **(d)** explicit fallbacks when data is missing.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. One-block router (paste once per session; keep short)
|
|
10
|
+
|
|
11
|
+
Use this verbatim or trim per model token limits. The same text ships as **`packages/mcp/docs/starter-prompt.md`**.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
You MUST use Sky UI MCP tools as the only source for component names, imports, props, events, slots, and theme tokens. Do not invent tags or --sky-* names.
|
|
15
|
+
|
|
16
|
+
Styling priority (pages, layouts, shells): Prefer @sky.ui/utils utility classes on elements (`class` / `className`) for layout, spacing, typography, and colors. Use get_docs `packages/mcp/docs/utils-usage-guide.md` for setup; utility_classes (variant_prefixes, search_classes, check_class) for class names; get_theme (operation guide, then fields/field) for userTheme. Do NOT default to large hand-written plain CSS or unrelated CSS frameworks unless the user asks or a case truly cannot be expressed with utilities.
|
|
17
|
+
|
|
18
|
+
Order: (1) get_project_guide (kind installation | setup) (2) get_sky_component_docs with optional surface (3) get_component_usage for lit/react/vue (4) get_reactivity_layer for @sky.ui/reactivity (5) get_chart_usage for sky-chart (6) theme: get_theme operation guide → match_intent/fields/field/compose (7) layout/styling: utility_classes + utils-usage-guide via get_docs.
|
|
19
|
+
|
|
20
|
+
JSON payloads include `_skyUiMcp.truthLayer` and `agentMust`: obey them — confirm API facts with get_sky_component_docs.
|
|
21
|
+
|
|
22
|
+
If a tool returns code starting with JSON parse errors or empty arrays, say what is missing (e.g. install or build @sky.ui/core for `custom-elements.json`) and retry after suggesting the user fix the environment.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Low-token rules (tool choice)
|
|
28
|
+
|
|
29
|
+
| Goal | Prefer | Avoid |
|
|
30
|
+
|------|--------|--------|
|
|
31
|
+
| Single prop/event/slot/method slice | `get_sky_component_docs` + `surface` | Full docs when you only need one slice |
|
|
32
|
+
| Multiple components | `get_sky_component_docs` + `names[]` | Many sequential single-name calls |
|
|
33
|
+
| Theme JSON from user goals | `get_theme` `match_intent` → `compose` or `field` | Guessing ThemeConfig paths |
|
|
34
|
+
| Token names list | `get_theme` `variables` | Guessing `--sky-*` |
|
|
35
|
+
| Bundler wiring | `get_project_guide` (`kind: setup`) | Copying generic Vite docs from memory |
|
|
36
|
+
| React/Vue usage | `get_component_usage` | Hand-written wrappers from memory |
|
|
37
|
+
| Charts | `get_chart_usage` + `get_sky_component_docs` (`sky-chart`) | Inventing option keys |
|
|
38
|
+
| Page/layout styling | `utility_classes` + utils-usage-guide | Big ad-hoc CSS unless user opts out |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 3. Framework fast paths (minimal sequence)
|
|
43
|
+
|
|
44
|
+
### Lit (native web components)
|
|
45
|
+
|
|
46
|
+
| Step | Tool | Notes |
|
|
47
|
+
|------|------|-------|
|
|
48
|
+
| 1 | `get_project_guide` (`kind: installation`, `lit` or `vanilla`) | |
|
|
49
|
+
| 2 | `get_project_guide` (`kind: setup`, bundler param) | |
|
|
50
|
+
| 3 | `get_component_usage` (`lit`, component name) | |
|
|
51
|
+
| 4 | Split API: `get_sky_component_docs` + `surface` as needed | |
|
|
52
|
+
|
|
53
|
+
### React (`@sky.ui/react`)
|
|
54
|
+
|
|
55
|
+
| Step | Tool | Notes |
|
|
56
|
+
|------|------|-------|
|
|
57
|
+
| 1 | `get_project_guide` (`kind: installation`, `react`) | |
|
|
58
|
+
| 2 | `get_component_usage` (`react`) | |
|
|
59
|
+
| 3 | Split docs from core component name | |
|
|
60
|
+
|
|
61
|
+
### Vue (`@sky.ui/vue`)
|
|
62
|
+
|
|
63
|
+
| Step | Tool | Notes |
|
|
64
|
+
|------|------|-------|
|
|
65
|
+
| 1 | `get_project_guide` (`kind: installation`, `vue`) | |
|
|
66
|
+
| 2 | `get_component_usage` (`vue`) | |
|
|
67
|
+
| 3 | Split docs | |
|
|
68
|
+
|
|
69
|
+
### `@sky.ui/reactivity` only
|
|
70
|
+
|
|
71
|
+
| Step | Tool | Notes |
|
|
72
|
+
|------|------|-------|
|
|
73
|
+
| 1 | `get_reactivity_layer` (`operation: list_topics`) | |
|
|
74
|
+
| 2 | `get_reactivity_layer` (`get_topic`) | |
|
|
75
|
+
| 3 | Optional `get_docs` allowlisted README slice | |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 4. Accuracy guarantees you can enforce
|
|
80
|
+
|
|
81
|
+
| Mechanism | What it proves | Owner action |
|
|
82
|
+
|-----------|----------------|--------------|
|
|
83
|
+
| **Golden tests** | Same tool input → same JSON shape | `test/mcp/run-mcp-test.mjs`, `contract-golden.mjs` |
|
|
84
|
+
| **CEM present** (`npm run build:core`) | Manifest supplements AST docs | Document in onboarding |
|
|
85
|
+
| **`sky-ui://catalog/tools` resource** | Discover tool names | Kept in sync via `verify-mcp-tool-parity.mjs` |
|
|
86
|
+
| **Theme authoring contract** | Stable ThemeConfig paths + hooks | `get_theme` operations + `theme-authoring-contract.json` |
|
|
87
|
+
| **Tool errors (`isError: true`)** | `{ code, error, ...extras }` | `McpErrorCode` in `mcp-tool-errors.ts` |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 5. Known systemic gaps
|
|
92
|
+
|
|
93
|
+
| Gap | Symptom | Mitigation |
|
|
94
|
+
|-----|---------|------------|
|
|
95
|
+
| POST allowlist drift | 403 on valid tools | Build runs `verify-mcp-tool-parity.mjs` |
|
|
96
|
+
| Huge responses | Context blow-up | Use `surface`, limits, pagination |
|
|
97
|
+
| Offline / no CEM | AST-only or CEM-only docs | Build core; run from monorepo with source |
|
|
98
|
+
| Utils not installed | `utility_classes` uses snapshot | Shipped `utils-suggestion-snapshot.json` at MCP build |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 6. Model evaluation matrix (your team fills)
|
|
103
|
+
|
|
104
|
+
| Model / client | Stdio MCP | HTTP POST `/tool` | Notes |
|
|
105
|
+
|----------------|-----------|-------------------|-------|
|
|
106
|
+
| | ☐ | ☐ | |
|
|
107
|
+
|
|
108
|
+
**Smoke checklist per row:** `sky_components` (`list`, limit 5) → `get_sky_component_docs` (`surface: props`, `sky-button`) → `get_theme` (`operation: guide`) → `get_theme` (`match_intent`, phrase `brand color`) → `get_theme` (`variables`, `max_names` 50) → `utility_classes` (`check_class`, `p-4`).
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 7. Improvement backlog
|
|
113
|
+
|
|
114
|
+
**Shipped (1.1.0):** Standard **9-tool** surface; `get_theme` guide/fields/field/match_intent/compose/variables; `get_reactivity_layer`; `get_chart_usage`; `utility_classes` snapshot fallback; docs aligned to new surface.
|
|
115
|
+
|
|
116
|
+
1. Expand golden tests as tools evolve.
|
|
117
|
+
2. Optional: richer component discovery heuristics without re-exposing removed guideline tools.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 8. How to fetch this file via MCP
|
|
122
|
+
|
|
123
|
+
1. **`get_docs`** with path **`packages/mcp/docs/cross-model-mcp-playbook.md`**
|
|
124
|
+
2. Short session prompt: **`packages/mcp/docs/starter-prompt.md`**
|
|
125
|
+
3. **`crossModelPlaybookPath`** from **`get_theme`** `variables` response → **`get_docs`**
|
|
126
|
+
|
|
127
|
+
*Last updated: 2026-06 — 9-tool standard surface.*
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
# Example site (`sky-ui-example`) vs MCP
|
|
2
|
-
|
|
3
|
-
Use **two layers**:
|
|
4
|
-
|
|
5
|
-
1. **`get_sky_component_docs`** — canonical **component API** from `@sky.ui/core` (CEM/AST). Names, types, slots, events, methods.
|
|
6
|
-
2. **Example-site enrichment** (internal to the same tool) — bounded HTTPS reads of the published app under **`/api/mcp/`**, or offline **`exampleSiteEmbed`**. Multi-framework snippets (HTML / Sky / Vue / React) and **`sections[].ai`** construction skeletons aligned with `sky-codebox` pages.
|
|
7
|
-
|
|
8
|
-
Do not treat rendered SPA HTML as ground truth; use the MCP endpoints or repo snippets.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Deployed endpoints (sky-ui-example)
|
|
13
|
-
|
|
14
|
-
| Method | Path | Purpose |
|
|
15
|
-
|--------|------|---------|
|
|
16
|
-
| GET | `/api/mcp/manifest` | JSON manifest: component ids, titles, `docPath` links. |
|
|
17
|
-
| GET | `/api/mcp/component/{id}` | JSON payload (`schema` `sky-ui-example-mcp/component/5`): `pageAi` routing + `sections[].ai` blueprints. Registry: **`sky-ui-example/server/mcp/component-payload-registry.ts`**. |
|
|
18
|
-
| GET | `/api/mcp/component/{id}?format=markdown` | One markdown file (fenced code per framework). |
|
|
19
|
-
|
|
20
|
-
`{id}` is kebab-case (e.g. `accordion`). Unknown id → 404.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## How MCP consumes the example site
|
|
25
|
-
|
|
26
|
-
Example-site data is merged into **`get_sky_component_docs`** when configured (see **Environment** below).
|
|
27
|
-
|
|
28
|
-
When **`SKY_UI_EXAMPLE_SITE_BASE_URL`** is set (or the default `https://library.sky-ui.com` is used):
|
|
29
|
-
|
|
30
|
-
- **`get_sky_component_docs`** may merge live data from **`GET /api/mcp/component/{id}`** (same shapes as the table above).
|
|
31
|
-
- Responses may include **`_skyUiMcp.enrichmentNote`** with `truthLayer: external_optional` — treat as supplementary to CEM/AST.
|
|
32
|
-
|
|
33
|
-
When the URL is **unset and disabled** (`SKY_UI_EXAMPLE_SITE_DISABLE=1`):
|
|
34
|
-
|
|
35
|
-
- Optional **`exampleSiteEmbed`** in **`packages/mcp/data/design-guidelines/p0-guidelines.json`** (`manifest` and/or `components` map).
|
|
36
|
-
- Supports **`npx @sky.ui/mcp`** offline without a deployed site.
|
|
37
|
-
|
|
38
|
-
### Guards (HTTP enrichment)
|
|
39
|
-
|
|
40
|
-
- Only **GET**; URLs built as `/api/mcp/manifest` or `/api/mcp/component/...`.
|
|
41
|
-
- Host allowlist + path must start with `/api/mcp/`.
|
|
42
|
-
- Body size cap (~600 KB); timeout (~25 s).
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Required / optional env (MCP host)
|
|
47
|
-
|
|
48
|
-
| Variable | Required | Notes |
|
|
49
|
-
|----------|----------|-------|
|
|
50
|
-
| **`SKY_UI_EXAMPLE_SITE_BASE_URL`** | No | Origin only, no path. Defaults to `https://library.sky-ui.com` (HeroUI-style). Override for local dev: `http://localhost:3000` |
|
|
51
|
-
| **`SKY_UI_EXAMPLE_SITE_DISABLE`** | No | Set `1` to skip live site fetches (offline-only) |
|
|
52
|
-
| **`SKY_UI_EXAMPLE_SITE_EXTRA_HOSTS`** | No | Comma-separated extra hosts after redirects |
|
|
53
|
-
|
|
54
|
-
Example Cursor config:
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
{
|
|
58
|
-
"mcpServers": {
|
|
59
|
-
"sky-ui": {
|
|
60
|
-
"command": "node",
|
|
61
|
-
"args": ["packages/mcp/dist/mcp-stdio-entry.js"],
|
|
62
|
-
"env": {
|
|
63
|
-
"SKY_UI_EXAMPLE_SITE_BASE_URL": "https://library.sky-ui.com"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Agent recipe
|
|
73
|
-
|
|
74
|
-
**`packages/mcp/docs/agent-recipe-example-site.md`** — checklist for every registered `{id}` (minimal/full paths, adding new builders).
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Adding a component to the manifest
|
|
79
|
-
|
|
80
|
-
Step-by-step: **`sky-ui-example/docs/component-docs-mcp-pipeline.md`**.
|
|
81
|
-
|
|
82
|
-
In **`sky-ui-example`**: add **`server/mcp/builders/<id>.ts`**, register in **`component-payload-registry.ts`**, add **`app/frameworks/<id>.frameworks.ts`**, reuse the same **`frameworks`** arrays on the Vue page.
|
|
1
|
+
# Example site (`sky-ui-example`) vs MCP
|
|
2
|
+
|
|
3
|
+
Use **two layers**:
|
|
4
|
+
|
|
5
|
+
1. **`get_sky_component_docs`** — canonical **component API** from `@sky.ui/core` (CEM/AST). Names, types, slots, events, methods.
|
|
6
|
+
2. **Example-site enrichment** (internal to the same tool) — bounded HTTPS reads of the published app under **`/api/mcp/`**, or offline **`exampleSiteEmbed`**. Multi-framework snippets (HTML / Sky / Vue / React) and **`sections[].ai`** construction skeletons aligned with `sky-codebox` pages.
|
|
7
|
+
|
|
8
|
+
Do not treat rendered SPA HTML as ground truth; use the MCP endpoints or repo snippets.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Deployed endpoints (sky-ui-example)
|
|
13
|
+
|
|
14
|
+
| Method | Path | Purpose |
|
|
15
|
+
|--------|------|---------|
|
|
16
|
+
| GET | `/api/mcp/manifest` | JSON manifest: component ids, titles, `docPath` links. |
|
|
17
|
+
| GET | `/api/mcp/component/{id}` | JSON payload (`schema` `sky-ui-example-mcp/component/5`): `pageAi` routing + `sections[].ai` blueprints. Registry: **`sky-ui-example/server/mcp/component-payload-registry.ts`**. |
|
|
18
|
+
| GET | `/api/mcp/component/{id}?format=markdown` | One markdown file (fenced code per framework). |
|
|
19
|
+
|
|
20
|
+
`{id}` is kebab-case (e.g. `accordion`). Unknown id → 404.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## How MCP consumes the example site
|
|
25
|
+
|
|
26
|
+
Example-site data is merged into **`get_sky_component_docs`** when configured (see **Environment** below).
|
|
27
|
+
|
|
28
|
+
When **`SKY_UI_EXAMPLE_SITE_BASE_URL`** is set (or the default `https://library.sky-ui.com` is used):
|
|
29
|
+
|
|
30
|
+
- **`get_sky_component_docs`** may merge live data from **`GET /api/mcp/component/{id}`** (same shapes as the table above).
|
|
31
|
+
- Responses may include **`_skyUiMcp.enrichmentNote`** with `truthLayer: external_optional` — treat as supplementary to CEM/AST.
|
|
32
|
+
|
|
33
|
+
When the URL is **unset and disabled** (`SKY_UI_EXAMPLE_SITE_DISABLE=1`):
|
|
34
|
+
|
|
35
|
+
- Optional **`exampleSiteEmbed`** in **`packages/mcp/data/design-guidelines/p0-guidelines.json`** (`manifest` and/or `components` map).
|
|
36
|
+
- Supports **`npx @sky.ui/mcp`** offline without a deployed site.
|
|
37
|
+
|
|
38
|
+
### Guards (HTTP enrichment)
|
|
39
|
+
|
|
40
|
+
- Only **GET**; URLs built as `/api/mcp/manifest` or `/api/mcp/component/...`.
|
|
41
|
+
- Host allowlist + path must start with `/api/mcp/`.
|
|
42
|
+
- Body size cap (~600 KB); timeout (~25 s).
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Required / optional env (MCP host)
|
|
47
|
+
|
|
48
|
+
| Variable | Required | Notes |
|
|
49
|
+
|----------|----------|-------|
|
|
50
|
+
| **`SKY_UI_EXAMPLE_SITE_BASE_URL`** | No | Origin only, no path. Defaults to `https://library.sky-ui.com` (HeroUI-style). Override for local dev: `http://localhost:3000` |
|
|
51
|
+
| **`SKY_UI_EXAMPLE_SITE_DISABLE`** | No | Set `1` to skip live site fetches (offline-only) |
|
|
52
|
+
| **`SKY_UI_EXAMPLE_SITE_EXTRA_HOSTS`** | No | Comma-separated extra hosts after redirects |
|
|
53
|
+
|
|
54
|
+
Example Cursor config:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"sky-ui": {
|
|
60
|
+
"command": "node",
|
|
61
|
+
"args": ["packages/mcp/dist/mcp-stdio-entry.js"],
|
|
62
|
+
"env": {
|
|
63
|
+
"SKY_UI_EXAMPLE_SITE_BASE_URL": "https://library.sky-ui.com"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Agent recipe
|
|
73
|
+
|
|
74
|
+
**`packages/mcp/docs/agent-recipe-example-site.md`** — checklist for every registered `{id}` (minimal/full paths, adding new builders).
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Adding a component to the manifest
|
|
79
|
+
|
|
80
|
+
Step-by-step: **`sky-ui-example/docs/component-docs-mcp-pipeline.md`**.
|
|
81
|
+
|
|
82
|
+
In **`sky-ui-example`**: add **`server/mcp/builders/<id>.ts`**, register in **`component-payload-registry.ts`**, add **`app/frameworks/<id>.frameworks.ts`**, reuse the same **`frameworks`** arrays on the Vue page.
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
# MCP Capability Status
|
|
2
|
-
|
|
3
|
-
Standard **9-tool** surface for `@sky.ui/mcp` (v1.1.x).
|
|
4
|
-
|
|
5
|
-
## Snapshot
|
|
6
|
-
|
|
7
|
-
- Scope: component discovery, docs, usage, reactivity, charts, theme authoring, utils classes, allowlisted guides
|
|
8
|
-
- Status: Standard surface shipped; docs and golden tests aligned
|
|
9
|
-
- Strength: predictable routing with smaller default payloads
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Capability Matrix
|
|
14
|
-
|
|
15
|
-
| Domain | Tool | Status | Maturity |
|
|
16
|
-
|---|---|---|---|
|
|
17
|
-
| Component discovery | `sky_components` (`list` \| `search` \| `search_by_api`) | Implemented | Stable |
|
|
18
|
-
| Structured docs | `get_sky_component_docs` (`name` \| `names[]`, optional `surface`, deprecations) | Implemented | Stable |
|
|
19
|
-
| Framework usage | `get_component_usage` (`lit` \| `react` \| `vue`) | Implemented | Stable |
|
|
20
|
-
| Setup | `get_project_guide` (`installation` \| `setup`) | Implemented | Stable |
|
|
21
|
-
| Reactivity | `get_reactivity_layer` (`list_topics` \| `get_topic` \| `package`) | Implemented | Stable |
|
|
22
|
-
| Charts | `get_chart_usage` (`list_types` \| `get_type` \| `option_guide`) | Implemented | Stable |
|
|
23
|
-
| Theme authoring | `get_theme` (`guide` \| `fields` \| `field` \| `match_intent` \| `compose` \| `variables`) | Implemented | Stable |
|
|
24
|
-
| Utils classes | `utility_classes` (live engine or shipped snapshot) | Implemented | Stable |
|
|
25
|
-
| Guides | `get_docs` (allowlisted paths) | Implemented | Stable |
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Supporting data (not MCP tools)
|
|
30
|
-
|
|
31
|
-
| Data | Used by |
|
|
32
|
-
|------|---------|
|
|
33
|
-
| Example-site payloads | `get_sky_component_docs` enrichment when `SKY_UI_EXAMPLE_SITE_BASE_URL` or `exampleSiteEmbed` is set |
|
|
34
|
-
| `p0-guidelines.json` | Build validation; optional offline embed manifest |
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Quality Gates
|
|
39
|
-
|
|
40
|
-
- Build: `npm run build -w @sky.ui/mcp` (parity, guideline refs, banned patterns)
|
|
41
|
-
- Smoke: `npm run test:mcp`
|
|
42
|
-
- Contract golden: `node test/mcp/contract-golden.mjs`
|
|
43
|
-
- Agent defaults: smaller omit-arg limits documented in README
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Recommended Next Milestones
|
|
48
|
-
|
|
49
|
-
1. Expand golden coverage for `get_theme` match_intent/compose edge cases
|
|
50
|
-
2. Publish `@sky.ui/mcp@1.1.0` and pin in consumer `.cursor/mcp.json`
|
|
51
|
-
3. Keep example-site embed manifest in sync with sky-ui-example page ids
|
|
1
|
+
# MCP Capability Status
|
|
2
|
+
|
|
3
|
+
Standard **9-tool** surface for `@sky.ui/mcp` (v1.1.x).
|
|
4
|
+
|
|
5
|
+
## Snapshot
|
|
6
|
+
|
|
7
|
+
- Scope: component discovery, docs, usage, reactivity, charts, theme authoring, utils classes, allowlisted guides
|
|
8
|
+
- Status: Standard surface shipped; docs and golden tests aligned
|
|
9
|
+
- Strength: predictable routing with smaller default payloads
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Capability Matrix
|
|
14
|
+
|
|
15
|
+
| Domain | Tool | Status | Maturity |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| Component discovery | `sky_components` (`list` \| `search` \| `search_by_api`) | Implemented | Stable |
|
|
18
|
+
| Structured docs | `get_sky_component_docs` (`name` \| `names[]`, optional `surface`, deprecations) | Implemented | Stable |
|
|
19
|
+
| Framework usage | `get_component_usage` (`lit` \| `react` \| `vue`) | Implemented | Stable |
|
|
20
|
+
| Setup | `get_project_guide` (`installation` \| `setup`) | Implemented | Stable |
|
|
21
|
+
| Reactivity | `get_reactivity_layer` (`list_topics` \| `get_topic` \| `package`) | Implemented | Stable |
|
|
22
|
+
| Charts | `get_chart_usage` (`list_types` \| `get_type` \| `option_guide`) | Implemented | Stable |
|
|
23
|
+
| Theme authoring | `get_theme` (`guide` \| `fields` \| `field` \| `match_intent` \| `compose` \| `variables`) | Implemented | Stable |
|
|
24
|
+
| Utils classes | `utility_classes` (live engine or shipped snapshot) | Implemented | Stable |
|
|
25
|
+
| Guides | `get_docs` (allowlisted paths) | Implemented | Stable |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Supporting data (not MCP tools)
|
|
30
|
+
|
|
31
|
+
| Data | Used by |
|
|
32
|
+
|------|---------|
|
|
33
|
+
| Example-site payloads | `get_sky_component_docs` enrichment when `SKY_UI_EXAMPLE_SITE_BASE_URL` or `exampleSiteEmbed` is set |
|
|
34
|
+
| `p0-guidelines.json` | Build validation; optional offline embed manifest |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Quality Gates
|
|
39
|
+
|
|
40
|
+
- Build: `npm run build -w @sky.ui/mcp` (parity, guideline refs, banned patterns)
|
|
41
|
+
- Smoke: `npm run test:mcp`
|
|
42
|
+
- Contract golden: `node test/mcp/contract-golden.mjs`
|
|
43
|
+
- Agent defaults: smaller omit-arg limits documented in README
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Recommended Next Milestones
|
|
48
|
+
|
|
49
|
+
1. Expand golden coverage for `get_theme` match_intent/compose edge cases
|
|
50
|
+
2. Publish `@sky.ui/mcp@1.1.0` and pin in consumer `.cursor/mcp.json`
|
|
51
|
+
3. Keep example-site embed manifest in sync with sky-ui-example page ids
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# MCP tooling roadmap
|
|
2
|
-
|
|
3
|
-
Complements **`mcp-capability-status.md`**. Follow-ups after the **9-tool standard surface** (`@sky.ui/mcp` 1.1.x).
|
|
4
|
-
|
|
5
|
-
## Shipped (1.1.x)
|
|
6
|
-
|
|
7
|
-
- **9 public tools:** `get_project_guide`, `sky_components`, `get_sky_component_docs`, `get_component_usage`, `get_reactivity_layer`, `get_chart_usage`, `get_theme`, `get_docs`, `utility_classes`
|
|
8
|
-
- **`get_theme`:** `guide`, `fields`, `field`, `match_intent`, `compose`, `variables`
|
|
9
|
-
- **Offline snapshots:** `utils-suggestion-snapshot.json`, `reactivity-readme-snapshot.json`, `chart-api-sections.json`
|
|
10
|
-
- **`_skyUiMcp`** metadata + **`--health`** diagnostics
|
|
11
|
-
- Example-site enrichment internal to **`get_sky_component_docs`**
|
|
12
|
-
- Guideline JSON for validation + embed only (`p0-guidelines.json`)
|
|
13
|
-
|
|
14
|
-
## High priority
|
|
15
|
-
|
|
16
|
-
| Area | Work |
|
|
17
|
-
|------|------|
|
|
18
|
-
| **Publish 1.1.x** | GitLab registry with `write_package_registry` |
|
|
19
|
-
| **Example-site embed CI** | Snapshot test when embed manifest ids change |
|
|
20
|
-
| **`get_project_guide`** | Optional JSON wrapper with `_skyUiMcp` |
|
|
21
|
-
|
|
22
|
-
## Medium priority
|
|
23
|
-
|
|
24
|
-
| Area | Work |
|
|
25
|
-
|------|------|
|
|
26
|
-
| **`utility_classes`** | Optional sandboxed read of user `skyui.config` |
|
|
27
|
-
| **`get_theme` `variables`** | Source hash / extract timestamp in response |
|
|
28
|
-
|
|
29
|
-
## Lower priority
|
|
30
|
-
|
|
31
|
-
- HTTP POST bridge: document `_skyUiMcp` in README POST section
|
|
32
|
-
- Optional consolidated design-assist tool (only if product asks)
|
|
33
|
-
|
|
34
|
-
## Principle
|
|
35
|
-
|
|
36
|
-
Prefer **`truthLayer` ∈ { `api_source`, `deterministic` }** for normative API answers. Treat **`external_optional`** and **`static_reference`** as supplementary.
|
|
1
|
+
# MCP tooling roadmap
|
|
2
|
+
|
|
3
|
+
Complements **`mcp-capability-status.md`**. Follow-ups after the **9-tool standard surface** (`@sky.ui/mcp` 1.1.x).
|
|
4
|
+
|
|
5
|
+
## Shipped (1.1.x)
|
|
6
|
+
|
|
7
|
+
- **9 public tools:** `get_project_guide`, `sky_components`, `get_sky_component_docs`, `get_component_usage`, `get_reactivity_layer`, `get_chart_usage`, `get_theme`, `get_docs`, `utility_classes`
|
|
8
|
+
- **`get_theme`:** `guide`, `fields`, `field`, `match_intent`, `compose`, `variables`
|
|
9
|
+
- **Offline snapshots:** `utils-suggestion-snapshot.json`, `reactivity-readme-snapshot.json`, `chart-api-sections.json`
|
|
10
|
+
- **`_skyUiMcp`** metadata + **`--health`** diagnostics
|
|
11
|
+
- Example-site enrichment internal to **`get_sky_component_docs`**
|
|
12
|
+
- Guideline JSON for validation + embed only (`p0-guidelines.json`)
|
|
13
|
+
|
|
14
|
+
## High priority
|
|
15
|
+
|
|
16
|
+
| Area | Work |
|
|
17
|
+
|------|------|
|
|
18
|
+
| **Publish 1.1.x** | GitLab registry with `write_package_registry` |
|
|
19
|
+
| **Example-site embed CI** | Snapshot test when embed manifest ids change |
|
|
20
|
+
| **`get_project_guide`** | Optional JSON wrapper with `_skyUiMcp` |
|
|
21
|
+
|
|
22
|
+
## Medium priority
|
|
23
|
+
|
|
24
|
+
| Area | Work |
|
|
25
|
+
|------|------|
|
|
26
|
+
| **`utility_classes`** | Optional sandboxed read of user `skyui.config` |
|
|
27
|
+
| **`get_theme` `variables`** | Source hash / extract timestamp in response |
|
|
28
|
+
|
|
29
|
+
## Lower priority
|
|
30
|
+
|
|
31
|
+
- HTTP POST bridge: document `_skyUiMcp` in README POST section
|
|
32
|
+
- Optional consolidated design-assist tool (only if product asks)
|
|
33
|
+
|
|
34
|
+
## Principle
|
|
35
|
+
|
|
36
|
+
Prefer **`truthLayer` ∈ { `api_source`, `deterministic` }** for normative API answers. Treat **`external_optional`** and **`static_reference`** as supplementary.
|