ai-developer-skill-os 1.8.1 → 2.0.0
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 +130 -171
- package/docs/CHI_TIET_SKILLS.md +89 -81
- package/docs/HUONG_DAN_SU_DUNG.md +120 -152
- package/package.json +1 -1
- package/skills/{qk-accessibility-audit → _archive_old_skills/qk-accessibility-audit}/SKILL.md +1 -1
- package/skills/{qk-agent-orchestrator → _archive_old_skills/qk-agent-orchestrator}/SKILL.md +1 -1
- package/skills/{qk-bug-fix → _archive_old_skills/qk-bug-fix}/SKILL.md +1 -1
- package/skills/{qk-component-generator → _archive_old_skills/qk-component-generator}/SKILL.md +1 -1
- package/skills/{qk-database-engineer → _archive_old_skills/qk-database-engineer}/SKILL.md +1 -1
- package/skills/{qk-design-system → _archive_old_skills/qk-design-system}/SKILL.md +1 -1
- package/skills/{qk-form-builder → _archive_old_skills/qk-form-builder}/SKILL.md +1 -1
- package/skills/{qk-frontend-architecture → _archive_old_skills/qk-frontend-architecture}/SKILL.md +1 -1
- package/skills/{qk-frontend-debug → _archive_old_skills/qk-frontend-debug}/SKILL.md +1 -1
- package/skills/{qk-frontend-performance → _archive_old_skills/qk-frontend-performance}/SKILL.md +1 -1
- package/skills/{qk-git-engineer → _archive_old_skills/qk-git-engineer}/SKILL.md +1 -1
- package/skills/_archive_old_skills/qk-help/SKILL.md +67 -0
- package/skills/{qk-state-management → _archive_old_skills/qk-state-management}/SKILL.md +1 -1
- package/skills/{qk-table-crud-generator → _archive_old_skills/qk-table-crud-generator}/SKILL.md +1 -1
- package/skills/qk-access-policy/SKILL.md +127 -0
- package/skills/qk-ai-builder/SKILL.md +33 -0
- package/skills/qk-api-lifecycle/SKILL.md +420 -0
- package/skills/qk-bug-resolution/SKILL.md +371 -0
- package/skills/qk-context-loader/SKILL.md +206 -0
- package/skills/qk-data-lifecycle/SKILL.md +135 -0
- package/skills/qk-design-to-code/SKILL.md +33 -0
- package/skills/qk-docs/SKILL.md +335 -0
- package/skills/qk-documentation-system/SKILL.md +33 -0
- package/skills/qk-engineering-standard/SKILL.md +171 -0
- package/skills/qk-engineering-standard/rules/backend.md +122 -0
- package/skills/qk-engineering-standard/rules/database.md +3 -0
- package/skills/qk-engineering-standard/rules/frontend.md +152 -0
- package/skills/qk-engineering-standard/rules/security.md +3 -0
- package/skills/qk-engineering-standard/rules/testing.md +3 -0
- package/skills/qk-feature-delivery/SKILL.md +432 -0
- package/skills/qk-help/SKILL.md +95 -67
- package/skills/qk-orchestrator/SKILL.md +272 -0
- package/skills/qk-policy-engine/SKILL.md +33 -0
- package/skills/qk-production-release/SKILL.md +127 -0
- package/skills/qk-project-bootstrap/SKILL.md +33 -0
- package/skills/qk-project-health/SKILL.md +650 -0
- package/skills/qk-project-memory/SKILL.md +33 -0
- package/skills/qk-system-evolution/SKILL.md +315 -0
- package/skills/qk-ui-audit/SKILL.md +152 -0
- package/skills/qk-ui-system-builder/SKILL.md +444 -0
- package/skills/qk-validation-gate/SKILL.md +33 -0
- /package/skills/{qk-api-integration → _archive_old_skills/qk-api-integration}/SKILL.md +0 -0
- /package/skills/{qk-auth-security → _archive_old_skills/qk-auth-security}/SKILL.md +0 -0
- /package/skills/{qk-backend-architecture → _archive_old_skills/qk-backend-architecture}/SKILL.md +0 -0
- /package/skills/{qk-context-manager → _archive_old_skills/qk-context-manager}/SKILL.md +0 -0
- /package/skills/{qk-deployment → _archive_old_skills/qk-deployment}/SKILL.md +0 -0
- /package/skills/{qk-frontend-testing → _archive_old_skills/qk-frontend-testing}/SKILL.md +0 -0
- /package/skills/{qk-migration → _archive_old_skills/qk-migration}/SKILL.md +0 -0
- /package/skills/{qk-project-audit → _archive_old_skills/qk-project-audit}/SKILL.md +0 -0
- /package/skills/{qk-refactor → _archive_old_skills/qk-refactor}/SKILL.md +0 -0
- /package/skills/{qk-ui-builder → _archive_old_skills/qk-ui-builder}/SKILL.md +0 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-ui-system-builder
|
|
3
|
+
purpose: Quản lý Design System, Component Library, Consistency.
|
|
4
|
+
mode_supported: [standard, enterprise]
|
|
5
|
+
input: [UI constraints]
|
|
6
|
+
output: [Reusable UI components/Tokens]
|
|
7
|
+
workflow: [1. Check Token -> 2. Check Pattern -> 3. Generate Component]
|
|
8
|
+
allowed_tools: [write_to_file, read_file]
|
|
9
|
+
handoff_to: [none]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 🛠️ qk-ui-system-builder - Quy Trình Vận Hành Chuẩn (SOP)
|
|
13
|
+
|
|
14
|
+
> **Mô tả:** Quản lý Design System, Component Library, Consistency.
|
|
15
|
+
|
|
16
|
+
## 🎯 1. Mục Tiêu (Goal)
|
|
17
|
+
- Hoàn thành thành công tác vụ được giao liên quan đến nhiệm vụ của skill.
|
|
18
|
+
- Đảm bảo chất lượng mã nguồn và tính nhất quán của hệ thống.
|
|
19
|
+
|
|
20
|
+
## 🔄 2. Chuỗi Hành Động (Chain of Thought / SOP)
|
|
21
|
+
*(Bắt buộc AI phải suy nghĩ và làm theo đúng thứ tự)*
|
|
22
|
+
1. **Phân tích (Analyze):** Thu thập ngữ cảnh và hiểu rõ yêu cầu đầu vào.
|
|
23
|
+
2. **Lên kế hoạch (Plan):** Xác định các bước cần thay đổi/tạo mới dựa trên bộ luật (rules).
|
|
24
|
+
3. **Thực thi (Execute):** Tiến hành sửa đổi mã nguồn hoặc tạo tài liệu.
|
|
25
|
+
4. **Xác thực (Verify):** Đảm bảo đầu ra đáp ứng đúng yêu cầu và không vi phạm quy định.
|
|
26
|
+
|
|
27
|
+
## 🛡️ 3. Ràng Buộc & Quy Tắc (Constraints)
|
|
28
|
+
- CẤM bỏ qua việc kiểm tra `qk-engineering-standard` trước khi viết code.
|
|
29
|
+
- Mọi quyết định kỹ thuật phải dựa trên nội dung tại phần Deep Knowledge (nếu có).
|
|
30
|
+
|
|
31
|
+
## 🤝 4. Giao Thức Bàn Giao (Handoff Protocol)
|
|
32
|
+
- Đích đến: `none`
|
|
33
|
+
- Nội dung bàn giao: Chuyển toàn bộ ngữ cảnh và kết quả đã thực thi cho bước tiếp theo.
|
|
34
|
+
|
|
35
|
+
## 📚 5. Kiến Thức Chuyên Sâu (Deep Knowledge)
|
|
36
|
+
|
|
37
|
+
*(Nền tảng kiến thức và quy tắc chi tiết kế thừa từ kỹ sư)*
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Design System Enforcer
|
|
44
|
+
|
|
45
|
+
> **Language rule:**
|
|
46
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
47
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
48
|
+
> The user may write in any language — detect and match it automatically.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Trigger
|
|
53
|
+
|
|
54
|
+
Activate this skill when:
|
|
55
|
+
- About to build UI screens or components
|
|
56
|
+
- Styling or layout work is required
|
|
57
|
+
- User asks to "make it look good" or "match the design"
|
|
58
|
+
- Integrating a third-party UI library (Tailwind, MUI, AntD, Shadcn)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Scope
|
|
63
|
+
|
|
64
|
+
- ✅ Identify the UI library or design system in use
|
|
65
|
+
- ✅ Map standard HTML elements to project-specific components (e.g., `<button>` → `<Button>`)
|
|
66
|
+
- ✅ Enforce usage of design tokens (colors, spacing, typography) instead of hardcoded values
|
|
67
|
+
- ✅ Provide available component variants and props to downstream skills (`ui-builder`)
|
|
68
|
+
- ✅ Prevent generation of raw CSS/inline styles if utility classes or styled-components are standard
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Non-goals
|
|
73
|
+
|
|
74
|
+
- ❌ Do NOT create new base components if an equivalent already exists
|
|
75
|
+
- ❌ Do NOT introduce a new styling method (e.g., don't add Tailwind if project uses CSS Modules)
|
|
76
|
+
- ❌ Do NOT design full pages (delegate to `ui-builder`)
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Workflow
|
|
81
|
+
|
|
82
|
+
### Phase 1 — Detect Design System
|
|
83
|
+
|
|
84
|
+
Analyze dependencies and project files to identify:
|
|
85
|
+
1. **Component Library:** Shadcn UI, MUI, Ant Design, Chakra, Bootstrap, custom internal library?
|
|
86
|
+
2. **Styling Method:** Tailwind CSS, CSS Modules, Styled Components, Emotion, SCSS, Vanilla CSS?
|
|
87
|
+
3. **Location of Shared Components:** Usually `src/components/ui/`, `src/shared/components/`, or from an npm package.
|
|
88
|
+
4. **Design Tokens:** `tailwind.config.js`, `theme.ts`, `variables.scss`.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Phase 2 — Component Mapping
|
|
93
|
+
|
|
94
|
+
Before `ui-builder` generates code, create a mapping table for required elements:
|
|
95
|
+
|
|
96
|
+
| Standard Element | Project Component | Source / Import Path |
|
|
97
|
+
|------------------|-------------------|----------------------|
|
|
98
|
+
| `<button>` | `<Button>` | `@/components/ui/button` |
|
|
99
|
+
| `<input type="text">` | `<Input>` | `@/components/ui/input` |
|
|
100
|
+
| `<div>` (Card) | `<Card>` | `@/components/ui/card` |
|
|
101
|
+
| `<h1>` | `<Typography variant="h1">` | `@mui/material` |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### Phase 3 — Token Extraction
|
|
106
|
+
|
|
107
|
+
Identify available tokens for spacing, colors, and typography to avoid hardcoding:
|
|
108
|
+
- *Instead of:* `margin-top: 16px; color: #3b82f6;`
|
|
109
|
+
- *Use:* `mt-4 text-blue-500` (Tailwind) or `theme.spacing(2)` (MUI) or `var(--primary-color)`.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Phase 4 — Rule Enforcement
|
|
114
|
+
|
|
115
|
+
Pass strict instructions to `ui-builder` or `component-generator`:
|
|
116
|
+
- "You MUST use `<Button>` instead of `<button>`."
|
|
117
|
+
- "You MUST use Tailwind classes for all styling. No inline `style={{}}` allowed."
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Decision Tree
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Does the project use a component library (e.g., Shadcn, MUI)?
|
|
125
|
+
├── Yes → Is the required component available?
|
|
126
|
+
│ ├── Yes → Require its use
|
|
127
|
+
│ └── No → Instruct `component-generator` to create it following library style
|
|
128
|
+
└── No → Check if custom shared components exist
|
|
129
|
+
├── Yes → Map to custom shared components
|
|
130
|
+
└── No → Use raw HTML but enforce project's styling method (e.g., Tailwind)
|
|
131
|
+
|
|
132
|
+
Does the project use utility classes (Tailwind)?
|
|
133
|
+
├── Yes → Forbid inline styles or custom CSS files
|
|
134
|
+
└── No → Enforce existing CSS Modules / Styled Components patterns
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Output Format
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
🎨 Design System Rules
|
|
143
|
+
─────────────────────────────────────────────────
|
|
144
|
+
Library: [Shadcn / MUI / Tailwind / Custom / etc.]
|
|
145
|
+
Styling Method: [Tailwind / CSS Modules / Styled Components]
|
|
146
|
+
|
|
147
|
+
Component Mapping for this task:
|
|
148
|
+
✅ Button → `<Button>` from `@/components/ui/button`
|
|
149
|
+
✅ Input → `<Input>` from `@/components/ui/input`
|
|
150
|
+
✅ Layout → Flexbox with Tailwind (`flex flex-col gap-4`)
|
|
151
|
+
|
|
152
|
+
Styling Rules Enforced:
|
|
153
|
+
• No raw HTML `<button>` allowed
|
|
154
|
+
• No inline styles allowed
|
|
155
|
+
• Use primary color token for CTAs
|
|
156
|
+
|
|
157
|
+
🔗 Next Steps:
|
|
158
|
+
Passing these rules to `ui-builder` to generate the UI.
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Validation Checklist
|
|
164
|
+
|
|
165
|
+
- [ ] Design system and styling method correctly identified
|
|
166
|
+
- [ ] Mappings created for all necessary UI elements
|
|
167
|
+
- [ ] Design tokens (spacing/colors) prioritized over hardcoded values
|
|
168
|
+
- [ ] Strict enforcement rules passed to next skill
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
# UI Builder
|
|
175
|
+
|
|
176
|
+
> **Language rule:**
|
|
177
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
178
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
179
|
+
> The user may write in any language — detect and match it automatically.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Trigger
|
|
184
|
+
|
|
185
|
+
Activate this skill when:
|
|
186
|
+
- User wants to create a new page, screen, or view
|
|
187
|
+
- User provides a mockup, wireframe, or visual description
|
|
188
|
+
- User asks to "build a layout", "create a dashboard", "make the profile page"
|
|
189
|
+
- Refactoring a large, messy view into a structured layout
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Scope
|
|
194
|
+
|
|
195
|
+
- ✅ Translate requirements into a component hierarchy
|
|
196
|
+
- ✅ Build layouts using Grid, Flexbox, and project styling conventions
|
|
197
|
+
- ✅ Ensure responsive design (mobile-first or desktop-first based on project)
|
|
198
|
+
- ✅ Integrate existing shared components (Buttons, Cards, Inputs) via `design-system` rules
|
|
199
|
+
- ✅ Define placeholders for data and logic (to be filled by `api-integration` or `state-management`)
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Non-goals
|
|
204
|
+
|
|
205
|
+
- ❌ Do NOT build backend APIs
|
|
206
|
+
- ❌ Do NOT implement complex global state (delegate to `state-management`)
|
|
207
|
+
- ❌ Do NOT invent new core UI components if they already exist in the design system
|
|
208
|
+
- ❌ Do NOT write raw HTML (`<button>`) if a shared component (`<Button>`) exists
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Workflow
|
|
213
|
+
|
|
214
|
+
### Phase 1 — Requirement Analysis
|
|
215
|
+
|
|
216
|
+
1. Understand the goal: What screen are we building?
|
|
217
|
+
2. Identify major sections: Header, Sidebar, Main Content, Footer, Modals.
|
|
218
|
+
3. Identify data requirements: What data will populate this view? (Use mock data initially).
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### Phase 2 — Component Hierarchy Planning
|
|
223
|
+
|
|
224
|
+
Break the screen down into smaller components.
|
|
225
|
+
**Rule of thumb:** If a section has complex logic or is reusable, it should be a separate component.
|
|
226
|
+
|
|
227
|
+
*Example:*
|
|
228
|
+
```text
|
|
229
|
+
UserProfilePage
|
|
230
|
+
├── ProfileHeader
|
|
231
|
+
│ ├── Avatar
|
|
232
|
+
│ └── UserStats
|
|
233
|
+
├── UserSettingsForm (delegate to form-builder)
|
|
234
|
+
└── UserActivityList
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### Phase 3 — Design System Integration
|
|
240
|
+
|
|
241
|
+
*(Relies on output from `design-system` skill)*
|
|
242
|
+
Identify which existing components will be used for each part of the hierarchy.
|
|
243
|
+
|
|
244
|
+
- Buttons → `<Button>`
|
|
245
|
+
- Layouts → `<Container>`, `<Grid>`
|
|
246
|
+
- Typography → `<Typography variant="h2">` or Tailwind text classes
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### Phase 4 — Implementation
|
|
251
|
+
|
|
252
|
+
Write the code.
|
|
253
|
+
1. Build the layout skeleton first (Flexbox/Grid).
|
|
254
|
+
2. Add static/mock data to visualize the structure.
|
|
255
|
+
3. Apply styling for layout, spacing, and typography.
|
|
256
|
+
4. Ensure responsive behavior (e.g., stack columns on mobile).
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
### Phase 5 — Validation
|
|
261
|
+
|
|
262
|
+
- [ ] Does it match the requirements?
|
|
263
|
+
- [ ] Is it responsive?
|
|
264
|
+
- [ ] Does it strictly use the design system?
|
|
265
|
+
- [ ] Is the code clean and well-structured (not one giant file)?
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Decision Tree
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
Is a section of the UI highly complex or forms a distinct logical unit?
|
|
273
|
+
├── Yes → Extract it into its own component file (e.g., `ProfileHeader.tsx`)
|
|
274
|
+
└── No → Keep it inline in the main layout file for now
|
|
275
|
+
|
|
276
|
+
Does a required base component (e.g., DatePicker) exist in the project?
|
|
277
|
+
├── Yes → Import and use it
|
|
278
|
+
└── No → Use a standard HTML fallback or instruct `component-generator` to build it later
|
|
279
|
+
|
|
280
|
+
Is the UI data-heavy (like a complex form or table)?
|
|
281
|
+
├── Yes → Delegate specific sections to `form-builder` or `table-crud-generator`
|
|
282
|
+
└── No → Build it fully within `ui-builder`
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Output Format
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
🎨 UI Builder Summary
|
|
291
|
+
─────────────────────────────────────────────────
|
|
292
|
+
Screen: [Name of the screen/view built]
|
|
293
|
+
|
|
294
|
+
Component Hierarchy:
|
|
295
|
+
[Tree showing parent and child components]
|
|
296
|
+
|
|
297
|
+
📁 Files Created/Modified:
|
|
298
|
+
✅ [path/to/Page.tsx]
|
|
299
|
+
✅ [path/to/SubComponent.tsx]
|
|
300
|
+
|
|
301
|
+
🛠️ Implementation Details:
|
|
302
|
+
- Responsive: [Yes - describe breakpoints used]
|
|
303
|
+
- Mock Data: [Added placeholders for API integration]
|
|
304
|
+
|
|
305
|
+
🔗 Next Steps:
|
|
306
|
+
→ Need to wire up API? Route to `api-integration`.
|
|
307
|
+
→ Need complex state? Route to `state-management`.
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Examples
|
|
313
|
+
|
|
314
|
+
See `examples/` folder.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
# Component Generator
|
|
321
|
+
|
|
322
|
+
> **Language rule:**
|
|
323
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
324
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
325
|
+
> The user may write in any language — detect and match it automatically.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Trigger
|
|
330
|
+
|
|
331
|
+
Activate this skill when:
|
|
332
|
+
- User says "create a Card component", "make a reusable Button", "extract this into a component"
|
|
333
|
+
- A larger skill (`ui-builder`, `form-builder`) requires a new isolated UI piece to be built
|
|
334
|
+
- Refactoring a large component by splitting it into smaller, reusable parts
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Scope
|
|
339
|
+
|
|
340
|
+
- ✅ Generate a single, focused component (e.g., `UserCard`, `StatBadge`, `Dropdown`)
|
|
341
|
+
- ✅ Define strict, explicit types/interfaces for all props
|
|
342
|
+
- ✅ Implement component variants (e.g., `size`, `color`, `variant`) if needed
|
|
343
|
+
- ✅ Follow project styling rules (Tailwind, CSS Modules, Styled Components)
|
|
344
|
+
- ✅ Ensure accessibility (ARIA attributes, semantic HTML) where applicable
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Non-goals
|
|
349
|
+
|
|
350
|
+
- ❌ Do NOT build full pages or complex screens (delegate to `ui-builder`)
|
|
351
|
+
- ❌ Do NOT handle complex business logic or data fetching inside a dumb/presentational component
|
|
352
|
+
- ❌ Do NOT overwrite existing components without explicit instruction
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Workflow
|
|
357
|
+
|
|
358
|
+
### Phase 1 — Component Design
|
|
359
|
+
|
|
360
|
+
Determine:
|
|
361
|
+
1. **Name:** PascalCase (e.g., `ProductCard`).
|
|
362
|
+
2. **Responsibility:** What exactly does this component do? Keep it single-responsibility.
|
|
363
|
+
3. **Props:** What data does it need from its parent? What events does it emit?
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
### Phase 2 — API (Props) Definition
|
|
368
|
+
|
|
369
|
+
Draft the interface first.
|
|
370
|
+
- Make required props explicit.
|
|
371
|
+
- Use optional props (`?`) for variants or non-essential data.
|
|
372
|
+
- Avoid `any`.
|
|
373
|
+
|
|
374
|
+
*Example:*
|
|
375
|
+
```typescript
|
|
376
|
+
interface ProductCardProps {
|
|
377
|
+
id: string;
|
|
378
|
+
title: string;
|
|
379
|
+
price: number;
|
|
380
|
+
imageUrl?: string;
|
|
381
|
+
isAvailable?: boolean;
|
|
382
|
+
onAddToCart: (id: string) => void;
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
### Phase 3 — Implementation
|
|
389
|
+
|
|
390
|
+
Write the component code.
|
|
391
|
+
1. Use destructuring for props.
|
|
392
|
+
2. Apply styling based on `design-system` rules.
|
|
393
|
+
3. Handle empty/null states (e.g., if `imageUrl` is missing, show a placeholder).
|
|
394
|
+
4. Add basic interactivity (e.g., calling `onAddToCart` when clicked).
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
### Phase 4 — Validation
|
|
399
|
+
|
|
400
|
+
- [ ] Are all props typed correctly?
|
|
401
|
+
- [ ] Is it truly reusable (no hardcoded data)?
|
|
402
|
+
- [ ] Does it use project design tokens?
|
|
403
|
+
- [ ] Is it exported correctly according to project conventions (default vs. named export)?
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## Decision Tree
|
|
408
|
+
|
|
409
|
+
```
|
|
410
|
+
Does the component need to manage its own state (e.g., an accordion opening/closing)?
|
|
411
|
+
├── Yes → Add local state (`useState`). Keep it minimal.
|
|
412
|
+
└── No → Make it a pure "dumb" component receiving props.
|
|
413
|
+
|
|
414
|
+
Are there multiple visual styles requested (e.g., primary, secondary, outline)?
|
|
415
|
+
├── Yes → Add a `variant` prop and map it to style classes.
|
|
416
|
+
└── No → Implement the single required style.
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Output Format
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
🧩 Component Generated
|
|
425
|
+
─────────────────────────────────────────────────
|
|
426
|
+
Name: [ComponentName]
|
|
427
|
+
Path: [path/to/Component.tsx]
|
|
428
|
+
|
|
429
|
+
Props Interface:
|
|
430
|
+
[List key props here briefly]
|
|
431
|
+
|
|
432
|
+
Features:
|
|
433
|
+
• [Feature 1, e.g., "Supports primary/secondary variants"]
|
|
434
|
+
• [Feature 2, e.g., "Fully typed with TypeScript"]
|
|
435
|
+
|
|
436
|
+
🔗 Next Steps:
|
|
437
|
+
Component is ready to be imported into your layout.
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Examples
|
|
443
|
+
|
|
444
|
+
See `examples/` folder.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-validation-gate
|
|
3
|
+
purpose: Cổng kiểm định chất lượng bắt buộc (Test, Lint, Security) trước khi hoàn tất.
|
|
4
|
+
mode_supported: [standard]
|
|
5
|
+
input: [Completed code]
|
|
6
|
+
output: [Validation pass/fail]
|
|
7
|
+
workflow: [1. Run Tests -> 2. Linting -> 3. Security Scan -> 4. Handoff if PASS]
|
|
8
|
+
allowed_tools: [run_command]
|
|
9
|
+
handoff_to: [qk-docs]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 🛠️ qk-validation-gate - Quy Trình Vận Hành Chuẩn (SOP)
|
|
13
|
+
|
|
14
|
+
> **Mô tả:** Cổng kiểm định chất lượng bắt buộc (Test, Lint, Security) trước khi hoàn tất.
|
|
15
|
+
|
|
16
|
+
## 🎯 1. Mục Tiêu (Goal)
|
|
17
|
+
- Hoàn thành thành công tác vụ được giao liên quan đến nhiệm vụ của skill.
|
|
18
|
+
- Đảm bảo chất lượng mã nguồn và tính nhất quán của hệ thống.
|
|
19
|
+
|
|
20
|
+
## 🔄 2. Chuỗi Hành Động (Chain of Thought / SOP)
|
|
21
|
+
*(Bắt buộc AI phải suy nghĩ và làm theo đúng thứ tự)*
|
|
22
|
+
1. **Phân tích (Analyze):** Thu thập ngữ cảnh và hiểu rõ yêu cầu đầu vào.
|
|
23
|
+
2. **Lên kế hoạch (Plan):** Xác định các bước cần thay đổi/tạo mới dựa trên bộ luật (rules).
|
|
24
|
+
3. **Thực thi (Execute):** Tiến hành sửa đổi mã nguồn hoặc tạo tài liệu.
|
|
25
|
+
4. **Xác thực (Verify):** Đảm bảo đầu ra đáp ứng đúng yêu cầu và không vi phạm quy định.
|
|
26
|
+
|
|
27
|
+
## 🛡️ 3. Ràng Buộc & Quy Tắc (Constraints)
|
|
28
|
+
- CẤM bỏ qua việc kiểm tra `qk-engineering-standard` trước khi viết code.
|
|
29
|
+
- Mọi quyết định kỹ thuật phải dựa trên nội dung tại phần Deep Knowledge (nếu có).
|
|
30
|
+
|
|
31
|
+
## 🤝 4. Giao Thức Bàn Giao (Handoff Protocol)
|
|
32
|
+
- Đích đến: `qk-docs`
|
|
33
|
+
- Nội dung bàn giao: Chuyển toàn bộ ngữ cảnh và kết quả đã thực thi cho bước tiếp theo.
|
|
File without changes
|
|
File without changes
|
/package/skills/{qk-backend-architecture → _archive_old_skills/qk-backend-architecture}/SKILL.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|