@godxjp/ui-mcp 0.17.0 → 0.17.1
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/dist/index.js +201 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7554,6 +7554,140 @@ XProp + XProp as XProps and register in props/registry. Then: add an MCP catalog
|
|
|
7554
7554
|
real-screen docs page; verify typecheck/lint/audit/check:*/preview:build/test all green.`
|
|
7555
7555
|
}
|
|
7556
7556
|
]
|
|
7557
|
+
},
|
|
7558
|
+
// ── design-to-page (consumer: handoff → real page) ─────────────
|
|
7559
|
+
{
|
|
7560
|
+
id: "design-to-page",
|
|
7561
|
+
name: "Design handoff \u2192 real page (consumer build guide)",
|
|
7562
|
+
whenToUse: "You (a consumer agent) received a Claude Design handoff \u2014 a bundle/mock/screenshot/HTML prototype or a written brief \u2014 and must build it as a REAL page with @godxjp/ui. Read this BEFORE writing any JSX. It teaches: read intent, map every block to a real primitive via this MCP, consume existing tokens, apply the dxs-kintai DNA, treat tables as the centerpiece, resolve gaps by extend-or-ask, and verify.",
|
|
7563
|
+
source: "@godxjp/ui .design/research (chats-intent, tables, atomic-components) + dxs-kintai SKILL/colors_and_type.css",
|
|
7564
|
+
sections: [
|
|
7565
|
+
{
|
|
7566
|
+
id: "read-intent",
|
|
7567
|
+
title: "Read the intent \u2014 chats before pixels",
|
|
7568
|
+
tagline: "A handoff is a prototype, not production code. Build the intent, not the markup.",
|
|
7569
|
+
body: `A Claude Design bundle is HTML/CSS/JS to LOOK AT \u2014 never transcribe its DOM.
|
|
7570
|
+
If the bundle has chats/*.md, read them FIRST: they hold what the user actually
|
|
7571
|
+
wanted after iterating, the directions rejected, and the explicit rules. The final
|
|
7572
|
+
HTML is just the last output; the chat is the intent. Then read the README/SKILL +
|
|
7573
|
+
colors_and_type.css for the DNA. Distil each screen to ONE primary question it
|
|
7574
|
+
answers (one-intent-per-screen) before choosing components. Honesty rules that
|
|
7575
|
+
recur in this DNA: render only VALID actions (no disabled-button noise \u2014 a punch
|
|
7576
|
+
card off-state shows Check-In only, never a greyed Check-Out); label = identity
|
|
7577
|
+
(never changes), helper row = state (error/help goes BELOW, never recolours the
|
|
7578
|
+
label); entry-point affordances live in chrome, not floating in content.`
|
|
7579
|
+
},
|
|
7580
|
+
{
|
|
7581
|
+
id: "map-to-primitives",
|
|
7582
|
+
title: "Map every block to a real primitive \u2014 MCP-first, never hand-roll",
|
|
7583
|
+
tagline: "For each visual block ask 'which @godxjp/ui component is this?' \u2014 list_primitives, then get_component.",
|
|
7584
|
+
body: `NEVER hand-roll a styled <div> that looks like a Card, or use raw
|
|
7585
|
+
<input>/<select>/<button>/<table>. Decompose each screen into a shopping list and
|
|
7586
|
+
resolve each item through THIS MCP: list_primitives to discover, get_component to
|
|
7587
|
+
confirm the exact prop/union before you write (never guess a prop). Typical map:
|
|
7588
|
+
page chrome \u2192 AppShell/Sidebar/Topbar/PageContainer; stat row \u2192 ResponsiveGrid +
|
|
7589
|
+
StatCard; data grid \u2192 DataTable; status pill \u2192 Badge tone=\u2026; filter row \u2192 Form
|
|
7590
|
+
inline + Select/Input; org\u2192branch \u2192 Cascader/TreeSelect; date/time \u2192 DatePicker/
|
|
7591
|
+
TimePicker; \u2318K \u2192 Command; bulk drawer/detail \u2192 Drawer/Sheet/Dialog; split list+
|
|
7592
|
+
detail \u2192 SplitPane/Resizable; empty \u2192 EmptyState; confirm \u2192 AlertDialog; toast \u2192
|
|
7593
|
+
Sonner. No duplication: Select (showSearch/loadOptions) is the ONLY searchable/
|
|
7594
|
+
async select (no Combobox/Autocomplete); the 4 i18n pickers are one AppSettingPicker
|
|
7595
|
+
kind=\u2026. A table = Card + CardContent-flush + DataTable (not PageContainer flush).`
|
|
7596
|
+
},
|
|
7597
|
+
{
|
|
7598
|
+
id: "tokens-exist",
|
|
7599
|
+
title: "Tokens already exist \u2014 consume var(--\u2026), never redeclare",
|
|
7600
|
+
tagline: "The design's colors_and_type.css is already implemented as foundation.css.",
|
|
7601
|
+
body: `The handoff's colors_and_type.css (SmartHR blue, wa-iro, M PLUS 2, the
|
|
7602
|
+
density scale) is ALREADY shipped as @godxjp/ui's foundation tokens. Never paste a
|
|
7603
|
+
hex, never redeclare a token, never invent a neutral. Consume var(--\u2026) and the
|
|
7604
|
+
semantic utilities. Use get_tokens (MCP) to find the right name \u2014 if a token seems
|
|
7605
|
+
missing it almost certainly exists under a different name. Soft tints come from
|
|
7606
|
+
color-mix(in oklch, var(--primary) 15%, transparent), NOT a new pale hex. Control
|
|
7607
|
+
heights come from the density scale (xs 24 / sm 28 / default 32 / lg 36 / xl 44),
|
|
7608
|
+
never a literal px. Radii: card 6px, control 4px, inner pill 2px.`
|
|
7609
|
+
},
|
|
7610
|
+
{
|
|
7611
|
+
id: "dna",
|
|
7612
|
+
title: "Apply the dxs-kintai DNA",
|
|
7613
|
+
tagline: "\u6E0B\u307F / \u9593 / \u7C21\u7D20 \u2014 fixed color signaling, dense, small headings, 14/1.7, no emoji.",
|
|
7614
|
+
body: `These rules survive when you drop the prototype's divs:
|
|
7615
|
+
\u2022 \u6E0B\u307F (restraint): primary chroma \u2264 0.18 \u2014 --primary is the single most-important
|
|
7616
|
+
action + brand surfaces ONLY, never status. No gradients, no pill cards, no
|
|
7617
|
+
saturated brand.
|
|
7618
|
+
\u2022 \u9593 (breathing): body 14px / 1.7 (NEVER 16/1.5); tabular-nums on every numeric
|
|
7619
|
+
column/stat so digits align under 1.7 leading.
|
|
7620
|
+
\u2022 \u7C21\u7D20 (simplicity): three weights only \u2014 400/500/700 (no 300, no 600). Headings
|
|
7621
|
+
stay SMALL: h1 = 20px, h2 = 18 (not 32) \u2014 JP enterprise is dense, big headings
|
|
7622
|
+
waste \u9593.
|
|
7623
|
+
\u2022 Color signaling is FIXED-mapping: success \u82E5\u7AF9 \xB7 warning \u5C71\u5439(yellow) \xB7 info \u7FA4\u9752
|
|
7624
|
+
\xB7 attention \u6731(orange \u2014 PREFER over red for non-destructive: \u9045\u523B/lateness) \xB7
|
|
7625
|
+
danger \u831C(destructive only). Wa-iro is decorative (charts/tags/tenant) \u2014 NEVER
|
|
7626
|
+
remap a wa-iro hue to a semantic role.
|
|
7627
|
+
\u2022 Density up front: compact 28 (heavy tables) \xB7 default 32 \xB7 comfortable 44 (login/
|
|
7628
|
+
mobile, 44px touch floor). Set on the container; don't mix mid-page.
|
|
7629
|
+
\u2022 Cards: 1px border, NO shadow at rest (shadows only on popover md / dialog xl).
|
|
7630
|
+
\u2022 Copy quiet & factual \u2014 \u300C\u627F\u8A8D\u3057\u307E\u3057\u305F\u300D not \u300C\u627F\u8A8D\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u{1F389}\u300D. Empty state =
|
|
7631
|
+
one calm sentence, no illustration. NO emoji in product UI; Lucide 1.5px icons,
|
|
7632
|
+
currentColor, sized by context (14 table / 16 nav / 18 button / 20 header).
|
|
7633
|
+
\u2022 Multi-tenant: tenants override only --primary/--ring/--foreground; semantic
|
|
7634
|
+
colors stay shared (a "rejected" badge means the same everywhere).`
|
|
7635
|
+
},
|
|
7636
|
+
{
|
|
7637
|
+
id: "tables-central",
|
|
7638
|
+
title: "Tables are the centerpiece \u2014 DataTable + the variant catalogue",
|
|
7639
|
+
tagline: "Enterprise \u52E4\u6020/admin lives in tables; showcase the family broadly.",
|
|
7640
|
+
body: `Most of this DNA's real value is in tables \u2014 make DataTable the
|
|
7641
|
+
centerpiece. One shell: Card + CardContent-flush wrapping DataTable (1px border,
|
|
7642
|
+
6px radius, no shadow). Region order: view tabs \xB7 toolbar (search + \u2318K + density +
|
|
7643
|
+
columns + import/export + primary CTA) \xB7 active-filter chip bar \xB7 table \xB7 footer
|
|
7644
|
+
totals \xB7 pagination \u2014 every region optional. Build each pattern as its own block:
|
|
7645
|
+
assembled CRUD list \xB7 bulk-action toolbar (selection REPLACES toolbar; cross-page
|
|
7646
|
+
"select all 1,284"; destructive isolated last) \xB7 column manager \xB7 advanced filter
|
|
7647
|
+
AND/OR \xB7 sort/resize \xB7 expandable detail row \xB7 inline editable row (row-level
|
|
7648
|
+
commit, dirty dot, "\u672A\u4FDD\u5B58" footer) \xB7 grouped rows w/ subtotals \xB7 tree rows \xB7 sticky
|
|
7649
|
+
columns + horizontal scroll \xB7 pagination \xD73 (numbered/load-more/cursor) \xB7 import/
|
|
7650
|
+
export stepper \xB7 empty/loading(Skeleton)/error/no-perm states \xB7 footer totals \xB7
|
|
7651
|
+
compact kintone grid \xB7 conditional row/cell formatting. Cells: status \u2192 Badge tone;
|
|
7652
|
+
identity \u2192 Avatar + two-line; numerics right-aligned tabular-nums with \u2014 for null;
|
|
7653
|
+
IDs mono. Confirmed (\u78BA\u5B9A\u6E08) rows are frozen \u2014 no edit, no destructive bulk. Row
|
|
7654
|
+
states change only background via color-mix, never height/padding. get_component
|
|
7655
|
+
DataTable + get_vocab ColumnDef/TableDensity/SortState before you build.`
|
|
7656
|
+
},
|
|
7657
|
+
{
|
|
7658
|
+
id: "gaps-extend-or-ask",
|
|
7659
|
+
title: "Gaps \u2192 extend or ask \u2014 never invent",
|
|
7660
|
+
tagline: "A block no primitive expresses is a decision, not a hand-roll.",
|
|
7661
|
+
body: `When a block has no clean primitive/prop/variant, do NOT bake a bespoke
|
|
7662
|
+
one-off into the page. First try to EXTEND: can an existing component take one more
|
|
7663
|
+
tone/size/variant/slot, or be composed from existing primitives (e.g. a punch-card
|
|
7664
|
+
FSM, a mobile selection-bar, an i18n locale-field are compositions over Button/Card/
|
|
7665
|
+
Badge/Tabs/Input, not new primitives)? If it's a genuine gap or you're unsure, STOP
|
|
7666
|
+
and ASK the user (or surface it as an ADR/decision) \u2014 name the gap, propose
|
|
7667
|
+
"new variant on <X> vs. app-level composition vs. new component", and converge
|
|
7668
|
+
before building. Known gaps to expect in this DNA (ask rather than invent): three-
|
|
7669
|
+
level table density (current is binary), multi-sort priority badges, column resize/
|
|
7670
|
+
manager, numbered/load-more pagination, expandable/editable/grouped/tree/sticky-col
|
|
7671
|
+
table modes, filter chip bar + AND/OR panel, saved-view tabs, week-timeline/staff\xD7
|
|
7672
|
+
time calendar, multilingual-field, no-code builders. Never silently fill a gap.`
|
|
7673
|
+
},
|
|
7674
|
+
{
|
|
7675
|
+
id: "verify",
|
|
7676
|
+
title: "Verify \u2014 states complete, a11y, build green",
|
|
7677
|
+
tagline: "Every state shown, WCAG 2.2 AA, typecheck/lint/audit clean, eyeballed at 3 widths.",
|
|
7678
|
+
body: `Before calling it done: every prop \xD7 union value \xD7 state is exercised
|
|
7679
|
+
(default/hover/focus/active/disabled/loading/empty/error) \u2014 Skeleton for INIT fetch,
|
|
7680
|
+
spinner/loading for active save, EmptyState for no-data, inline error near the field
|
|
7681
|
+
(not a disappearing toast). A11y: correct roles/landmarks, keyboard (arrows/Home/End/
|
|
7682
|
+
Enter/Esc, visible focus, no positive tabindex), \u226524px targets, never colour-only
|
|
7683
|
+
state (add sr-only text), icon-only buttons have a name; aim for 0 vitest-axe
|
|
7684
|
+
violations. i18n: zero hardcoded strings \u2014 every label + aria-label through t(),
|
|
7685
|
+
format numbers/dates via Intl. Then run the build: pnpm typecheck + pnpm lint +
|
|
7686
|
+
pnpm audit must be green, console clean, and eyeball the page at 390 / 768 / 1280
|
|
7687
|
+
(atoms never wrap, containers wrap with row-gap, tabs horizontal-scroll, grids
|
|
7688
|
+
minmax(0,1fr), heights never break).`
|
|
7689
|
+
}
|
|
7690
|
+
]
|
|
7557
7691
|
}
|
|
7558
7692
|
];
|
|
7559
7693
|
function findSkill(id) {
|
|
@@ -7652,6 +7786,13 @@ function routeTask(task) {
|
|
|
7652
7786
|
"workflow",
|
|
7653
7787
|
"Generate design image first \u2192 analyze \u2192 implement."
|
|
7654
7788
|
);
|
|
7789
|
+
route(
|
|
7790
|
+
["handoff", "design bundle", "claude design", "prototype", "build the page", "implement the design", "build this screen", "mockup"],
|
|
7791
|
+
"design-to-page",
|
|
7792
|
+
"map-to-primitives",
|
|
7793
|
+
"Map every block to a real @godxjp/ui primitive (MCP-first), consume existing tokens, apply the dxs-kintai DNA, tables central, gaps \u2192 extend-or-ask, verify.",
|
|
7794
|
+
["design-to-page/read-intent", "design-to-page/dna", "design-to-page/tables-central"]
|
|
7795
|
+
);
|
|
7655
7796
|
if (matches.length === 0) {
|
|
7656
7797
|
return [
|
|
7657
7798
|
{
|
|
@@ -9155,12 +9296,71 @@ ${c.example}
|
|
|
9155
9296
|
return out;
|
|
9156
9297
|
}
|
|
9157
9298
|
|
|
9299
|
+
// package.json
|
|
9300
|
+
var package_default = {
|
|
9301
|
+
name: "@godxjp/ui-mcp",
|
|
9302
|
+
version: "0.17.1",
|
|
9303
|
+
description: "Model Context Protocol server for @godxjp/ui \u2014 gives Claude Code / Codex CLI / Cursor / any MCP-aware agent live access to the component catalog, prop vocabulary, design tokens, 34 cardinal rules, copy-paste-ready patterns, 12 design / taste skills synthesised from Leonxlnx/taste-skill, 20+ anti-AI-tell patterns, and a 50-check redesign audit \u2014 token-efficient (list \u2192 drill-down).",
|
|
9304
|
+
type: "module",
|
|
9305
|
+
main: "./dist/index.js",
|
|
9306
|
+
module: "./dist/index.js",
|
|
9307
|
+
types: "./dist/index.d.ts",
|
|
9308
|
+
bin: {
|
|
9309
|
+
"godx-ui-mcp": "./dist/index.js"
|
|
9310
|
+
},
|
|
9311
|
+
files: [
|
|
9312
|
+
"dist",
|
|
9313
|
+
"README.md"
|
|
9314
|
+
],
|
|
9315
|
+
publishConfig: {
|
|
9316
|
+
registry: "https://registry.npmjs.org/",
|
|
9317
|
+
access: "public"
|
|
9318
|
+
},
|
|
9319
|
+
repository: {
|
|
9320
|
+
type: "git",
|
|
9321
|
+
url: "git+https://github.com/godx-jp/godxjp-ui.git",
|
|
9322
|
+
directory: "mcp"
|
|
9323
|
+
},
|
|
9324
|
+
homepage: "https://github.com/godx-jp/godxjp-ui/tree/main/mcp#readme",
|
|
9325
|
+
license: "Apache-2.0",
|
|
9326
|
+
scripts: {
|
|
9327
|
+
build: "tsup",
|
|
9328
|
+
dev: "tsup --watch",
|
|
9329
|
+
start: "node dist/index.js",
|
|
9330
|
+
inspect: "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
9331
|
+
"type-check": "tsc --noEmit",
|
|
9332
|
+
test: "vitest run",
|
|
9333
|
+
prepublishOnly: "npm run build"
|
|
9334
|
+
},
|
|
9335
|
+
dependencies: {
|
|
9336
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
9337
|
+
zod: "^4.4.3"
|
|
9338
|
+
},
|
|
9339
|
+
devDependencies: {
|
|
9340
|
+
"@types/node": "^22.10.0",
|
|
9341
|
+
tsup: "^8.5.1",
|
|
9342
|
+
typescript: "^6.0.3",
|
|
9343
|
+
vitest: "^4.1.6"
|
|
9344
|
+
},
|
|
9345
|
+
keywords: [
|
|
9346
|
+
"mcp",
|
|
9347
|
+
"model-context-protocol",
|
|
9348
|
+
"godxjp",
|
|
9349
|
+
"ui",
|
|
9350
|
+
"design-system",
|
|
9351
|
+
"react",
|
|
9352
|
+
"claude",
|
|
9353
|
+
"cursor"
|
|
9354
|
+
]
|
|
9355
|
+
};
|
|
9356
|
+
|
|
9158
9357
|
// src/index.ts
|
|
9159
9358
|
async function main() {
|
|
9160
9359
|
const server = new Server(
|
|
9161
9360
|
{
|
|
9162
9361
|
name: "godx-ui-mcp",
|
|
9163
|
-
version
|
|
9362
|
+
// Track the package version — never hardcode (see server.test.ts guard).
|
|
9363
|
+
version: package_default.version
|
|
9164
9364
|
},
|
|
9165
9365
|
{
|
|
9166
9366
|
capabilities: {
|