web-stylebook-mcp 0.1.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.ko.md +64 -21
  2. package/README.md +62 -20
  3. package/dist/audit/planner.d.ts +95 -0
  4. package/dist/audit/planner.js +256 -0
  5. package/dist/audit/planner.js.map +1 -0
  6. package/dist/catalog/repository.d.ts +30 -1
  7. package/dist/catalog/repository.js +35 -0
  8. package/dist/catalog/repository.js.map +1 -1
  9. package/dist/catalog/validate.js +279 -2
  10. package/dist/catalog/validate.js.map +1 -1
  11. package/dist/design-principles/planner.d.ts +52 -0
  12. package/dist/design-principles/planner.js +186 -0
  13. package/dist/design-principles/planner.js.map +1 -0
  14. package/dist/principles/planner.d.ts +65 -0
  15. package/dist/principles/planner.js +193 -0
  16. package/dist/principles/planner.js.map +1 -0
  17. package/dist/protocol/errors.d.ts +1 -1
  18. package/dist/protocol/errors.js +2 -0
  19. package/dist/protocol/errors.js.map +1 -1
  20. package/dist/protocol/register-prompts.js +72 -10
  21. package/dist/protocol/register-prompts.js.map +1 -1
  22. package/dist/protocol/register-resources.js +52 -1
  23. package/dist/protocol/register-resources.js.map +1 -1
  24. package/dist/protocol/register-tools.js +264 -3
  25. package/dist/protocol/register-tools.js.map +1 -1
  26. package/dist/protocol/result.d.ts +1 -1
  27. package/dist/protocol/result.js +7 -4
  28. package/dist/protocol/result.js.map +1 -1
  29. package/dist/server-info.d.ts +3 -3
  30. package/dist/server-info.js +7 -2
  31. package/dist/server-info.js.map +1 -1
  32. package/dist/types.d.ts +126 -0
  33. package/dist/types.js +35 -0
  34. package/dist/types.js.map +1 -1
  35. package/generated/catalog.v1.json +14215 -9685
  36. package/generated/manifest.v1.json +8 -4
  37. package/package.json +5 -4
  38. package/skill/AGENTS.md +27 -6
  39. package/skill/CLAUDE.md +27 -6
  40. package/skill/web-stylebook-design/SKILL.md +59 -15
package/README.ko.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # web-stylebook-mcp
4
4
 
5
5
  **AI 코딩 에이전트를 위한 디자인 인텔리전스.** 매번 똑같은 히어로 + 카드 3개는 그만.
6
- 에이전트가 점수화된 디자인 *계약*(방향·UI 상태 계획·토큰)을 받아, 근거를 바탕으로 코드를 씁니다.
6
+ 에이전트가 점수화된 디자인 *계약*(방향·시각 디자인 계획·UX 원칙 계획·UI 상태 계획·토큰·근거 기반 감사 계획)을 받아, 근거를 바탕으로 코드를 쓰고 검증합니다.
7
7
 
