@wangs-ui/skills 1.0.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/bin.js ADDED
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ import { i as listSkills, n as updateSkills, r as addSkills, t as removeSkills } from "./src-BsIrKDsV.js";
3
+ import path from "node:path";
4
+ import { parseArgs } from "node:util";
5
+ //#region bin.ts
6
+ var HELP_TEXT = `
7
+ \x1b[1m\x1b[36m🚀 Wangs UI Skills CLI\x1b[0m
8
+ Install, update, and manage modular AI agent skills for Wangs UI React applications.
9
+
10
+ \x1b[1mUsage:\x1b[0m
11
+ npx @wangs-ui/skills [command] [options]
12
+ wangs-ui-skills [command] [options]
13
+
14
+ \x1b[1mCommands:\x1b[0m
15
+ \x1b[36mlist\x1b[0m List all available and installed skills
16
+ \x1b[36madd\x1b[0m [skills...] Install specified skills (interactive if none provided)
17
+ \x1b[36mupdate\x1b[0m [skills...] Update installed skills to latest versions
18
+ \x1b[36mremove\x1b[0m <skills...> Remove specified skills from agent environment
19
+
20
+ \x1b[1mOptions:\x1b[0m
21
+ --target <dir> Target directory (default: current working directory)
22
+ -h, --help Show help message
23
+ -v, --version Show version
24
+
25
+ \x1b[1mExamples:\x1b[0m
26
+ npx @wangs-ui/skills list
27
+ npx @wangs-ui/skills add create-form
28
+ npx @wangs-ui/skills add wangs-ui-components data-table dialog-modal
29
+ npx @wangs-ui/skills update
30
+ npx @wangs-ui/skills remove create-form
31
+ `;
32
+ async function main() {
33
+ const args = process.argv.slice(2);
34
+ if (args.includes("--help") || args.includes("-h")) {
35
+ console.log(HELP_TEXT);
36
+ return;
37
+ }
38
+ if (args.includes("--version") || args.includes("-v")) {
39
+ console.log("1.0.0");
40
+ return;
41
+ }
42
+ const parsed = parseArgs({
43
+ args,
44
+ options: { target: { type: "string" } },
45
+ allowPositionals: true,
46
+ strict: false
47
+ });
48
+ const baseDir = parsed.values.target ? path.resolve(parsed.values.target) : process.cwd();
49
+ const { positionals } = parsed;
50
+ const command = positionals[0] || "list";
51
+ const skillArgs = positionals.slice(1);
52
+ switch (command) {
53
+ case "list":
54
+ case "ls":
55
+ listSkills(baseDir);
56
+ break;
57
+ case "add":
58
+ case "install":
59
+ case "i":
60
+ await addSkills(skillArgs, baseDir);
61
+ break;
62
+ case "update":
63
+ case "up":
64
+ updateSkills(skillArgs, baseDir);
65
+ break;
66
+ case "remove":
67
+ case "rm":
68
+ case "delete":
69
+ removeSkills(skillArgs, baseDir);
70
+ break;
71
+ default:
72
+ console.log(`\x1b[31mUnknown command: "${command}"\x1b[0m`);
73
+ console.log(HELP_TEXT);
74
+ process.exit(1);
75
+ }
76
+ }
77
+ try {
78
+ await main();
79
+ } catch (err) {
80
+ console.error("Error running @wangs-ui/skills:", err);
81
+ process.exit(1);
82
+ }
83
+ //#endregion
84
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { a as getAgentSkillDirs, c as isSkillInstalled, d as loadAllSkills, i as listSkills, l as removeSkill, n as updateSkills, o as getInstalledSkills, r as addSkills, s as installSkill, t as removeSkills, u as getSkill } from "./src-BsIrKDsV.js";
2
+ export { addSkills, getAgentSkillDirs, getInstalledSkills, getSkill, installSkill, isSkillInstalled, listSkills, loadAllSkills, removeSkill, removeSkills, updateSkills };
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: create-form
3
+ description: Architecture, validation workflows, and MCP discovery protocol for building forms and input controls with @wangs-ui/react-core.
4
+ ---
5
+
6
+ # Skill: Form Architecture & Validation Workflows
7
+
8
+ Use this skill when building forms, data entry panels, settings pages, or multipart forms in Wangs UI applications.
9
+
10
+ ---
11
+
12
+ ## 1. MCP Inspection Protocol (Mandatory Single Source of Truth)
13
+
14
+ Do **NOT** hardcode or guess prop names, field configurations, or validation options. Retrieve active component definitions and live implementation stories directly from MCP:
15
+
16
+ ### Inspect Component & Form Contracts:
17
+
18
+ ```json
19
+ get-documentation({ "id": "form" })
20
+ get-documentation({ "id": "field" })
21
+ get-documentation({ "id": "input" })
22
+ get-documentation({ "id": "numberinput" })
23
+ get-documentation({ "id": "select" })
24
+ get-documentation({ "id": "multiselect" })
25
+ get-documentation({ "id": "datepicker" })
26
+ get-documentation({ "id": "fileupload" })
27
+ ```
28
+
29
+ ### Inspect Live Story Implementations:
30
+
31
+ ```json
32
+ get-documentation-for-story({ "id": "form", "storyName": "Default" })
33
+ get-documentation-for-story({ "id": "field", "storyName": "Default" })
34
+ get-documentation-for-story({ "id": "select", "storyName": "Basic" })
35
+ get-documentation-for-story({ "id": "datepicker", "storyName": "Default" })
36
+ get-documentation-for-story({ "id": "fileupload", "storyName": "Default" })
37
+ ```
38
+
39
+ ### Inspect Knowledge Graph & Usages:
40
+
41
+ ```json
42
+ query_graph({ "query": "useFormControl" })
43
+ query_graph({ "query": "Field" })
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 2. Form Architecture & State Principles
49
+
50
+ 1. **State & Control**:
51
+ - Standard REST payload forms use `useFormControl` with JSON mode.
52
+ - Multipart file upload workflows use `useFormControl` with FormData mode.
53
+ 2. **Field Composition**:
54
+ - Form inputs are wrapped with `<Field>` layout containers for unified label, tooltip, helper text, and error rendering.
55
+ - Exact props, slot rendering functions, and field binding options must be retrieved via MCP (`get-documentation({ "id": "field" })`).
56
+ 3. **Server Validation Error Mapping**:
57
+ - Backend validation responses (e.g. `422 Unprocessable Entity`) are mapped back into the form instance via `formControl.setError()`.
58
+ 4. **Submission Lifecycle**:
59
+ - In-flight network requests should manage loading state on submit actions and prevent accidental reset during mutations.
60
+
61
+ ---
62
+
63
+ ## 3. Mandatory Implementation Rules
64
+
65
+ 1. **Always Query MCP First**: Never guess input props or event signatures; obtain the exact types from `get-documentation`.
66
+ 2. **Strict Subpath Imports**: All components must be imported via their granular subpath (`@wangs-ui/react-core/primitive/*`, `@wangs-ui/form`).
67
+ 3. **Translate All Visible Strings**: Every field label, placeholder, helper text, and error message must be wrapped in `t('...')` from `@wangs-ui/react-i18n`.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: data-table
3
+ description: Architecture, workflows, and MCP discovery protocol for building DataTables with sorting, pagination, filtering, selection, and export.
4
+ ---
5
+
6
+ # Skill: DataTable Architecture & Integration Workflows
7
+
8
+ Use this skill when implementing data grids, server-paginated tables, filterable listing views, or batch management interfaces with `@wangs-ui/react-core`.
9
+
10
+ ---
11
+
12
+ ## 1. MCP Inspection Protocol (Mandatory Single Source of Truth)
13
+
14
+ Do **NOT** guess table prop names or hardcode table structures. Query the MCP server dynamically to inspect exact TypeScript signatures, live story implementations, and companion controls:
15
+
16
+ ### Inspect Component Contracts:
17
+
18
+ ```json
19
+ get-documentation({ "id": "datatable" })
20
+ get-documentation({ "id": "exportbutton" })
21
+ get-documentation({ "id": "filtercontainer" })
22
+ get-documentation({ "id": "bulkactionbutton" })
23
+ ```
24
+
25
+ ### Inspect Live Story Implementations:
26
+
27
+ ```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" })
34
+ ```
35
+
36
+ ### Inspect Knowledge Graph & Usages:
37
+
38
+ ```json
39
+ query_graph({ "query": "DataTable" })
40
+ query_graph({ "query": "useDataTableFetch" })
41
+ ```
42
+
43
+ ---
44
+
45
+ ## 2. Core Architecture & Mental Model
46
+
47
+ The Wangs UI `DataTable` is built on a modular, headless-first architecture:
48
+
49
+ 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.
51
+ 2. **Table Instance Hook (`useDataTable`)**:
52
+ Coordinates table state (sorting, pagination, selection, column ordering, pinning, visibility).
53
+ 3. **Data Fetching Hook (`useDataTableFetch`)**:
54
+ Feeds server-side data, handles loading indicators, manages query parameters (`search`, `filter`, `sort`, `page`, `limit`), and debounces requests automatically.
55
+ 4. **Ecosystem Companions**:
56
+ - `FilterContainer` & `FilterToggleButton`: Filter popovers and faceted search.
57
+ - `ExportButton`: Client/server export to Excel, CSV, PDF, or Print.
58
+ - `BulkActionButton`: Contextual batch actions triggered when rows are selected.
59
+ - `CustomColumn`: User-controlled column ordering, visibility toggling, and pinning.
60
+
61
+ ---
62
+
63
+ ## 3. Mandatory Implementation Rules
64
+
65
+ 1. **Query MCP for Current Code Patterns**: Always run `get-documentation-for-story` for `datatable` before drafting code.
66
+ 2. **Strict Subpath Imports**: Import via `@wangs-ui/react-core/primitive/datatable` and companion primitive paths.
67
+ 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
+ 4. **Stable Row Identity**: Always configure a unique key identifier for stable selection and row identity.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: dialog-modal
3
+ description: Patterns, overlay selection criteria, and MCP discovery protocol for Dialog, Modal, and DialogForm components in Wangs UI.
4
+ ---
5
+
6
+ # Skill: Dialog, Modal & Overlay Workflows
7
+
8
+ Use this skill when building interactive modals, create/edit dialog forms, destructive action confirmations, or slide-in overlay panels.
9
+
10
+ ---
11
+
12
+ ## 1. MCP Inspection Protocol (Mandatory Single Source of Truth)
13
+
14
+ Do **NOT** guess overlay props, event names, or footer slots. Query the MCP server dynamically to inspect exact contracts and live story implementations:
15
+
16
+ ### Inspect Overlay Contracts:
17
+
18
+ ```json
19
+ get-documentation({ "id": "dialog" })
20
+ get-documentation({ "id": "dialogform" })
21
+ get-documentation({ "id": "modal" })
22
+ get-documentation({ "id": "toast" })
23
+ ```
24
+
25
+ ### Inspect Live Story Implementations:
26
+
27
+ ```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" })
31
+ ```
32
+
33
+ ### Inspect Knowledge Graph & Usages:
34
+
35
+ ```json
36
+ query_graph({ "query": "Dialog" })
37
+ query_graph({ "query": "DialogForm" })
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 2. Overlay Selection Matrix
43
+
44
+ | Component | Primary Use Case | Key Characteristics |
45
+ | :--------------- | :-------------------------------------------- | :------------------------------------------------------------------------------------ |
46
+ | **`Dialog`** | Confirmations, alerts, simple detail previews | Standard `header`, `footer`, and body layout; built-in backdrop dimming. |
47
+ | **`DialogForm`** | Create/Edit forms embedded inside a dialog | Built-in form submit/cancel action bar, dirty state tracking, and submit lifecycle. |
48
+ | **`Modal`** | Slide-in drawers, complex custom viewports | Headless overlay primitive with flexible animations, size variants, and drawer modes. |
49
+
50
+ ---
51
+
52
+ ## 3. Mandatory Implementation Rules
53
+
54
+ 1. **Query MCP for Current Code Patterns**: Always inspect `dialog`, `dialogform`, or `modal` stories via MCP before writing overlay code.
55
+ 2. **Strict Subpath Imports**: Import via `@wangs-ui/react-core/primitive/dialog`, `@wangs-ui/react-core/primitive/dialogform`, `@wangs-ui/react-core/primitive/modal`, or `@wangs-ui/react-core/primitive/toast`.
56
+ 3. **Prevent Dismissal During Async Mutations**: Guard the close handler so users cannot accidentally dismiss the dialog while a mutation request is in-flight.
57
+ 4. **Coordinate with Toast Notifications**: Trigger feedback toasts on successful creation, update, or deletion actions.
58
+ 5. **Translate All Overlay Copy**: All dialog titles, confirmation descriptions, and button labels must be localized using `t('...')` from `@wangs-ui/react-i18n`.
@@ -0,0 +1,232 @@
1
+ ---
2
+ name: i18n-usage
3
+ description: Comprehensive guidelines for application internationalization, JIT translations (t), ICU formatting, and locale-aware formatting with @wangs-ui/react-i18n.
4
+ ---
5
+
6
+ # Skill: Application Internationalization & Formatting Protocol
7
+
8
+ Use this skill when implementing multi-language interfaces, translating user-facing text, formatting dates, times, currencies, or numbers in React applications built with Wangs UI and `@wangs-ui/react-i18n`.
9
+
10
+ ---
11
+
12
+ ## 1. The MCP Discovery Protocol (Single Source of Truth)
13
+
14
+ Do **NOT** guess component localization contracts, language switcher variants, or datepicker props. Query the MCP server dynamically to inspect exact props and live story implementations:
15
+
16
+ ### Inspect Localized Component Contracts:
17
+
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" })
24
+ ```
25
+
26
+ ### Inspect Live Story Implementations:
27
+
28
+ ```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" })
32
+ ```
33
+
34
+ ---
35
+
36
+ ## 2. Root Provider Setup (`WangsUiI18nProvider`)
37
+
38
+ Wrap the application root with `WangsUiI18nProvider` from `@wangs-ui/react-i18n` to enable dynamic JIT translations, versioned cache invalidation, and locale context:
39
+
40
+ ```tsx
41
+ import { WangsUiI18nProvider } from '@wangs-ui/react-i18n';
42
+ import React from 'react';
43
+ import ReactDOM from 'react-dom/client';
44
+ import App from './App';
45
+
46
+ ReactDOM.createRoot(document.getElementById('root')!).render(
47
+ <React.StrictMode>
48
+ <WangsUiI18nProvider defaultLocale="en" baseUrl={import.meta.env.VITE_API_URL || ''}>
49
+ <App />
50
+ </WangsUiI18nProvider>
51
+ </React.StrictMode>,
52
+ );
53
+ ```
54
+
55
+ ---
56
+
57
+ ## 3. Translation Protocol with `useI18n()`
58
+
59
+ The `@wangs-ui/react-i18n` package uses a Just-In-Time (JIT) translation architecture where natural English text strings serve as database keys.
60
+
61
+ ### A. Consumer-Level Translation for `ReactNode` Props (Mandatory)
62
+
63
+ All user-facing text props in Wangs UI components (`placeholder`, `label`, `emptyMessage`, `header`, `tooltip`, etc.) are typed as `ReactNode` and rendered as-is. Components do **NOT** automatically translate custom strings. Translation **MUST** be called at the application/consumer level:
64
+
65
+ ```tsx
66
+ import { useI18n } from '@wangs-ui/react-i18n';
67
+ import Button from '@wangs-ui/react-core/primitive/button';
68
+ import DataTable from '@wangs-ui/react-core/primitive/datatable';
69
+ import Select from '@wangs-ui/react-core/primitive/select';
70
+
71
+ export function OrderList() {
72
+ const { t } = useI18n();
73
+
74
+ return (
75
+ <div>
76
+ <Select placeholder={t('Search category...')} />
77
+ <DataTable emptyMessage={t('No orders found')} />
78
+ <Button label={t('Create new order')} />
79
+ </div>
80
+ );
81
+ }
82
+ ```
83
+
84
+ ### B. Natural English Sentence Keys
85
+
86
+ Always write full, natural English sentences as translation keys. Never use artificial dotted namespace keys:
87
+
88
+ ```tsx
89
+ // ✅ Good — Natural English
90
+ t('Invoice Summary');
91
+ t('Are you sure you want to delete this customer?');
92
+
93
+ // ❌ Bad — Artificial dotted keys
94
+ t('invoice.summary.title');
95
+ t('dialog.delete.customer.confirm');
96
+ ```
97
+
98
+ ### C. Named Variable Interpolation (Single Braces `{var}`)
99
+
100
+ Pass interpolation values inside a plain object using descriptive named variables. This provides crucial semantic context for AI translation engines:
101
+
102
+ ```tsx
103
+ // ✅ Good — Named variables provide context
104
+ t('Upload {count} files to {groupName}', { count: 5, groupName: 'Marketing' });
105
+ t('Welcome back, {userName}!', { userName: user.name });
106
+
107
+ // ❌ Bad — Concatenation or positional arguments
108
+ t('Welcome back, ' + user.name);
109
+ t('Upload {0} files to {1}', 5, 'Marketing');
110
+ ```
111
+
112
+ ### D. ICU Pluralization & Zero-State (`=0`)
113
+
114
+ Always handle singular, plural, and zero states directly within ICU MessageFormat strings. Do **NOT** use JavaScript ternary operators:
115
+
116
+ ```tsx
117
+ // ✅ Good — Clean ICU pluralization with zero-state handling
118
+ t('{count, plural, =0 {No items selected} one {1 item selected} other {{count} items selected}}', {
119
+ count: selectedCount,
120
+ });
121
+
122
+ // ❌ Bad — Manual JS branching
123
+ selectedCount === 0
124
+ ? t('No items selected')
125
+ : selectedCount === 1
126
+ ? t('1 item selected')
127
+ : t('{count} items selected', { count: selectedCount });
128
+ ```
129
+
130
+ ### E. Rich Text / Annotated Strings
131
+
132
+ Use standard supported HTML tags (`<a>`, `<b>`, `<i>`, `<u>`, `<s>`, `<br/>`, `<sub>`, `<sup>`, `<code>`, `<mark>`) for inline styling. Tags are automatically parsed into React elements without custom regex or string manipulation:
133
+
134
+ ```tsx
135
+ import Link from '@wangs-ui/foundation/theme/Link';
136
+
137
+ t('You have selected <b>{count} items</b>. Click <a>here</a> to review.', {
138
+ count: selectedCount,
139
+ a: (chunks) => <Link href="/review">{chunks}</Link>,
140
+ });
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 4. Locale Formatting Protocol with `useLocaleFormatter()`
146
+
147
+ For locale-aware formatting of dates, relative times, currencies, numbers, and display names, use the dedicated `useLocaleFormatter()` hook. All functions automatically adapt to the active locale without triggering backend database requests:
148
+
149
+ ```tsx
150
+ import { useLocaleFormatter } from '@wangs-ui/react-i18n';
151
+
152
+ export function SummaryCard({ updatedAt, amount, count }: Props) {
153
+ const {
154
+ formatDate,
155
+ formatRelativeTime,
156
+ formatCurrency,
157
+ formatNumber,
158
+ formatDisplayName,
159
+ formatList,
160
+ truncateText,
161
+ } = useLocaleFormatter();
162
+
163
+ return (
164
+ <div>
165
+ {/* Date formatting with Go tokens or date-fns tokens, and timezone */}
166
+ <p>{formatDate(new Date(), 'dd MMMM yyyy, HH:mm', 'Asia/Jakarta')}</p>
167
+
168
+ {/* Relative time */}
169
+ <p>{formatRelativeTime(updatedAt)}</p>
170
+
171
+ {/* Currency formatting */}
172
+ <p>{formatCurrency(amount, 'IDR')}</p>
173
+
174
+ {/* Number formatting with locale grouping */}
175
+ <p>{formatNumber(count)}</p>
176
+
177
+ {/* ISO code to localized name */}
178
+ <p>{formatDisplayName('id', 'language')}</p>
179
+
180
+ {/* Localized list */}
181
+ <p>{formatList(['Finance', 'Operations', 'IT'])}</p>
182
+
183
+ {/* Emoji & multi-byte safe text truncation */}
184
+ <p>{truncateText('Long product description with emojis 🚀', 20)}</p>
185
+ </div>
186
+ );
187
+ }
188
+ ```
189
+
190
+ > [!NOTE]
191
+ > Formatters MUST NOT be called as standalone `t()` keys (e.g. `t(formatRelativeTime(date))`). Instead, pass the formatted result as a named variable:
192
+ >
193
+ > ```tsx
194
+ > const { t } = useI18n();
195
+ > const { formatRelativeTime } = useLocaleFormatter();
196
+ > const label = t('Updated {time}', { time: formatRelativeTime(updatedAt) });
197
+ > ```
198
+
199
+ ---
200
+
201
+ ## 5. Language Switching UI Integration
202
+
203
+ Connect the Wangs UI `LanguageSwitcher` primitive directly with `useI18n()` state:
204
+
205
+ ```tsx
206
+ import LanguageSwitcher from '@wangs-ui/react-core/primitive/languageswitcher';
207
+ import { useI18n } from '@wangs-ui/react-i18n';
208
+
209
+ export function HeaderLanguageSwitcher() {
210
+ const { locale, setLocale, languageOptions } = useI18n();
211
+
212
+ return (
213
+ <LanguageSwitcher
214
+ options={languageOptions}
215
+ value={locale}
216
+ onChange={(code) => setLocale(code)}
217
+ />
218
+ );
219
+ }
220
+ ```
221
+
222
+ ---
223
+
224
+ ## 6. Strict Behavioral Constraints (MUST NOT)
225
+
226
+ - **NO Formatters Destructured from `useI18n()`:** Formatters are isolated in `useLocaleFormatter()`. Never attempt to import `formatDate` or `formatCurrency` from `useI18n()`.
227
+ - **NO String Concatenation in `t()` Keys:** Never concatenate strings or use dynamic template literals (e.g. `t('Hello ' + user.name)` or ``t(`Hello ${user.name}`)``). This creates infinite distinct keys in the translation database and prevents caching.
228
+ - **NO Manual Zero-State JavaScript Branching:** Always use ICU `=0` syntax inside a single plural key.
229
+ - **NO Dotted Artificial Translation Keys:** Never use dotted keys like `t('app.header.title')`. Use natural English sentences.
230
+ - **NO Custom Markdown Formatting Symbols:** Do not use `*bold*` or `_italic_` in translation keys. Use valid HTML tags like `<b>bold</b>`.
231
+ - **NO Hardcoded Static Translation Dictionaries:** Do not bundle static translation files (`id.json`, `zh.json`). The JIT backend broker manages translations dynamically.
232
+ - **NO Unnecessary English Key Modifications:** Minor typos or punctuation changes in keys create orphaned entries in the translation backend and trigger new AI translation costs.
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: layout-navigation
3
+ description: Architecture, navigation hierarchies, and MCP discovery protocol for AppLayout, Sidebar, Breadcrumb, and Tabs in Wangs UI.
4
+ ---
5
+
6
+ # Skill: Application Layout & Navigation Hierarchy
7
+
8
+ Use this skill when constructing application shells, multi-level sidebars, page headers, breadcrumbs, or tabbed views with `@wangs-ui/react-core`.
9
+
10
+ ---
11
+
12
+ ## 1. MCP Inspection Protocol (Mandatory Single Source of Truth)
13
+
14
+ Do **NOT** guess layout block slots, sidebar item interfaces, or breadcrumb props. Query the MCP server dynamically to inspect exact contracts and live story implementations:
15
+
16
+ ### Inspect Layout & Navigation Contracts:
17
+
18
+ ```json
19
+ get-documentation({ "id": "applayout" })
20
+ get-documentation({ "id": "sidebar" })
21
+ get-documentation({ "id": "breadcrumb" })
22
+ get-documentation({ "id": "tabs" })
23
+ ```
24
+
25
+ ### Inspect Live Story Implementations:
26
+
27
+ ```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" })
32
+ ```
33
+
34
+ ### Inspect Knowledge Graph & Usages:
35
+
36
+ ```json
37
+ query_graph({ "query": "AppLayout" })
38
+ query_graph({ "query": "Sidebar" })
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 2. Layout Architecture & Mental Model
44
+
45
+ 1. **Top-Level App Shell (`AppLayout`)**:
46
+ Provides structured slots for `sidebar`, `header`, and main content view, handling responsive viewport scaling and mobile navigation overlays.
47
+ 2. **Hierarchical Menu (`Sidebar`)**:
48
+ Renders single and nested navigation items, active route indicators, collapsible state, and notification badges.
49
+ 3. **Breadcrumb Trail (`Breadcrumb`)**:
50
+ Maintains clear navigational hierarchy on page headers.
51
+ 4. **Tabbed Sub-Views (`Tabs`)**:
52
+ Organizes complex entity detail views or multi-section settings into distinct tabbed panels.
53
+
54
+ ---
55
+
56
+ ## 3. Mandatory Implementation Rules
57
+
58
+ 1. **Query MCP for Current Code Patterns**: Inspect `applayout` and `sidebar` stories via MCP before assembling the layout.
59
+ 2. **Strict Subpath Imports**: Import layout blocks via `@wangs-ui/react-core/blocks/*` and primitives via `@wangs-ui/react-core/primitive/*`.
60
+ 3. **Consistent Spacing Grid**: Use standard container padding (`p-6` or `p-xxl`) across page contents.
61
+ 4. **Page Hierarchy Alignment**: Every page view inside the layout must provide a clear `.heading-1` hierarchy and synchronized breadcrumbs.
62
+ 5. **Translate Navigation Labels**: Wrap all sidebar item labels and breadcrumb texts in `t('...')` from `@wangs-ui/react-i18n`.