@wangs-ui/skills 1.2.28 → 1.3.0-alpha.11

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.
@@ -16,21 +16,28 @@ Do **NOT** guess table prop names or hardcode table structures. Query the MCP se
16
16
  ### Inspect Component Contracts:
17
17
 
18
18
  ```json
19
- get-documentation({ "id": "datatable" })
20
- get-documentation({ "id": "exportbutton" })
21
- get-documentation({ "id": "filtercontainer" })
22
- get-documentation({ "id": "bulkactionbutton" })
19
+ get_component_api({ "id": "datatable" })
20
+ get_component_api({ "id": "exportbutton" })
21
+ get_component_api({ "id": "filtercontainer" })
22
+ get_component_api({ "id": "bulkactionbutton" })
23
+ ```
24
+
25
+ ### Read Curated Documentation:
26
+
27
+ ```json
28
+ get_documentation({ "id": "datatable" })
29
+ get_documentation({ "id": "exportbutton" })
23
30
  ```
24
31
 
25
32
  ### Inspect Live Story Implementations:
26
33
 
27
34
  ```json
28
- get-documentation-for-story({ "id": "datatable", "storyName": "Basic" })
29
- get-documentation-for-story({ "id": "datatable", "storyName": "ServerPagination" })
30
- get-documentation-for-story({ "id": "datatable", "storyName": "Sortable" })
31
- get-documentation-for-story({ "id": "datatable", "storyName": "MultipleSelection" })
32
- get-documentation-for-story({ "id": "datatable", "storyName": "CustomColumn" })
33
- get-documentation-for-story({ "id": "exportbutton", "storyName": "WithTable" })
35
+ get_component_examples({ "component": "datatable", "variant": "Basic" })
36
+ get_component_examples({ "component": "datatable", "variant": "CursorPagination" })
37
+ get_component_examples({ "component": "datatable", "variant": "Sortable" })
38
+ get_component_examples({ "component": "datatable", "variant": "MultipleSelection" })
39
+ get_component_examples({ "component": "datatable", "variant": "CustomColumn" })
40
+ get_component_examples({ "component": "exportbutton", "variant": "WithTable" })
34
41
  ```
35
42
 
36
43
  ### Inspect Knowledge Graph & Usages:
@@ -47,7 +54,7 @@ query_graph({ "query": "useDataTableFetch" })
47
54
  The Wangs UI `DataTable` is built on a modular, headless-first architecture:
48
55
 
49
56
  1. **Declarative Column Definitions (`TableColumn<T>[]`)**:
50
- Columns are configured as typed array objects, not as JSX children. Check `get-documentation({ "id": "datatable" })` for column field types.
57
+ Columns are configured as typed array objects, not as JSX children. Check `get_component_api({ "id": "datatable" })` for column field types.
51
58
  2. **Table Instance Hook (`useDataTable`)**:
52
59
  Coordinates table state (sorting, pagination, selection, column ordering, pinning, visibility).
53
60
  3. **Data Fetching Hook (`useDataTableFetch`)**:
@@ -62,7 +69,7 @@ The Wangs UI `DataTable` is built on a modular, headless-first architecture:
62
69
 
63
70
  ## 3. Mandatory Implementation Rules
64
71
 
65
- 1. **Query MCP for Current Code Patterns**: Always run `get-documentation-for-story` for `datatable` before drafting code.
72
+ 1. **Query MCP for Current Code Patterns**: Always run `get_component_examples` for `datatable` before drafting code.
66
73
  2. **Strict Subpath Imports**: Import via `@wangs-ui/react-core/primitive/datatable` and companion primitive paths.
67
74
  3. **Always Translate Visible Copy**: All column header labels, empty state messages, and action button labels must be wrapped in `t('...')` from `@wangs-ui/react-i18n`.
68
75
  4. **Stable Row Identity**: Always configure a unique key identifier for stable selection and row identity.
@@ -16,18 +16,26 @@ Do **NOT** guess overlay props, event names, or footer slots. Query the MCP serv
16
16
  ### Inspect Overlay Contracts:
17
17
 