8
8
  [![npm version](https://img.shields.io/npm/v/web-stylebook-mcp?logo=npm&color=cb3837)](https://www.npmjs.com/package/web-stylebook-mcp)
9
9
  [![downloads](https://img.shields.io/npm/dm/web-stylebook-mcp?color=cb3837)](https://www.npmjs.com/package/web-stylebook-mcp)
@@ -17,17 +17,20 @@
17
17
 
18
18
  ---
19
19
 
20
- 코딩 에이전트는 *무엇이 어떻게 생겨야 하는지*를 정하지 못해서 매번 똑같은 UI로 도망칩니다 — 히어로 + 카드 3개 + 그라데이션. `web-stylebook-mcp`는 에이전트에게 **디자인 계약**(점수화된 시각 방향, UI 상태 계획, 디자인 토큰)을 건네는 Model Context Protocol 서버이고, [webstylebook.com](https://webstylebook.com)과 동일한 큐레이션 카탈로그에서 가져옵니다. **코드가 아니라 근거**를 돌려줍니다. 코드는 여전히 에이전트가 쓰지만, 이제 무엇을 만들지 알고 씁니다.
20
+ 코딩 에이전트는 *무엇이 어떻게 생겨야 하는지*를 정하지 못해서 매번 똑같은 UI로 도망칩니다 — 히어로 + 카드 3개 + 그라데이션. `web-stylebook-mcp`는 에이전트에게 **디자인 계약**(점수화된 시각 방향, 배치 중심 시각 디자인 계획, 근거 수준이 표시된 UX 원칙 계획, UI 상태 계획, 디자인 토큰)을 건네는 Model Context Protocol 서버이고, [webstylebook.com](https://webstylebook.com)과 동일한 큐레이션 카탈로그에서 가져옵니다. **코드가 아니라 근거**를 돌려줍니다. 코드는 여전히 에이전트가 쓰지만, 이제 무엇을 만들고 무엇을 검증할지 알고 씁니다.
21
21
 
22
- API 키 없음. 모델 호출 없음. 네트워크 없음. 파일시스템 접근 없음. **결정적이고, 읽기 전용이며, 완전히 로컬.**
22
+ API 키 없음. 모델 호출 없음. 네트워크 없음. 프로젝트 파일시스템 접근 없음. **결정적이고, 읽기 전용이며, 완전히 로컬.**
23
23
 
24
24
  ## 없을 때 / 있을 때
25
25
 
26
26
  | | `web-stylebook-mcp` 없이 | `web-stylebook-mcp`로 |
27
27
  |---|---|---|
28
28
  | **방향** | 한 가지 룩을 찍어서 밀어붙임 | 점수화된 후보 + 사유 코드 + *무엇을 왜 탈락*시켰는지 |
29
+ | **제작 원칙** | 문서에 원칙 이름만 적고 검증은 없음 | 원칙마다 배치 지침 + 관찰 가능한 검증 기준 + 주의점 |
30
+ | **UX 근거** | "힉의 법칙에 따르면…"으로 논의 종료 | 근거 신뢰도(strong·contextual·contested)가 붙어 법칙으로 단정할 수 없는 점검 질문 |
29
31
  | **UI 상태** | 해피패스만, 빈/에러/로딩은 나중에 덧붙임 | 표면별 필수/권장/도메인 상태를 처음부터 |
30
32
  | **토큰** | 손으로 고른 hex, 대비는 거의 미확인 | 역할 기반 토큰 + WCAG 대비 경고 |
33
+ | **감사** | 요약만 보고 "좋아 보임" 판정 | 안정적인 검사 ID·심각도·필요 증거·미검증 상태를 갖춘 화면별 감사 계획 |
31
34
  | **결과** | 천편일률 AI UI | 에이전트가 근거로 삼아 구현하는 디자인 계약 |
32
35
 
33
36
  ## 직접 판단하는 걸 보세요
@@ -42,7 +45,8 @@ API 키 없음. 모델 호출 없음. 네트워크 없음. 파일시스템 접
42
45
  "tone": ["calm", "technical"],
43
46
  "density": "high",
44
47
  "usageFrequency": "daily",
45
- "avoid": ["cyberpunk"]
48
+ "avoid": ["cyberpunk"],
49
+ "locale": "ko"
46
50
  }
47
51
  ```
48
52
 
@@ -51,21 +55,30 @@ API 키 없음. 모델 호출 없음. 네트워크 없음. 파일시스템 접
51
55
  {
52
56
  "confidence": "high",
53
57
  "candidates": [ // 모두 0.91 동점 — 순서는 의미 없음
54
- { "style": "notion-style", "score": 0.91 },
55
- { "style": "platform-core", "score": 0.91 },
56
- { "style": "quiet-utility", "score": 0.91 },
57
- { "style": "runtime-signal", "score": 0.91 }
58
+ { "styleId": "notion-style", "score": 0.91 },
59
+ { "styleId": "platform-core", "score": 0.91 },
60
+ { "styleId": "quiet-utility", "score": 0.91 },
61
+ { "styleId": "runtime-signal", "score": 0.91 },
62
+ { "styleId": "console-launch", "score": 0.91 }
58
63
  ],
59
64
  "rejected": [
60
- { "style": "cyberpunk-glitch", "reasons": ["EXPLICITLY_AVOIDED", "DAILY_USE_OVERSTIMULATION"] },
61
- { "style": "aurora-gradient", "reasons": ["PRODUCT_NOT_IDEAL", "DAILY_USE_OVERSTIMULATION"] }
65
+ { "styleId": "aurora-gradient", "reasonCodes": ["PRODUCT_NOT_IDEAL", "DAILY_USE_OVERSTIMULATION"] },
66
+ { "styleId": "claymorphism", "reasonCodes": ["PRODUCT_NOT_IDEAL"] },
67
+ { "styleId": "cyberpunk-glitch", "reasonCodes": ["EXPLICITLY_AVOIDED", "DAILY_USE_OVERSTIMULATION"] }
62
68
  ],
63
- "pairing": "macos-liquid-glass + notion-style (조용한 폼 / 내비)",
64
- "guidance": "Treat candidates as scored evidence; pick by product context. 4 are tied — ordering isn't meaningful; use differentiators."
69
+ "pairings": [
70
+ {
71
+ "styleId": "macos-liquid-glass",
72
+ "pairWith": "notion-style",
73
+ "role": ["forms", "navigation", "repetitive surfaces"],
74
+ "rationale": "operational-saas용으로 짝지은 보조 스타일 — notion-style의 차분하고 반복적인 화면을 보완한다."
75
+ }
76
+ ],
77
+ "guidance": "후보는 점수화된 근거다 — 제품 맥락으로 직접 고르라. candidates[0]은 가장 강한 후보일 뿐 강제가 아니다. 상위 5개 후보가 동점이다 — 그 사이 순서는 의미가 없으니 각 후보의 differentiators와 제품 맥락으로 고르라."
65
78
  }
66
79
  ```
67
80
 
68
- 여기서 *하지 않는* 것에 주목하세요 — 정답 하나를 내세우지 않습니다. 네 방향이 0.91로 동점이고, 탈락에는 사유 코드가 붙고, 가이던스는 최종 선택을 모델에게 넘깁니다. 그 정직함이 핵심입니다. 서버는 근거를 주고, 결정은 에이전트가 합니다.
81
+ 여기서 *하지 않는* 것에 주목하세요 — 정답 하나를 내세우지 않습니다. 다섯 방향이 0.91로 동점이고, 탈락한 스타일에는 사유 코드가 붙으며, 페어링은 강제가 아니라 제안입니다. 그 정직함이 핵심입니다. 서버는 근거를 주고, 결정은 에이전트가 합니다.
69
82
 
70
83
  그다음 고른 방향을 실제 토큰으로:
71
84
 
@@ -101,10 +114,13 @@ flowchart LR
101
114
  B --> C{번들된 카탈로그<br/>읽기 전용 · 오프라인}
102
115
  C --> D[recommend_design_direction]
103
116
  C --> E[compare_design_directions]
104
- C --> F[get_ui_state_plan]
105
- C --> G[compose_design_tokens]
106
- D & E & F & G -->|디자인 계약<br/>점수 · 사유 코드 · 토큰| A
107
- A -->|근거로<br/>코드 작성| H[당신의 UI]
117
+ C --> F[get_design_principle_plan]
118
+ C --> G[get_ux_principle_plan]
119
+ C --> H[get_ui_state_plan]
120
+ C --> I[compose_design_tokens]
121
+ C --> J[get_design_audit_plan]
122
+ D & E & F & G & H & I & J -->|디자인 계약<br/>점수 · 사유 코드<br/>배치 · 증거 · 토큰| A
123
+ A -->|근거로<br/>코드 작성| Z[당신의 UI]
108
124
  ```
109
125
 
110
126
  에이전트가 제품을 설명하면, 서버가 큐레이션 카탈로그를 점수화해 구조화된 근거를 돌려줍니다. 코드는 생성하지 않고, 어떤 것도 기기를 벗어나지 않습니다.
@@ -190,10 +206,13 @@ MCP 설정에 추가:
190
206
  |------|--------------|-----------------|
191
207
  | **`recommend_design_direction`** | 사유 코드가 붙은 점수화 스타일 후보, *이유*가 붙은 **탈락** 스타일, 보조 페어링, 신뢰도 | 최종 선택은 모델이 — 이건 근거 제공자입니다 |
192
208
  | **`compare_design_directions`** | 2~4개 방향을 제품 적합성·반복 사용·밀도·신뢰·차별성·접근성 리스크·모션·유지보수로 비교 | 정답 하나를 선언하지 않습니다 |
209
+ | **`get_design_principle_plan`** | 시각적 관심사·화면·설계 단계·원칙 ID로 고른 배치/적용/검증 계획 | 제작 원칙은 경험 법칙이나 고정 레시피가 아니라 검증 가능한 점검 질문입니다 |
210
+ | **`get_ux_principle_plan`** | 결과 목표·화면·설계 단계·원칙 ID로 고른 적용/검증 계획 — 질문·주의점·근거 신뢰도·참고 링크 포함 | 원칙은 보편 법칙이나 사용자 조사의 대체물이 아니라 맥락별 점검 질문입니다 |
193
211
  | **`get_ui_state_plan`** | 표면(데이터 테이블·폼·체크아웃·채팅·개발자 콘솔)의 필수/권장/도메인 UI 상태 — 트리거·표시 필수·금지·접근성·모션 | 에이전트가 잊는 상태까지: 빈·에러·로딩·엣지 |
194
212
  | **`compose_design_tokens`** | 역할 기반 토큰(색·타이포·간격·radius·모션·밀도)을 `json` / `css-variables` / `tailwind` / `typescript`, light / dark / both | WCAG 대비 경고를 숨기지 않고 내보냅니다 |
213
+ | **`get_design_audit_plan`** | 안정적인 검사 ID·심각도·적용 조건·필요 증거·수정 방향·선택 원칙 검사·UI 상태 범위를 담은 다국어 감사 계획 | 프로젝트를 실제로 봤다고 가장하지 않으며, 증거가 없으면 `PASS`가 아니라 `NOT_VERIFIED`입니다 |
195
214
 
196
- **카탈로그:** 스타일 48 · 컴포넌트 20 · 표면 5 · UI 상태 레시피 57 · 모션 프로파일 29 · 제품 아키타입 14.
215
+ **카탈로그:** 스타일 48 · 시각 디자인 원칙 22 · UX 원칙 23 · 구조화 감사 검사 38 · 컴포넌트 20 · 표면 5 · UI 상태 레시피 57 · 모션 프로파일 29 · 제품 아키타입 14.
197
216
 
198
217
  ## 다국어 출력
199
218
 
@@ -212,16 +231,18 @@ webstylebook://manifest
212
231
  webstylebook://styles · /styles/{id}
213
232
  webstylebook://motion · /motion/{id}
214
233
  webstylebook://components · /components/{id}
234
+ webstylebook://principles · /principles/{id}
235
+ webstylebook://design-principles · /design-principles/{id}
215
236
  webstylebook://states/surfaces · /states/{surface} · /states/{surface}/{state}
216
237
  webstylebook://products · /products/{id}
217
- webstylebook://policies/anti-patterns · /policies/verification
238
+ webstylebook://policies/anti-patterns · /policies/verification · /policies/audit-checks
218
239
  ```
219
240
 
220
241
  ## 프롬프트
221
242
 
222
243
  자주 쓰는 워크플로우용 MCP 프롬프트:
223
244
 
224
- `design-product` · `design-screen` · `complete-ui-states` · `redesign-with-style` · `audit-design-direction`
245
+ `design-product` · `design-screen` · `complete-ui-states` · `redesign-with-style` · `audit-design-direction` · `audit-design-principles` · `audit-ux-principles`
225
246
 
226
247
  ## CLI
227
248
 
@@ -255,11 +276,25 @@ web-stylebook-mcp --validate-catalog
255
276
  | API 키 | 없음 |
256
277
  | 모델 호출 | 없음 |
257
278
  | 네트워크 접근 | 없음 — 완전 오프라인 동작 |
258
- | 프로젝트 / 파일시스템 접근 | 없음 |
279
+ | 프로젝트 파일시스템 접근 | 없음 — 서버는 번들된 카탈로그 스냅샷만 읽음 |
259
280
  | 동작 | 결정적, 읽기 전용 |
260
281
 
261
282
  서버는 패키지에 번들된 카탈로그 스냅샷만 읽습니다. 어디로도 전송하지 않으며, 같은 입력은 항상 같은 계약을 냅니다.
262
283
 
284
+ ## 카탈로그 원본 동기화
285
+
286
+ 카탈로그 원본은
287
+ [`web-stylebook`](https://github.com/seungdori/web-stylebook) 저장소에서 작성합니다. 그 저장소에서
288
+ 로컬 MCP 전달용 스냅샷을 생성한 뒤, 이 패키지를 릴리스하기 전에 바이트 단위 일치를 확인하세요.
289
+
290
+ ```bash
291
+ npm run catalog:check-canonical -- /absolute/path/to/web-stylebook/packages/mcp/generated
292
+ ```
293
+
294
+ 인자를 생략하면 `WEB_STYLEBOOK_CANONICAL_CATALOG_DIR` 또는 로컬 형제 경로
295
+ `../showcase/packages/mcp/generated`를 사용합니다. 일반 테스트는 번들 아티팩트 내부의 해시,
296
+ enum, 개수, 런타임 계약을 검증하고, 이 명령은 두 저장소 사이의 원본 일치를 명시적으로 검증합니다.
297
+
263
298
  ## 호환성
264
299
 
265
300
  - **Node:** 20 이상
@@ -271,3 +306,11 @@ web-stylebook-mcp --validate-catalog
271
306
  [MIT](./LICENSE) — 코드 **및** 번들된 카탈로그 스냅샷에 적용 (상업적 사용 자유).
272
307
 
273
308
  > [webstylebook.com](https://webstylebook.com) 웹사이트는 CC BY-NC로 배포됩니다. 동일한 저작권자가 이 패키지에 번들된 카탈로그 스냅샷에 대해 MIT를 부여합니다.
309
+ >
310
+ > UX 원칙 항목은 독자적으로 작성한 적용·검증 가이드입니다. [Laws of UX](https://lawsofux.com)
311
+ > (CC BY-NC-ND 4.0)와 보조 근거를 출처로 표시하고 링크하지만, Laws of UX의 문구·삽화·페이지
312
+ > 레이아웃은 번들하지 않습니다.
313
+ >
314
+ > 시각 디자인 원칙은 현대 인터페이스를 위한 과업 중심 검토 체계로 독자 작성했습니다.
315
+ > 의미 구조·반응형 재배치·현지화·토큰과 테마·다중 입력 방식·전체 상태 모델·복구·동작 선호를
316
+ > 함께 다룹니다.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # web-stylebook-mcp
4
4
 
5
5
  **Design intelligence for AI coding agents.** Stop shipping the same hero-plus-three-cards.
6
- Your agent gets scored design *contracts* — directions, UI-state plans, tokens — then writes the code from evidence.
6
+ Your agent gets scored design *contracts* — directions, visual-design plans, UX-principle plans, UI-state plans, tokens, evidence-backed audit plans — then writes and verifies the code from evidence.
7
7
 
8
8
  [![npm version](https://img.shields.io/npm/v/web-stylebook-mcp?logo=npm&color=cb3837)](https://www.npmjs.com/package/web-stylebook-mcp)
9
9
  [![downloads](https://img.shields.io/npm/dm/web-stylebook-mcp?color=cb3837)](https://www.npmjs.com/package/web-stylebook-mcp)
@@ -17,17 +17,20 @@ Your agent gets scored design *contracts* — directions, UI-state plans, tokens
17
17
 
18
18
  ---
19
19
 
20
- Coding agents default to the same generic UI because they can't *decide* what it should look like — so they fall back to hero + 3 cards + a gradient. `web-stylebook-mcp` is a Model Context Protocol server that hands the agent **design contracts** — scored visual directions, UI-state plans, and design tokens — drawn from the same curated catalog as [webstylebook.com](https://webstylebook.com). It returns **evidence, not code**. Your agent still writes the code — now it knows what to build.
20
+ Coding agents default to the same generic UI because they can't *decide* what it should look like — so they fall back to hero + 3 cards + a gradient. `web-stylebook-mcp` is a Model Context Protocol server that hands the agent **design contracts** — scored visual directions, placement-aware visual-design plans, evidence-labeled UX-principle plans, UI-state plans, and design tokens — drawn from the same curated catalog as [webstylebook.com](https://webstylebook.com). It returns **evidence, not code**. Your agent still writes the code — now it knows what to build and what to verify.
21
21
 
22
- No API key. No model call. No network. No filesystem access. **Deterministic, read-only, fully local.**
22
+ No API key. No model call. No network. No project filesystem access. **Deterministic, read-only, fully local.**
23
23
 
24
24
  ## Without it / with it
25
25
 
26
26
  | | Without `web-stylebook-mcp` | With `web-stylebook-mcp` |
27
27
  |---|---|---|
28
28
  | **Direction** | Guesses one look, commits to it | Scored candidates + reason codes + what it *rejected* and why |
29
+ | **Craft** | Principle names dropped into a doc, nothing verified | Placement guidance + an observable check per principle, cautions attached |
30
+ | **UX evidence** | "Hick's Law says…" as a conversation-ender | Evidence-labeled prompts (`strong` / `contextual` / `contested`) you can't restate as law |
29
31
  | **UI states** | Happy path only; empty / error / loading bolted on later | Required / recommended / domain states up front, per surface |
30
32
  | **Tokens** | Hand-picked hexes, contrast rarely checked | Role-based tokens with WCAG contrast warnings |
33
+ | **Audit** | "Looks good" from a summary | Surface-aware checks with stable ids, severity, required evidence, and explicit unverified states |
31
34
  | **Result** | Generic AI UI | A defensible design contract the agent builds from |
32
35
 
33
36
  ## Watch it decide
@@ -51,21 +54,29 @@ No API key. No model call. No network. No filesystem access. **Deterministic, re
51
54
  {
52
55
  "confidence": "high",
53
56
  "candidates": [ // all tied at 0.91 — ordering is NOT meaningful
54
- { "style": "notion-style", "score": 0.91 },
55
- { "style": "platform-core", "score": 0.91 },
56
- { "style": "quiet-utility", "score": 0.91 },
57
- { "style": "runtime-signal", "score": 0.91 }
57
+ { "styleId": "notion-style", "score": 0.91 },
58
+ { "styleId": "platform-core", "score": 0.91 },
59
+ { "styleId": "quiet-utility", "score": 0.91 },
60
+ { "styleId": "runtime-signal", "score": 0.91 },
61
+ { "styleId": "console-launch", "score": 0.91 }
58
62
  ],
59
63
  "rejected": [
60
- { "style": "cyberpunk-glitch", "reasons": ["EXPLICITLY_AVOIDED", "DAILY_USE_OVERSTIMULATION"] },
61
- { "style": "aurora-gradient", "reasons": ["PRODUCT_NOT_IDEAL", "DAILY_USE_OVERSTIMULATION"] }
64
+ { "styleId": "aurora-gradient", "reasonCodes": ["PRODUCT_NOT_IDEAL", "DAILY_USE_OVERSTIMULATION"] },
65
+ { "styleId": "claymorphism", "reasonCodes": ["PRODUCT_NOT_IDEAL"] },
66
+ { "styleId": "cyberpunk-glitch", "reasonCodes": ["EXPLICITLY_AVOIDED", "DAILY_USE_OVERSTIMULATION"] }
62
67
  ],
63
- "pairing": "macos-liquid-glass + notion-style (quieter forms / nav)",
64
- "guidance": "Treat candidates as scored evidence; pick by product context. 4 are tied — ordering isn't meaningful; use differentiators."
68
+ "pairings": [
69
+ {
70
+ "styleId": "macos-liquid-glass",
71
+ "pairWith": "notion-style",
72
+ "role": ["forms", "navigation", "repetitive surfaces"]
73
+ }
74
+ ],
75
+ "guidance": "Treat candidates as scored evidence; choose using product context. candidates[0] is the strongest match, not a mandate. 5 candidates are tied at the top score — the ordering among them is not meaningful; pick using their \"differentiators\" and your product context."
65
76
  }
66
77
  ```
67
78
 
68
- Notice what it *doesn't* do: it doesn't pretend there's one winner. Four directions tie at 0.91, the rejects come with reason codes, and the guidance tells the model to make the final call. That honesty is the point — the server provides evidence, the agent decides.
79
+ Notice what it *doesn't* do: it doesn't pretend there's one winner. Five directions tie at 0.91, rejected styles come with reason codes, and pairings are suggestions rather than a mandate. That honesty is the point — the server provides evidence, the agent decides.
69
80
 
70
81
  Then turn the chosen direction into real tokens:
71
82
 
@@ -101,10 +112,13 @@ flowchart LR
101
112
  B --> C{Bundled catalog<br/>read-only · offline}
102
113
  C --> D[recommend_design_direction]
103
114
  C --> E[compare_design_directions]
104
- C --> F[get_ui_state_plan]
105
- C --> G[compose_design_tokens]
106
- D & E & F & G -->|design contracts<br/>scores · reason codes · tokens| A
107
- A -->|writes code<br/>from evidence| H[Your UI]
115
+ C --> F[get_design_principle_plan]
116
+ C --> G[get_ux_principle_plan]
117
+ C --> H[get_ui_state_plan]
118
+ C --> I[compose_design_tokens]
119
+ C --> J[get_design_audit_plan]
120
+ D & E & F & G & H & I & J -->|design contracts<br/>scores · reason codes<br/>placement · evidence · tokens| A
121
+ A -->|writes code<br/>from evidence| Z[Your UI]
108
122
  ```
109
123
 
110
124
  The agent describes the product; the server scores its curated catalog and returns structured evidence. No code is generated and nothing leaves your machine.
@@ -190,10 +204,13 @@ Add the same block to your `claude_desktop_config.json`, then restart:
190
204
  |------|--------------|-----------------|
191
205
  | **`recommend_design_direction`** | Scored style candidates with reason codes, **rejected** styles with *why*, secondary pairings, confidence | The model makes the final pick — this is the evidence provider |
192
206
  | **`compare_design_directions`** | 2–4 directions compared across product-fit, repeated-use, density, trust, distinctiveness, accessibility-risk, motion, maintenance | No single winner is declared |
207
+ | **`get_design_principle_plan`** | A focused placement, application, and verification plan selected by visual concerns, surface, phase, or principle ids | Craft prompts are testable guidance, not empirical laws or a fixed recipe |
208
+ | **`get_ux_principle_plan`** | A focused apply-and-verify plan selected by outcomes, surface, phase, or principle ids — with questions, cautions, confidence, and references | Principles are contextual prompts, not universal laws or a substitute for research |
193
209
  | **`get_ui_state_plan`** | Required / recommended / domain UI states for a surface (data-table, form, checkout, chat, developer-console) — triggers, must-show, must-not, a11y, motion | Covers the states agents forget: empty, error, loading, edge |
194
210
  | **`compose_design_tokens`** | Role-based tokens (color, type, spacing, radius, motion, density) as `json` / `css-variables` / `tailwind` / `typescript`, light / dark / both | Emits WCAG contrast warnings instead of hiding them |
211
+ | **`get_design_audit_plan`** | Localized, surface-aware checks with stable ids, severity, applicability, required evidence, remediation, selected principle checks, and UI-state coverage | The tool plans the audit but never pretends it inspected your project; missing evidence is `NOT_VERIFIED`, not `PASS` |
195
212
 
196
- **Catalog:** 48 styles · 20 components · 5 surfaces · 57 UI-state recipes · 29 motion profiles · 14 product archetypes.
213
+ **Catalog:** 48 styles · 22 visual design principles · 23 UX principles · 38 structured audit checks · 20 components · 5 surfaces · 57 UI-state recipes · 29 motion profiles · 14 product archetypes.
197
214
 
198
215
  ## Localized output
199
216
 
@@ -212,16 +229,18 @@ webstylebook://manifest
212
229
  webstylebook://styles · /styles/{id}
213
230
  webstylebook://motion · /motion/{id}
214
231
  webstylebook://components · /components/{id}
232
+ webstylebook://principles · /principles/{id}
233
+ webstylebook://design-principles · /design-principles/{id}
215
234
  webstylebook://states/surfaces · /states/{surface} · /states/{surface}/{state}
216
235
  webstylebook://products · /products/{id}
217
- webstylebook://policies/anti-patterns · /policies/verification
236
+ webstylebook://policies/anti-patterns · /policies/verification · /policies/audit-checks
218
237
  ```
219
238
 
220
239
  ## Prompts
221
240
 
222
241
  Ready-made MCP prompts for common workflows:
223
242
 
224
- `design-product` · `design-screen` · `complete-ui-states` · `redesign-with-style` · `audit-design-direction`
243
+ `design-product` · `design-screen` · `complete-ui-states` · `redesign-with-style` · `audit-design-direction` · `audit-design-principles` · `audit-ux-principles`
225
244
 
226
245
  ## CLI
227
246
 
@@ -255,11 +274,26 @@ A companion skill ships in [`skill/`](./skill) so your agent reaches for these t
255
274
  | API key | None |
256
275
  | Model calls | None |
257
276
  | Network access | None — works fully offline |
258
- | Project / filesystem access | None |
277
+ | Project filesystem access | None — the server only reads its bundled catalog snapshot |
259
278
  | Behavior | Deterministic, read-only |
260
279
 
261
280
  The server reads from a catalog snapshot bundled in the package. Nothing is sent anywhere; the same inputs always yield the same contracts.
262
281
 
282
+ ## Catalog source sync
283
+
284
+ The canonical catalog is authored in the
285
+ [`web-stylebook`](https://github.com/seungdori/web-stylebook) repository. After generating its
286
+ local MCP handoff snapshot, verify byte-for-byte parity before releasing this package:
287
+
288
+ ```bash
289
+ npm run catalog:check-canonical -- /absolute/path/to/web-stylebook/packages/mcp/generated
290
+ ```
291
+
292
+ Without an argument, the command uses `WEB_STYLEBOOK_CANONICAL_CATALOG_DIR` or the local sibling
293
+ path `../showcase/packages/mcp/generated`. The regular test suite verifies the bundled artifact's
294
+ internal hash, enums, counts, and runtime contract; this command is the explicit cross-repository
295
+ source check.
296
+
263
297
  ## Compatibility
264
298
 
265
299
  - **Node:** ≥ 20
@@ -271,3 +305,11 @@ The server reads from a catalog snapshot bundled in the package. Nothing is sent
271
305
  [MIT](./LICENSE) — covers the code **and** the bundled catalog snapshot (free for commercial use).
272
306
 
273
307
  > The [webstylebook.com](https://webstylebook.com) website is licensed CC BY-NC. The same owner grants an MIT license for the catalog snapshot bundled in this package.
308
+ >
309
+ > UX-principle entries are independently written application and verification guidance. They
310
+ > attribute and link to [Laws of UX](https://lawsofux.com) (CC BY-NC-ND 4.0) and supporting
311
+ > references; Laws of UX prose, illustrations, and page layouts are not bundled.
312
+ >
313
+ > Visual-design-principle entries form an independently authored, task-oriented review system for
314
+ > contemporary interfaces. They cover semantic structure, responsive reflow, localization, tokens
315
+ > and themes, multiple input modes, complete state models, recovery, and motion preferences.
@@ -0,0 +1,95 @@
1
+ import type { CatalogRepository } from '../catalog/repository.js';
2
+ import type { AuditApplicability, AuditAutomationLevel, AuditCheckDefinition, AuditEvidenceType, AuditSeverity, Lang, UxPrinciple, UxSurface } from '../types.js';
3
+ export declare const AUDIT_GROUP_IDS: readonly ["build", "layout", "fidelity", "behavior", "principles", "docs", "anti-patterns"];
4
+ export type AuditGroupId = (typeof AUDIT_GROUP_IDS)[number];
5
+ export declare const AUDIT_VERDICTS: readonly ["PASS", "FIX_NOW", "RISK", "NOT_APPLICABLE", "NOT_VERIFIED"];
6
+ export type AuditVerdict = (typeof AUDIT_VERDICTS)[number];
7
+ export interface DesignAuditPlanInput {
8
+ styleId?: string;
9
+ surfaces?: UxSurface[];
10
+ designPrincipleIds?: string[];
11
+ uxPrincipleIds?: string[];
12
+ stateSurfaceIds?: string[];
13
+ domainSignals?: string[];
14
+ includeGroups?: AuditGroupId[];
15
+ includeDocumentation?: boolean;
16
+ locale?: Lang;
17
+ }
18
+ export interface ResolvedAuditCheck {
19
+ id: string;
20
+ groupId: AuditGroupId;
21
+ criterion: string;
22
+ why?: string;
23
+ remediation?: string;
24
+ severity: AuditSeverity;
25
+ evidenceTypes: AuditEvidenceType[];
26
+ automation: AuditAutomationLevel;
27
+ applicability: AuditApplicability;
28
+ surfaceTags: UxSurface[];
29
+ source: AuditCheckDefinition['source'];
30
+ }
31
+ interface PrincipleAuditContract {
32
+ id: string;
33
+ name: string;
34
+ verify: string[];
35
+ caution: string;
36
+ resourceUri: string;
37
+ }
38
+ interface UxPrincipleAuditContract extends PrincipleAuditContract {
39
+ evidenceConfidence: UxPrinciple['evidence']['confidence'];
40
+ }
41
+ interface CompactState {
42
+ id: string;
43
+ name: string;
44
+ resourceUri: string;
45
+ }
46
+ export interface DesignAuditPlan {
47
+ query: {
48
+ styleId?: string;
49
+ surfaces: UxSurface[];
50
+ designPrincipleIds: string[];
51
+ uxPrincipleIds: string[];
52
+ stateSurfaceIds: string[];
53
+ includeGroups: AuditGroupId[];
54
+ includeDocumentation: boolean;
55
+ locale: Lang;
56
+ };
57
+ verdicts: Array<{
58
+ id: AuditVerdict;
59
+ meaning: string;
60
+ }>;
61
+ evidenceRule: string;
62
+ evidenceLegend: Record<AuditEvidenceType, string>;
63
+ applicabilityLegend: Record<AuditApplicability, string>;
64
+ verificationDefaults: {
65
+ why: string;
66
+ remediation: string;
67
+ };
68
+ checks: ResolvedAuditCheck[];
69
+ principles: {
70
+ design: PrincipleAuditContract[];
71
+ ux: UxPrincipleAuditContract[];
72
+ };
73
+ stateCoverage: Array<{
74
+ surfaceId: string;
75
+ required: CompactState[];
76
+ recommended: CompactState[];
77
+ domainSpecific: CompactState[];
78
+ resourceUri: string;
79
+ }>;
80
+ stateAtlasUnmappedSurfaces: UxSurface[];
81
+ coverage: {
82
+ catalogChecks: number;
83
+ includedChecks: number;
84
+ excludedChecks: number;
85
+ };
86
+ resourceUris: string[];
87
+ guidance: string[];
88
+ }
89
+ export declare class AuditPlanError extends Error {
90
+ readonly kind: 'INVALID_INPUT' | 'STYLE_NOT_FOUND' | 'DESIGN_PRINCIPLE_NOT_FOUND' | 'UX_PRINCIPLE_NOT_FOUND' | 'STATE_SURFACE_NOT_FOUND';
91
+ readonly unknownId?: string | undefined;
92
+ constructor(message: string, kind?: 'INVALID_INPUT' | 'STYLE_NOT_FOUND' | 'DESIGN_PRINCIPLE_NOT_FOUND' | 'UX_PRINCIPLE_NOT_FOUND' | 'STATE_SURFACE_NOT_FOUND', unknownId?: string | undefined);
93
+ }
94
+ export declare function planDesignAudit(input: DesignAuditPlanInput, repo: CatalogRepository): DesignAuditPlan;
95
+ export {};