ai-developer-skill-os 2.0.1 → 3.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/.agents/AGENTS.md +48 -0
- package/README.md +77 -130
- package/knowledge/frontend/react.md +27 -0
- package/package.json +1 -1
- package/skills/qk-access-policy/SKILL.md +40 -127
- package/skills/qk-ai-builder/SKILL.md +41 -33
- package/skills/qk-api-lifecycle/SKILL.md +62 -420
- package/skills/qk-bug-resolution/SKILL.md +65 -371
- package/skills/qk-context-loader/SKILL.md +47 -206
- package/skills/qk-data-lifecycle/SKILL.md +60 -135
- package/skills/qk-design-to-code/SKILL.md +46 -33
- package/skills/qk-docs/SKILL.md +52 -335
- package/skills/qk-documentation-system/SKILL.md +38 -33
- package/skills/qk-engineering-standard/SKILL.md +61 -171
- package/skills/qk-feature-delivery/SKILL.md +63 -432
- package/skills/qk-help/SKILL.md +37 -95
- package/skills/qk-orchestrator/SKILL.md +52 -272
- package/skills/qk-policy-engine/SKILL.md +52 -33
- package/skills/qk-production-release/SKILL.md +45 -127
- package/skills/qk-project-bootstrap/SKILL.md +43 -33
- package/skills/qk-project-health/SKILL.md +56 -650
- package/skills/qk-project-memory/SKILL.md +35 -33
- package/skills/qk-system-evolution/SKILL.md +63 -315
- package/skills/qk-ui-audit/SKILL.md +58 -152
- package/skills/qk-ui-system-builder/SKILL.md +40 -444
- package/skills/qk-validation-gate/SKILL.md +59 -33
- package/templates/bug-report.md +21 -0
- package/templates/design-report.md +21 -0
- package/templates/feature-report.md +20 -0
- package/templates/review-report.md +21 -0
|
@@ -1,206 +1,47 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-context-loader
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
##
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Trigger
|
|
52
|
-
|
|
53
|
-
Activate this skill when:
|
|
54
|
-
- Starting work on an unfamiliar or large codebase
|
|
55
|
-
- About to read many files and need to prioritize
|
|
56
|
-
- Context window is at risk of overflowing
|
|
57
|
-
- User asks "where is X", "what does Y do", "how is this project structured"
|
|
58
|
-
- Another skill (e.g. `project-audit`, `frontend-architecture`) needs project context first
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Scope
|
|
63
|
-
|
|
64
|
-
- ✅ Identify which files are relevant to the current task
|
|
65
|
-
- ✅ Summarize project architecture in structured format
|
|
66
|
-
- ✅ Map folder structure to responsibilities
|
|
67
|
-
- ✅ Track what has been read and what still needs reading
|
|
68
|
-
- ✅ Flag context window risks
|
|
69
|
-
- ✅ Maintain a working memory summary for multi-turn sessions
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Non-goals
|
|
74
|
-
|
|
75
|
-
- ❌ Do NOT modify any files
|
|
76
|
-
- ❌ Do NOT fix bugs
|
|
77
|
-
- ❌ Do NOT make architectural decisions
|
|
78
|
-
- ❌ Do NOT read every file blindly — be selective and efficient
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Workflow
|
|
83
|
-
|
|
84
|
-
### Phase 1 — Project Discovery
|
|
85
|
-
|
|
86
|
-
Read only top-level signals first:
|
|
87
|
-
1. `package.json` / `pyproject.toml` / `Cargo.toml` → detect framework, language, scripts
|
|
88
|
-
2. Root config files → `.env.example`, `tsconfig.json`, `vite.config.ts`, `next.config.js`
|
|
89
|
-
3. Folder structure (1-2 levels deep) → identify key directories
|
|
90
|
-
4. Entry points → `src/index.ts`, `app/`, `pages/`, `main.py`
|
|
91
|
-
|
|
92
|
-
Produce: **Project Profile** (framework, language, key directories, architecture style)
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
### Phase 2 — Task-Scoped File Selection
|
|
97
|
-
|
|
98
|
-
Given the current task, identify the minimum relevant set of files:
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
Task type → Files to read
|
|
102
|
-
─────────────────────────────────────────────────────
|
|
103
|
-
UI work → components/, pages/, styles/, design system files
|
|
104
|
-
API work → services/, hooks/, api/, types/
|
|
105
|
-
State work → store/, context/, hooks/
|
|
106
|
-
Bug fix → files mentioned in error, related modules
|
|
107
|
-
Architecture → folder structure, key abstractions
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Rules:
|
|
111
|
-
- Read **entry points** before diving into details
|
|
112
|
-
- Prefer **index files** as anchors
|
|
113
|
-
- Skip `node_modules`, `dist`, `build`, `.git`
|
|
114
|
-
- If uncertain which file → check imports, not the file itself
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
### Phase 3 — Architecture Summary
|
|
119
|
-
|
|
120
|
-
Produce a concise summary:
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
Project: [Name / repo]
|
|
124
|
-
Framework: [React 18 / Next.js 14 / Vue 3 / etc.]
|
|
125
|
-
Language: [TypeScript / JavaScript / Python]
|
|
126
|
-
Structure: [Feature-based / Layer-based / Domain-based]
|
|
127
|
-
|
|
128
|
-
Key directories:
|
|
129
|
-
src/components/ → Shared UI components
|
|
130
|
-
src/features/ → Feature modules (collocated)
|
|
131
|
-
src/services/ → API and data services
|
|
132
|
-
src/hooks/ → Custom React hooks
|
|
133
|
-
src/types/ → TypeScript interfaces
|
|
134
|
-
|
|
135
|
-
State: [Zustand / Redux / React Query / Pinia]
|
|
136
|
-
HTTP client: [axios instance at src/lib/axios.ts]
|
|
137
|
-
Auth: [JWT stored in httpOnly cookie]
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
### Phase 4 — Working Memory Maintenance
|
|
143
|
-
|
|
144
|
-
During multi-turn sessions:
|
|
145
|
-
- Track which files have been read (avoid re-reading)
|
|
146
|
-
- Track decisions made (e.g. "we decided to use feature-based structure")
|
|
147
|
-
- Flag when context is approaching limits
|
|
148
|
-
- Offer to summarize and compress if needed
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Decision Tree
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
Is this a new project / first time seeing this codebase?
|
|
156
|
-
├── Yes → Run full Phase 1 + Phase 2 + Phase 3
|
|
157
|
-
└── No → Has something changed since last context load?
|
|
158
|
-
├── Yes → Re-run Phase 2 for affected area
|
|
159
|
-
└── No → Use cached architecture summary
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
Is context window at risk?
|
|
164
|
-
├── Yes → Summarize what's been read, drop low-relevance files
|
|
165
|
-
└── No → Continue loading relevant files
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## Output Format
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
🗂️ Project Context Loaded
|
|
174
|
-
|
|
175
|
-
Framework: [framework]
|
|
176
|
-
Language: [language]
|
|
177
|
-
Structure: [style]
|
|
178
|
-
|
|
179
|
-
Relevant files for this task:
|
|
180
|
-
📄 [path/to/file.ts] — [why it's relevant]
|
|
181
|
-
📄 [path/to/file.ts] — [why it's relevant]
|
|
182
|
-
|
|
183
|
-
Architecture summary:
|
|
184
|
-
[2-4 lines describing how this codebase is organized]
|
|
185
|
-
|
|
186
|
-
⚠️ Context notes:
|
|
187
|
-
[Any risks, unknowns, or files that couldn't be read]
|
|
188
|
-
|
|
189
|
-
✅ Ready. Proceeding with: [next skill or action]
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## Validation Checklist
|
|
195
|
-
|
|
196
|
-
- [ ] Framework and language correctly identified
|
|
197
|
-
- [ ] Only task-relevant files selected (no noise)
|
|
198
|
-
- [ ] Architecture summary is accurate and concise
|
|
199
|
-
- [ ] Context window usage is reasonable
|
|
200
|
-
- [ ] Working memory updated for this session
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## Examples
|
|
205
|
-
|
|
206
|
-
See `examples/` folder.
|
|
1
|
+
---
|
|
2
|
+
name: qk-context-loader
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Load relevant files and map the dependency graph for a task.
|
|
6
|
+
category: utilities
|
|
7
|
+
priority: medium
|
|
8
|
+
tags: [context, filesystem, dependencies, graph]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: AI needs to understand the surrounding files before modifying a core component.
|
|
11
|
+
inputs: [Target File]
|
|
12
|
+
outputs: [Loaded Context, Dependency Graph]
|
|
13
|
+
allowed_tools: [grep_search, read_file, list_dir]
|
|
14
|
+
pipeline: [analyze, implement, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-context-loader - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** "Người thu thập tình báo". Đảm bảo AI hiểu rõ môi trường xung quanh một file code trước khi tiến hành sửa nó, tránh lỗi thiếu context.
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Target Identification):**
|
|
23
|
+
- Identify the main file that needs modification.
|
|
24
|
+
2. **Implement (Graph Traversal):**
|
|
25
|
+
- **Load Parents:** Search for files that import the target file.
|
|
26
|
+
- **Load Children:** Read the target file to see what it imports.
|
|
27
|
+
- Gather the essential chunks of these related files.
|
|
28
|
+
3. **Complete (Context Mapping):**
|
|
29
|
+
- Build a mental map of how the data flows.
|
|
30
|
+
|
|
31
|
+
## 🛡️ 2. Constraints & Rules
|
|
32
|
+
- **Token Optimization:** Do not load `node_modules` or massive minified build files. Extract only the exact logic needed.
|
|
33
|
+
|
|
34
|
+
## 🌳 3. Decision Tree
|
|
35
|
+
```text
|
|
36
|
+
Is the target file a UI Component?
|
|
37
|
+
├── YES → Load its CSS/Theme tokens and any nested Child components.
|
|
38
|
+
└── NO (API Service) → Load the corresponding Controller and Database Model.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 🤝 4. Handoff Pipeline
|
|
42
|
+
1. `complete`: Provide the context map to the Orchestrator or Target Skill.
|
|
43
|
+
|
|
44
|
+
## 📝 5. Output Format
|
|
45
|
+
Vui lòng trả kết quả bằng Tiếng Việt.
|
|
46
|
+
- **Tóm tắt (Summary):** Đã nạp thành công ngữ cảnh.
|
|
47
|
+
- **Chi tiết (Changes):** Các file có liên quan trực tiếp.
|
|
@@ -1,135 +1,60 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-data-lifecycle
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## Scope
|
|
63
|
-
|
|
64
|
-
- ✅ **Schema Design:** Model tables, relations (1:1, 1:N, N:M), and constraints (Unique, FK).
|
|
65
|
-
- ✅ **ORM Integration:** Generate code for Prisma, Drizzle, TypeORM, Sequelize, or Mongoose.
|
|
66
|
-
- ✅ **Migrations:** Generate SQL or ORM migration files safely.
|
|
67
|
-
- ✅ **Query Optimization:** Prevent N+1 queries, add indexes, use efficient aggregations.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Non-goals
|
|
72
|
-
|
|
73
|
-
- ❌ Do NOT execute destructive migrations (DROP TABLE) on production environments without extreme warnings and approval.
|
|
74
|
-
- ❌ Do NOT mix raw SQL into ORM logic unless necessary for performance.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Workflow
|
|
79
|
-
|
|
80
|
-
### Phase 1 — Schema Design
|
|
81
|
-
|
|
82
|
-
Understand the business entities and relations.
|
|
83
|
-
- Identify primary keys (UUID vs Auto-increment ID).
|
|
84
|
-
- Identify foreign keys and cascade rules (`ON DELETE CASCADE`).
|
|
85
|
-
- Ensure proper normalization (usually 3NF) or denormalization (if NoSQL).
|
|
86
|
-
|
|
87
|
-
### Phase 2 — ORM / Migration Generation
|
|
88
|
-
|
|
89
|
-
Map the design to the project's tool:
|
|
90
|
-
- **Prisma:** Update `schema.prisma`.
|
|
91
|
-
- **Drizzle:** Update `schema.ts`.
|
|
92
|
-
- **Raw SQL:** Write `V1__create_table.sql`.
|
|
93
|
-
|
|
94
|
-
### Phase 3 — Query Implementation
|
|
95
|
-
|
|
96
|
-
Write the data access methods (Repository pattern or direct ORM calls).
|
|
97
|
-
- Avoid fetching `SELECT *` if only 2 columns are needed.
|
|
98
|
-
- Batch queries or use joins to prevent N+1 issues.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Decision Tree
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
Is the project using an ORM?
|
|
106
|
-
├── Prisma → Modify `schema.prisma`, use `prisma.entity.findMany()`
|
|
107
|
-
├── Drizzle → Modify schema TS files, use Drizzle query builder
|
|
108
|
-
└── No → Write raw SQL or use query builder (Knex)
|
|
109
|
-
|
|
110
|
-
Does the schema change drop data or alter existing columns?
|
|
111
|
-
├── Yes → Flag as High Risk. Provide rollback strategy. Ask for approval.
|
|
112
|
-
└── No → Standard migration (e.g., adding a nullable column).
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Output Format
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
🗄️ Database Engineering Report
|
|
121
|
-
─────────────────────────────────────────────────
|
|
122
|
-
Action: [Schema Update / Query Optimization]
|
|
123
|
-
Tooling: [Prisma / Raw SQL / etc.]
|
|
124
|
-
|
|
125
|
-
Changes:
|
|
126
|
-
✅ Added model: `User` (1:N with `Post`)
|
|
127
|
-
✅ Added index on `User.email`
|
|
128
|
-
✅ Generated query: `getUserWithPosts`
|
|
129
|
-
|
|
130
|
-
⚠️ Risk Assessment:
|
|
131
|
-
[Low / High — e.g., "Safe addition, no data loss"]
|
|
132
|
-
|
|
133
|
-
🔗 Next Steps:
|
|
134
|
-
Run `npx prisma migrate dev` to apply these changes locally.
|
|
135
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: qk-data-lifecycle
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Manage Database Schema, Migrations, and Repositories.
|
|
6
|
+
category: database
|
|
7
|
+
priority: medium
|
|
8
|
+
tags: [database, sql, migration, schema, orm]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: User asks to create a new database table, modify schema, or write complex queries.
|
|
11
|
+
inputs: [Data model requirements]
|
|
12
|
+
outputs: [Migration scripts, Models, Repositories]
|
|
13
|
+
allowed_tools: [run_command, read_file, write_to_file]
|
|
14
|
+
pipeline: [analyze, design, implement, engineering-standard, validate, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-data-lifecycle - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** Quản lý an toàn vòng đời dữ liệu, đảm bảo Schema chuẩn xác, Migration có thể Rollback và Query tối ưu.
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Requirements):**
|
|
23
|
+
- Understand the entities and their relationships (1:1, 1:N, N:N).
|
|
24
|
+
- Identify the ORM/Query Builder used in the project (e.g., Prisma, TypeORM, Drizzle).
|
|
25
|
+
2. **Design (Schema & Normalization):**
|
|
26
|
+
- Design the schema. Ensure foreign keys and indices are applied to frequently queried columns.
|
|
27
|
+
- Always include audit columns (`created_at`, `updated_at`).
|
|
28
|
+
3. **Implement (Migration & Models):**
|
|
29
|
+
- Write the Migration script. MUST include both `up` (apply) and `down` (rollback) logic.
|
|
30
|
+
- Write/Update the Model/Entity files.
|
|
31
|
+
- Create Repository layer functions if necessary.
|
|
32
|
+
4. **Verify (Safety Check):**
|
|
33
|
+
- Review the migration script for destructive operations (e.g., `DROP TABLE`, `DROP COLUMN`).
|
|
34
|
+
|
|
35
|
+
## 🛡️ 2. Constraints & Rules
|
|
36
|
+
- **No Data Loss:** NEVER execute a migration that drops data on Production without explicit User approval and a backup plan.
|
|
37
|
+
- **Decoupling:** Do not write SQL queries directly in Controllers. Always use the Repository or DAO pattern.
|
|
38
|
+
- **Index Rule:** Any column used in a `WHERE`, `JOIN`, or `ORDER BY` clause should be evaluated for an index.
|
|
39
|
+
|
|
40
|
+
## 🌳 3. Decision Tree
|
|
41
|
+
```text
|
|
42
|
+
Is this modifying an existing table in Production?
|
|
43
|
+
├── YES → Does it drop a column or change a data type destructively?
|
|
44
|
+
│ ├── YES → STOP. Create a new column, migrate data, then drop the old one (Expand & Contract Pattern).
|
|
45
|
+
│ └── NO → Proceed with safe migration (e.g., ADD COLUMN).
|
|
46
|
+
└── NO (New Table) → Ensure Primary Key, Timestamps, and Foreign Keys are defined.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 🤝 4. Handoff Pipeline
|
|
50
|
+
1. `engineering-standard`: Verify naming conventions (e.g., snake_case for DB columns if required).
|
|
51
|
+
2. `validate`: Run dry-run migrations or unit tests.
|
|
52
|
+
3. `complete`: Generate the Database report.
|
|
53
|
+
|
|
54
|
+
## 📝 5. Output Format
|
|
55
|
+
Vui lòng trả kết quả bằng Tiếng Việt.
|
|
56
|
+
- **Tóm tắt (Summary):** Bảng nào được tạo/sửa.
|
|
57
|
+
- **Chi tiết (Changes):** File migration và Model đã sinh ra.
|
|
58
|
+
- **Kiến trúc (Reasoning):** Lý do thiết kế quan hệ bảng và các Index.
|
|
59
|
+
- **Rủi ro (Risks):** Đánh giá mức độ an toàn của Migration (Có làm mất data không?).
|
|
60
|
+
- **Hành động tiếp (Next Action):** Hướng dẫn user chạy lệnh migrate.
|
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-design-to-code
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
---
|
|
2
|
+
name: qk-design-to-code
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Convert Figma/Images to semantic, pixel-perfect code components.
|
|
6
|
+
category: frontend
|
|
7
|
+
priority: high
|
|
8
|
+
tags: [ui, figma, frontend, styling, css]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: User uploads an image mockup or provides a design requirement for a UI component.
|
|
11
|
+
inputs: [Image/Mockup, Framework choice]
|
|
12
|
+
outputs: [Code component, CSS/Tailwind classes]
|
|
13
|
+
allowed_tools: [write_to_file, read_file]
|
|
14
|
+
pipeline: [analyze, implement, engineering-standard, validate, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-design-to-code - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** Dịch thiết kế (Mockups/Images) thành mã nguồn (React, Vue, HTML/CSS) với độ chính xác Pixel-Perfect.
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Deconstruct Design):**
|
|
23
|
+
- Look at the provided mockup.
|
|
24
|
+
- Break it down from Outside-In (Container -> Rows -> Columns -> Elements).
|
|
25
|
+
2. **Plan (Token Mapping):**
|
|
26
|
+
- Map colors, fonts, and spacings to existing Design System Tokens (e.g., Tailwind classes `text-primary-500`, `gap-4`).
|
|
27
|
+
3. **Implement (Code Construction):**
|
|
28
|
+
- Write the semantic HTML (`<article>`, `<section>`, `<nav>`).
|
|
29
|
+
- Apply styling.
|
|
30
|
+
4. **Validate (Responsive Check):**
|
|
31
|
+
- Ensure the component uses relative units where necessary and scales on mobile.
|
|
32
|
+
|
|
33
|
+
## 🛡️ 2. Constraints & Rules
|
|
34
|
+
- **No Magic Values:** Do not use random hex codes or pixel values if a Design System is available.
|
|
35
|
+
- **Accessibility:** Always include `alt` for images and `aria-label` for icon-only buttons.
|
|
36
|
+
|
|
37
|
+
## 🤝 3. Handoff Pipeline
|
|
38
|
+
1. `engineering-standard`: Ensure the UI component has no business logic.
|
|
39
|
+
2. `validate`: Trigger `qk-ui-audit` checks.
|
|
40
|
+
3. `complete`: Generate the UI Component Report.
|
|
41
|
+
|
|
42
|
+
## 📝 4. Output Format
|
|
43
|
+
Vui lòng trả kết quả bằng Tiếng Việt.
|
|
44
|
+
- **Tóm tắt (Summary):** Tên Component vừa tạo.
|
|
45
|
+
- **Chi tiết (Changes):** File chứa component.
|
|
46
|
+
- **Rủi ro (Risks):** Vấn đề responsive nếu có.
|