18
18
  ```json
19
- get-documentation({ "id": "dialog" })
20
- get-documentation({ "id": "dialogform" })
21
- get-documentation({ "id": "modal" })
22
- get-documentation({ "id": "toast" })
19
+ get_component_api({ "id": "dialog" })
20
+ get_component_api({ "id": "dialogform" })
21
+ get_component_api({ "id": "modal" })
22
+ get_component_api({ "id": "toast" })
23
+ ```
24
+
25
+ ### Read Curated Overlay Documentation:
26
+
27
+ ```json
28
+ get_documentation({ "id": "dialog" })
29
+ get_documentation({ "id": "dialogform" })
30
+ get_documentation({ "id": "modal" })
23
31
  ```
24
32
 
25
33
  ### Inspect Live Story Implementations:
26
34
 
27
35
  ```json
28
- get-documentation-for-story({ "id": "dialog", "storyName": "Confirmation" })
29
- get-documentation-for-story({ "id": "dialogform", "storyName": "Default" })
30
- get-documentation-for-story({ "id": "modal", "storyName": "Default" })
36
+ get_component_examples({ "component": "dialog", "variant": "RichHeaderFooter" })
37
+ get_component_examples({ "component": "dialogform", "variant": "Default" })
38
+ get_component_examples({ "component": "modal", "variant": "Default" })
31
39
  ```
32
40
 
33
41
  ### Inspect Knowledge Graph & Usages:
@@ -16,19 +16,26 @@ Do **NOT** guess component localization contracts, language switcher variants, o
16
16
  ### Inspect Localized Component Contracts:
17
17
 
18
18
  ```json
19
- get-documentation({ "id": "languageswitcher" })
20
- get-documentation({ "id": "currencyinput" })
21
- get-documentation({ "id": "datepicker" })
22
- get-documentation({ "id": "select" })
23
- get-documentation({ "id": "datatable" })
19
+ get_component_api({ "id": "languageswitcher" })
20
+ get_component_api({ "id": "currencyinput" })
21
+ get_component_api({ "id": "datepicker" })
22
+ get_component_api({ "id": "select" })
23
+ get_component_api({ "id": "datatable" })
24
+ ```
25
+
26
+ ### Read Curated Localization Documentation:
27
+
28
+ ```json
29
+ get_documentation({ "id": "languageswitcher" })
30
+ get_documentation({ "id": "currencyinput" })
24
31
  ```
25
32
 
26
33
  ### Inspect Live Story Implementations:
27
34
 
28
35
  ```json
29
- get-documentation-for-story({ "id": "languageswitcher", "storyName": "Basic" })
30
- get-documentation-for-story({ "id": "currencyinput", "storyName": "Basic" })
31
- get-documentation-for-story({ "id": "datepicker", "storyName": "Default" })
36
+ get_component_examples({ "component": "languageswitcher", "variant": "Default" })
37
+ get_component_examples({ "component": "currencyinput", "variant": "Default" })
38
+ get_component_examples({ "component": "datepicker", "variant": "Default" })
32
39
  ```
33
40
 
34
41
  ---
@@ -16,19 +16,26 @@ Do **NOT** guess layout block slots, sidebar item interfaces, or breadcrumb prop
16
16
  ### Inspect Layout & Navigation Contracts:
17
17
 
18
18
  ```json
19
- get-documentation({ "id": "applayout" })
20
- get-documentation({ "id": "sidebar" })
21
- get-documentation({ "id": "breadcrumb" })
22
- get-documentation({ "id": "tabs" })
19
+ get_component_api({ "id": "applayout" })
20
+ get_component_api({ "id": "sidebar" })
21
+ get_component_api({ "id": "breadcrumb" })
22
+ get_component_api({ "id": "tabs" })
23
+ ```
24
+
25
+ ### Read Curated Layout Documentation:
26
+
27
+ ```json
28
+ get_documentation({ "id": "applayout" })
29
+ get_documentation({ "id": "sidebar" })
23
30
  ```
24
31
 
25
32
  ### Inspect Live Story Implementations:
26
33
 
27
34
  ```json
28
- get-documentation-for-story({ "id": "applayout", "storyName": "Default" })
29
- get-documentation-for-story({ "id": "sidebar", "storyName": "Default" })
30
- get-documentation-for-story({ "id": "breadcrumb", "storyName": "Default" })
31
- get-documentation-for-story({ "id": "tabs", "storyName": "Default" })
35
+ get_component_examples({ "component": "applayout", "variant": "TopNavbar" })
36
+ get_component_examples({ "component": "sidebar", "variant": "WithSubMenu" })
37
+ get_component_examples({ "component": "breadcrumb", "variant": "Default" })
38
+ get_component_examples({ "component": "tabs", "variant": "Default" })
32
39
  ```
