@godxjp/ui-mcp 0.18.0 → 0.19.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/README.md +66 -29
- package/dist/index.js +518 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1604,10 +1604,79 @@ import { ResponsiveGrid } from "@godxjp/ui/layout";
|
|
|
1604
1604
|
rules: []
|
|
1605
1605
|
},
|
|
1606
1606
|
// ─── data-entry ─────────────────────────────────────────────────────────
|
|
1607
|
+
{
|
|
1608
|
+
name: "Form",
|
|
1609
|
+
group: "data-entry",
|
|
1610
|
+
tagline: "Ant-style layout container \u2014 renders <form> and pushes layout (vertical/horizontal), labelWidth/controlWidth, label alignment, responsive collapse, and multi-column grid down to every FormField (overridable per field).",
|
|
1611
|
+
props: [
|
|
1612
|
+
{
|
|
1613
|
+
name: "layout",
|
|
1614
|
+
type: '"vertical" | "horizontal" | "inline"',
|
|
1615
|
+
defaultValue: '"vertical"',
|
|
1616
|
+
description: "Label position relative to control; applied to all FormFields."
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
name: "labelWidth",
|
|
1620
|
+
type: "number | string",
|
|
1621
|
+
description: "Label column width in horizontal layout (number\u2192px). e.g. 120 or '8rem'."
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
name: "controlWidth",
|
|
1625
|
+
type: "number | string",
|
|
1626
|
+
description: "Cap the control width (number\u2192px). Omit to fill the column."
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
name: "labelAlign",
|
|
1630
|
+
type: '"start" | "end"',
|
|
1631
|
+
defaultValue: '"end"',
|
|
1632
|
+
description: "Horizontal alignment of the label within its column."
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
name: "collapseBelow",
|
|
1636
|
+
type: '"sm" | "md" | "lg" | "xl" | false',
|
|
1637
|
+
defaultValue: '"md"',
|
|
1638
|
+
description: "Breakpoint below which horizontal collapses to vertical (mobile-first). false = always horizontal."
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
name: "columns",
|
|
1642
|
+
type: "number | { sm?: number; md?: number; lg?: number }",
|
|
1643
|
+
description: "Lay fields out in a responsive grid (reuses ResponsiveGrid; 1 col on small)."
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
name: "density",
|
|
1647
|
+
type: '"compact" | "default" | "comfortable"',
|
|
1648
|
+
description: "Apply a density to controls inside the form."
|
|
1649
|
+
}
|
|
1650
|
+
],
|
|
1651
|
+
usage: [
|
|
1652
|
+
"DO set `layout`, `labelWidth`, `controlWidth` ONCE on `<Form>` \u2014 every `<FormField>` inside inherits them. Override a single field by passing the same prop on that `<FormField>` (Form \u2192 FormField priority).",
|
|
1653
|
+
"DO rely on mobile-first collapse: `layout='horizontal'` automatically stacks to vertical below `collapseBelow` (default `md`). Pass `collapseBelow={false}` only when a field MUST stay label-beside-control even on phones.",
|
|
1654
|
+
"DO use `columns` for multi-field forms (e.g. `columns={2}`) \u2014 it reuses ResponsiveGrid (1 column on small screens, more on md/lg). Span a wide field across columns with `<FormField colSpan={2}>`.",
|
|
1655
|
+
"DON'T hand-roll a `<form>` + Flex stack for spacing \u2014 `<Form>` provides the vertical rhythm and the layout context FormField reads. Wire react-hook-form by spreading `onSubmit={handleSubmit(...)}` onto `<Form>`."
|
|
1656
|
+
],
|
|
1657
|
+
useCases: [
|
|
1658
|
+
"A settings page form where every label sits in a fixed 120px column to the left of its control (horizontal), collapsing to stacked labels on mobile.",
|
|
1659
|
+
"A two-column entity-edit form (`columns={2}`) where the address field spans both columns (`colSpan={2}`).",
|
|
1660
|
+
"A compact filter form (`layout='horizontal' density='compact'`) above a DataTable."
|
|
1661
|
+
],
|
|
1662
|
+
related: [
|
|
1663
|
+
"FormField \u2014 the per-field wrapper (label + control + helper/error) that reads Form's layout context; use one per control inside a Form.",
|
|
1664
|
+
"ResponsiveGrid \u2014 Form `columns` reuses it; use ResponsiveGrid directly for non-form card grids."
|
|
1665
|
+
],
|
|
1666
|
+
example: `import { Form, FormField, Input } from "@godxjp/ui/data-entry";
|
|
1667
|
+
|
|
1668
|
+
<Form layout="horizontal" labelWidth={120} columns={2} onSubmit={onSubmit}>
|
|
1669
|
+
<FormField id="first" label="\u59D3"><Input id="first" /></FormField>
|
|
1670
|
+
<FormField id="last" label="\u540D"><Input id="last" /></FormField>
|
|
1671
|
+
<FormField id="address" label="\u4F4F\u6240" colSpan={2}><Input id="address" /></FormField>
|
|
1672
|
+
</Form>`,
|
|
1673
|
+
storyPath: "data-entry/Form.stories.tsx",
|
|
1674
|
+
rules: [23, 24]
|
|
1675
|
+
},
|
|
1607
1676
|
{
|
|
1608
1677
|
name: "FormField",
|
|
1609
1678
|
group: "data-entry",
|
|
1610
|
-
tagline: "Wraps a control with label, helper, and error; injects aria-describedby/aria-invalid onto the child.",
|
|
1679
|
+
tagline: "Wraps a control with label, helper, and error; injects aria-describedby/aria-invalid onto the child. Reads the parent Form's layout (vertical/horizontal) \u2014 overridable per field.",
|
|
1611
1680
|
props: [
|
|
1612
1681
|
{
|
|
1613
1682
|
name: "id",
|
|
@@ -1633,6 +1702,26 @@ import { ResponsiveGrid } from "@godxjp/ui/layout";
|
|
|
1633
1702
|
type: "string",
|
|
1634
1703
|
description: "Destructive error message (role=alert); overrides helper."
|
|
1635
1704
|
},
|
|
1705
|
+
{
|
|
1706
|
+
name: "layout",
|
|
1707
|
+
type: '"vertical" | "horizontal" | "inline"',
|
|
1708
|
+
description: "Override the parent Form's layout for this field only."
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
name: "labelWidth",
|
|
1712
|
+
type: "number | string",
|
|
1713
|
+
description: "Override the Form's label width for this field."
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
name: "controlWidth",
|
|
1717
|
+
type: "number | string",
|
|
1718
|
+
description: "Override the Form's control width for this field."
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
name: "colSpan",
|
|
1722
|
+
type: "number",
|
|
1723
|
+
description: "Span N columns when inside a `columns` Form grid."
|
|
1724
|
+
},
|
|
1636
1725
|
{
|
|
1637
1726
|
name: "children",
|
|
1638
1727
|
type: "ReactNode",
|
|
@@ -2342,7 +2431,8 @@ export function InvoiceDueDateField() {
|
|
|
2342
2431
|
usage: [
|
|
2343
2432
|
"Use `Dialog` for form-style or wizard-style modal flows that need freeform content and a close action.",
|
|
2344
2433
|
"DO always control open state via `open` + `onOpenChange`. Dialog has no uncontrolled shortcut \u2014 omitting `open` means the trigger alone drives state, which is fine for simple trigger-only cases, but any async submission flow must use controlled state so you can hold the dialog open while `pending=true` and close it only on success.",
|
|
2345
|
-
"DO include `DialogHeader` with `DialogTitle` (and optionally `DialogDescription`) inside every `DialogContent`. Radix requires an accessible title for screen readers; omitting it triggers a console warning and breaks a11y."
|
|
2434
|
+
"DO include `DialogHeader` with `DialogTitle` (and optionally `DialogDescription`) inside every `DialogContent`. Radix requires an accessible title for screen readers; omitting it triggers a console warning and breaks a11y.",
|
|
2435
|
+
"DO wrap tall/scrolling content in `DialogBody` (the ring-safe scroll slot, max-height ~60vh). It insets the content to match the dialog padding so a full-width control's focus ring never clips against the scroll container \u2014 mirror of SheetBody."
|
|
2346
2436
|
],
|
|
2347
2437
|
useCases: [
|
|
2348
2438
|
"Inline form dialog \u2014 create or edit a record (invoice line, supplier, coupon) without navigating away. Place `FormField`/`Input`/`Select` inside `DialogContent`, wire the submit button to your mutation, and hold `open` while `pending` to prevent double-submit.",
|
|
@@ -2469,20 +2559,33 @@ function CreateDialog() {
|
|
|
2469
2559
|
{
|
|
2470
2560
|
name: "Sheet",
|
|
2471
2561
|
group: "feedback",
|
|
2472
|
-
tagline: "Side-panel drawer (Radix Dialog). Parts: Sheet/SheetTrigger/SheetContent(side=right|left|top|bottom)/SheetHeader/SheetTitle/SheetFooter.",
|
|
2562
|
+
tagline: "Side-panel drawer (Radix Dialog). Parts: Sheet/SheetTrigger/SheetContent(side=right|left|top|bottom)/SheetHeader/SheetBody/SheetTitle/SheetFooter.",
|
|
2473
2563
|
props: [
|
|
2474
2564
|
{ name: "open", type: "boolean", description: "Controlled open state." },
|
|
2475
2565
|
{
|
|
2476
2566
|
name: "onOpenChange",
|
|
2477
2567
|
type: "(open: boolean) => void",
|
|
2478
2568
|
description: "Open-state change handler."
|
|
2569
|
+
},
|
|
2570
|
+
{
|
|
2571
|
+
name: "width",
|
|
2572
|
+
type: "number | string",
|
|
2573
|
+
description: "On SheetContent (side left/right): desired panel width (number\u2192px). Caps at the viewport \u2014 full-width on a small screen (min(width,100%)), NOT a hard fixed width. Default w-3/4 sm:max-w-md."
|
|
2574
|
+
},
|
|
2575
|
+
{
|
|
2576
|
+
name: "title / subtitle / extra / tone",
|
|
2577
|
+
type: "ReactNode / ReactNode / ReactNode / ToneProp",
|
|
2578
|
+
description: "On SheetHeader (Ant-style): title (\u2192 SheetTitle, accessible name), subtitle (\u2192 SheetDescription), right-aligned extra actions, and a soft semantic `tone` background band. Children still supported."
|
|
2479
2579
|
}
|
|
2480
2580
|
],
|
|
2481
2581
|
usage: [
|
|
2582
|
+
"DO build the panel with SheetHeader (pass `title`/`subtitle`/`extra`/`tone` OR children) > SheetBody (scrollable, ring-safe) > SheetFooter (pinned). SheetTitle is required for a11y \u2014 the `title` prop renders it for you. Never skip the title.",
|
|
2583
|
+
"DO set `width` on SheetContent for a wider/narrower panel (e.g. width={480}); it caps at the viewport so small screens still get a full-width panel.",
|
|
2482
2584
|
"DO use all named sub-parts in order: Sheet (root) > SheetTrigger (opener) > SheetContent (panel) > SheetHeader > SheetTitle (required for a11y \u2014 maps to Radix DialogPrimitive.Title, announced as the accessible name) > optional SheetDescription > body content > SheetFooter. Never skip SheetTitle inside an open SheetContent.",
|
|
2483
2585
|
"DO control state explicitly with open + onOpenChange on Sheet root when you need to close programmatically (e.g. after form submit). Uncontrolled (no props) works for simple trigger-only cases but gives you no hook to reset form state on close.",
|
|
2484
2586
|
"DO use SheetTrigger asChild to wrap a Button or other interactive element \u2014 this avoids a nested <button> in the DOM. Never render a raw <button> as a direct child of SheetTrigger.",
|
|
2485
|
-
"DO
|
|
2587
|
+
"DO wrap a long/scrolling body in SheetBody (between SheetHeader and a pinned SheetFooter). It is the ring-safe scroll slot: a hand-rolled <div className='overflow-y-auto'> clips the 3px focus ring of a full-width Input/Select at the scroll edges \u2014 SheetBody insets the content so the ring never clips.",
|
|
2588
|
+
"DO use SheetFooter (renders at the bottom via mt-auto, symmetric 16/24 padding, full-bleed top border) for primary/cancel action Buttons. Never float action Buttons inside the body \u2014 they will not stick to the panel bottom.",
|
|
2486
2589
|
"DON'T set showCloseButton={false} on SheetContent unless you provide your own SheetClose element; omitting both leaves users with no keyboard-accessible close path and breaks a11y.",
|
|
2487
2590
|
"DON'T put a Sheet inside a Dialog (nested Radix portals conflict). If you need a slide-over triggered from within a modal, close the Dialog first, then open the Sheet."
|
|
2488
2591
|
],
|
|
@@ -5790,51 +5893,6 @@ export default function PasswordBlock() {
|
|
|
5790
5893
|
storyPath: "data-entry/PasswordStrength.stories.tsx",
|
|
5791
5894
|
rules: [3, 6]
|
|
5792
5895
|
},
|
|
5793
|
-
{
|
|
5794
|
-
name: "Drawer",
|
|
5795
|
-
group: "feedback",
|
|
5796
|
-
tagline: "Bottom-sheet (vaul) \u2014 a draggable sheet that slides up from the screen edge. DISTINCT from Sheet (the side panel); use Drawer for mobile/touch bottom sheets.",
|
|
5797
|
-
props: [
|
|
5798
|
-
{ name: "open", type: "boolean", description: "Controlled open state." },
|
|
5799
|
-
{
|
|
5800
|
-
name: "onOpenChange",
|
|
5801
|
-
type: "(open: boolean) => void",
|
|
5802
|
-
description: "Open-state callback."
|
|
5803
|
-
},
|
|
5804
|
-
{
|
|
5805
|
-
name: "shouldScaleBackground",
|
|
5806
|
-
type: "boolean",
|
|
5807
|
-
defaultValue: "true",
|
|
5808
|
-
description: "Scale the page behind the sheet (iOS-style)."
|
|
5809
|
-
}
|
|
5810
|
-
],
|
|
5811
|
-
usage: [
|
|
5812
|
-
"DO compose Drawer > DrawerTrigger > DrawerContent (> DrawerHeader/DrawerTitle + body + DrawerFooter).",
|
|
5813
|
-
"DO use Drawer for mobile/touch bottom sheets; use Sheet for a desktop side panel and Dialog for a centered modal.",
|
|
5814
|
-
"DON'T confuse with Sheet \u2014 Sheet slides from a side edge, Drawer is the draggable bottom sheet."
|
|
5815
|
-
],
|
|
5816
|
-
useCases: [
|
|
5817
|
-
"Mobile action sheet / menu",
|
|
5818
|
-
"Filter panel on small screens",
|
|
5819
|
-
"Quick-create form on touch",
|
|
5820
|
-
"Detail peek that drags up"
|
|
5821
|
-
],
|
|
5822
|
-
related: [
|
|
5823
|
-
"Sheet (side panel, same Radix Dialog base, different placement)",
|
|
5824
|
-
"Dialog (centered modal)"
|
|
5825
|
-
],
|
|
5826
|
-
example: `import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle } from "@godxjp/ui/feedback";
|
|
5827
|
-
|
|
5828
|
-
<Drawer>
|
|
5829
|
-
<DrawerTrigger>\u7D5E\u308A\u8FBC\u307F</DrawerTrigger>
|
|
5830
|
-
<DrawerContent>
|
|
5831
|
-
<DrawerHeader><DrawerTitle>\u7D5E\u308A\u8FBC\u307F</DrawerTitle></DrawerHeader>
|
|
5832
|
-
{/* filters */}
|
|
5833
|
-
</DrawerContent>
|
|
5834
|
-
</Drawer>`,
|
|
5835
|
-
storyPath: "feedback/Drawer.stories.tsx",
|
|
5836
|
-
rules: [3, 6, 24]
|
|
5837
|
-
},
|
|
5838
5896
|
{
|
|
5839
5897
|
name: "InputOTP",
|
|
5840
5898
|
group: "data-entry",
|
|
@@ -6084,7 +6142,7 @@ export default function PasswordBlock() {
|
|
|
6084
6142
|
{
|
|
6085
6143
|
name: "Carousel",
|
|
6086
6144
|
group: "data-display",
|
|
6087
|
-
tagline: "Embla-backed carousel primitives
|
|
6145
|
+
tagline: "Embla-backed carousel primitives: previous/next controls, CarouselDots indicators, and a context API.",
|
|
6088
6146
|
props: [
|
|
6089
6147
|
{
|
|
6090
6148
|
name: "opts",
|
|
@@ -6105,15 +6163,17 @@ export default function PasswordBlock() {
|
|
|
6105
6163
|
useCases: ["Feature cards", "Image galleries", "Horizontal stepping lists"],
|
|
6106
6164
|
storyPath: "data-display/Carousel.stories.tsx",
|
|
6107
6165
|
rules: [3, 6],
|
|
6108
|
-
example: `import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } from "@godxjp/ui/data-display";
|
|
6166
|
+
example: `import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots } from "@godxjp/ui/data-display";
|
|
6109
6167
|
|
|
6110
|
-
|
|
6168
|
+
// CarouselDots reads the Embla api from context \u2014 no setApi wiring needed.
|
|
6169
|
+
<Carousel opts={{ loop: true }}>
|
|
6111
6170
|
<CarouselContent>
|
|
6112
6171
|
<CarouselItem>1</CarouselItem>
|
|
6113
6172
|
<CarouselItem>2</CarouselItem>
|
|
6114
6173
|
</CarouselContent>
|
|
6115
6174
|
<CarouselPrevious />
|
|
6116
6175
|
<CarouselNext />
|
|
6176
|
+
<CarouselDots />
|
|
6117
6177
|
</Carousel>`
|
|
6118
6178
|
},
|
|
6119
6179
|
{
|
|
@@ -7061,10 +7121,14 @@ function searchPatterns(query) {
|
|
|
7061
7121
|
}
|
|
7062
7122
|
|
|
7063
7123
|
// src/data/skills-index.ts
|
|
7124
|
+
function isConsumerSkill(s) {
|
|
7125
|
+
return s.audience !== "core";
|
|
7126
|
+
}
|
|
7064
7127
|
var SKILLS = [
|
|
7065
7128
|
// ── taste (foundational) ───────────────────────────────────────
|
|
7066
7129
|
{
|
|
7067
7130
|
id: "taste",
|
|
7131
|
+
audience: "both",
|
|
7068
7132
|
name: "Taste baseline \u2014 Senior UI/UX engineering",
|
|
7069
7133
|
whenToUse: "Default for any production app screen. Metric-based rules, strict component architecture, CSS hardware acceleration, balanced design engineering.",
|
|
7070
7134
|
source: "Leonxlnx/taste-skill (root) + @godxjp/ui design-thinking.ts",
|
|
@@ -7144,6 +7208,7 @@ broken). Spinner during init is wrong (nothing to spin over).`
|
|
|
7144
7208
|
// ── soft (Awwwards / premium agency) ───────────────────────────
|
|
7145
7209
|
{
|
|
7146
7210
|
id: "soft",
|
|
7211
|
+
audience: "consumer",
|
|
7147
7212
|
name: "Awwwards-tier \u2014 $150k agency build",
|
|
7148
7213
|
whenToUse: "Premium agency brief \u2014 marketing site, hero pages, product showcase. NOT every internal SaaS screen. Apply when the brief asks for 'Linear-tier', 'Apple-esque', 'Awwwards-style'.",
|
|
7149
7214
|
source: "Leonxlnx/taste-skill/soft-skill",
|
|
@@ -7263,6 +7328,7 @@ or Framer Motion's whileInView. NEVER window.addEventListener("scroll")
|
|
|
7263
7328
|
// ── minimalist (editorial workspace) ───────────────────────────
|
|
7264
7329
|
{
|
|
7265
7330
|
id: "minimalist",
|
|
7331
|
+
audience: "consumer",
|
|
7266
7332
|
name: "Minimalist \u2014 editorial workspace",
|
|
7267
7333
|
whenToUse: "Document-style apps (Notion-clone, knowledge base, blog admin). Warm monochrome + spot pastels. Bento grids. Editorial serif headings + sans body + monospace for data.",
|
|
7268
7334
|
source: "Leonxlnx/taste-skill/minimalist-skill",
|
|
@@ -7346,6 +7412,7 @@ position:fixed pointer-events-none layer.`
|
|
|
7346
7412
|
// ── brutalist ──────────────────────────────────────────────────
|
|
7347
7413
|
{
|
|
7348
7414
|
id: "brutalist",
|
|
7415
|
+
audience: "consumer",
|
|
7349
7416
|
name: "Brutalist \u2014 Swiss print + military terminal",
|
|
7350
7417
|
whenToUse: "Data-heavy dashboards, declassified-blueprint feel, portfolios needing raw mechanical aesthetic. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects.",
|
|
7351
7418
|
source: "Leonxlnx/taste-skill/brutalist-skill",
|
|
@@ -7368,6 +7435,7 @@ portfolios.`
|
|
|
7368
7435
|
// ── gpt-tasteskill ─────────────────────────────────────────────
|
|
7369
7436
|
{
|
|
7370
7437
|
id: "gpt-tasteskill",
|
|
7438
|
+
audience: "consumer",
|
|
7371
7439
|
name: "GPT taste \u2014 editorial + advanced GSAP motion",
|
|
7372
7440
|
whenToUse: "Long-scroll marketing pages with cinematic scroll choreography. Pins, stacks, scrubbed timelines. AIDA structure. Wide editorial typography. Bans 6-line wraps. Gapless bento grids.",
|
|
7373
7441
|
source: "Leonxlnx/taste-skill/gpt-tasteskill",
|
|
@@ -7390,6 +7458,7 @@ over current), scrubbing (animation tied to scroll progress).`
|
|
|
7390
7458
|
// ── redesign ───────────────────────────────────────────────────
|
|
7391
7459
|
{
|
|
7392
7460
|
id: "redesign",
|
|
7461
|
+
audience: "both",
|
|
7393
7462
|
name: "Redesign \u2014 audit + upgrade existing UI",
|
|
7394
7463
|
whenToUse: "Working on an existing project (not greenfield). Find generic patterns, weak points, missing states. Apply fixes in priority order \u2014 font swap first, palette cleanup second, etc.",
|
|
7395
7464
|
source: "Leonxlnx/taste-skill/redesign-skill + redesign-audit.ts",
|
|
@@ -7437,6 +7506,7 @@ no skip-to-content.`
|
|
|
7437
7506
|
// ── output (full-output enforcement) ───────────────────────────
|
|
7438
7507
|
{
|
|
7439
7508
|
id: "output",
|
|
7509
|
+
audience: "both",
|
|
7440
7510
|
name: "Full-output enforcement",
|
|
7441
7511
|
whenToUse: "Always. Bans the // ... / // TODO / 'I'll leave this as an exercise' patterns. Treat every task as production-critical.",
|
|
7442
7512
|
source: "Leonxlnx/taste-skill/output-skill + output-quality.ts",
|
|
@@ -7476,6 +7546,7 @@ of writing it.`
|
|
|
7476
7546
|
// ── brandkit ───────────────────────────────────────────────────
|
|
7477
7547
|
{
|
|
7478
7548
|
id: "brandkit",
|
|
7549
|
+
audience: "consumer",
|
|
7479
7550
|
name: "Brandkit \u2014 identity guidelines boards",
|
|
7480
7551
|
whenToUse: "Designing a brand identity board first (before screens). Logo system, color palette, typography lockup, icon system, photography direction, brand voice.",
|
|
7481
7552
|
source: "Leonxlnx/taste-skill/brandkit",
|
|
@@ -7497,6 +7568,7 @@ imagery. Flexible grid layouts.`
|
|
|
7497
7568
|
// ── stitch ─────────────────────────────────────────────────────
|
|
7498
7569
|
{
|
|
7499
7570
|
id: "stitch",
|
|
7571
|
+
audience: "consumer",
|
|
7500
7572
|
name: "Stitch \u2014 semantic DESIGN.md for Google Stitch",
|
|
7501
7573
|
whenToUse: "Pairing with Google Stitch (or similar AI UI generator). Generate DESIGN.md files that enforce premium standards \u2014 strict typography, calibrated color, asymmetric layouts, perpetual micro-motion.",
|
|
7502
7574
|
source: "Leonxlnx/taste-skill/stitch-skill",
|
|
@@ -7518,6 +7590,7 @@ expressive.`
|
|
|
7518
7590
|
// ── imagegen-mobile ────────────────────────────────────────────
|
|
7519
7591
|
{
|
|
7520
7592
|
id: "imagegen-mobile",
|
|
7593
|
+
audience: "consumer",
|
|
7521
7594
|
name: "Imagegen mobile \u2014 app screen reference images",
|
|
7522
7595
|
whenToUse: "Pre-code phase. Generate mobile screen mockups before implementing. Onboarding flows, auth, home dashboards, profile, settings, chat, ecommerce, fintech, health, productivity.",
|
|
7523
7596
|
source: "Leonxlnx/taste-skill/imagegen-frontend-mobile",
|
|
@@ -7544,6 +7617,7 @@ screens in flows.`
|
|
|
7544
7617
|
// ── imagegen-web ───────────────────────────────────────────────
|
|
7545
7618
|
{
|
|
7546
7619
|
id: "imagegen-web",
|
|
7620
|
+
audience: "consumer",
|
|
7547
7621
|
name: "Imagegen web \u2014 landing page section images",
|
|
7548
7622
|
whenToUse: "Pre-code phase for landing / marketing sites. Generate ONE image per section (8 sections \u2192 8 images). Hero composition variety (NOT always left-text/right-image).",
|
|
7549
7623
|
source: "Leonxlnx/taste-skill/imagegen-frontend-web",
|
|
@@ -7580,6 +7654,7 @@ for the brand.`
|
|
|
7580
7654
|
// ── image-to-code ──────────────────────────────────────────────
|
|
7581
7655
|
{
|
|
7582
7656
|
id: "image-to-code",
|
|
7657
|
+
audience: "consumer",
|
|
7583
7658
|
name: "Image-to-code \u2014 generate design first, then implement",
|
|
7584
7659
|
whenToUse: "Visual-first brief in Codex. First generate the design image yourself, deeply analyze, THEN implement code matching it.",
|
|
7585
7660
|
source: "Leonxlnx/taste-skill/image-to-code-skill",
|
|
@@ -7604,6 +7679,7 @@ visible on a small laptop.`
|
|
|
7604
7679
|
// ── component discipline (hard contract) ───────────────────────
|
|
7605
7680
|
{
|
|
7606
7681
|
id: "component-discipline",
|
|
7682
|
+
audience: "core",
|
|
7607
7683
|
name: "Component discipline \u2014 international standards (hard contract)",
|
|
7608
7684
|
whenToUse: "MANDATORY before creating or changing ANY @godxjp/ui component, recipe, doc, or example. Enforces real primitives only, no duplication, i18n (Intl/CLDR/ISO/IANA/BCP-47), WAI-ARIA APG + WCAG 2.2 AA, RTL, and the controlled-vocabulary API.",
|
|
7609
7685
|
source: "@godxjp/ui .claude/skills/godxjp-ui-component + international-standardization audit",
|
|
@@ -7650,12 +7726,26 @@ with expectNoA11yViolations. Prefer Radix/cmdk/vaul for ARIA.`
|
|
|
7650
7726
|
"default"); positive booleans; tone for status; forward ref + ...props + className + id; export
|
|
7651
7727
|
XProp + XProp as XProps and register in props/registry. Then: add an MCP catalog entry + a
|
|
7652
7728
|
real-screen docs page; verify typecheck/lint/audit/check:*/preview:build/test all green.`
|
|
7729
|
+
},
|
|
7730
|
+
{
|
|
7731
|
+
id: "report-bug",
|
|
7732
|
+
title: "Found a library-level defect \u2192 file a gh issue (never paper over it)",
|
|
7733
|
+
tagline: "A missing token / wrong vocab / broken a11y in the system is a bug to report, not to work around.",
|
|
7734
|
+
body: `If satisfying this contract is blocked by @godxjp/ui itself \u2014 a token tier that
|
|
7735
|
+
doesn't exist, a primitive missing the controlled-vocabulary prop, a Radix wiring with a
|
|
7736
|
+
real a11y bug, a catalog example that's wrong \u2014 the contract says STOP and fix the SYSTEM,
|
|
7737
|
+
not the call site. Don't bake a one-off around it. If you can fix the library in this repo,
|
|
7738
|
+
do. If you can't (or you're a consumer agent without write access), open a detailed GitHub
|
|
7739
|
+
issue: use the draft_bug_report MCP tool to produce the issue body + a 'gh issue create
|
|
7740
|
+
--repo godx-jp/godxjp-ui \u2026' command, linking the component (get_component) and the cardinal
|
|
7741
|
+
rule (get_rule) involved, with a minimal repro, expected vs actual, version, and env.`
|
|
7653
7742
|
}
|
|
7654
7743
|
]
|
|
7655
7744
|
},
|
|
7656
7745
|
// ── design-to-page (consumer: handoff → real page) ─────────────
|
|
7657
7746
|
{
|
|
7658
7747
|
id: "design-to-page",
|
|
7748
|
+
audience: "consumer",
|
|
7659
7749
|
name: "Design handoff \u2192 real page (consumer build guide)",
|
|
7660
7750
|
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.",
|
|
7661
7751
|
source: "@godxjp/ui .design/research (chats-intent, tables, atomic-components) + dxs-kintai SKILL/colors_and_type.css",
|
|
@@ -7784,6 +7874,114 @@ format numbers/dates via Intl. Then run the build: pnpm typecheck + pnpm lint +
|
|
|
7784
7874
|
pnpm audit must be green, console clean, and eyeball the page at 390 / 768 / 1280
|
|
7785
7875
|
(atoms never wrap, containers wrap with row-gap, tabs horizontal-scroll, grids
|
|
7786
7876
|
minmax(0,1fr), heights never break).`
|
|
7877
|
+
},
|
|
7878
|
+
{
|
|
7879
|
+
id: "report-bug",
|
|
7880
|
+
title: "godx-ui bug / can't-follow-a-rule \u2192 file a gh issue (never fake it)",
|
|
7881
|
+
tagline: "If the LIBRARY is wrong, report it \u2014 don't hand-roll a workaround that hides the bug.",
|
|
7882
|
+
body: `When you CANNOT satisfy a rule because @godxjp/ui itself is at fault \u2014 a
|
|
7883
|
+
primitive doesn't expose the controlled-vocabulary prop you need, a token is
|
|
7884
|
+
missing, a component has a real a11y/behaviour bug, an example in the catalog is
|
|
7885
|
+
wrong \u2014 the rule is: DO NOT silently hand-roll/fake a replacement to dodge it (that
|
|
7886
|
+
just buries a library bug inside every app). Instead:
|
|
7887
|
+
\u2022 DON'T: copy a primitive's internals into your app, swap in a raw <input>/<div>, or
|
|
7888
|
+
redeclare a token to route around the defect.
|
|
7889
|
+
\u2022 DO: open a detailed GitHub issue against the library, then apply the SMALLEST
|
|
7890
|
+
possible local workaround marked // TODO(godxui#<n>: <summary>) so it's grep-able
|
|
7891
|
+
and removed once fixed.
|
|
7892
|
+
\u2022 Use the MCP tool draft_bug_report to generate the issue body + a copy-paste
|
|
7893
|
+
'gh issue create --repo godx-jp/godxjp-ui \u2026' command. Include: the component/rule
|
|
7894
|
+
(link via get_component/get_rule), a minimal repro, expected vs actual, the
|
|
7895
|
+
installed @godxjp/ui version, and your env. A vague "X is broken" issue is not
|
|
7896
|
+
enough \u2014 the report must let a maintainer reproduce in one paste.`
|
|
7897
|
+
}
|
|
7898
|
+
]
|
|
7899
|
+
},
|
|
7900
|
+
// ── compose-a-screen (consumer: primitives → a finished screen) ──
|
|
7901
|
+
{
|
|
7902
|
+
id: "compose-a-screen",
|
|
7903
|
+
audience: "consumer",
|
|
7904
|
+
name: "Compose a screen \u2014 primitives \u2192 a finished app view (consumer)",
|
|
7905
|
+
whenToUse: "You (a consumer agent) are building a NEW screen/page in an app that imports @godxjp/ui \u2014 from a written brief or product requirement, not a design handoff. Read this to assemble it from real primitives via this MCP: pick the right components, lay out one-intent-per-screen, wire every state + a11y + i18n, and verify. For a Claude Design handoff bundle/mock specifically, use design-to-page instead.",
|
|
7906
|
+
source: "@godxjp/ui MCP (consumer surface) \u2014 taste/one-intent + component-discipline + dxs-kintai DNA",
|
|
7907
|
+
sections: [
|
|
7908
|
+
{
|
|
7909
|
+
id: "pick-primitives",
|
|
7910
|
+
title: "Pick primitives via the MCP \u2014 never hand-roll, never guess a prop",
|
|
7911
|
+
tagline: "Decompose the screen into a shopping list; resolve each item with list_primitives \u2192 get_component.",
|
|
7912
|
+
body: `Start from the requirement, not the markup. Write a shopping list of every
|
|
7913
|
+
block the screen needs, then resolve each through THIS MCP before writing JSX:
|
|
7914
|
+
list_primitives (discover the group), get_component <Name> (confirm the exact
|
|
7915
|
+
prop/union/default \u2014 never guess), suggest_primitive / search_components when unsure
|
|
7916
|
+
which fits. Hard rules: compose ONLY real @godxjp/ui primitives \u2014 no styled <div>
|
|
7917
|
+
faking a Card, no raw <input>/<select>/<button>/<textarea>/<table>. No duplication:
|
|
7918
|
+
Select (showSearch/loadOptions) is the ONLY searchable/async select (there is no
|
|
7919
|
+
Combobox/Autocomplete/CountrySelect); the 4 i18n pickers are one AppSettingPicker
|
|
7920
|
+
kind=\u2026. A table = Card + CardContent-flush + DataTable. If a block has no clean
|
|
7921
|
+
primitive, see gaps handling in design-to-page/gaps-extend-or-ask + report-bug.`
|
|
7922
|
+
},
|
|
7923
|
+
{
|
|
7924
|
+
id: "assemble-screen",
|
|
7925
|
+
title: "Assemble it \u2014 one intent per screen, real chrome, fixed signaling",
|
|
7926
|
+
tagline: "One primary question per page; AppShell/PageContainer chrome; --primary once; semantic color is fixed.",
|
|
7927
|
+
body: `Distil the screen to ONE primary question it answers (one-intent-per-screen):
|
|
7928
|
+
1\u20132 hero facts + ONE primary list/form + contextual actions; push tertiary content to
|
|
7929
|
+
a Sheet/Dialog/next page. An 8-stat-card wall is a red flag. Use real page chrome
|
|
7930
|
+
(AppShell/Sidebar/Topbar/PageContainer) \u2014 content never touches the viewport edge,
|
|
7931
|
+
two bordered surfaces never touch (\u9593/breathing via Stack gap). Exactly ONE --primary
|
|
7932
|
+
action per view; status uses the FIXED semantic mapping (success/warning/info/
|
|
7933
|
+
attention/danger) \u2014 never recolor a wa-iro hue into a role, never use --primary for
|
|
7934
|
+
status. Pick density up front (compact 28 heavy-table / default 32 / comfortable 44
|
|
7935
|
+
login-mobile) and don't mix it mid-page. Hierarchy from type weight+size+color
|
|
7936
|
+
(20/18/14/13 \xD7 400/500/700), not colored background blocks. Mobile-first: default one
|
|
7937
|
+
column, add columns only at md:/lg: when each keeps \u226514px body at \u2265~280px width.`
|
|
7938
|
+
},
|
|
7939
|
+
{
|
|
7940
|
+
id: "state-and-a11y",
|
|
7941
|
+
title: "Wire every state + a11y + i18n (the part that gets skipped)",
|
|
7942
|
+
tagline: "default/hover/focus/active/disabled/loading/empty/error all handled; APG keyboard; t() everything.",
|
|
7943
|
+
body: `A screen isn't done at the happy path. Handle every state: Skeleton for INIT
|
|
7944
|
+
fetch (no data yet), Form loading / Spinner for active save (data present), EmptyState
|
|
7945
|
+
for no-data (one calm sentence, no illustration), inline error near the field via
|
|
7946
|
+
FormField (NOT a disappearing toast). Forms: explicit label + help + error always \u2014
|
|
7947
|
+
never placeholder-as-label. A11y (WAI-ARIA APG + WCAG 2.2 AA): correct roles/landmarks,
|
|
7948
|
+
keyboard (arrows/Home/End/Enter/Esc, visible focus, no positive tabindex, return focus
|
|
7949
|
+
on close), \u226524px targets, never colour-only state (add sr-only text), icon-only buttons
|
|
7950
|
+
need a name. i18n: zero hardcoded strings \u2014 every label + aria-label through t();
|
|
7951
|
+
numbers/currency/dates via Intl with the active locale (ISO 4217/8601, IANA tz),
|
|
7952
|
+
plurals via Intl.PluralRules. State-truthful affordances: a parent checkbox aggregates
|
|
7953
|
+
its children (checked/indeterminate/empty); a held value is visible when a control
|
|
7954
|
+
opens; controlled inputs mirror type\u2194click both ways (a controlled value with no
|
|
7955
|
+
synchronous onValueChange FREEZES the input).`
|
|
7956
|
+
},
|
|
7957
|
+
{
|
|
7958
|
+
id: "verify",
|
|
7959
|
+
title: "Verify \u2014 states shown, console clean, build green, 3 widths",
|
|
7960
|
+
tagline: "Drive every interactive control; 0 console errors/warnings; typecheck/lint green; eyeball 390/768/1280.",
|
|
7961
|
+
body: `Before calling the screen done: drive EVERY interactive control to its
|
|
7962
|
+
terminal state in a real browser (don't infer behaviour from source) and read the
|
|
7963
|
+
DevTools console \u2014 a <button>-in-<button>/hydration/act()/404 warning is a FINDING,
|
|
7964
|
+
not noise. Confirm: every prop \xD7 union \xD7 state is exercised; held values visible on
|
|
7965
|
+
open; multi-step selections (date range, capped multi-select) can be restarted from a
|
|
7966
|
+
complete state, not trapped; controlled mirrors update both directions. Run the app's
|
|
7967
|
+
build: typecheck + lint clean, console clean, and eyeball at 390 / 768 / 1280 (atoms
|
|
7968
|
+
never wrap, containers wrap with row-gap, natural-width components stay w-fit, no
|
|
7969
|
+
decorative edge fades, no dead grey panes). If a failure traces to @godxjp/ui itself,
|
|
7970
|
+
do not fake around it \u2014 see report-bug.`
|
|
7971
|
+
},
|
|
7972
|
+
{
|
|
7973
|
+
id: "report-bug",
|
|
7974
|
+
title: "godx-ui bug / can't-follow-a-rule \u2192 file a gh issue (never fake it)",
|
|
7975
|
+
tagline: "If the LIBRARY is wrong, report it \u2014 don't hand-roll a workaround that hides the bug.",
|
|
7976
|
+
body: `Same contract as design-to-page/report-bug: when a rule is impossible because
|
|
7977
|
+
@godxjp/ui is at fault (missing token, a primitive without the controlled-vocabulary
|
|
7978
|
+
prop, a real a11y/behaviour bug, a wrong catalog example) \u2014 DO NOT silently fake a
|
|
7979
|
+
replacement. DON'T copy primitive internals, drop to raw HTML, or redeclare a token to
|
|
7980
|
+
dodge it. DO open a detailed GitHub issue (use the draft_bug_report MCP tool to build
|
|
7981
|
+
the body + the 'gh issue create --repo godx-jp/godxjp-ui \u2026' command), then apply the
|
|
7982
|
+
smallest local workaround tagged // TODO(godxui#<n>: <summary>). The issue must carry a
|
|
7983
|
+
minimal repro, expected vs actual, the installed version, and env \u2014 enough to
|
|
7984
|
+
reproduce in one paste.`
|
|
7787
7985
|
}
|
|
7788
7986
|
]
|
|
7789
7987
|
}
|
|
@@ -7794,7 +7992,7 @@ function findSkill(id) {
|
|
|
7794
7992
|
function findSection(skillId, sectionId) {
|
|
7795
7993
|
return findSkill(skillId)?.sections.find((s) => s.id === sectionId);
|
|
7796
7994
|
}
|
|
7797
|
-
function routeTask(task) {
|
|
7995
|
+
function routeTask(task, opts) {
|
|
7798
7996
|
const q = task.toLowerCase();
|
|
7799
7997
|
const matches = [];
|
|
7800
7998
|
const route = (kw, skill, section, why, alsoSee) => {
|
|
@@ -7885,13 +8083,73 @@ function routeTask(task) {
|
|
|
7885
8083
|
"Generate design image first \u2192 analyze \u2192 implement."
|
|
7886
8084
|
);
|
|
7887
8085
|
route(
|
|
7888
|
-
[
|
|
8086
|
+
[
|
|
8087
|
+
"handoff",
|
|
8088
|
+
"design bundle",
|
|
8089
|
+
"claude design",
|
|
8090
|
+
"prototype",
|
|
8091
|
+
"build the page",
|
|
8092
|
+
"implement the design",
|
|
8093
|
+
"build this screen",
|
|
8094
|
+
"mockup"
|
|
8095
|
+
],
|
|
7889
8096
|
"design-to-page",
|
|
7890
8097
|
"map-to-primitives",
|
|
7891
8098
|
"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.",
|
|
7892
8099
|
["design-to-page/read-intent", "design-to-page/dna", "design-to-page/tables-central"]
|
|
7893
8100
|
);
|
|
7894
|
-
|
|
8101
|
+
route(
|
|
8102
|
+
[
|
|
8103
|
+
"compose a screen",
|
|
8104
|
+
"new screen",
|
|
8105
|
+
"new page",
|
|
8106
|
+
"create a page",
|
|
8107
|
+
"create a screen",
|
|
8108
|
+
"build a view",
|
|
8109
|
+
"build a screen",
|
|
8110
|
+
"from scratch",
|
|
8111
|
+
"screen from a brief"
|
|
8112
|
+
],
|
|
8113
|
+
"compose-a-screen",
|
|
8114
|
+
"pick-primitives",
|
|
8115
|
+
"Build a new app screen from real @godxjp/ui primitives (MCP-first): one-intent-per-screen, real chrome, every state + a11y + i18n, verify.",
|
|
8116
|
+
[
|
|
8117
|
+
"compose-a-screen/assemble-screen",
|
|
8118
|
+
"compose-a-screen/state-and-a11y",
|
|
8119
|
+
"taste/one-intent-per-screen"
|
|
8120
|
+
]
|
|
8121
|
+
);
|
|
8122
|
+
route(
|
|
8123
|
+
[
|
|
8124
|
+
"bug in godx",
|
|
8125
|
+
"godx-ui bug",
|
|
8126
|
+
"report a bug",
|
|
8127
|
+
"file an issue",
|
|
8128
|
+
"gh issue",
|
|
8129
|
+
"can't follow the rule",
|
|
8130
|
+
"library is broken",
|
|
8131
|
+
"primitive is broken"
|
|
8132
|
+
],
|
|
8133
|
+
"compose-a-screen",
|
|
8134
|
+
"report-bug",
|
|
8135
|
+
"If @godxjp/ui itself is at fault, don't fake a workaround \u2014 file a detailed gh issue (use draft_bug_report).",
|
|
8136
|
+
["design-to-page/report-bug"]
|
|
8137
|
+
);
|
|
8138
|
+
const filtered = opts?.consumerOnly ? matches.filter((m) => {
|
|
8139
|
+
const sk = findSkill(m.skill);
|
|
8140
|
+
return !sk || sk.audience !== "core";
|
|
8141
|
+
}) : matches;
|
|
8142
|
+
if (filtered.length === 0) {
|
|
8143
|
+
if (opts?.consumerOnly) {
|
|
8144
|
+
return [
|
|
8145
|
+
{
|
|
8146
|
+
skill: "compose-a-screen",
|
|
8147
|
+
section: "pick-primitives",
|
|
8148
|
+
why: `No keyword match for "${task}". Default consumer path: compose the screen from real primitives via the MCP.`,
|
|
8149
|
+
alsoSee: ["design-to-page/map-to-primitives", "taste/one-intent-per-screen"]
|
|
8150
|
+
}
|
|
8151
|
+
];
|
|
8152
|
+
}
|
|
7895
8153
|
return [
|
|
7896
8154
|
{
|
|
7897
8155
|
skill: "taste",
|
|
@@ -7900,7 +8158,7 @@ function routeTask(task) {
|
|
|
7900
8158
|
}
|
|
7901
8159
|
];
|
|
7902
8160
|
}
|
|
7903
|
-
return
|
|
8161
|
+
return filtered;
|
|
7904
8162
|
}
|
|
7905
8163
|
|
|
7906
8164
|
// src/data/anti-ai-tells.ts
|
|
@@ -8629,27 +8887,71 @@ var TOOL_DEFINITIONS = [
|
|
|
8629
8887
|
},
|
|
8630
8888
|
{
|
|
8631
8889
|
name: "get_tokens",
|
|
8632
|
-
description: "Read design tokens, optionally filtered by category.",
|
|
8890
|
+
description: "Read design tokens, optionally filtered by tier category (primitive / semantic / component).",
|
|
8633
8891
|
inputSchema: {
|
|
8634
8892
|
type: "object",
|
|
8635
8893
|
properties: {
|
|
8636
8894
|
category: {
|
|
8637
8895
|
type: "string",
|
|
8638
|
-
enum: [
|
|
8639
|
-
"color",
|
|
8640
|
-
"spacing",
|
|
8641
|
-
"typography",
|
|
8642
|
-
"radius",
|
|
8643
|
-
"shadow",
|
|
8644
|
-
"motion",
|
|
8645
|
-
"breakpoint",
|
|
8646
|
-
"density",
|
|
8647
|
-
"z-index"
|
|
8648
|
-
]
|
|
8896
|
+
enum: ["primitive", "semantic", "component"]
|
|
8649
8897
|
}
|
|
8650
8898
|
}
|
|
8651
8899
|
}
|
|
8652
8900
|
},
|
|
8901
|
+
// ── CONSUMER NAMESPACE (app-dev surface — core-only skills hidden) ─
|
|
8902
|
+
{
|
|
8903
|
+
name: "list_consumer_skills",
|
|
8904
|
+
description: "List the design skills relevant to an app-dev BUILDING WITH @godxjp/ui (audience consumer/both). Hides core library-maintenance skills. START HERE if you import @godxjp/ui and want guidance (design-to-page, compose-a-screen, taste, \u2026). Returns id + name + whenToUse + section ids.",
|
|
8905
|
+
inputSchema: { type: "object", properties: {} }
|
|
8906
|
+
},
|
|
8907
|
+
{
|
|
8908
|
+
name: "get_consumer_skill",
|
|
8909
|
+
description: "Fetch ONE section of ONE consumer-facing skill. Same as get_skill_section but refuses core-only skills (steers app-devs away from library-maintenance material). Use after list_consumer_skills / route_consumer_task.",
|
|
8910
|
+
inputSchema: {
|
|
8911
|
+
type: "object",
|
|
8912
|
+
properties: {
|
|
8913
|
+
skill: {
|
|
8914
|
+
type: "string",
|
|
8915
|
+
description: "Consumer skill id (e.g. 'design-to-page', 'compose-a-screen')."
|
|
8916
|
+
},
|
|
8917
|
+
section: { type: "string", description: "Section id within that skill." }
|
|
8918
|
+
},
|
|
8919
|
+
required: ["skill"]
|
|
8920
|
+
}
|
|
8921
|
+
},
|
|
8922
|
+
{
|
|
8923
|
+
name: "route_consumer_task",
|
|
8924
|
+
description: "Natural-language task \u2192 consumer skill+section pointer. Like route_task but only points to consumer-facing skills (never core library-maintenance). Use FIRST when you're building an app with @godxjp/ui.",
|
|
8925
|
+
inputSchema: {
|
|
8926
|
+
type: "object",
|
|
8927
|
+
properties: { task: { type: "string", description: "Describe what you want to build." } },
|
|
8928
|
+
required: ["task"]
|
|
8929
|
+
}
|
|
8930
|
+
},
|
|
8931
|
+
{
|
|
8932
|
+
name: "draft_bug_report",
|
|
8933
|
+
description: "When @godxjp/ui ITSELF is at fault (missing token, a primitive lacking the controlled-vocabulary prop, a real a11y/behaviour bug, a wrong catalog example) and you cannot follow a rule \u2014 DON'T fake a workaround. This drafts a detailed GitHub issue body + a copy-paste `gh issue create` command so you can report it. Prints the command only; never runs gh.",
|
|
8934
|
+
inputSchema: {
|
|
8935
|
+
type: "object",
|
|
8936
|
+
properties: {
|
|
8937
|
+
summary: { type: "string", description: "One-line title of the bug / blocked rule." },
|
|
8938
|
+
repro: { type: "string", description: "Minimal steps or code to reproduce." },
|
|
8939
|
+
expected: { type: "string", description: "What SHOULD happen (per the rule/spec)." },
|
|
8940
|
+
actual: { type: "string", description: "What actually happens." },
|
|
8941
|
+
component: {
|
|
8942
|
+
type: "string",
|
|
8943
|
+
description: "Affected component name, if any (links to get_component)."
|
|
8944
|
+
},
|
|
8945
|
+
rule: {
|
|
8946
|
+
type: "number",
|
|
8947
|
+
description: "Cardinal rule number that can't be followed, if any."
|
|
8948
|
+
},
|
|
8949
|
+
version: { type: "string", description: "Installed @godxjp/ui version (e.g. '12.1.0')." },
|
|
8950
|
+
env: { type: "string", description: "Environment (browser/OS/framework), if relevant." }
|
|
8951
|
+
},
|
|
8952
|
+
required: ["summary"]
|
|
8953
|
+
}
|
|
8954
|
+
},
|
|
8653
8955
|
// ── TASK ROUTING (smallest response — pointer) ─────────────────
|
|
8654
8956
|
{
|
|
8655
8957
|
name: "route_task",
|
|
@@ -8716,9 +9018,18 @@ async function dispatchTool(name, args) {
|
|
|
8716
9018
|
case "get_rule":
|
|
8717
9019
|
return getRule(typeof args.number === "number" ? args.number : void 0);
|
|
8718
9020
|
case "get_vocab":
|
|
8719
|
-
return getVocab(args.name);
|
|
9021
|
+
return getVocab(args.name == null ? void 0 : String(args.name));
|
|
8720
9022
|
case "get_tokens":
|
|
8721
9023
|
return getTokens(args.category);
|
|
9024
|
+
// Consumer namespace
|
|
9025
|
+
case "list_consumer_skills":
|
|
9026
|
+
return listConsumerSkills();
|
|
9027
|
+
case "get_consumer_skill":
|
|
9028
|
+
return getConsumerSkill(String(args.skill ?? ""), String(args.section ?? ""));
|
|
9029
|
+
case "route_consumer_task":
|
|
9030
|
+
return routeTaskTool(String(args.task ?? ""), { consumerOnly: true });
|
|
9031
|
+
case "draft_bug_report":
|
|
9032
|
+
return draftBugReport(args);
|
|
8722
9033
|
// Task routing
|
|
8723
9034
|
case "route_task":
|
|
8724
9035
|
return routeTaskTool(String(args.task ?? ""));
|
|
@@ -8736,12 +9047,15 @@ async function dispatchTool(name, args) {
|
|
|
8736
9047
|
function listSkills() {
|
|
8737
9048
|
let out = `# Available skills (${SKILLS.length})
|
|
8738
9049
|
|
|
9050
|
+
`;
|
|
9051
|
+
out += `Each is tagged \`[audience]\` \u2014 \`core\` = building @godxjp/ui itself, \`consumer\` = building an app with it, \`both\`. App-devs: use \`list_consumer_skills\` to hide core material.
|
|
9052
|
+
|
|
8739
9053
|
`;
|
|
8740
9054
|
out += `Use \`get_skill_section skill="..." section="..."\` to drill in.
|
|
8741
9055
|
|
|
8742
9056
|
`;
|
|
8743
9057
|
for (const s of SKILLS) {
|
|
8744
|
-
out += `## ${s.id} \u2014 ${s.name}
|
|
9058
|
+
out += `## ${s.id} \u2014 ${s.name} \`[${s.audience}]\`
|
|
8745
9059
|
`;
|
|
8746
9060
|
out += `**When to use:** ${s.whenToUse}
|
|
8747
9061
|
|
|
@@ -8754,6 +9068,124 @@ function listSkills() {
|
|
|
8754
9068
|
_Source: ${SKILLS.map((s) => s.source).filter((v, i, a) => a.indexOf(v) === i).slice(0, 3).join("; ")}, \u2026_`;
|
|
8755
9069
|
return out;
|
|
8756
9070
|
}
|
|
9071
|
+
function listConsumerSkills() {
|
|
9072
|
+
const list = SKILLS.filter(isConsumerSkill);
|
|
9073
|
+
let out = `# Consumer skills (${list.length}) \u2014 building an app WITH @godxjp/ui
|
|
9074
|
+
|
|
9075
|
+
`;
|
|
9076
|
+
out += `Core library-maintenance skills are hidden. Drill in with \`get_consumer_skill skill="..." section="..."\`, or route a task with \`route_consumer_task\`.
|
|
9077
|
+
|
|
9078
|
+
`;
|
|
9079
|
+
for (const s of list) {
|
|
9080
|
+
out += `## ${s.id} \u2014 ${s.name} \`[${s.audience}]\`
|
|
9081
|
+
`;
|
|
9082
|
+
out += `**When to use:** ${s.whenToUse}
|
|
9083
|
+
|
|
9084
|
+
`;
|
|
9085
|
+
out += `**Sections:** ${s.sections.map((sec) => `\`${sec.id}\``).join(", ")}
|
|
9086
|
+
|
|
9087
|
+
`;
|
|
9088
|
+
}
|
|
9089
|
+
return out;
|
|
9090
|
+
}
|
|
9091
|
+
function getConsumerSkill(skillId, sectionId) {
|
|
9092
|
+
const skill = findSkill(skillId);
|
|
9093
|
+
if (skill && !isConsumerSkill(skill)) {
|
|
9094
|
+
return `Skill "${skillId}" is CORE-only (building @godxjp/ui itself) and isn't served to app-devs. Use \`list_consumer_skills\` for consumer-facing guidance${skillId === "component-discipline" ? ` \u2014 the standards you need when composing/extending are folded into \`compose-a-screen/state-and-a11y\` and \`design-to-page/verify\`.` : `.`}`;
|
|
9095
|
+
}
|
|
9096
|
+
return getSkillSection(skillId, sectionId);
|
|
9097
|
+
}
|
|
9098
|
+
function draftBugReport(args) {
|
|
9099
|
+
const get = (k) => {
|
|
9100
|
+
const v = args[k];
|
|
9101
|
+
return typeof v === "string" ? v.trim() : "";
|
|
9102
|
+
};
|
|
9103
|
+
const summary = get("summary");
|
|
9104
|
+
if (!summary) {
|
|
9105
|
+
return "Pass at least `summary` (one-line title). For a useful report also pass `repro`, `expected`, `actual`, and ideally `component` / `rule` / `version` / `env`. A vague report a maintainer can't reproduce is not enough.";
|
|
9106
|
+
}
|
|
9107
|
+
const repro = get("repro");
|
|
9108
|
+
const expected = get("expected");
|
|
9109
|
+
const actual = get("actual");
|
|
9110
|
+
const component = get("component");
|
|
9111
|
+
const rule = typeof args.rule === "number" ? args.rule : void 0;
|
|
9112
|
+
const version = get("version");
|
|
9113
|
+
const env = get("env");
|
|
9114
|
+
const missing = [];
|
|
9115
|
+
if (!repro) missing.push("repro");
|
|
9116
|
+
if (!expected) missing.push("expected");
|
|
9117
|
+
if (!actual) missing.push("actual");
|
|
9118
|
+
const ph = (label, val) => val ? val : `_(TODO: ${label} \u2014 required for a reproducible report)_`;
|
|
9119
|
+
const title = `[bug] ${summary}`;
|
|
9120
|
+
let body = `## Summary
|
|
9121
|
+
|
|
9122
|
+
${summary}
|
|
9123
|
+
|
|
9124
|
+
`;
|
|
9125
|
+
body += `## Affected
|
|
9126
|
+
|
|
9127
|
+
`;
|
|
9128
|
+
body += component ? `- Component: \`${component}\` (see \`get_component name="${component}"\`)
|
|
9129
|
+
` : `- Component: _(n/a)_
|
|
9130
|
+
`;
|
|
9131
|
+
body += rule !== void 0 ? `- Cardinal rule: #${rule} (see \`get_rule number=${rule}\`)
|
|
9132
|
+
` : "";
|
|
9133
|
+
body += `
|
|
9134
|
+
## Reproduction (minimal)
|
|
9135
|
+
|
|
9136
|
+
${ph("repro", repro)}
|
|
9137
|
+
|
|
9138
|
+
`;
|
|
9139
|
+
body += `## Expected
|
|
9140
|
+
|
|
9141
|
+
${ph("expected", expected)}
|
|
9142
|
+
|
|
9143
|
+
`;
|
|
9144
|
+
body += `## Actual
|
|
9145
|
+
|
|
9146
|
+
${ph("actual", actual)}
|
|
9147
|
+
|
|
9148
|
+
`;
|
|
9149
|
+
body += `## Environment
|
|
9150
|
+
|
|
9151
|
+
`;
|
|
9152
|
+
body += `- @godxjp/ui version: ${version || "_(TODO: e.g. 12.1.0)_"}
|
|
9153
|
+
`;
|
|
9154
|
+
body += `- Env: ${env || "_(TODO: browser / OS / framework)_"}
|
|
9155
|
+
|
|
9156
|
+
`;
|
|
9157
|
+
body += `## Proposed fix
|
|
9158
|
+
|
|
9159
|
+
_(optional \u2014 what the library should do instead)_
|
|
9160
|
+
`;
|
|
9161
|
+
const q = (s) => `'${s.replace(/'/g, `'\\''`)}'`;
|
|
9162
|
+
const cmd = `gh issue create --repo godx-jp/godxjp-ui --label bug --title ${q(title)} --body ${q(body)}`;
|
|
9163
|
+
let out = `# Draft bug report
|
|
9164
|
+
|
|
9165
|
+
`;
|
|
9166
|
+
if (missing.length) {
|
|
9167
|
+
out += `> \u26A0\uFE0F Incomplete \u2014 fill ${missing.map((m) => `\`${m}\``).join(", ")} before filing (a report a maintainer can't reproduce will bounce).
|
|
9168
|
+
|
|
9169
|
+
`;
|
|
9170
|
+
}
|
|
9171
|
+
out += `**Title:** ${title}
|
|
9172
|
+
|
|
9173
|
+
`;
|
|
9174
|
+
out += `## Issue body (Markdown)
|
|
9175
|
+
|
|
9176
|
+
${body}
|
|
9177
|
+
`;
|
|
9178
|
+
out += `## File it (copy-paste \u2014 this tool does NOT run gh)
|
|
9179
|
+
|
|
9180
|
+
\`\`\`sh
|
|
9181
|
+
${cmd}
|
|
9182
|
+
\`\`\`
|
|
9183
|
+
|
|
9184
|
+
`;
|
|
9185
|
+
out += `_Reminder: don't hand-roll a fake workaround to hide the bug \u2014 file this, then mark any minimal local workaround with \`// TODO(godxui#<n>)\`._
|
|
9186
|
+
`;
|
|
9187
|
+
return out;
|
|
9188
|
+
}
|
|
8757
9189
|
function listPrimitives(group) {
|
|
8758
9190
|
const list = group ? componentsByGroup(group) : COMPONENTS;
|
|
8759
9191
|
if (list.length === 0) return `No components${group ? ` in group "${group}"` : ""}.`;
|
|
@@ -9093,11 +9525,11 @@ function getTokens(cat) {
|
|
|
9093
9525
|
}
|
|
9094
9526
|
return out;
|
|
9095
9527
|
}
|
|
9096
|
-
function routeTaskTool(task) {
|
|
9528
|
+
function routeTaskTool(task, opts) {
|
|
9097
9529
|
if (!task.trim())
|
|
9098
9530
|
return "Describe the task (e.g. 'design a premium agency hero', 'audit existing settings page').";
|
|
9099
|
-
const results = routeTask(task);
|
|
9100
|
-
let out = `# Routing "${task}"
|
|
9531
|
+
const results = routeTask(task, opts);
|
|
9532
|
+
let out = `# Routing "${task}"${opts?.consumerOnly ? " (consumer)" : ""}
|
|
9101
9533
|
|
|
9102
9534
|
`;
|
|
9103
9535
|
for (const r of results) {
|
|
@@ -9196,10 +9628,19 @@ function lintJsx(jsx) {
|
|
|
9196
9628
|
check(/<input[\s>]/, "Use `<Input>` instead of raw `<input>` (rule 29).");
|
|
9197
9629
|
check(/<select[\s>]/, "Use `<Select>` instead of raw `<select>` (rule 29).");
|
|
9198
9630
|
check(/<textarea[\s>]/, "Use `<Textarea>` instead of raw `<textarea>` (rule 29).");
|
|
9631
|
+
check(/<(table|thead|tbody)[\s>]/, "Use `<DataTable>` instead of a hand-rolled `<table>` (rule 29).");
|
|
9199
9632
|
check(
|
|
9200
9633
|
/bg-(red|blue|green|yellow|gray|slate|zinc|neutral|stone|orange|amber|lime|emerald|teal|cyan|sky|indigo|violet|purple|fuchsia|pink|rose)-\d{2,3}\b/,
|
|
9201
9634
|
"Use semantic token utilities (`bg-primary`/`bg-destructive`) not raw color scales (rule 2)."
|
|
9202
9635
|
);
|
|
9636
|
+
check(
|
|
9637
|
+
/\b(?:ml|mr|pl|pr|left|right)-(?:\d|\[|auto|px|full|screen)|\b(?:rounded-[lr]|border-[lr]|text-(?:left|right))\b/,
|
|
9638
|
+
"Physical direction class \u2014 use logical CSS (`ms-/me-`, `ps-/pe-`, `start-/end-`, `rounded-s/e`, `text-start/end`) so the UI flips correctly under RTL (rule: logical CSS)."
|
|
9639
|
+
);
|
|
9640
|
+
check(
|
|
9641
|
+
/size=["']default["']/,
|
|
9642
|
+
'`size="default"` is not in the controlled vocabulary \u2014 use `size` \u2208 xs|sm|md|lg.'
|
|
9643
|
+
);
|
|
9203
9644
|
check(
|
|
9204
9645
|
/<Tag[\s\S]*?color=["']error["']/i,
|
|
9205
9646
|
'Tag `color="error"` \u2192 `"destructive"` (v5.0, PR #60).'
|
|
@@ -9268,6 +9709,7 @@ Note: heuristic only \u2014 not a substitute for the full CI gate.
|
|
|
9268
9709
|
}
|
|
9269
9710
|
|
|
9270
9711
|
// src/resources/registry.ts
|
|
9712
|
+
var RULE_COUNT = CARDINAL_RULES.length;
|
|
9271
9713
|
var RESOURCE_DEFINITIONS = [
|
|
9272
9714
|
{
|
|
9273
9715
|
uri: "godx-ui://components",
|
|
@@ -9289,8 +9731,8 @@ var RESOURCE_DEFINITIONS = [
|
|
|
9289
9731
|
},
|
|
9290
9732
|
{
|
|
9291
9733
|
uri: "godx-ui://rules",
|
|
9292
|
-
name:
|
|
9293
|
-
description:
|
|
9734
|
+
name: `Cardinal rules (${RULE_COUNT})`,
|
|
9735
|
+
description: `The ${RULE_COUNT} binding rules from CLAUDE.md as Markdown.`,
|
|
9294
9736
|
mimeType: "text/markdown"
|
|
9295
9737
|
},
|
|
9296
9738
|
{
|
|
@@ -9397,7 +9839,7 @@ ${c.example}
|
|
|
9397
9839
|
// package.json
|
|
9398
9840
|
var package_default = {
|
|
9399
9841
|
name: "@godxjp/ui-mcp",
|
|
9400
|
-
version: "0.
|
|
9842
|
+
version: "0.19.0",
|
|
9401
9843
|
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).",
|
|
9402
9844
|
type: "module",
|
|
9403
9845
|
main: "./dist/index.js",
|