@hobui/viui-cli 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -139
- package/dist/adapters/adapter-registry.d.ts +12 -0
- package/dist/adapters/adapter-registry.d.ts.map +1 -0
- package/dist/adapters/adapter-registry.js +49 -0
- package/dist/adapters/adapter-types.d.ts +20 -0
- package/dist/adapters/adapter-types.d.ts.map +1 -0
- package/dist/adapters/adapter-types.js +1 -0
- package/dist/adapters/aider-adapter.d.ts +3 -0
- package/dist/adapters/aider-adapter.d.ts.map +1 -0
- package/dist/adapters/aider-adapter.js +8 -0
- package/dist/adapters/claude-adapter.d.ts +3 -0
- package/dist/adapters/claude-adapter.d.ts.map +1 -0
- package/dist/adapters/claude-adapter.js +15 -0
- package/dist/adapters/cline-adapter.d.ts +3 -0
- package/dist/adapters/cline-adapter.d.ts.map +1 -0
- package/dist/adapters/cline-adapter.js +8 -0
- package/dist/adapters/copilot-adapter.d.ts +5 -0
- package/dist/adapters/copilot-adapter.d.ts.map +1 -0
- package/dist/adapters/copilot-adapter.js +20 -0
- package/dist/adapters/cursor-adapter.d.ts +3 -0
- package/dist/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/adapters/cursor-adapter.js +18 -0
- package/dist/adapters/external/bolt-adapter.d.ts +3 -0
- package/dist/adapters/external/bolt-adapter.d.ts.map +1 -0
- package/dist/adapters/external/bolt-adapter.js +15 -0
- package/dist/adapters/external/chatgpt-adapter.d.ts +3 -0
- package/dist/adapters/external/chatgpt-adapter.d.ts.map +1 -0
- package/dist/adapters/external/chatgpt-adapter.js +14 -0
- package/dist/adapters/external/external-adapter-base.d.ts +15 -0
- package/dist/adapters/external/external-adapter-base.d.ts.map +1 -0
- package/dist/adapters/external/external-adapter-base.js +92 -0
- package/dist/adapters/external/gemini-adapter.d.ts +3 -0
- package/dist/adapters/external/gemini-adapter.d.ts.map +1 -0
- package/dist/adapters/external/gemini-adapter.js +14 -0
- package/dist/adapters/external/lovable-adapter.d.ts +3 -0
- package/dist/adapters/external/lovable-adapter.d.ts.map +1 -0
- package/dist/adapters/external/lovable-adapter.js +14 -0
- package/dist/adapters/external/v0-adapter.d.ts +3 -0
- package/dist/adapters/external/v0-adapter.d.ts.map +1 -0
- package/dist/adapters/external/v0-adapter.js +15 -0
- package/dist/adapters/windsurf-adapter.d.ts +3 -0
- package/dist/adapters/windsurf-adapter.d.ts.map +1 -0
- package/dist/adapters/windsurf-adapter.js +23 -0
- package/dist/assets/plugins/viui-conf/apply-theme-body.ts +23 -4
- package/dist/assets/plugins/viui-conf/defaults/README.md +2 -0
- package/dist/assets/plugins/viui-conf/defaults/app-bar.ts +1 -1
- package/dist/assets/plugins/viui-conf/defaults/buttons.ts +1 -1
- package/dist/assets/plugins/viui-conf/defaults/by-theme/minimalist-2.ts +1 -1
- package/dist/assets/plugins/viui-conf/defaults/cards.ts +1 -1
- package/dist/assets/plugins/viui-conf/defaults/expansion-panels.ts +16 -0
- package/dist/assets/plugins/viui-conf/defaults/index.ts +3 -0
- package/dist/assets/plugins/viui-conf/defaults/inputs.ts +11 -1
- package/dist/assets/plugins/viui-conf/design-tokens.ts +135 -0
- package/dist/assets/plugins/viui-conf/theme-base.ts +1 -1
- package/dist/assets/plugins/viui-conf/v-dark.ts +3 -5
- package/dist/assets/plugins/viui-conf/v-light.ts +3 -5
- package/dist/assets/plugins/vuetify.ts +36 -0
- package/dist/assets/prompt-data/components.json +106 -0
- package/dist/assets/prompt-data/tokens.json +83 -0
- package/dist/assets/themes/_bento-grid.scss +8 -0
- package/dist/assets/themes/_glassmorphism.scss +8 -0
- package/dist/assets/themes/_material.scss +8 -0
- package/dist/assets/themes/_minimalist-2.scss +375 -0
- package/dist/assets/themes/_minimalist.scss +9 -0
- package/dist/assets/themes/_neo-brutalism.scss +199 -0
- package/dist/assets/themes/bento-grid.scss +4 -0
- package/dist/assets/themes/glassmorphism.scss +4 -0
- package/dist/assets/themes/index.scss +11 -0
- package/dist/assets/themes/material.scss +4 -0
- package/dist/assets/themes/minimalist-2.scss +5 -0
- package/dist/assets/themes/minimalist.scss +4 -0
- package/dist/assets/themes/neo-brutalism.scss +5 -0
- package/dist/assets/viui-themes/_neo-brutalism.scss +70 -152
- package/dist/cli-paths.d.ts +7 -0
- package/dist/cli-paths.d.ts.map +1 -0
- package/dist/cli-paths.js +19 -0
- package/dist/cli.js +28 -578
- package/dist/cli.legacy.d.ts +3 -0
- package/dist/cli.legacy.d.ts.map +1 -0
- package/dist/cli.legacy.js +597 -0
- package/dist/commands/audit.d.ts +3 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +152 -0
- package/dist/commands/config/config-export.d.ts +6 -0
- package/dist/commands/config/config-export.d.ts.map +1 -0
- package/dist/commands/config/config-export.js +23 -0
- package/dist/commands/config/config-health.d.ts +6 -0
- package/dist/commands/config/config-health.d.ts.map +1 -0
- package/dist/commands/config/config-health.js +42 -0
- package/dist/commands/config/config-import.d.ts +6 -0
- package/dist/commands/config/config-import.d.ts.map +1 -0
- package/dist/commands/config/config-import.js +63 -0
- package/dist/commands/config/config-rollback.d.ts +6 -0
- package/dist/commands/config/config-rollback.d.ts.map +1 -0
- package/dist/commands/config/config-rollback.js +47 -0
- package/dist/commands/config/config-setup.d.ts +6 -0
- package/dist/commands/config/config-setup.d.ts.map +1 -0
- package/dist/commands/config/config-setup.js +103 -0
- package/dist/commands/config/config-status.d.ts +6 -0
- package/dist/commands/config/config-status.d.ts.map +1 -0
- package/dist/commands/config/config-status.js +42 -0
- package/dist/commands/config/config-uninstall.d.ts +6 -0
- package/dist/commands/config/config-uninstall.d.ts.map +1 -0
- package/dist/commands/config/config-uninstall.js +74 -0
- package/dist/commands/config.d.ts +6 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +19 -0
- package/dist/commands/docs.d.ts +3 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +17 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +93 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +183 -0
- package/dist/commands/sync.d.ts +3 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +73 -0
- package/dist/commands/theme.d.ts +3 -0
- package/dist/commands/theme.d.ts.map +1 -0
- package/dist/commands/theme.js +86 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +97 -0
- package/dist/prompts/prompt-builder.d.ts +4 -0
- package/dist/prompts/prompt-builder.d.ts.map +1 -0
- package/dist/prompts/prompt-builder.js +18 -0
- package/dist/prompts/prompt-data-loader.d.ts +11 -0
- package/dist/prompts/prompt-data-loader.d.ts.map +1 -0
- package/dist/prompts/prompt-data-loader.js +15 -0
- package/dist/prompts/prompt-sections/section-code-examples.d.ts +2 -0
- package/dist/prompts/prompt-sections/section-code-examples.d.ts.map +1 -0
- package/dist/prompts/prompt-sections/section-code-examples.js +36 -0
- package/dist/prompts/prompt-sections/section-color-tokens.d.ts +2 -0
- package/dist/prompts/prompt-sections/section-color-tokens.d.ts.map +1 -0
- package/dist/prompts/prompt-sections/section-color-tokens.js +19 -0
- package/dist/prompts/prompt-sections/section-component-map.d.ts +3 -0
- package/dist/prompts/prompt-sections/section-component-map.d.ts.map +1 -0
- package/dist/prompts/prompt-sections/section-component-map.js +12 -0
- package/dist/prompts/prompt-sections/section-typography-spacing.d.ts +2 -0
- package/dist/prompts/prompt-sections/section-typography-spacing.d.ts.map +1 -0
- package/dist/prompts/prompt-sections/section-typography-spacing.js +29 -0
- package/dist/services/backup-service.d.ts +7 -0
- package/dist/services/backup-service.d.ts.map +1 -0
- package/dist/services/backup-service.js +54 -0
- package/dist/services/config-service.d.ts +17 -0
- package/dist/services/config-service.d.ts.map +1 -0
- package/dist/services/config-service.js +64 -0
- package/dist/services/diff-engine.d.ts +13 -0
- package/dist/services/diff-engine.d.ts.map +1 -0
- package/dist/services/diff-engine.js +59 -0
- package/dist/services/ide-detector.d.ts +9 -0
- package/dist/services/ide-detector.d.ts.map +1 -0
- package/dist/services/ide-detector.js +113 -0
- package/dist/services/ide-detector.spec.d.ts +2 -0
- package/dist/services/ide-detector.spec.d.ts.map +1 -0
- package/dist/services/ide-detector.spec.js +108 -0
- package/dist/services/lock-file-service.d.ts +15 -0
- package/dist/services/lock-file-service.d.ts.map +1 -0
- package/dist/services/lock-file-service.js +74 -0
- package/dist/services/mcp-config-reader.d.ts +11 -0
- package/dist/services/mcp-config-reader.d.ts.map +1 -0
- package/dist/services/mcp-config-reader.js +40 -0
- package/dist/services/mcp-config-reader.spec.d.ts +2 -0
- package/dist/services/mcp-config-reader.spec.d.ts.map +1 -0
- package/dist/services/mcp-config-reader.spec.js +125 -0
- package/dist/services/mcp-config-writer.d.ts +11 -0
- package/dist/services/mcp-config-writer.d.ts.map +1 -0
- package/dist/services/mcp-config-writer.js +98 -0
- package/dist/services/mcp-config-writer.spec.d.ts +2 -0
- package/dist/services/mcp-config-writer.spec.d.ts.map +1 -0
- package/dist/services/mcp-config-writer.spec.js +162 -0
- package/dist/services/merge-engine.d.ts +12 -0
- package/dist/services/merge-engine.d.ts.map +1 -0
- package/dist/services/merge-engine.js +54 -0
- package/dist/services/vuetify-scaffold-service.d.ts +5 -0
- package/dist/services/vuetify-scaffold-service.d.ts.map +1 -0
- package/dist/services/vuetify-scaffold-service.js +67 -0
- package/dist/templates/vuetify-plugin.d.ts +90 -0
- package/dist/templates/vuetify-plugin.d.ts.map +1 -0
- package/dist/templates/vuetify-plugin.js +33 -0
- package/dist/types/command-types.d.ts +15 -0
- package/dist/types/command-types.d.ts.map +1 -0
- package/dist/types/command-types.js +2 -0
- package/dist/types/config-types.d.ts +29 -0
- package/dist/types/config-types.d.ts.map +1 -0
- package/dist/types/config-types.js +10 -0
- package/dist/types/ide-types.d.ts +29 -0
- package/dist/types/ide-types.d.ts.map +1 -0
- package/dist/types/ide-types.js +4 -0
- package/dist/types/lock-file-types.d.ts +27 -0
- package/dist/types/lock-file-types.d.ts.map +1 -0
- package/dist/types/lock-file-types.js +2 -0
- package/dist/utils/diff-display.d.ts +18 -0
- package/dist/utils/diff-display.d.ts.map +1 -0
- package/dist/utils/diff-display.js +61 -0
- package/dist/utils/fs-safe.d.ts +9 -0
- package/dist/utils/fs-safe.d.ts.map +1 -0
- package/dist/utils/fs-safe.js +44 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +28 -0
- package/dist/utils/open-browser.d.ts +3 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +13 -0
- package/package.json +11 -6
- package/dist/assets/cursor/.design-system-version +0 -1
- package/dist/assets/cursor/commands/audit-accessibility.md +0 -25
- package/dist/assets/cursor/commands/audit-ui.md +0 -35
- package/dist/assets/cursor/commands/component.md +0 -18
- package/dist/assets/cursor/commands/fix-storybook.md +0 -24
- package/dist/assets/cursor/commands/generate-component-from-figma.md +0 -26
- package/dist/assets/cursor/commands/generate-page-from-figma.md +0 -26
- package/dist/assets/cursor/plans/DESIGN_SYSTEM_PLAN.md +0 -177
- package/dist/assets/cursor/plans/PLANS_INDEX.md +0 -35
- package/dist/assets/cursor/rules/accessibility-contrast.mdc +0 -38
- package/dist/assets/cursor/rules/bem-class-style.mdc +0 -107
- package/dist/assets/cursor/rules/component-naming.mdc +0 -57
- package/dist/assets/cursor/rules/design-system-component-library.mdc +0 -59
- package/dist/assets/cursor/rules/design-system-workflow.mdc +0 -48
- package/dist/assets/cursor/rules/figma-mapping.mdc +0 -37
- package/dist/assets/cursor/rules/icons.mdc +0 -42
- package/dist/assets/cursor/rules/project-structure.mdc +0 -137
- package/dist/assets/cursor/rules/storybook-component-template.mdc +0 -103
- package/dist/assets/cursor/rules/storybook.mdc +0 -68
- package/dist/assets/cursor/rules/tokens.mdc +0 -32
- package/dist/assets/cursor/rules/viui-themes.mdc +0 -53
- package/dist/assets/cursor/rules/vuetify-layout.mdc +0 -52
- package/dist/assets/cursor/skills/accessibility.md +0 -75
- package/dist/assets/cursor/skills/design-system-thinking.md +0 -40
- package/dist/assets/cursor/skills/figma-interpretation.md +0 -38
- package/dist/assets/cursor/skills/vue-vuetify-design-system-architect.md +0 -60
- package/dist/assets/cursor/sync-manifest.json +0 -6
- package/dist/assets/viui-themes/bento-grid-global.scss +0 -5
- package/dist/assets/viui-themes/glassmorphism-global.scss +0 -5
- package/dist/assets/viui-themes/material-global.scss +0 -5
- package/dist/assets/viui-themes/minimalist-2-global.scss +0 -5
- package/dist/assets/viui-themes/minimalist-global.scss +0 -5
- package/dist/assets/viui-themes/neo-brutalism-global.scss +0 -5
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: accessibility
|
|
3
|
-
description: Chuyên gia accessibility tập trung — ARIA, keyboard, focus, color contrast (WCAG AA). Một file cho audit a11y, sửa component/story, checklist a11y, và mọi vấn đề tương phản màu chữ/nền.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Accessibility (Skill tổng thể — gồm Color Contrast)
|
|
7
|
-
|
|
8
|
-
## Khi nào dùng skill này
|
|
9
|
-
|
|
10
|
-
- **Audit accessibility** cho component, story hoặc trang.
|
|
11
|
-
- Thiết kế hoặc refactor component để **dễ truy cập** (screen reader, keyboard, focus).
|
|
12
|
-
- Cần **checklist a11y** trước khi merge (ARIA, contrast, keyboard, focus).
|
|
13
|
-
- **Sửa hoặc review color contrast** — chữ/nền đạt 4.5:1 (chữ thường), 3:1 (chữ lớn); thêm component/story mới có chữ trên nền màu/swatch.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## 1. Color contrast (WCAG AA)
|
|
18
|
-
|
|
19
|
-
### Chuẩn
|
|
20
|
-
|
|
21
|
-
- **WCAG 2.1 AA:** Chữ thường ≥ 4.5:1, chữ lớn (18pt+ hoặc 14pt đậm) ≥ 3:1.
|
|
22
|
-
- Tham chiếu: [Deque color-contrast](https://dequeuniversity.com/rules/axe/4.11/color-contrast?application=axeAPI).
|
|
23
|
-
|
|
24
|
-
### Quy tắc trong dự án
|
|
25
|
-
|
|
26
|
-
- Chữ và nền đạt tỉ lệ trên. Không dùng `text.disabled` cho nội dung đọc được; trên nền có màu dùng semantic `.text`. Trên swatch dùng #000/#fff theo luminance.
|
|
27
|
-
- **Rule chi tiết:** `.cursor/rules/accessibility-contrast.mdc` (quy tắc đầy đủ + ví dụ Colors.stories.ts). **AGENTS.md:** mục "Color contrast (WCAG AA)".
|
|
28
|
-
|
|
29
|
-
### Hành động nhanh (contrast)
|
|
30
|
-
|
|
31
|
-
1. **Chữ trên nền neutral:** Dùng `text.primary` hoặc `text.secondary`; không dùng `text.disabled` cho nội dung đọc được.
|
|
32
|
-
2. **Chữ trên nền có màu (success, warning, error, info):** Dùng semantic `.text` (vd: `colors.success.light.text` trên `colors.success.light.surface`).
|
|
33
|
-
3. **Chữ trên swatch / ô màu:** Màu đặc theo luminance: `#000` (lum > 0.5), `#fff` (lum ≤ 0.5).
|
|
34
|
-
4. **Tag / pill trên swatch:** Màu chữ và nền pill theo luminance để cặp ≥ 4.5:1.
|
|
35
|
-
5. **Token mới "text on X surface":** Ghi rõ cặp nền và kiểm tra tỉ lệ 4.5:1.
|
|
36
|
-
|
|
37
|
-
### Tokens & theme (contrast)
|
|
38
|
-
|
|
39
|
-
- **Tokens:** `design-tokens.ts` (text.disabled chỉ cho UI disabled), `inet-design-tokens.ts` (semantic surface + text).
|
|
40
|
-
- **Theme:** `v-light.ts` / `v-dark.ts` map `on-success` / `on-warning` từ inet-design-tokens.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 2. ARIA & ngữ nghĩa
|
|
45
|
-
|
|
46
|
-
- Dùng đúng role, aria-label, aria-describedby, aria-live khi cần.
|
|
47
|
-
- Form control có label (for/id hoặc aria-label). Nút/icon có text hoặc aria-label.
|
|
48
|
-
|
|
49
|
-
## 3. Keyboard
|
|
50
|
-
|
|
51
|
-
- Mọi tương tác có thể dùng bàn phím; thứ tự tab hợp lý; không trap focus trừ modal/dialog (và khi đó có cách thoát).
|
|
52
|
-
|
|
53
|
-
## 4. Focus
|
|
54
|
-
|
|
55
|
-
- Focus visible (outline hoặc ring); focus không mất vào element ẩn; sau khi mở modal/dropdown, focus chuyển vào vùng tương tác.
|
|
56
|
-
|
|
57
|
-
## 5. Vùng chạm (touch target)
|
|
58
|
-
|
|
59
|
-
- Nút/control đủ lớn (vd ≥ 44x44px) khi có thể.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Hành động nhanh (chung)
|
|
64
|
-
|
|
65
|
-
- **Sửa contrast:** Áp dụng rule `accessibility-contrast.mdc` và phần "Color contrast" trên.
|
|
66
|
-
- **Sửa ARIA/keyboard/focus:** Kiểm tra component Vue/Vuetify có aria-*, tabindex, @keydown; form có label; nút có mô tả.
|
|
67
|
-
- **Kiểm tra bằng addon:** Storybook addon a11y hoặc axe; sửa từng lỗi theo thứ tự ưu tiên (contrast → ARIA → keyboard).
|
|
68
|
-
|
|
69
|
-
## Trong dự án
|
|
70
|
-
|
|
71
|
-
- **Rule contrast:** `.cursor/rules/accessibility-contrast.mdc`
|
|
72
|
-
- **Command audit:** `.cursor/commands/audit-accessibility.md` (chạy audit và liệt kê lỗi + hướng sửa)
|
|
73
|
-
- **AGENTS.md:** Mục "Color contrast (WCAG AA)" và quy tắc chung
|
|
74
|
-
|
|
75
|
-
Khi được kích hoạt, đóng vai chuyên gia a11y: gợi ý chỉnh sửa cụ thể (attribute, token, component) để đạt WCAG 2.1 AA và trải nghiệm keyboard/screen reader tốt; với contrast, áp dụng quy tắc trên và gợi ý sửa token/màu/component cụ thể.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: design-system-thinking
|
|
3
|
-
description: Tư duy design system — NHÓM, workflow thêm mới/tìm kiếm/tổng kết, tokens là nguồn chân lý, 8pt grid, Simple–Secure–Stable. Dùng khi quyết định cấu trúc, thêm item mới, hoặc review nhất quán.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Skill: Design System Thinking
|
|
7
|
-
|
|
8
|
-
## Khi nào dùng
|
|
9
|
-
|
|
10
|
-
- Cần **thêm item mới** (component, token file, doc, story) và phải đặt đúng NHÓM và vị trí.
|
|
11
|
-
- Cần **tìm** component hoặc tài liệu theo nhóm hoặc tên.
|
|
12
|
-
- Cần **tổng kết** hoặc review design system (số NHÓM, số items, trạng thái).
|
|
13
|
-
- Cần ra quyết định **kiến trúc** (tách component, đặt token, cấu trúc Storybook).
|
|
14
|
-
|
|
15
|
-
## Vai trò
|
|
16
|
-
|
|
17
|
-
Áp dụng tư duy design system iNET: tổ chức theo NHÓM và items, workflow rõ (thêm mới, tìm kiếm, tổng kết), tokens là single source of truth, 8pt grid và triết lý Simple – Secure – Stable. Bám `docs/design-system-plan.md` và các rule trong `.cursor/rules/`.
|
|
18
|
-
|
|
19
|
-
## Nguyên tắc
|
|
20
|
-
|
|
21
|
-
1. **NHÓM chuẩn** — Vi-ui, Brands, Errors, Icons, Tokens, Docs, Storybook foundations. Mỗi item thuộc đúng một NHÓM; vị trí file theo `.cursor/rules/project-structure.mdc` và `.cursor/rules/design-system-workflow.mdc`.
|
|
22
|
-
2. **Workflow** — Thêm mới: chọn NHÓM → tạo đúng vị trí → cập nhật index/re-export → story hoặc docs nếu cần. Tìm kiếm: theo tên hoặc theo NHÓM. Tổng kết: đếm items theo nhóm, trạng thái documented/có story/dùng token.
|
|
23
|
-
3. **Tokens trước** — Màu, spacing, typography, elevation, shape lấy từ `src/tokens/design-tokens.ts`. Không hard-code giá trị thiết kế trong component hoặc story.
|
|
24
|
-
4. **8pt grid** — Spacing layout theo bội số 8px (space8pt); chi tiết có thể 4px. Nhất quán với `spacingTokens` và `space8pt`.
|
|
25
|
-
5. **Simple – Secure – Stable** — Thiết kế đơn giản, trạng thái an toàn rõ ràng (semantic color, xác nhận thao tác nguy hiểm), API và token ổn định (semver, tương thích ngược).
|
|
26
|
-
|
|
27
|
-
## Checklist khi thêm item mới
|
|
28
|
-
|
|
29
|
-
- [ ] Đã chọn NHÓM (vi-ui, Brands, Errors, Icons, Tokens, Docs, Storybook foundations).
|
|
30
|
-
- [ ] File đặt đúng thư mục (vd Vi* → `src/design-system/vi-ui/vi-<tên>/`, stories cùng thư mục).
|
|
31
|
-
- [ ] Đã dùng tokens (không hard-code); nếu cần token mới thì cập nhật `design-tokens.ts` và quy ước mirror TS ↔ SCSS.
|
|
32
|
-
- [ ] Naming tuân `.cursor/rules/component-naming.mdc` và `.cursor/rules/storybook.mdc`.
|
|
33
|
-
- [ ] Đã cập nhật index/re-export nếu NHÓM có file index.
|
|
34
|
-
|
|
35
|
-
## Tham chiếu
|
|
36
|
-
|
|
37
|
-
- Workflow và NHÓM: `.cursor/rules/design-system-workflow.mdc`, `.cursor/rules/project-structure.mdc`
|
|
38
|
-
- Plan và mục tiêu: `docs/design-system-plan.md`, `docs/design-system.md`
|
|
39
|
-
- Tokens: `.cursor/rules/tokens.mdc`, `src/tokens/design-tokens.ts`
|
|
40
|
-
- Tổng quan tích hợp: `docs/integration-guide.md`
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: figma-interpretation
|
|
3
|
-
description: Chuyên gia đọc và chuyển design từ Figma sang code. Dùng khi có Figma URL/node, cần get_design_context hoặc get_screenshot (MCP), map design sang tokens và component Vue theo iNET Design System.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Skill: Figma Interpretation
|
|
7
|
-
|
|
8
|
-
## Khi nào dùng
|
|
9
|
-
|
|
10
|
-
- User cung cấp **Figma URL** (design hoặc Make) và muốn sinh/cập nhật page, component hoặc story từ design.
|
|
11
|
-
- Cần **ánh xạ** layer/spec Figma sang token names và component API của dự án.
|
|
12
|
-
- Cần hướng dẫn **quy trình** design → code (MCP, mapping, kiểm tra drift).
|
|
13
|
-
|
|
14
|
-
## Vai trò
|
|
15
|
-
|
|
16
|
-
Đọc design từ Figma (qua MCP hoặc mô tả), hiểu layout và spec, và chuyển thành code Vue 3 + Vuetify bám **tokens** và **quy ước** của iNET Design System. Không hard-code màu/spacing/typography; luôn map sang `design-tokens.ts` và `inet-design-tokens.ts`.
|
|
17
|
-
|
|
18
|
-
## Nguyên tắc
|
|
19
|
-
|
|
20
|
-
1. **Tokens là nguồn chân lý** — Giá trị trong Figma (màu, spacing, radius, shadow) map sang key trong `src/tokens/design-tokens.ts`. Nếu Figma dùng giá trị khác token, ưu tiên token; ghi chú trong code hoặc với designer để cập nhật Figma.
|
|
21
|
-
2. **Figma Variables ↔ token names** — Nếu Figma có Variables, map tên (vd `brand/primary` → `colorTokens.brand.primary`). Tham chiếu `.cursor/rules/tokens.mdc` và `docs/integration-guide.md`.
|
|
22
|
-
3. **Component naming** — Component sinh từ Figma tuân `.cursor/rules/component-naming.mdc`: Vi* trong `vi-<tên>/`, PascalCase, `*.stories.ts` cùng thư mục. Story title = `{Nhóm}/{Tên}` theo `.cursor/rules/storybook.mdc`.
|
|
23
|
-
4. **MCP workflow** — Khi dùng Figma MCP: gọi `get_design_context` với `fileKey` (và `nodeId` nếu có) để lấy code/screenshot/hints. Output MCP thường là reference (React/Tailwind); chuyển sang Vue 3 + Vuetify và component/token của dự án.
|
|
24
|
-
5. **Accessibility** — Màu chữ/nền phải đạt WCAG 2.1 AA; dùng semantic `.text` trên nền màu. Xem `.cursor/rules/accessibility-contrast.mdc`.
|
|
25
|
-
|
|
26
|
-
## Quy trình gợi ý (Figma → code)
|
|
27
|
-
|
|
28
|
-
1. **Lấy design** — MCP `get_design_context(fileKey, nodeId?)` hoặc user mô tả/screenshot. Xác định sections, components, và giá trị (màu, spacing, typography).
|
|
29
|
-
2. **Map tokens** — Màu → `colorTokens.*` hoặc `inetDesignTokens.colors.*`; spacing → `spacingTokens` / `space8pt`; radius → `shapeTokens`; shadow → `elevationTokens`. Không thêm giá trị mới ngoài token trừ khi đã cập nhật `design-tokens.ts`.
|
|
30
|
-
3. **Chọn component** — Dùng Vi* có sẵn nếu khớp; nếu không, tạo component mới đúng thư mục và naming. Thêm story trong cùng thư mục.
|
|
31
|
-
4. **Kiểm tra** — Storybook chạy đúng; không có `[object Object]` hay chuỗi render-function; contrast và a11y đạt.
|
|
32
|
-
|
|
33
|
-
## Tham chiếu
|
|
34
|
-
|
|
35
|
-
- Tokens: `src/tokens/design-tokens.ts`, `.cursor/rules/tokens.mdc`
|
|
36
|
-
- Naming: `.cursor/rules/component-naming.mdc`, `.cursor/rules/storybook.mdc`
|
|
37
|
-
- Figma integration: `docs/integration-guide.md`, `docs/AI-prompt-rules.md` (block Designer / Figma AI)
|
|
38
|
-
- Contrast: `.cursor/rules/accessibility-contrast.mdc`
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: vue-vuetify-design-system-architect
|
|
3
|
-
description: Vue 3 & Vuetify Design System — pattern component, kiến trúc, tokens, theming, accessibility. Một file tập trung cho viết/sửa component Vi* hoặc brands/errors/icons, refactor, và quyết định design system.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Vue 3 & Vuetify Design System (Pattern + Kiến trúc)
|
|
7
|
-
|
|
8
|
-
## Ngôn ngữ và tài liệu
|
|
9
|
-
|
|
10
|
-
- **File hướng dẫn (.md, .mdc, …)**: Luôn ưu tiên **Tiếng Việt** khi soạn hoặc sửa nội dung.
|
|
11
|
-
- **Khi chưa rõ**: Luôn **hỏi lại User** thay vì đoán; không bỏ qua hoặc giả định yêu cầu.
|
|
12
|
-
|
|
13
|
-
## Khi nào dùng
|
|
14
|
-
|
|
15
|
-
- Đang **viết hoặc sửa** component Vue (Vi*, Brands, Errors, Icons) — cần pattern nhất quán.
|
|
16
|
-
- Cần **refactor** component cũ sang đúng chuẩn design system.
|
|
17
|
-
- Cần **quyết định kiến trúc** (tokens, theme, API, cấu trúc Storybook).
|
|
18
|
-
- Định nghĩa props/slots, thêm stories, hoặc thiết kế theme từ tokens.
|
|
19
|
-
|
|
20
|
-
## Vai trò
|
|
21
|
-
|
|
22
|
-
Một skill tập trung cho Vue 3 + Vuetify trong iNET Design System: pattern component (Composition API, tokens, props/slots), kiến trúc (tokens, theme, API), và accessibility. Bám AGENTS.md và rules trong `.cursor/rules/`.
|
|
23
|
-
|
|
24
|
-
## Nguyên tắc cốt lõi
|
|
25
|
-
|
|
26
|
-
1. **Tokens trước** — Component dùng design tokens (màu, khoảng cách, typography) từ design system. Không hard-code giá trị cho layout hoặc theme.
|
|
27
|
-
2. **Vue 3 + Vuetify** — Ưu tiên Composition API, `<script setup>`, và component/theme Vuetify 3. Dùng biến theme Vuetify xuất phát từ tokens khi phù hợp.
|
|
28
|
-
3. **Accessible mặc định** — ARIA, điều hướng bàn phím, quản lý focus, HTML ngữ nghĩa. Kiểm tra tương phản và vùng chạm. **Color contrast:** tuân WCAG 2.1 AA; xem `.cursor/rules/accessibility-contrast.mdc` và `.cursor/skills/accessibility.md` (phần Color contrast).
|
|
29
|
-
4. **API composable** — Props, slots, events rõ ràng; hỗ trợ tùy biến qua props và theme thay vì override từng chỗ.
|
|
30
|
-
5. **Định dạng chặt** — Tuân style dự án (AGENTS.md). Không tự chạy lệnh shell khi chưa có User đồng ý; giải thích rủi ro an toàn với thao tác hạ tầng.
|
|
31
|
-
|
|
32
|
-
## Cấu trúc file (pattern)
|
|
33
|
-
|
|
34
|
-
- **Vi*:** `src/design-system/vi-ui/vi-<tên>/ViName.vue` + `ViName.stories.ts`; export qua `src/design-system/vi-ui/index.ts`.
|
|
35
|
-
- **Brands/Errors/Icons:** `src/components/<nhóm>/<ComponentName>/ComponentName.vue` + `ComponentName.stories.ts`.
|
|
36
|
-
- **Story title:** `{Nhóm}/{Tên}` (vd `vi-ui/Button`, `Foundations/Colors`). Naming và vị trí theo `.cursor/rules/component-naming.mdc`, `.cursor/rules/storybook.mdc`.
|
|
37
|
-
|
|
38
|
-
## Khi thiết kế hoặc triển khai
|
|
39
|
-
|
|
40
|
-
- **Component mới**: Định nghĩa props và slots từ use case; ánh xạ UI sang tokens; thêm stories và mô tả biến thể.
|
|
41
|
-
- **Tokens**: Một nguồn chân lý (`design-tokens.ts`); expose ra theme/SCSS để component dùng qua theme hoặc CSS variables.
|
|
42
|
-
- **Theming**: Theme Vuetify lấy từ design tokens; tránh trùng lặp giá trị token giữa theme và component.
|
|
43
|
-
- **Refactor**: Giữ hoặc cải thiện accessibility và việc dùng tokens; giữ API công khai ổn định hoặc ghi rõ breaking changes.
|
|
44
|
-
|
|
45
|
-
## Checklist trước khi giao
|
|
46
|
-
|
|
47
|
-
- [ ] Code dùng tokens (không hard-code màu/khoảng cách/typography cho quyết định thiết kế).
|
|
48
|
-
- [ ] Vue 3 Composition API / `<script setup>` khi phù hợp.
|
|
49
|
-
- [ ] Props/slots rõ; naming đúng `.cursor/rules/component-naming.mdc`.
|
|
50
|
-
- [ ] Component và theme Vuetify dùng nhất quán.
|
|
51
|
-
- [ ] Đã xét accessibility (nhãn, focus, bàn phím, ngữ nghĩa, **color contrast** WCAG AA).
|
|
52
|
-
- [ ] Story có và chạy đúng; không có `[object Object]` hay chuỗi render trong DOM.
|
|
53
|
-
- [ ] Tuân AGENTS.md và quy tắc dự án (không auto-exec, ghi chú an toàn cho hạ tầng).
|
|
54
|
-
|
|
55
|
-
## Tài liệu tham khảo
|
|
56
|
-
|
|
57
|
-
- Tokens và theme: `src/tokens/`, `.cursor/rules/tokens.mdc`, theme trong `src/plugins/`.
|
|
58
|
-
- Color contrast (WCAG AA): `.cursor/rules/accessibility-contrast.mdc`, `.cursor/skills/accessibility.md` (phần Color contrast).
|
|
59
|
-
- Naming và workflow: `.cursor/rules/component-naming.mdc`, `.cursor/rules/design-system-workflow.mdc`, `.cursor/rules/storybook.mdc`.
|
|
60
|
-
- Quyết định design system: `AGENTS.md`, `docs/design-system.md`.
|