33
40
 
34
41
  ### Inspect Knowledge Graph & Usages:
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: responsive-design
3
+ description: Guidelines for implementing responsive UIs with Wangs UI — covering Breakpoint tiers, responsive props (ResponsiveValue), <Show> conditional rendering, and spacing conventions.
4
+ ---
5
+
6
+ # Skill: Responsive Design (Consumer Guide)
7
+
8
+ Use this skill when building responsive pages, layouts, or screen adaptations with Wangs UI components.
9
+
10
+ ---
11
+
12
+ ## 1. Breakpoint Reference
13
+
14
+ Wangs UI uses three standardized breakpoints:
15
+
16
+ | Breakpoint | Viewport Range | Typical Target |
17
+ | :------------- | :------------- | :------------------------- |
18
+ | **`compact`** | `< 600px` | Mobile phones |
19
+ | **`medium`** | `600–839px` | Tablet portrait |
20
+ | **`expanded`** | `≥ 840px` | Tablet landscape & Desktop |
21
+
22
+ ### Reading the Current Breakpoint in Code
23
+
24
+ ```tsx
25
+ import { useTheme } from '@wangs-ui/foundation/theme';
26
+
27
+ const { breakpoint } = useTheme(); // 'compact' | 'medium' | 'expanded'
28
+ ```
29
+
30
+ ---
31
+
32
+ ## 2. Responsive Props (`ResponsiveValue`)
33
+
34
+ Visual scale props (`size`, layout `gap`, `columns`, `p`, `m`) accept either a single value or an object mapped by breakpoint:
35
+
36
+ ```tsx
37
+ // Static (identical across all devices)
38
+ <Button size="md" />
39
+ <Stack gap={4} />
40
+
41
+ // Adaptive (changes across breakpoints)
42
+ <Button size={{ compact: 'lg', expanded: 'sm' }} />
43
+ <Grid columns={{ compact: 1, medium: 2, expanded: 4 }} />
44
+ ```
45
+
46
+ > **Rule**: Do **NOT** attempt to use responsive objects on event handlers or boolean flags (e.g. `disabled`, `onClick`). Only visual scale props support responsive objects.
47
+
48
+ ---
49
+
50
+ ## 3. Conditional Rendering (`<Show>`)
51
+
52
+ Use `<Show>` when a component should be mounted or unmounted based on the active breakpoint:
53
+
54
+ ```tsx
55
+ import { Show } from '@wangs-ui/foundation/theme';
56
+
57
+ // Render only on tablet & desktop
58
+ <Show above="medium">
59
+ <SidebarNav />
60
+ </Show>
61
+
62
+ // Render only on mobile
63
+ <Show below="medium">
64
+ <MobileNavbar />
65
+ </Show>
66
+
67
+ // Swap component with a fallback
68
+ <Show at="compact" fallback={<DesktopTable />}>
69
+ <MobileCardList />
70
+ </Show>
71
+ ```
72
+
73
+ ### When to use `<Show>` vs CSS `hidden`:
74
+
75
+ - **Use `<Show>`**: If the hidden component has expensive network fetches, subscriptions, or animations (unmounts completely).
76
+ - **Use CSS Tailwind (`hidden md:block`)**: If it's just a visual styling toggle with no side effects.
77
+
78
+ ---
79
+
80
+ ## 4. Spacing Conventions
81
+
82
+ Spacing tokens are **flat and fixed** (1 unit = 4px):
83
+
84
+ - **Web**: Use standard Tailwind numeric classes (`gap-2`, `px-4`, `py-3`). **Never** use legacy named classes like `gap-md` or `px-sm`.
85
+ - **Native**: Use `const { spacing } = useTheme();` (`spacing[4]` = 16px).
86
+
87
+ ---
88
+
89
+ ## 5. Anti-Patterns to Avoid
90
+
91
+ 1. **Avoid `hidden md:block` for stateful/heavy trees**: Always prefer `<Show>` so unused components cleanly unmount.
92
+ 2. **Never pass responsive objects to behavioral props**: `<Button disabled={{ compact: true }} />` is invalid.
93
+ 3. **No manual pixel calculations**: Use Tailwind numeric tokens (`gap-4`, `p-6`) or `ResponsiveValue`.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: universal-layout
3
+ description: Universal layout primitives (Box, Flex, Stack, Grid, Container, Section) with ResponsiveValue patterns for Web and React Native in Wangs UI.
4
+ ---
5
+
6
+ # Skill: Universal Layout Primitives
7
+
8
+ Use this skill when arranging page structure, spacing, or responsive grids with
9
+ `@wangs-ui/foundation/layout`.
10
+ For app shells (sidebar, breadcrumb, tabs), see the `layout-navigation` skill instead.
11
+
12
+ ---
13
+
14
+ ## 1. MCP Inspection Protocol (Mandatory Single Source of Truth)
15
+
16
+ Do **NOT** guess layout prop names, spacing scales, or breakpoint keys. Query the MCP
17
+ server dynamically:
18
+
19
+ ```json
20
+ list_catalog({ "category": "layout" })
21
+ get_component_api({ "id": "layout:box" })
22
+ get_component_api({ "id": "layout:grid" })
23
+ get_documentation({ "id": "layout-stack" })
24
+ ```
25
+
26
+ Resolve shared types before writing responsive props:
27
+
28
+ ```json
29
+ resolve_type_definition({ "name": "ResponsiveValue" })
30
+ resolve_type_definition({ "name": "SpacingKey" })
31
+ ```
32
+
33
+ ---
34
+
35
+ ## 2. Choosing the Right Primitive
36
+
37
+ 1. **Stack (VStack)** — default for vertical flows (forms, cards, page sections).
38
+ Fixed `column` direction, uniform `gap`, optional auto-`separator`.
39
+ 2. **HStack** — horizontal rows with vertical centering (avatar + label + action,
40
+ toolbar clusters). Fixed `row` direction.
41
+ 3. **Flex** — only when you need explicit `direction`, `wrap`, `align`, or `justify`
42
+ control beyond what Stack/HStack fix. Prefer Stack/HStack otherwise.
43
+ 4. **Grid** — two-dimensional placement or multi-column flows:
44
+ - explicit `columns={{ compact: 1, medium: 2, expanded: 4 }}` for fixed column counts;
45
+ - `minItemWidth` for auto-fit (columns grow/shrink with container width, no media query);
46
+ - `GridItem` with `colSpan` / `rowSpan` for featured tiles.
47
+ 5. **Box** — leaf-level spacing/sizing wrapper (`p`, `m`, `radius`, `overflow`), or
48
+ polymorphic `as="section" | "main" | "article"` for landmarks.
49
+ 6. **Container / Section** — page-level rhythm only: `Container` bounds max-width
50
+ (`size`, default `'xl'`) with consistent horizontal padding; `Section` sets
51
+ vertical rhythm (`space: 'sm' | 'md' | 'lg'`, default `'md'`). Never nest
52
+ `Container` inside `Container`.
53
+ 7. **ZStack** — overlays (badge on card, status dot on avatar, hero overlay).
54
+ 8. **AspectRatio / Bleed / Spacer** — media frames (`ratio`), full-bleed breakouts
55
+ inside padded containers (`Bleed`), and flexible fillers in stacks (`Spacer`).
56
+
57
+ ---
58
+
59
+ ## 3. Mandatory Implementation Rules
60
+
61
+ 1. **ResponsiveValue everywhere**: scalar for static (`gap={4}`), object for
62
+ adaptive (`gap={{ compact: 2, medium: 4, expanded: 6 }}`,
63
+ `columns={{ compact: 1, medium: 2, expanded: 4 }}`). Breakpoints are
64
+ `compact` (mobile-first base), `medium` (`md:`), `expanded` (`lg:`).
65
+ 2. **Separators, not manual dividers**: `<Stack separator={<Divider />}>` inserts
66
+ dividers between children with no trailing element. Never hand-place a divider
67
+ after every child.
68
+ 3. **Spacing scale**: `gap`/`p`/`m` use `SpacingKey` (Tailwind numeric scale,
69
+ 1 unit = 4px). Never pass raw pixel strings to spacing props.
70
+ 4. **Strict subpath imports**:
71
+ ```tsx
72
+ import { Stack, HStack, Grid, Container } from '@wangs-ui/foundation/layout';
73
+ ```
74
+ 5. **Translate visible labels** inside layout children via `t('...')` from
75
+ `@wangs-ui/react-i18n` (layout props themselves are never translated).
76
+
77
+ ---
78
+
79
+ ## 4. Anti-Patterns (Forbidden)
80
+
81
+ 1. **Gap vs margin**: NEVER hardcode `marginBottom`/`mb-*` on children inside a
82
+ Stack/Flex/Grid to fake spacing — always use the parent's `gap`/`gapX`/`gapY`.
83
+ Margins collapse unpredictably and break `separator` insertion.
84
+ 2. **No nested Containers** and no `Container` for non-page content (cards, modals).
85
+ 3. **No `Flex` with hardcoded `flexDirection` styles** when `Stack`/`HStack` express it.
86
+ 4. **No raw media queries** for `direction`/`gap`/`columns` — use `ResponsiveValue`.
87
+ 5. **No `Grid` for one-dimensional lists** — that is `Stack`/`HStack` territory.
@@ -15,28 +15,34 @@ Do **NOT** guess component props, Pass-Through (`pt`) slots, or event names. Alw
15
15
 
