@fewangsit/wangsvue 1.5.229-alpha.44 → 1.5.229-alpha.46
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/icon/index.d.ts +51 -53
- package/mcp/components.json +1 -1
- package/mcp/components.summary.txt +1 -1
- package/mcp/main.js +4577 -4565
- package/mcp/package.json +5 -5
- package/mcp/skills/api-service-generator/SKILL.md +93 -0
- package/mcp/skills/committing-changes/SKILL.md +38 -0
- package/mcp/skills/figma-datatable-generator/SKILL.md +93 -0
- package/mcp/skills/figma-to-code/SKILL.md +117 -0
- package/mcp/skills/import-validator/SKILL.md +54 -0
- package/mcp/skills/wangsvue-code-review/SKILL.md +70 -0
- package/mcp/skills/wangsvue-workflow/SKILL.md +91 -0
- package/package.json +1 -1
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fewangsit/wangsvue-mcp",
|
|
3
|
-
"version": "1.5.229-alpha.
|
|
3
|
+
"version": "1.5.229-alpha.45",
|
|
4
4
|
"description": "MCP Server for @fewangsit/wangsvue",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"buildContext": {
|
|
11
11
|
"package": {
|
|
12
12
|
"name": "@fewangsit/wangsvue",
|
|
13
|
-
"version": "1.5.229-alpha.
|
|
13
|
+
"version": "1.5.229-alpha.45",
|
|
14
14
|
"description": "Wangsit VueJS Component Library",
|
|
15
15
|
"repository": "https://github.com/fewangsit/wangsvue",
|
|
16
16
|
"workspace": "wangsvue"
|
|
17
17
|
},
|
|
18
18
|
"build": {
|
|
19
|
-
"timestamp": "2026-02-
|
|
19
|
+
"timestamp": "2026-02-04T02:10:13.889Z",
|
|
20
20
|
"gitInfo": {
|
|
21
|
-
"head": "
|
|
21
|
+
"head": "bb6a3e23c4e436eb20ba4b0eefcdc49b4f53386a",
|
|
22
22
|
"branch": "feat/mcp",
|
|
23
23
|
"repository": "https://github.com/fewangsit/wangsvue.git",
|
|
24
|
-
"timestamp": "2026-02-
|
|
24
|
+
"timestamp": "2026-02-04T02:10:13.698Z"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'api-service-generator'
|
|
3
|
+
description: 'Generates production-ready API Services, DTOs, and Response Types from OpenAPI specifications. Invoke when user provides an OpenAPI spec or asks to create API services.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API Service Generator
|
|
7
|
+
|
|
8
|
+
This skill automates the creation of API services, request DTOs, and response types based on an OpenAPI (Swagger) specification, following the project's architectural standards.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Invoke when the user provides an OpenAPI specification (YAML or JSON).
|
|
13
|
+
- Invoke when the user asks to "create API services" or "implement endpoints" from a spec.
|
|
14
|
+
- Invoke when updating existing services based on a new API version.
|
|
15
|
+
|
|
16
|
+
## Standards & Patterns
|
|
17
|
+
|
|
18
|
+
### 1. File Structure
|
|
19
|
+
|
|
20
|
+
- **Services**: `src/services/<serviceName>.service.ts`
|
|
21
|
+
- **Request DTOs**: `src/dto/<serviceName>.dto.ts`
|
|
22
|
+
- **Response Types**: `src/types/<serviceName>.type.ts`
|
|
23
|
+
|
|
24
|
+
### 2. Service Object
|
|
25
|
+
|
|
26
|
+
- Use **PascalCase** for the service object name (e.g., `AuthService`).
|
|
27
|
+
- Use **camelCase** for methods (e.g., `postLogin`).
|
|
28
|
+
- Methods should follow the naming: `[httpMethod][ActionName]` (e.g., `getDetail`, `postCreate`).
|
|
29
|
+
- Return type: `Promise<AxiosResponse<ResponseType>>`.
|
|
30
|
+
- Single line spacing between methods.
|
|
31
|
+
|
|
32
|
+
### 3. Instance Creation
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { AxiosResponse } from 'axios';
|
|
36
|
+
import createAxiosInstance from './createInstance';
|
|
37
|
+
|
|
38
|
+
const API = createAxiosInstance({
|
|
39
|
+
env: 'VITE_API_BASE_URL',
|
|
40
|
+
prefix: '/v2/iam',
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 4. DTOs & Types
|
|
45
|
+
|
|
46
|
+
- **DTOs**: Interfaces for request bodies and query params.
|
|
47
|
+
- **Types**: Interfaces for response bodies.
|
|
48
|
+
- Use clear, descriptive noun-based names (e.g., `LoginBody`, `LoginResponse`).
|
|
49
|
+
- Use `UserProfileResponse` instead of `GetUserProfileResponse`.
|
|
50
|
+
|
|
51
|
+
## Workflow
|
|
52
|
+
|
|
53
|
+
1. **Parse the Spec**: Identify paths, methods, request schemas, and response schemas.
|
|
54
|
+
2. **Group by Module**: Group endpoints by their primary path segment (e.g., `/auth/*` -> `AuthService`).
|
|
55
|
+
3. **Generate Interfaces**:
|
|
56
|
+
- Create `src/dto/<module>.dto.ts` for all request-related interfaces.
|
|
57
|
+
- Create `src/types/<module>.type.ts` for all response-related interfaces.
|
|
58
|
+
4. **Generate Service**:
|
|
59
|
+
- Create `src/services/<module>.service.ts`.
|
|
60
|
+
- Implement methods for each endpoint in the group.
|
|
61
|
+
5. **Register Service**:
|
|
62
|
+
- Export the service from `src/main.ts` for global availability.
|
|
63
|
+
|
|
64
|
+
## Example Transformation
|
|
65
|
+
|
|
66
|
+
**Input (OpenAPI):**
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
/auth/login:
|
|
70
|
+
post:
|
|
71
|
+
summary: Login
|
|
72
|
+
requestBody:
|
|
73
|
+
content:
|
|
74
|
+
application/json:
|
|
75
|
+
schema:
|
|
76
|
+
$ref: '#/components/schemas/LoginRequest'
|
|
77
|
+
responses:
|
|
78
|
+
'200':
|
|
79
|
+
content:
|
|
80
|
+
application/json:
|
|
81
|
+
schema:
|
|
82
|
+
$ref: '#/components/schemas/LoginResponse'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Output (Service):**
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
const AuthService = {
|
|
89
|
+
postLogin: (body: LoginRequest): Promise<AxiosResponse<LoginResponse>> => {
|
|
90
|
+
return API.post('/auth/login', body);
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
```
|
|
@@ -0,0 +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
|
+
```
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +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?
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'wangsvue-code-review'
|
|
3
|
+
description: 'Reviews generated Wangsvue code against mandatory architectural principles and enforcement checklists. Invoke after generating code or before completion.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wangsvue Code Review Protocol
|
|
7
|
+
|
|
8
|
+
This skill enforces the strict quality standards for Wangsvue code. Use this checklist to review any generated code before considering the task complete.
|
|
9
|
+
|
|
10
|
+
## 🚨 Mandatory Architectural Principles
|
|
11
|
+
|
|
12
|
+
### 1. Total Wangsvue Exclusivity
|
|
13
|
+
|
|
14
|
+
- [ ] **Strict Prohibition:** NO usage of PrimeVue, Element Plus, Vuetify, or other libraries.
|
|
15
|
+
- [ ] **Compliance:** ONLY use props, slots, events, and patterns defined in Wangsvue MCP or Knowledge Base.
|
|
16
|
+
|
|
17
|
+
### 2. Zero Assumption Policy
|
|
18
|
+
|
|
19
|
+
- [ ] **Verification:** Are all prop names, slot names, icon names, and enum values verified via MCP?
|
|
20
|
+
- [ ] **No Guessing:** If it's not in the MCP result, it doesn't exist.
|
|
21
|
+
|
|
22
|
+
### 3. MCP-First Verification
|
|
23
|
+
|
|
24
|
+
- [ ] **Component Discovery:** Was `list_all_components()` called to find specialized components?
|
|
25
|
+
- [ ] **Type Resolution:** Were all literal values (icons, severity, sizes) verified with `resolve_type_definition`?
|
|
26
|
+
- [ ] **Example Check:** Did you check `get_example` for intended usage patterns?
|
|
27
|
+
|
|
28
|
+
## ✅ Final Enforcement Checklist (Every File Must Pass)
|
|
29
|
+
|
|
30
|
+
### 1. SFC Structure & Organization
|
|
31
|
+
|
|
32
|
+
- [ ] **Structure:** `<script setup>` → `<template>` → `<style>` (only if needed).
|
|
33
|
+
- [ ] **Script Order:** Imports → Props/Emits → Lifecycle → Variables → Methods (follows Vue Code Structure MD).
|
|
34
|
+
- [ ] **Project Structure:** Business logic is in `components/modules/`, NOT in views.
|
|
35
|
+
- [ ] **App.vue:** Only contains `<router-view />`, no business logic.
|
|
36
|
+
|
|
37
|
+
### 2. Import Protocol
|
|
38
|
+
|
|
39
|
+
- [ ] **Exact Paths:** ALL imports match MCP results EXACTLY (no modifications).
|
|
40
|
+
- [ ] **Type Imports:** `type` keyword used for all type imports (from `resolve_type_definition`).
|
|
41
|
+
- [ ] **Separation:** Component imports (main package) separated from Type imports (specific modules).
|
|
42
|
+
|
|
43
|
+
### 3. Testing & Attributes
|
|
44
|
+
|
|
45
|
+
- [ ] **Data Attributes:** `data-wv-name` on root element, `data-wv-section` on significant sections.
|
|
46
|
+
|
|
47
|
+
### 4. Code Quality
|
|
48
|
+
|
|
49
|
+
- [ ] **Linter:** `pnpm lint` must pass with exit code 0. After fixing ESLint errors, check editor `#problems_and_diagnostics` and fix any remaining issues.
|
|
50
|
+
- [ ] **No Generic HTML:** specialized components used instead of `<div>` (e.g., `Card` instead of `div.bg-white`).
|
|
51
|
+
- [ ] **No Manual CSS:** No styling on Wangsvue components (trust the design system).
|
|
52
|
+
- [ ] **Exact Pixel Values:** 21px remains 21px, do not round to 20px (h-5).
|
|
53
|
+
|
|
54
|
+
## ❌ Automatic Failure Indicators (IMMEDIATE STOP)
|
|
55
|
+
|
|
56
|
+
If ANY of these are found, the code is rejected:
|
|
57
|
+
|
|
58
|
+
- **Guessing:** Guessing icon names (`edit-line` vs `edit`) or enum values.
|
|
59
|
+
- **Manual Styles:** Writing `<div class="bg-white p-4">` instead of `<Card>`.
|
|
60
|
+
- **CSS Vars:** Using `bg-[var(--color)]` instead of Tailwind tokens (`bg-general-50`).
|
|
61
|
+
- **Wrong Imports:** Mixing component and type paths, or forgetting `type` keyword.
|
|
62
|
+
- **Double Wrapping:** `<div><Breadcrumb /></div>` (remove the div).
|
|
63
|
+
- **Fat Views:** Putting data, columns, or handlers in view components instead of modules.
|
|
64
|
+
- **Custom Patterns:** Implementing custom solutions when documentation provides a standard approach.
|
|
65
|
+
- **Optimization:** "Optimizing" documented patterns instead of following them exactly.
|
|
66
|
+
|
|
67
|
+
## Review Decision
|
|
68
|
+
|
|
69
|
+
- **PASS:** All checklists checked, no failure indicators.
|
|
70
|
+
- **FAIL:** Any unchecked item or presence of failure indicator. **Fix immediately.**
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'wangsvue-workflow'
|
|
3
|
+
description: 'Enforces the 5-step mandatory workflow for Wangsvue development, including component discovery protocols. Invoke when starting a new task, feature, or component implementation.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wangsvue Mandatory Workflow
|
|
7
|
+
|
|
8
|
+
This skill guides you through the 5 mandatory steps for any Wangsvue development task. You MUST follow these steps in order.
|
|
9
|
+
|
|
10
|
+
## The 5-Step Workflow
|
|
11
|
+
|
|
12
|
+
### Step 1: Standard Synchronization
|
|
13
|
+
|
|
14
|
+
**Action:** Read relevant MD files before starting.
|
|
15
|
+
|
|
16
|
+
- **Files to Check:** Vue Code Structure, Project Structure, Code Consistency Guidelines.
|
|
17
|
+
- **Goal:** Ensure you are aligned with the latest architectural standards.
|
|
18
|
+
|
|
19
|
+
### Step 2: Technical Discovery (MCP First)
|
|
20
|
+
|
|
21
|
+
**Action:** Use MCP tools to find components and types.
|
|
22
|
+
|
|
23
|
+
- **Command:** `mcp_wangsvue_mcp_list_all_components()`
|
|
24
|
+
- **Command:** `mcp_wangsvue_mcp_analyze_component(componentId, format: "toon")`
|
|
25
|
+
- **Command:** `mcp_wangsvue_mcp_resolve_type_definition(types: [...])`
|
|
26
|
+
- **Goal:** Get the correct component ID, import paths, and TypeScript contracts.
|
|
27
|
+
- **Rule:** NEVER write import statements without MCP verification.
|
|
28
|
+
|
|
29
|
+
#### 🔍 Discovery Protocol (Detailed)
|
|
30
|
+
|
|
31
|
+
**Always ask:** "Does Wangsvue have a specialized component for this?"
|
|
32
|
+
|
|
33
|
+
**Keyword Search Guide:**
|
|
34
|
+
|
|
35
|
+
- **Functional Components:**
|
|
36
|
+
|
|
37
|
+
- Filter? → Search "filter"
|
|
38
|
+
- Download? → Search "download" (e.g., `ButtonDownload`)
|
|
39
|
+
- Bulk actions? → Search "bulk" (e.g., `ButtonBulkAction`)
|
|
40
|
+
- Search? → Search "search" (e.g., `ButtonSearch`)
|
|
41
|
+
- Upload? → Search "upload" (e.g., `FileUpload`)
|
|
42
|
+
- Copy? → Search "copy" (e.g., `ButtonCopy`)
|
|
43
|
+
|
|
44
|
+
- **Structural Components:**
|
|
45
|
+
- Card/Container? → Search "card" (for background, padding, border)
|
|
46
|
+
- Form wrapper? → Search "form"
|
|
47
|
+
- Modal/Popup? → Search "dialog", "dialogconfirm"
|
|
48
|
+
- Loading? → Search "loading"
|
|
49
|
+
|
|
50
|
+
**Mental Shift Required:**
|
|
51
|
+
|
|
52
|
+
- **❌ OLD:** "I need a container with background" → `<div class="bg-white p-4">`
|
|
53
|
+
- **✅ NEW:** "I need a container" → Search components → Find `Card`
|
|
54
|
+
- **❌ OLD:** "I need a button for download" → `<Button>`
|
|
55
|
+
- **✅ NEW:** "I need download functionality" → Search components → Find `ButtonDownload`
|
|
56
|
+
|
|
57
|
+
### Step 3: Pattern Extraction (Documentation)
|
|
58
|
+
|
|
59
|
+
**Action:** Use MCP tools to see real usage patterns.
|
|
60
|
+
|
|
61
|
+
1. **Mandatory Discovery:** Call `mcp_wangsvue_docs_get_sections(component)` FIRST to see available section IDs.
|
|
62
|
+
2. **Extraction:** Call `mcp_wangsvue_docs_get_example(component, section)` using the exact ID found in step 1.
|
|
63
|
+
|
|
64
|
+
- **Goal:** Understand intended usage, built-in features, and architecture.
|
|
65
|
+
- **Rule:** NEVER guess a section name. NEVER assume an example exists without checking sections.
|
|
66
|
+
- **Rule:** Follow examples EXACTLY. Do not create custom interpretations.
|
|
67
|
+
|
|
68
|
+
**Questions to Ask:**
|
|
69
|
+
|
|
70
|
+
- "Does this component handle its own state?" (e.g., `DataTable` handles pagination)
|
|
71
|
+
- "Does it integrate with Router?" (e.g., `TabMenu`)
|
|
72
|
+
- "Does it use a store?" (e.g., `Breadcrumb` uses `useBreadcrumbStore`)
|
|
73
|
+
|
|
74
|
+
### Step 4: Synthesis (Strict Implementation)
|
|
75
|
+
|
|
76
|
+
**Action:** Implement the code following strict structure rules.
|
|
77
|
+
|
|
78
|
+
- **Structure:** Script → Template → Style.
|
|
79
|
+
- **Organization:** Imports → Props/Emits → Lifecycle → Variables → Methods.
|
|
80
|
+
- **Logic:** Business logic in `components/modules/`, NOT in views.
|
|
81
|
+
- **Views:** Lightweight, only import and compose from modules.
|
|
82
|
+
- **Attributes:** Ensure `data-wv-name` and `data-wv-section` are present.
|
|
83
|
+
|
|
84
|
+
### Step 5: Validation (The "Black Box" Linter Rule)
|
|
85
|
+
|
|
86
|
+
Launch skill `wangsvue-code-review`.
|
|
87
|
+
|
|
88
|
+
## Repetition Protocol
|
|
89
|
+
|
|
90
|
+
Before starting, affirm:
|
|
91
|
+
"I WILL DISCOVER SPECIALIZED COMPONENTS FIRST. I WILL CALL GET_SECTIONS BEFORE GET_EXAMPLE. I WILL NOT GUESS SECTION NAMES OR IMPORTS. I WILL FOLLOW DOCUMENTED PATTERNS EXACTLY. I WILL RUN PNPM LINT."
|