@fewangsit/wangsvue-gsts 2.0.0-alpha.13 → 2.0.0-alpha.15

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.
@@ -1,38 +1,38 @@
1
- ---
2
- name: 'committing-changes'
3
- description: 'Guidelines for Git Conventional Commits. Invoke when user asks for commit message rules or when committing code.'
4
- ---
5
-
6
- # Committing Changes
7
-
8
- When making commits, follow these guidelines for clear communication about the nature of the changes.
9
-
10
- ## Commit Types
11
-
12
- - **fix**: Resolve an error or bug.
13
- - **feat**: Add a new feature.
14
- - **docs**: Documentation-related changes.
15
- - **chore**: Changes related to project configurations.
16
- - **refactor**: Restructure the code.
17
- - **ci**: Changes related to continuous integration scripts/files.
18
- - **test**: Changes related to testing.
19
- - **style**: Changes related to design, such as background color.
20
-
21
- ## Commit Format
22
-
23
- ```bash
24
- <type>(Commit Scope): <short description>
25
-
26
- [Optional Commit Body]
27
-
28
- [Optional Footer or Breaking Change Note]
29
- ```
30
-
31
- ## Example
32
-
33
- ```bash
34
- fix(datatable): bulk action not properly works
35
-
36
- - Bulk action should applying the selected action on Apply button clicked.
37
- - The label should be back into 'Bulk Action' on Apply button clicked.
38
- ```
1
+ ---
2
+ name: 'committing-changes'
3
+ description: 'Guidelines for Git Conventional Commits. Invoke when user asks for commit message rules or when committing code.'
4
+ ---
5
+
6
+ # Committing Changes
7
+
8
+ When making commits, follow these guidelines for clear communication about the nature of the changes.
9
+
10
+ ## Commit Types
11
+
12
+ - **fix**: Resolve an error or bug.
13
+ - **feat**: Add a new feature.
14
+ - **docs**: Documentation-related changes.
15
+ - **chore**: Changes related to project configurations.
16
+ - **refactor**: Restructure the code.
17
+ - **ci**: Changes related to continuous integration scripts/files.
18
+ - **test**: Changes related to testing.
19
+ - **style**: Changes related to design, such as background color.
20
+
21
+ ## Commit Format
22
+
23
+ ```bash
24
+ <type>(Commit Scope): <short description>
25
+
26
+ [Optional Commit Body]
27
+
28
+ [Optional Footer or Breaking Change Note]
29
+ ```
30
+
31
+ ## Example
32
+
33
+ ```bash
34
+ fix(datatable): bulk action not properly works
35
+
36
+ - Bulk action should applying the selected action on Apply button clicked.
37
+ - The label should be back into 'Bulk Action' on Apply button clicked.
38
+ ```
@@ -1,93 +1,93 @@
1
- ---
2
- name: 'figma-datatable-generator'
3
- description: 'Generates Wangsvue DataTables from Figma, including toolbars, bulk actions, search, filter, and pagination. Invoke when converting complex table designs from Figma.'
4
- ---
5
-
6
- # Figma DataTable Generator
7
-
8
- This skill specializes in converting Figma design into feature-rich Wangsvue `DataTable` modules. It handles toolbar button integration, bulk actions, and server-side table configurations.
9
-
10
- ## 🚨 Mandatory Architectural Principles
11
-
12
- - **Business Logic Placement**: All table logic (columns, fetch functions, state) MUST be in `components/modules/`.
13
- - **Component Exclusivity**: ONLY use WangsVue components.
14
-
15
- ## 🛠️ Figma Metadata Interpretation
16
-
17
- ### 1. Toolbar Generation
18
-
19
- When frames contain lists of buttons/instances (e.g., `Button Search`, `Button Filter`, `Button View Log`):
20
-
21
- #### Toolbar Layout (Right Side)
22
-
23
- Group the buttons identified in the Figma context in a flex container on the right side. These buttons are **optional** and should only be generated if they exist in the metadata:
24
-
25
- - **Search**: `<ButtonSearch :table-name="tableName" />` (Invoke if `Button Search` or `Input Search` instance is found).
26
- - **Filter**: `<ButtonFilter :table-name="tableName" />` (Invoke if `Button Filter` instance is found).
27
- - **Download**: `<ButtonDownload :table-name="tableName" file-name="[EntityName]" />` (Invoke if `Button Download` or `Export` instance is found).
28
- - **View Log**: `<ButtonViewLog />` (Invoke if `Button View Log` instance is found).
29
- - **Primary Action**: A generic `<Button />` (e.g., "Add", "Create"). Map the `label`, `icon`, and `severity` based on the Figma instance properties (e.g., `severity="primary"` for main actions).
30
-
31
- #### Toolbar Layout (Left Side) - ButtonBulkAction
32
-
33
- Include `<ButtonBulkAction />` on the left side of the toolbar if:
34
-
35
- 1. A frame named **"Bulk action"** or similar exists in the metadata.
36
- 2. **OR** the first column of the table contains a checkbox selection (TH with checkbox or Table Data with checkbox).
37
-
38
- ### 2. DataTable Configuration
39
-
40
- Identify all table headers by finding instances named **"TH"** in the Figma metadata. For each "TH" instance, invoke `get_design_context` to extract precise configuration:
41
-
42
- - **Column Mapping**:
43
-
44
- - `header`: The text content found within the `<p>` tag (e.g., "Device Name").
45
- - `field`: camelCase version of the `header` text (e.g., `deviceName`).
46
- - `sortable`: Set to `true` if the `get_design_context` code contains an element with `data-name="arrow-up-down-line"`. Otherwise, set to `false` or omit.
47
- - `dateFormatOptions`: For columns containing date/time values, provide this object. Set `showDate: true` to display the date and `showTime: true` if time values are present in the design. Omit for non-date columns.
48
- - `bodyComponent`:
49
- - Use `BadgeGroup` if a column contains multiple `Badge` instances or text like `+% more`. Reference the `template` section in `DataTable` documentation via `mcp_wangsvue-docs` and `BadgeGroup` for correct implementation.
50
- - Use `Badge` if a column contains a single `Badge` instance. Especially for Badge contains Statuses value, set the `format` to `nowrap`.
51
- - Use `Image` if a column contains an image. Provide the src from the specified field, e.g., `:src="item.imageUrl"` and set the `size` to `small`.
52
-
53
- - **Table Props**:
54
- - `lazy`: Always `true` for table with pagination, unless the user specifies otherwise.
55
- - `use-paginator`: Set to `true` if the Figma metadata contains a pagination component (e.g., `Pagination`). Otherwise, set to `false`.
56
- - `v-model:selected-data`: Required if `ButtonBulkAction` is present.
57
- - `fetch-function`: Map to a service method from the API services package (e.g., `@fewangsit/api-services-template` or as provided by the user in the prompt).
58
- - `data-key`: Use `_id` by default.
59
- - `use-option`: Set to `false` if you DO NOT find an element with `data-name="more-line"` or an ellipsis button in the Figma context. If found, leave as default (`true`) and provide the `:options` prop bound to a computed property or variable initialized with an empty array `[]`.
60
-
61
- ## 📋 Implementation Checklist
62
-
63
- 1. **Service Integration**: Import the relevant service and DTOs from the API services package (e.g., `@fewangsit/api-services-template` or as specified).
64
- 2. **State Management**:
65
- - `tableName`: Unique string (e.g., `entity-table`).
66
- - `selectedData`: Ref for bulk selection.
67
- - `columns`: Typed as `TableColumn<T>[]`.
68
- 3. **Template Structure**:
69
- ```html
70
- <div class="flex flex-col gap-4" data-wv-name="[module-name]">
71
- <div class="flex items-center justify-between gap-2">
72
- <ButtonBulkAction ... />
73
- <!-- Left Side -->
74
- <div class="flex items-center gap-2 ml-auto">
75
- <!-- Right Side Buttons -->
76
- <ButtonSearch ... />
77
- <ButtonFilter ... />
78
- <ButtonDownload ... />
79
- <ButtonViewLog ... />
80
- <button ... />
81
- </div>
82
- </div>
83
- <DataTable ... />
84
- </div>
85
- ```
86
-
87
- ## 🔍 Discovery Protocol
88
-
89
- 1. **Call `get_metadata`** to identify the overall structure and find all instances named **"TH"**.
90
- 2. **Call `get_design_context`** for each identified **"TH"** node ID to extract the header text and sortable state.
91
- 3. **Call `list_all_components`** to verify toolbar components.
92
- 4. **Call `analyze_component`** for `datatable` and toolbar buttons to check prop requirements.
93
- 5. **Call `resolve_type_definition`** for DTOs and item types from the API service package.
1
+ ---
2
+ name: 'figma-datatable-generator'
3
+ description: 'Generates Wangsvue DataTables from Figma, including toolbars, bulk actions, search, filter, and pagination. Invoke when converting complex table designs from Figma.'
4
+ ---
5
+
6
+ # Figma DataTable Generator
7
+
8
+ This skill specializes in converting Figma design into feature-rich Wangsvue `DataTable` modules. It handles toolbar button integration, bulk actions, and server-side table configurations.
9
+
10
+ ## 🚨 Mandatory Architectural Principles
11
+
12
+ - **Business Logic Placement**: All table logic (columns, fetch functions, state) MUST be in `components/modules/`.
13
+ - **Component Exclusivity**: ONLY use WangsVue components.
14
+
15
+ ## 🛠️ Figma Metadata Interpretation
16
+
17
+ ### 1. Toolbar Generation
18
+
19
+ When frames contain lists of buttons/instances (e.g., `Button Search`, `Button Filter`, `Button View Log`):
20
+
21
+ #### Toolbar Layout (Right Side)
22
+
23
+ Group the buttons identified in the Figma context in a flex container on the right side. These buttons are **optional** and should only be generated if they exist in the metadata:
24
+
25
+ - **Search**: `<ButtonSearch :table-name="tableName" />` (Invoke if `Button Search` or `Input Search` instance is found).
26
+ - **Filter**: `<ButtonFilter :table-name="tableName" />` (Invoke if `Button Filter` instance is found).
27
+ - **Download**: `<ButtonDownload :table-name="tableName" file-name="[EntityName]" />` (Invoke if `Button Download` or `Export` instance is found).
28
+ - **View Log**: `<ButtonViewLog />` (Invoke if `Button View Log` instance is found).
29
+ - **Primary Action**: A generic `<Button />` (e.g., "Add", "Create"). Map the `label`, `icon`, and `severity` based on the Figma instance properties (e.g., `severity="primary"` for main actions).
30
+
31
+ #### Toolbar Layout (Left Side) - ButtonBulkAction
32
+
33
+ Include `<ButtonBulkAction />` on the left side of the toolbar if:
34
+
35
+ 1. A frame named **"Bulk action"** or similar exists in the metadata.
36
+ 2. **OR** the first column of the table contains a checkbox selection (TH with checkbox or Table Data with checkbox).
37
+
38
+ ### 2. DataTable Configuration
39
+
40
+ Identify all table headers by finding instances named **"TH"** in the Figma metadata. For each "TH" instance, invoke `get_design_context` to extract precise configuration:
41
+
42
+ - **Column Mapping**:
43
+
44
+ - `header`: The text content found within the `<p>` tag (e.g., "Device Name").
45
+ - `field`: camelCase version of the `header` text (e.g., `deviceName`).
46
+ - `sortable`: Set to `true` if the `get_design_context` code contains an element with `data-name="arrow-up-down-line"`. Otherwise, set to `false` or omit.
47
+ - `dateFormatOptions`: For columns containing date/time values, provide this object. Set `showDate: true` to display the date and `showTime: true` if time values are present in the design. Omit for non-date columns.
48
+ - `bodyComponent`:
49
+ - Use `BadgeGroup` if a column contains multiple `Badge` instances or text like `+% more`. Reference the `template` section in `DataTable` documentation via `mcp_wangsvue-docs` and `BadgeGroup` for correct implementation.
50
+ - Use `Badge` if a column contains a single `Badge` instance. Especially for Badge contains Statuses value, set the `format` to `nowrap`.
51
+ - Use `Image` if a column contains an image. Provide the src from the specified field, e.g., `:src="item.imageUrl"` and set the `size` to `small`.
52
+
53
+ - **Table Props**:
54
+ - `lazy`: Always `true` for table with pagination, unless the user specifies otherwise.
55
+ - `use-paginator`: Set to `true` if the Figma metadata contains a pagination component (e.g., `Pagination`). Otherwise, set to `false`.
56
+ - `v-model:selected-data`: Required if `ButtonBulkAction` is present.
57
+ - `fetch-function`: Map to a service method from the API services package (e.g., `@fewangsit/api-services-template` or as provided by the user in the prompt).
58
+ - `data-key`: Use `_id` by default.
59
+ - `use-option`: Set to `false` if you DO NOT find an element with `data-name="more-line"` or an ellipsis button in the Figma context. If found, leave as default (`true`) and provide the `:options` prop bound to a computed property or variable initialized with an empty array `[]`.
60
+
61
+ ## 📋 Implementation Checklist
62
+
63
+ 1. **Service Integration**: Import the relevant service and DTOs from the API services package (e.g., `@fewangsit/api-services-template` or as specified).
64
+ 2. **State Management**:
65
+ - `tableName`: Unique string (e.g., `entity-table`).
66
+ - `selectedData`: Ref for bulk selection.
67
+ - `columns`: Typed as `TableColumn<T>[]`.
68
+ 3. **Template Structure**:
69
+ ```html
70
+ <div class="flex flex-col gap-4" data-wv-name="[module-name]">
71
+ <div class="flex items-center justify-between gap-2">
72
+ <ButtonBulkAction ... />
73
+ <!-- Left Side -->
74
+ <div class="flex items-center gap-2 ml-auto">
75
+ <!-- Right Side Buttons -->
76
+ <ButtonSearch ... />
77
+ <ButtonFilter ... />
78
+ <ButtonDownload ... />
79
+ <ButtonViewLog ... />
80
+ <button ... />
81
+ </div>
82
+ </div>
83
+ <DataTable ... />
84
+ </div>
85
+ ```
86
+
87
+ ## 🔍 Discovery Protocol
88
+
89
+ 1. **Call `get_metadata`** to identify the overall structure and find all instances named **"TH"**.
90
+ 2. **Call `get_design_context`** for each identified **"TH"** node ID to extract the header text and sortable state.
91
+ 3. **Call `list_all_components`** to verify toolbar components.
92
+ 4. **Call `analyze_component`** for `datatable` and toolbar buttons to check prop requirements.
93
+ 5. **Call `resolve_type_definition`** for DTOs and item types from the API service package.
@@ -1,117 +1,117 @@
1
- ---
2
- name: 'figma-to-code'
3
- description: 'Converts Figma designs to Wangsvue code following strict mapping rules and color system. Invoke when user provides Figma section link or node ID'
4
- ---
5
-
6
- # Figma to Code Logic
7
-
8
- This skill provides strict guidelines for converting Figma designs or React/JSX code into Wangsvue Vue 3 components.
9
-
10
- ## 0. Figma Discovery Protocol (Link/Node ID)
11
-
12
- **Invoke this protocol when a Figma URL or Node ID is provided:**
13
-
14
- 1. **Extract Node ID:** If a URL is provided (e.g., `...node-id=1-2`), extract the ID (e.g., `1:2`).
15
- 2. **Call `mcp_figma-dev_get_design_context`:** Use the `nodeId` to get the design metadata and code.
16
- 3. **Analyze Variables:** Call `mcp_figma-dev_get_variable_defs` for the node to map any design tokens to the Wangsvue color system.
17
-
18
- ## 1. Core Conversion Logic
19
-
20
- When converting from Figma or React:
21
-
22
- 1. **Strict Conversion:** Convert all React hooks/JSX into Vue 3 Composition API.
23
- 2. **Component Mapping:** You MUST identify and use the correct **Wangsvue Component** from the MCP. Do not use generic HTML if a Wangsvue component exists.
24
- 3. **Style Abstraction:** **DO NOT** convert Figma color variables or design system tokens manually. Trust the Wangsvue components to provide and handle the design system.
25
- 4. **Layout Focus:** Concentrate exclusively on:
26
- - **Layout Structure:** Component hierarchy and nesting.
27
- - **Layout Style:** Flex/Grid positioning, spacing, alignment, and sizing.
28
- - **Custom Style:** Apply only to non-Wangsvue elements where layout-specific CSS is required.
29
- - You MUST use tailwind css class instead of css in `<style>` block.
30
- 5. **Architecture:** You MUST break flat code into the appropriate folder defined in the **Project Structure**. Logic in `components/modules/`, NOT in views.
31
-
32
- ## 2. Component Discovery Protocol
33
-
34
- **ALWAYS ASK BEFORE USING GENERIC COMPONENTS OR MANUAL STYLING:**
35
-
36
- 1. **Search First:** If you need functionality (Filter, Download, Bulk action, Search, Upload, Copy), search the component list first.
37
- 2. **Structural Components:** If you need a container, card, form, modal, panel, or loading state, check if Wangsvue has a specialized component (e.g., `Card`, `Dialog`, `Form`, `Loading`).
38
- 3. **Mental Shift:**
39
- - ❌ OLD: `<div class="bg-white p-4">` → ✅ NEW: `<Card>`
40
- - ❌ OLD: `<Button>` for download → ✅ NEW: `<ButtonDownload>`
41
-
42
- ## 3. Figma Conversion Rules
43
-
44
- ### Component Replacement Logic
45
-
46
- - **`data-name="ComponentName"`** = Replace this entire element with `<ComponentName>`
47
- - **NOT** wrap `<ComponentName>` inside this element.
48
- - **Example:** `<div data-name="Breadcrumb">...</div>` → `<Breadcrumb />`
49
- - **Exception:** If `data-name` is NOT in Wangsvue component list, it may be a custom layout name - keep as div with appropriate classes.
50
-
51
- ### No Double Wrapping
52
-
53
- - ❌ **WRONG:** `<div><Breadcrumb /></div>` (when div only contains 1 component)
54
- - ✅ **CORRECT:** `<Breadcrumb />` (every Vue component has root element)
55
- - **Rule:** If container has only 1 component, remove the container.
56
-
57
- ### Trust Component Styling
58
-
59
- - ❌ **NEVER:** Add styling to Wangsvue components.
60
- - ✅ **ALWAYS:** Trust component's built-in design system.
61
- - **Exception:** Layout positioning only (margin, positioning).
62
- - **Example:** `<Breadcrumb class="mb-4" />` (spacing OK), `<Breadcrumb class="flex gap-2" />` (styling NOT OK).
63
-
64
- ### Figma Data-Name Decision Tree
65
-
66
- ```
67
- Figma element has data-name="SomeName"
68
-
69
- Check: Is "SomeName" in Wangsvue component list?
70
-
71
- YES → Replace: <div data-name="Button"> → <Button />
72
-
73
- NO → Keep as layout: <div data-name="HeaderSection"> → <div class="...">
74
- ```
75
-
76
- ### Exact Value Preservation
77
-
78
- - ❌ **WRONG:** `h-[21px]` → `h-5` (20px ≠ 21px)
79
- - ✅ **CORRECT:** Keep exact values `h-[21px]`
80
- - **Rule:** 1px difference matters for pixel-perfect design.
81
-
82
- ## 4. Color System Protocol
83
-
84
- **WANGSVUE COLOR SYSTEM RULES:**
85
-
86
- - ❌ **NEVER use CSS variables**: `bg-[var(--general/content,#ebeaf0)]`
87
- - ✅ **ALWAYS use Tailwind color tokens**: `bg-general-50`
88
- - ❌ **NEVER use hex colors directly**: `bg-[#ebeaf0]`
89
- - ✅ **ALWAYS map hex to color palette**: `#ebeaf0` → `general-50`
90
-
91
- ### Color Palette Mapping Process
92
-
93
- 1. **Find hex color** in Figma code or design.
94
- 2. **Check `tailwind.config.js`** for the color config path.
95
- 3. **Match hex to color token** in the referenced JSON config (e.g., `general-50`, `grayscale-50`, `primary-500`).
96
-
97
- ## 5. Synthesis & Structure
98
-
99
- - **Vue SFC Structure:** Script → Template → Style.
100
- - **Script Organization:** Imports → Props/Emits → Lifecycle → Variables → Methods.
101
- - **Views Architecture:** Views are lightweight, only import and compose from modules.
102
- - **Logic Placement:** Business logic, data, columns, and handlers belong in modules, NOT in view components.
103
- - **Testing Attributes:** Always include `data-wv-name` and `data-wv-section`.
104
-
105
- ## 6. Critical Failure Indicators (STOP IF ANY OCCUR)
106
-
107
- - Using generic Button when specialized component exists.
108
- - Using manual CSS when structural component exists.
109
- - Using CSS variables or hex colors instead of Tailwind color tokens.
110
- - Writing `<div class="bg-white p-4">` instead of `<Card>`.
111
- - Writing component usage without checking examples.
112
- - Guessing icon names or enum values.
113
- - Creating custom solutions when documented patterns exist.
114
- - Double wrapping components.
115
- - Adding styling to Wangsvue components.
116
- - Converting exact pixel values incorrectly (e.g., 21px → 20px).
117
- - Putting business logic in view components.
1
+ ---
2
+ name: 'figma-to-code'
3
+ description: 'Converts Figma designs to Wangsvue code following strict mapping rules and color system. Invoke when user provides Figma section link or node ID'
4
+ ---
5
+
6
+ # Figma to Code Logic
7
+
8
+ This skill provides strict guidelines for converting Figma designs or React/JSX code into Wangsvue Vue 3 components.
9
+
10
+ ## 0. Figma Discovery Protocol (Link/Node ID)
11
+
12
+ **Invoke this protocol when a Figma URL or Node ID is provided:**
13
+
14
+ 1. **Extract Node ID:** If a URL is provided (e.g., `...node-id=1-2`), extract the ID (e.g., `1:2`).
15
+ 2. **Call `mcp_figma-dev_get_design_context`:** Use the `nodeId` to get the design metadata and code.
16
+ 3. **Analyze Variables:** Call `mcp_figma-dev_get_variable_defs` for the node to map any design tokens to the Wangsvue color system.
17
+
18
+ ## 1. Core Conversion Logic
19
+
20
+ When converting from Figma or React:
21
+
22
+ 1. **Strict Conversion:** Convert all React hooks/JSX into Vue 3 Composition API.
23
+ 2. **Component Mapping:** You MUST identify and use the correct **Wangsvue Component** from the MCP. Do not use generic HTML if a Wangsvue component exists.
24
+ 3. **Style Abstraction:** **DO NOT** convert Figma color variables or design system tokens manually. Trust the Wangsvue components to provide and handle the design system.
25
+ 4. **Layout Focus:** Concentrate exclusively on:
26
+ - **Layout Structure:** Component hierarchy and nesting.
27
+ - **Layout Style:** Flex/Grid positioning, spacing, alignment, and sizing.
28
+ - **Custom Style:** Apply only to non-Wangsvue elements where layout-specific CSS is required.
29
+ - You MUST use tailwind css class instead of css in `<style>` block.
30
+ 5. **Architecture:** You MUST break flat code into the appropriate folder defined in the **Project Structure**. Logic in `components/modules/`, NOT in views.
31
+
32
+ ## 2. Component Discovery Protocol
33
+
34
+ **ALWAYS ASK BEFORE USING GENERIC COMPONENTS OR MANUAL STYLING:**
35
+
36
+ 1. **Search First:** If you need functionality (Filter, Download, Bulk action, Search, Upload, Copy), search the component list first.
37
+ 2. **Structural Components:** If you need a container, card, form, modal, panel, or loading state, check if Wangsvue has a specialized component (e.g., `Card`, `Dialog`, `Form`, `Loading`).
38
+ 3. **Mental Shift:**
39
+ - ❌ OLD: `<div class="bg-white p-4">` → ✅ NEW: `<Card>`
40
+ - ❌ OLD: `<Button>` for download → ✅ NEW: `<ButtonDownload>`
41
+
42
+ ## 3. Figma Conversion Rules
43
+
44
+ ### Component Replacement Logic
45
+
46
+ - **`data-name="ComponentName"`** = Replace this entire element with `<ComponentName>`
47
+ - **NOT** wrap `<ComponentName>` inside this element.
48
+ - **Example:** `<div data-name="Breadcrumb">...</div>` → `<Breadcrumb />`
49
+ - **Exception:** If `data-name` is NOT in Wangsvue component list, it may be a custom layout name - keep as div with appropriate classes.
50
+
51
+ ### No Double Wrapping
52
+
53
+ - ❌ **WRONG:** `<div><Breadcrumb /></div>` (when div only contains 1 component)
54
+ - ✅ **CORRECT:** `<Breadcrumb />` (every Vue component has root element)
55
+ - **Rule:** If container has only 1 component, remove the container.
56
+
57
+ ### Trust Component Styling
58
+
59
+ - ❌ **NEVER:** Add styling to Wangsvue components.
60
+ - ✅ **ALWAYS:** Trust component's built-in design system.
61
+ - **Exception:** Layout positioning only (margin, positioning).
62
+ - **Example:** `<Breadcrumb class="mb-4" />` (spacing OK), `<Breadcrumb class="flex gap-2" />` (styling NOT OK).
63
+
64
+ ### Figma Data-Name Decision Tree
65
+
66
+ ```
67
+ Figma element has data-name="SomeName"
68
+
69
+ Check: Is "SomeName" in Wangsvue component list?
70
+
71
+ YES → Replace: <div data-name="Button"> → <Button />
72
+
73
+ NO → Keep as layout: <div data-name="HeaderSection"> → <div class="...">
74
+ ```
75
+
76
+ ### Exact Value Preservation
77
+
78
+ - ❌ **WRONG:** `h-[21px]` → `h-5` (20px ≠ 21px)
79
+ - ✅ **CORRECT:** Keep exact values `h-[21px]`
80
+ - **Rule:** 1px difference matters for pixel-perfect design.
81
+
82
+ ## 4. Color System Protocol
83
+
84
+ **WANGSVUE COLOR SYSTEM RULES:**
85
+
86
+ - ❌ **NEVER use CSS variables**: `bg-[var(--general/content,#ebeaf0)]`
87
+ - ✅ **ALWAYS use Tailwind color tokens**: `bg-general-50`
88
+ - ❌ **NEVER use hex colors directly**: `bg-[#ebeaf0]`
89
+ - ✅ **ALWAYS map hex to color palette**: `#ebeaf0` → `general-50`
90
+
91
+ ### Color Palette Mapping Process
92
+
93
+ 1. **Find hex color** in Figma code or design.
94
+ 2. **Check `tailwind.config.js`** for the color config path.
95
+ 3. **Match hex to color token** in the referenced JSON config (e.g., `general-50`, `grayscale-50`, `primary-500`).
96
+
97
+ ## 5. Synthesis & Structure
98
+
99
+ - **Vue SFC Structure:** Script → Template → Style.
100
+ - **Script Organization:** Imports → Props/Emits → Lifecycle → Variables → Methods.
101
+ - **Views Architecture:** Views are lightweight, only import and compose from modules.
102
+ - **Logic Placement:** Business logic, data, columns, and handlers belong in modules, NOT in view components.
103
+ - **Testing Attributes:** Always include `data-wv-name` and `data-wv-section`.
104
+
105
+ ## 6. Critical Failure Indicators (STOP IF ANY OCCUR)
106
+
107
+ - Using generic Button when specialized component exists.
108
+ - Using manual CSS when structural component exists.
109
+ - Using CSS variables or hex colors instead of Tailwind color tokens.
110
+ - Writing `<div class="bg-white p-4">` instead of `<Card>`.
111
+ - Writing component usage without checking examples.
112
+ - Guessing icon names or enum values.
113
+ - Creating custom solutions when documented patterns exist.
114
+ - Double wrapping components.
115
+ - Adding styling to Wangsvue components.
116
+ - Converting exact pixel values incorrectly (e.g., 21px → 20px).
117
+ - Putting business logic in view components.
@@ -1,54 +1,54 @@
1
- ---
2
- name: 'import-validator'
3
- description: 'Enforces strict import protocols for Wangsvue components and types. Invoke when writing imports or fixing import errors.'
4
- ---
5
-
6
- # Import Protocol Validator
7
-
8
- This skill ensures that all imports follow the strict Wangsvue Import Protocol.
9
-
10
- ## The Golden Rules
11
-
12
- 1. **NEVER Guess:** Always use `mcp_wangsvue_mcp_analyze_component` and `mcp_wangsvue_mcp_resolve_type_definition` to get the correct paths.
13
- 2. **Exact Paths:** Do not modify the import paths returned by MCP tools.
14
- 3. **Type Keyword:** Always add `type` keyword for type imports.
15
-
16
- ## Common Mistakes & Corrections
17
-
18
- ### 1. Component Imports
19
-
20
- **❌ WRONG:** `import { Button } from '@fewangsit/wangsvue/button';`
21
- **✅ RIGHT:** `import { Button } from '@fewangsit/wangsvue';`
22
- _Rule: Components usually come from the main package._
23
-
24
- ### 2. Type Imports
25
-
26
- **❌ WRONG:** `import { MenuItem } from '@fewangsit/wangsvue/menuitem';`
27
- **✅ RIGHT:** `import type { MenuItem } from '@fewangsit/wangsvue/menuitem';`
28
- _Rule: Types usually come from specific modules and MUST use `import type`._
29
-
30
- ### 3. Mixing Imports
31
-
32
- **❌ WRONG:** `import { Button, ButtonProps } from '@fewangsit/wangsvue';`
33
- **✅ RIGHT:** Separate them.
34
-
35
- ```typescript
36
- import { Button } from '@fewangsit/wangsvue';
37
- import type { ButtonProps } from '@fewangsit/wangsvue/button'; // Verify path with MCP!
38
- ```
39
-
40
- ## Verification Process
41
-
42
- Before writing any import:
43
-
44
- 1. **Call MCP Tools:** `analyze_component` for components, `resolve_type_definition` for types.
45
- 2. **Copy Exact Paths:** Use the path provided in the MCP result.
46
- 3. **Add 'type':** If it is a type definition, ensure `type` keyword is used.
47
- 4. **Group Properly:** Keep components and types separate.
48
-
49
- ## Checklist
50
-
51
- - [ ] Did I get this path from MCP tools?
52
- - [ ] Is this a component? (Use main package path)
53
- - [ ] Is this a type? (Use specific module path + `type`)
54
- - [ ] Did I copy the exact path?
1
+ ---
2
+ name: 'import-validator'
3
+ description: 'Enforces strict import protocols for Wangsvue components and types. Invoke when writing imports or fixing import errors.'
4
+ ---
5
+
6
+ # Import Protocol Validator
7
+
8
+ This skill ensures that all imports follow the strict Wangsvue Import Protocol.
9
+
10
+ ## The Golden Rules
11
+
12
+ 1. **NEVER Guess:** Always use `mcp_wangsvue_mcp_analyze_component` and `mcp_wangsvue_mcp_resolve_type_definition` to get the correct paths.
13
+ 2. **Exact Paths:** Do not modify the import paths returned by MCP tools.
14
+ 3. **Type Keyword:** Always add `type` keyword for type imports.
15
+
16
+ ## Common Mistakes & Corrections
17
+
18
+ ### 1. Component Imports
19
+
20
+ **❌ WRONG:** `import { Button } from '@fewangsit/wangsvue/button';`
21
+ **✅ RIGHT:** `import { Button } from '@fewangsit/wangsvue';`
22
+ _Rule: Components usually come from the main package._
23
+
24
+ ### 2. Type Imports
25
+
26
+ **❌ WRONG:** `import { MenuItem } from '@fewangsit/wangsvue/menuitem';`
27
+ **✅ RIGHT:** `import type { MenuItem } from '@fewangsit/wangsvue/menuitem';`
28
+ _Rule: Types usually come from specific modules and MUST use `import type`._
29
+
30
+ ### 3. Mixing Imports
31
+
32
+ **❌ WRONG:** `import { Button, ButtonProps } from '@fewangsit/wangsvue';`
33
+ **✅ RIGHT:** Separate them.
34
+
35
+ ```typescript
36
+ import { Button } from '@fewangsit/wangsvue';
37
+ import type { ButtonProps } from '@fewangsit/wangsvue/button'; // Verify path with MCP!
38
+ ```
39
+
40
+ ## Verification Process
41
+
42
+ Before writing any import:
43
+
44
+ 1. **Call MCP Tools:** `analyze_component` for components, `resolve_type_definition` for types.
45
+ 2. **Copy Exact Paths:** Use the path provided in the MCP result.
46
+ 3. **Add 'type':** If it is a type definition, ensure `type` keyword is used.
47
+ 4. **Group Properly:** Keep components and types separate.
48
+
49
+ ## Checklist
50
+
51
+ - [ ] Did I get this path from MCP tools?
52
+ - [ ] Is this a component? (Use main package path)
53
+ - [ ] Is this a type? (Use specific module path + `type`)
54
+ - [ ] Did I copy the exact path?