16
16
  ```mermaid
17
17
  graph TD
18
- A[Identify Component Needed] --> B[Call get-documentation id]
19
- B --> C{Need live story / variant code?}
20
- C -->|Yes| D[Call get-documentation-for-story]
21
- C -->|No| E[Check Graphify: query_graph]
22
- D --> E
23
- E --> F[Implement Component with Subpath Imports]
18
+ A[Identify Component Needed] --> B[list_catalog to confirm the id]
19
+ B --> C[get_component_api for the typed contract]
20
+ C --> D{Need live story / variant code?}
21
+ D -->|Yes| E[get_component_examples]
22
+ D -->|No| F[get_documentation for curated guidance]
23
+ E --> G[Check Graphify: query_graph]
24
+ F --> G
25
+ G --> H[Implement Component with Subpath Imports]
24
26
  ```
25
27
 
26
28
  ### Discovery Steps:
27
29
 
28
30
  1. **Inspect Component Contract & Props**:
29
31
  ```json
30
- get-documentation({ "id": "button" })
31
- get-documentation({ "id": "input" })
32
- get-documentation({ "id": "datatable" })
32
+ get_component_api({ "id": "button" })
33
+ get_component_api({ "id": "input" })
34
+ get_component_api({ "id": "datatable" })
33
35
  ```
34
- 2. **Inspect Live Usage & Story Variants**:
36
+ 2. **Inspect Curated Documentation**:
35
37
  ```json
36
- get-documentation-for-story({ "id": "button", "storyName": "Default" })
37
- get-documentation-for-story({ "id": "datatable", "storyName": "ServerPagination" })
38
+ get_documentation({ "id": "button" })
38
39
  ```
39
- 3. **Inspect Relationships & Real Usages in Graph**:
40
+ 3. **Inspect Live Usage & Story Variants**:
41
+ ```json
42
+ get_component_examples({ "component": "button", "variant": "Sizes" })
43
+ get_component_examples({ "component": "datatable", "variant": "CursorPagination" })
44
+ ```
45
+ 4. **Inspect Relationships & Real Usages in Graph**:
40
46
  ```json
41
47
  query_graph({ "query": "DataTable" })
42
48
  query_graph({ "query": "usePT" })
@@ -104,5 +110,7 @@ Never write raw HTML elements when a Wangs UI primitive exists:
104
110
 
105
111
  ### Spacing Tokens
106
112
 
107
- - Gap: `gap-xs`, `gap-sm`, `gap-md`, `gap-lg`, `gap-xl`, `gap-2xl`, `gap-3xl`
108
- - Padding: `p-xs`, `p-sm`, `p-md`, `p-lg`, `p-xl`, `p-2xl`, `p-3xl`
113
+ - Flat numeric scale, Tailwind-aligned (1 unit = 4px): `0`, `0.5`, `1`, `1.5`, `2`, `2.5`, `3`, `3.5`, `4`…`16` (e.g. `4` = 16px)
114
+ - Web: use numeric utilities directly — Gap: `gap-4`, Padding: `px-4 py-1.5`
115
+ - Native: read pixel values via `useTheme().spacing` (e.g. `spacing[4] === 16`)
116
+ - Responsiveness via `ResponsiveValue<T>` size props and `<Show>`, not per-density spacing tokens