ai-developer-skill-os 3.1.5 → 6.0.0-rc1

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.
Files changed (108) hide show
  1. package/README.md +15 -19
  2. package/_template/BEHAVIOR_SPEC.md +96 -0
  3. package/docs/GOVERNANCE.md +1 -1
  4. package/fix_seeds.js +22 -0
  5. package/framework/KERNEL.md +83 -0
  6. package/framework/bias-library/cosmetic-refactor.md +21 -0
  7. package/framework/bias-library/enterprise-crud.md +21 -0
  8. package/framework/bias-library/fake-ui-slop.md +20 -0
  9. package/framework/bias-library/hallucinated-tools.md +20 -0
  10. package/framework/bias-library/missing-ui-states.md +19 -0
  11. package/framework/bias-library/over-indexing.md +20 -0
  12. package/framework/bias-library/swallow-errors.md +19 -0
  13. package/framework/bias-library/ui-only-security.md +17 -0
  14. package/framework/decision-primitives.md +47 -0
  15. package/framework/dial-library/complexity-budget.md +13 -0
  16. package/framework/dial-library/granularity.md +13 -0
  17. package/framework/dial-library/optimization-strategy.md +13 -0
  18. package/framework/dial-library/strictness.md +13 -0
  19. package/framework/rule-library/delegation-only.md +9 -0
  20. package/framework/rule-library/minimal-diff.md +9 -0
  21. package/migrate-to-v6.js +130 -0
  22. package/migrate.js +147 -0
  23. package/migrate.py +133 -0
  24. package/migrate_all.cjs +96 -0
  25. package/package.json +2 -2
  26. package/skills/qk-access-policy/SKILL.md +30 -42
  27. package/skills/qk-ai-builder/SKILL.md +32 -43
  28. package/skills/qk-api-lifecycle/SKILL.md +28 -62
  29. package/skills/qk-bug-resolution/SKILL.md +29 -66
  30. package/skills/qk-context-loader/SKILL.md +25 -44
  31. package/skills/qk-data-lifecycle/SKILL.md +25 -58
  32. package/skills/qk-db-optimizer/SKILL.md +25 -53
  33. package/skills/qk-design-to-code/SKILL.md +32 -48
  34. package/skills/qk-docs/SKILL.md +26 -52
  35. package/skills/qk-engineering-standard/SKILL.md +28 -59
  36. package/skills/qk-feature-delivery/SKILL.md +29 -64
  37. package/skills/qk-help/SKILL.md +30 -40
  38. package/skills/qk-orchestrator/SKILL.md +25 -51
  39. package/skills/qk-policy-engine/SKILL.md +24 -49
  40. package/skills/qk-production-release/SKILL.md +31 -48
  41. package/skills/qk-project-bootstrap/SKILL.md +32 -46
  42. package/skills/qk-project-health/SKILL.md +26 -54
  43. package/skills/qk-project-memory/SKILL.md +31 -38
  44. package/skills/qk-system-evolution/SKILL.md +25 -61
  45. package/skills/qk-ui-audit/SKILL.md +25 -56
  46. package/skills/qk-ui-system-builder/SKILL.md +30 -42
  47. package/skills/qk-validation-gate/SKILL.md +26 -57
  48. package/specs/contracts/behavior-contract.yaml +40 -0
  49. package/specs/expectations/qk-bug-resolution.yaml +35 -0
  50. package/specs/scenarios/fix-login-nullref.yaml +3 -0
  51. package/taste-skill/.claude-plugin/marketplace.json +20 -0
  52. package/taste-skill/.claude-plugin/plugin.json +19 -0
  53. package/taste-skill/.github/FUNDING.yml +1 -0
  54. package/taste-skill/.github/copilot-instructions.md +11 -0
  55. package/taste-skill/CHANGELOG.md +111 -0
  56. package/taste-skill/LICENSE +21 -0
  57. package/taste-skill/README.md +212 -0
  58. package/taste-skill/assets/.gitkeep +0 -0
  59. package/taste-skill/assets/readme-banner.webp +0 -0
  60. package/taste-skill/assets/readme-buttons/btn-agent-skills.webp +0 -0
  61. package/taste-skill/assets/readme-buttons/btn-changelog.webp +0 -0
  62. package/taste-skill/assets/readme-buttons/btn-mit.webp +0 -0
  63. package/taste-skill/assets/readme-buttons/btn-site.webp +0 -0
  64. package/taste-skill/assets/readme-buttons/btn-tools.webp +0 -0
  65. package/taste-skill/assets/readme-cta-tasteskill.svg +5 -0
  66. package/taste-skill/assets/sponsors/animations-dev.webp +0 -0
  67. package/taste-skill/assets/sponsors/emil-animations-dev.webp +0 -0
  68. package/taste-skill/assets/taste-skill-logo.png +0 -0
  69. package/taste-skill/assets/taste-skill-logo.webp +0 -0
  70. package/taste-skill/assets/vercel-oss-program-badge.svg +44 -0
  71. package/taste-skill/examples/floria-bottom.webp +0 -0
  72. package/taste-skill/examples/floria-full.webp +0 -0
  73. package/taste-skill/examples/floria-top.webp +0 -0
  74. package/taste-skill/research/README.md +8 -0
  75. package/taste-skill/research/laziness/README.md +25 -0
  76. package/taste-skill/research/laziness/findings/empirical-results.md +58 -0
  77. package/taste-skill/research/laziness/findings/references.md +20 -0
  78. package/taste-skill/research/laziness/remediation/architectural-patterns.md +55 -0
  79. package/taste-skill/research/laziness/remediation/parameter-tuning.md +44 -0
  80. package/taste-skill/research/laziness/remediation/prompt-engineering.md +52 -0
  81. package/taste-skill/research/laziness/remediation/reference-prompts.md +79 -0
  82. package/taste-skill/research/laziness/root-causes/cognitive-shortcuts.md +23 -0
  83. package/taste-skill/research/laziness/root-causes/output-limits.md +39 -0
  84. package/taste-skill/research/laziness/root-causes/rlhf-and-compute.md +27 -0
  85. package/taste-skill/research/laziness/root-causes/training-data-bias.md +28 -0
  86. package/taste-skill/scripts/build-emil-sponsor-row.mjs +41 -0
  87. package/taste-skill/scripts/convert-readme-assets-webp.mjs +142 -0
  88. package/taste-skill/scripts/process-readme-buttons.mjs +108 -0
  89. package/taste-skill/scripts/process-sponsor-badge.mjs +83 -0
  90. package/taste-skill/skill.sh +25 -0
  91. package/taste-skill/skills/brandkit/SKILL.md +798 -0
  92. package/taste-skill/skills/brutalist-skill/SKILL.md +92 -0
  93. package/taste-skill/skills/gpt-tasteskill/SKILL.md +74 -0
  94. package/taste-skill/skills/image-to-code-skill/SKILL.md +1228 -0
  95. package/taste-skill/skills/imagegen-frontend-mobile/SKILL.md +1465 -0
  96. package/taste-skill/skills/imagegen-frontend-web/SKILL.md +987 -0
  97. package/taste-skill/skills/llms.txt +13 -0
  98. package/taste-skill/skills/minimalist-skill/SKILL.md +85 -0
  99. package/taste-skill/skills/output-skill/SKILL.md +49 -0
  100. package/taste-skill/skills/redesign-skill/SKILL.md +178 -0
  101. package/taste-skill/skills/soft-skill/SKILL.md +98 -0
  102. package/taste-skill/skills/stitch-skill/DESIGN.md +121 -0
  103. package/taste-skill/skills/stitch-skill/SKILL.md +184 -0
  104. package/taste-skill/skills/taste-skill/SKILL.md +1206 -0
  105. package/taste-skill/skills/taste-skill-v1/SKILL.md +226 -0
  106. package/tests/behavior-conformance.test.js +151 -0
  107. package/_template/SKILL.md +0 -154
  108. package/tests/spec-compliance.test.js +0 -193
@@ -1,72 +1,38 @@
1
1
  ---
2
2
  name: qk-api-lifecycle
3
- version: 3.1.5
4
- updated: 2026-07-02
5
- description: Thiết kế, triển khai, và tích hợp các API endpoints.
6
- category: engineering
7
- behavior: development
8
- intent: implement-feature
9
- priority: high
10
- tags: [api, backend, frontend-integration, endpoints]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User wants to create a new API, fix an API, or integrate frontend with backend API.
13
- inputs: [API requirements, JSON schema, or Backend URL]
14
- outputs: [API routes, Service classes, API Hooks]
15
- allowed_tools: [run_command, read_file, write_to_file, grep_search]
16
- pipeline: [analyze, implement, engineering-standard, validate, complete]
3
+ category: fullstack
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-api-lifecycle - Standard Operating Procedure
7
+ # qk-api-lifecycle
20
8
 
21
- > **Goal:** Quản lý toàn bộ vòng đời của một API, từ việc thiết kế Spec (Swagger/Types) cho đến khi Backend code xong và Frontend gọi thành công.
9
+ ## Scope
10
+ - API design, endpoints, contracts, and lifecycle management (Plan & Execute)
22
11
 
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Contract Definition):**
26
- - Read the user requirements.
27
- - Define the exact API contract (Request Body, Query Params, Response DTO) in TypeScript interfaces or OpenAPI spec.
28
- 2. **Plan (Architecture Selection):**
29
- - Determine if the task is Backend (creating the endpoint) or Frontend (consuming the endpoint).
30
- - If Frontend: Load `knowledge/frontend/react.md` to decide between React Query vs raw fetch.
31
- - If Backend: Choose the appropriate layer (Controller -> Service -> Repository).
32
- 3. **Execute (Implementation):**
33
- - Write the backend handler/controller with strict validation (e.g., Zod, Class Validator).
34
- - **Security:** Integrate Auth Middleware (JWT/RBAC) before the Controller. DO NOT expose public endpoints unless explicitly requested.
35
- - Write the frontend API client (e.g., Axios instance wrapper).
36
- 4. **Verify (Validation):**
37
- - Handle Error Status Codes (400, 401, 403, 404, 500) gracefully.
38
- - Ensure loading states are managed on the frontend.
39
-
40
- ## 🛡️ 2. Constraints & Rules
41
-
42
- - **No Hardcoded URLs:** Never hardcode `http://localhost:3000` inside frontend components. Always use environment variables (`process.env.API_URL`).
43
- - **Separation of Concerns:** Do NOT write `fetch` or `axios.get` directly inside a React UI component. Extract it to a custom hook or an API service file.
44
- - **Pagination & Rate Limit:** Any `GET` API returning a list MUST include Pagination by default to prevent server OOM.
45
-
46
- ## 🌳 3. Decision Tree
47
-
48
- ```text
49
- Is this a Backend or Frontend task?
50
- ├── BACKEND → Does the API need Database access?
51
- │ ├── YES → Handoff to `qk-data-lifecycle` to create models first.
52
- │ └── NO → Write Controller and Service.
53
- └── FRONTEND → Are we fetching data to display or mutating data?
54
- ├── FETCH → Use React Query `useQuery` or equivalent.
55
- └── MUTATE → Use React Query `useMutation` or equivalent.
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Define clear request/response contracts (OpenAPI/Swagger)
16
+ - Ensure backward compatibility on existing endpoints
17
+ must_not:
18
+ - Introduce breaking changes without versioning
19
+ - Bypass authentication or authorization checks
56
20
  ```
57
21
 
58
- ## 🤝 4. Handoff Pipeline
59
-
60
- 1. `engineering-standard`: Verify API naming conventions (e.g., `GET /users` instead of `POST /getUsers`).
61
- 2. `validate`: Run API tests and Type-checks.
62
- 3. `complete`: Generate the final report.
63
-
64
- ## 📝 5. Output Format
22
+ ## Policies
23
+ ```yaml
24
+ prefer:
25
+ - RESTful resource naming conventions
26
+ - Meaningful HTTP status codes
27
+ ```
65
28
 
66
- Vui lòng trả kết quả bằng Tiếng Việt. Sử dụng template chuẩn của hệ thống:
29
+ ## Escalation
30
+ ```yaml
31
+ stop:
32
+ - Required API contracts or models are missing
33
+ - Major breaking change detected on production APIs
34
+ ```
67
35
 
68
- - **Tóm tắt (Summary):** Các endpoint đã tạo hoặc tích hợp.
69
- - **Chi tiết (Changes):** File nào chứa logic API.
70
- - **Kiến trúc (Reasoning):** Lý do chọn thư viện hoặc cách bắt lỗi (Error handling).
71
- - **Xác thực (Verification):** Cách gọi thử API.
72
- - **Rủi ro (Risks):** Vấn đề bảo mật CORS hoặc Rate Limit (nếu có).
36
+ ## Output
37
+ - API endpoints, controllers, and documentation
38
+ ```
@@ -1,76 +1,39 @@
1
1
  ---
2
2
  name: qk-bug-resolution
3
- version: 3.1.5
4
- updated: 2026-07-02
5
- description: Xử lý và sửa các lỗi (bugs), đồng thời ngăn ngừa lỗi hồi quy.
6
- category: engineering
7
- behavior: development
8
- intent: fix-bug
9
- priority: high
10
- tags: [bug, debug, regression]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User reports an error or crash.
13
- inputs: [Error log, Bug description, File path]
14
- outputs: [Fixed code, Verification report]
15
- allowed_tools: [run_command, read_file, grep_search]
16
- pipeline: [analyze, implement, engineering-standard, validate, complete]
3
+ category: maintenance
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-bug-resolution - Standard Operating Procedure
7
+ # qk-bug-resolution
20
8
 
21
- > **Goal:** Định vị nguyên nhân, sửa lỗi triệt để, và đảm bảo lỗi không bị lặp lại (Regression Prevention).
9
+ ## Scope
10
+ - Existing defects only (Diagnose)
22
11
 
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Root Cause Analysis & Reproduce):**
26
- - Read the provided error log or bug description.
27
- - Identify how to reproduce the bug. Ask the user for more info if it is unclear.
28
- - Trace the error to the exact file and line of code.
29
- - Identify if the bug is a syntax error, logic error, state issue, or boundary case.
30
- 2. **Plan (Fix Strategy):**
31
- - Determine the minimal change required to fix the bug.
32
- - If the bug is UI-related, refer to frontend knowledge (e.g., `knowledge/frontend/react.md`).
33
- 3. **Execute (Implement Fix):**
34
- - Modify the source code exactly where needed.
35
- - Do NOT rewrite unrelated code blocks.
36
- 4. **Verify (Validation):**
37
- - Provide steps to test the fix.
38
- - Ensure backward compatibility.
39
-
40
- ## 🛡️ 3. Constraints & Rules
41
-
42
- - **No Guesses:** Do not assume the shape of an API response. Print it or read the type definitions first.
43
- - **Minimal Fix:** Always prefer a 1-line fix over a 100-line refactor, unless the architecture is fundamentally broken.
44
- - **Clean Up:** Remove any `console.log()` or debugger statements introduced during the debugging process.
45
- - **Regression Test:** Add at least 1 Unit or Integration Test to prevent this bug from recurring.
46
-
47
- ## 🌳 3. Decision Tree
48
-
49
- ```text
50
- Is there a Stack Trace?
51
- ├── YES → Use grep_search to find the exact file and line number.
52
- └── NO → Ask the user for the file path or use grep_search with keywords from the bug description.
53
-
54
- Is the bug related to State/Re-rendering?
55
- ├── YES → Load `knowledge/frontend/react.md` to check for stale closures or missing dependencies.
56
- └── NO → Proceed with standard logic debugging.
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Collect evidence (stack trace/logs) before diagnosis
16
+ - Verify fix before completion
17
+ must_not:
18
+ - Rewrite modules
19
+ - Guess root cause without evidence
57
20
  ```
58
21
 
59
- ## 🤝 4. Handoff Pipeline
60
-
61
- After implementing the fix, map to the pipeline:
62
-
63
- 1. `engineering-standard`: Ensure the fix follows naming and architecture rules.
64
- 2. `validate`: Run linters and tests (via `qk-validation-gate` equivalent).
65
- 3. `complete`: Output the final report.
66
-
67
- ## 📝 5. Output Format
22
+ ## Policies
23
+ ```yaml
24
+ prefer:
25
+ - Minimal patch
26
+ - Regression prevention
27
+ ```
68
28
 
69
- Vui lòng sử dụng template `templates/bug-report.md` (Báo Cáo Xử Lý Lỗi) để phản hồi lại cho người dùng bằng Tiếng Việt. Nội dung bao gồm:
29
+ ## Escalation
30
+ ```yaml
31
+ stop:
32
+ - Missing logs/evidence
33
+ - Fix requires major architectural changes
34
+ ```
70
35
 
71
- - Summary
72
- - Changes
73
- - Root Cause
74
- - Verification
75
- - Risks
76
- - Next Action
36
+ ## Output
37
+ - Minimal patch
38
+ - Risk summary
39
+ ```
@@ -1,55 +1,36 @@
1
1
  ---
2
2
  name: qk-context-loader
3
- version: 3.1.5
4
- updated: 2026-07-02
5
- description: Tải các file liên quan và vẽ biểu đồ phụ thuộc (dependency graph) cho một tác vụ.
6
3
  category: utilities
7
- behavior: static-analysis
8
- intent: review-code
9
- priority: medium
10
- tags: [context, filesystem, dependencies, graph]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: AI needs to understand the surrounding files before modifying a core component.
13
- inputs: [Target File]
14
- outputs: [Loaded Context, Dependency Graph]
15
- allowed_tools: [grep_search, read_file, list_dir]
16
- pipeline: [analyze, implement, complete]
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-context-loader - Standard Operating Procedure
7
+ # qk-context-loader
20
8
 
21
- > **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.
9
+ ## Scope
10
+ - Context collection and dependency mapping (Collect)
22
11
 
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Target Identification):**
26
- - Identify the main file that needs modification.
27
- 2. **Implement (Graph Traversal):**
28
- - **Load Parents:** Search for files that import the target file.
29
- - **Load Children:** Read the target file to see what it imports.
30
- - Gather the essential chunks of these related files.
31
- 3. **Complete (Context Mapping):**
32
- - Build a mental map of how the data flows.
33
-
34
- ## 🛡️ 2. Constraints & Rules
35
-
36
- - **Token Optimization:** Do not load `node_modules` or massive minified build files. Extract only the exact logic needed.
37
-
38
- ## 🌳 3. Decision Tree
39
-
40
- ```text
41
- Is the target file a UI Component?
42
- ├── YES → Load its CSS/Theme tokens and any nested Child components.
43
- └── NO (API Service) → Load the corresponding Controller and Database Model.
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Find and load related dependency files
16
+ must_not:
17
+ - Modify code
18
+ - Load entire repo or node_modules
19
+ - Hallucinate filenames
44
20
  ```
45
21
 
46
- ## 🤝 4. Handoff Pipeline
47
-
48
- 1. `complete`: Provide the context map to the Orchestrator or Target Skill.
49
-
50
- ## 📝 5. Output Format
22
+ ## Policies
23
+ ```yaml
24
+ prefer:
25
+ - Build dependency graph
26
+ ```
51
27
 
52
- Vui lòng trả kết quả bằng Tiếng Việt.
28
+ ## Escalation
29
+ ```yaml
30
+ stop:
31
+ - Repo or files are inaccessible
32
+ ```
53
33
 
54
- - **Tóm tắt (Summary):** Đã nạp thành công ngữ cảnh.
55
- - **Chi tiết (Changes):** Các file có liên quan trực tiếp.
34
+ ## Output
35
+ - Context mapping
36
+ ```
@@ -1,68 +1,35 @@
1
1
  ---
2
2
  name: qk-data-lifecycle
3
- version: 3.1.5
4
- updated: 2026-07-02
5
- description: Quản lý Database Schema, Migrations, và Repositories.
6
- category: database
7
- behavior: development
8
- intent: implement-feature
9
- priority: medium
10
- tags: [database, sql, migration, schema, orm]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User asks to create a new database table, modify schema, or write complex queries.
13
- inputs: [Data model requirements]
14
- outputs: [Migration scripts, Models, Repositories]
15
- allowed_tools: [run_command, read_file, write_to_file]
16
- pipeline: [analyze, design, implement, engineering-standard, validate, complete]
3
+ category: infrastructure
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-data-lifecycle - Standard Operating Procedure
7
+ # qk-data-lifecycle
20
8
 
21
- > **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.
9
+ ## Scope
10
+ - Database Schema, Migrations, and Repositories management (Plan & Execute)
22
11
 
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Requirements):**
26
- - Understand the entities and their relationships (1:1, 1:N, N:N).
27
- - Identify the ORM/Query Builder used in the project (e.g., Prisma, TypeORM, Drizzle).
28
- 2. **Design (Schema & Normalization):**
29
- - Design the schema. Ensure foreign keys and indices are applied to frequently queried columns.
30
- - Always include audit columns (`created_at`, `updated_at`).
31
- 3. **Implement (Migration & Models):**
32
- - Write the Migration script. MUST include both `up` (apply) and `down` (rollback) logic.
33
- - Write/Update the Model/Entity files.
34
- - Create Repository layer functions if necessary.
35
- 4. **Verify (Safety Check):**
36
- - Review the migration script for destructive operations (e.g., `DROP TABLE`, `DROP COLUMN`).
37
-
38
- ## 🛡️ 2. Constraints & Rules
39
-
40
- - **No Data Loss:** NEVER execute a migration that drops data on Production without explicit User approval and a backup plan.
41
- - **Decoupling:** Do not write SQL queries directly in Controllers. Always use the Repository or DAO pattern.
42
- - **Index Rule:** Any column used in a `WHERE`, `JOIN`, or `ORDER BY` clause should be evaluated for an index.
43
-
44
- ## 🌳 3. Decision Tree
45
-
46
- ```text
47
- Is this modifying an existing table in Production?
48
- ├── YES → Does it drop a column or change a data type destructively?
49
- │ ├── YES → STOP. Create a new column, migrate data, then drop the old one (Expand & Contract Pattern).
50
- │ └── NO → Proceed with safe migration (e.g., ADD COLUMN).
51
- └── NO (New Table) → Ensure Primary Key, Timestamps, and Foreign Keys are defined.
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Ensure data schema matches application domain models
16
+ - Generate reversible migration scripts
17
+ must_not:
18
+ - Perform destructive schema changes without explicit user approval
52
19
  ```
53
20
 
54
- ## 🤝 4. Handoff Pipeline
55
-
56
- 1. `engineering-standard`: Verify naming conventions (e.g., snake_case for DB columns if required).
57
- 2. `validate`: Run dry-run migrations or unit tests.
58
- 3. `complete`: Generate the Database report.
59
-
60
- ## 📝 5. Output Format
21
+ ## Policies
22
+ ```yaml
23
+ prefer:
24
+ - Declarative schema definitions over imperative scripts
25
+ ```
61
26
 
62
- Vui lòng trả kết quả bằng Tiếng Việt.
27
+ ## Escalation
28
+ ```yaml
29
+ stop:
30
+ - Migration script risks massive data loss
31
+ ```
63
32
 
64
- - **Tóm tắt (Summary):** Bảng nào được tạo/sửa.
65
- - **Chi tiết (Changes):** File migration và Model đã sinh ra.
66
- - **Kiến trúc (Reasoning):** Lý do thiết kế quan hệ bảng và các Index.
67
- - **Rủi ro (Risks):** Đánh giá mức độ an toàn của Migration (Có làm mất data không?).
68
- - **Hành động tiếp (Next Action):** Hướng dẫn user chạy lệnh migrate.
33
+ ## Output
34
+ - Database schemas and migration scripts
35
+ ```
@@ -1,63 +1,35 @@
1
1
  ---
2
2
  name: qk-db-optimizer
3
- version: 1.0.0
4
- updated: 2026-07-02
5
- description: Tối ưu hóa Database (đánh Index, xử lý N+1 Queries, Slow Queries).
6
- category: database
7
- behavior: development
8
- intent: implement-feature
9
- priority: high
10
- tags: [database, optimize, sql, index, performance]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User asks to optimize database, fix slow queries, add index, or resolve N+1 issues.
13
- inputs: [Database Schema, Slow Query Log or ORM code]
14
- outputs: [Optimized Query/ORM code, Migration script for Indexes]
15
- allowed_tools: [run_command, read_file, write_to_file, grep_search]
16
- pipeline: [analyze, plan, implement, validate, complete]
3
+ category: infrastructure
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-db-optimizer - Standard Operating Procedure
7
+ # qk-db-optimizer
20
8
 
21
- > **Goal:** Tối ưu hóa hiệu suất cơ sở dữ liệu. Đóng vai trò là một Database Administrator (DBA) / Performance Engineer. Giải quyết các bài toán cổ điển như N+1 queries, thiếu Index, truy vấn chậm.
9
+ ## Scope
10
+ - Database optimization (Indexes, N+1 Queries, Slow Queries) (Diagnose & Evaluate)
22
11
 
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Bottleneck Identification):**
26
- - Read the relevant ORM code (Prisma, TypeORM, Drizzle) or raw SQL.
27
- - Identify the source of the slowdown (e.g., fetching in a loop causing N+1).
28
- 2. **Plan (Optimization Strategy):**
29
- - Decide whether to optimize the query structure (e.g., using `JOIN` / `include`) or add an Index to the database schema.
30
- 3. **Implement (Code & Schema changes):**
31
- - Refactor the code to eliminate N+1 queries.
32
- - Write migration scripts or update the ORM schema to add necessary Indexes.
33
- 4. **Verify (Explain & Test):**
34
- - Ensure the new query yields the same correct result.
35
-
36
- ## 🛡️ 2. Constraints & Rules
37
-
38
- - **No Destructive Operations:** Never drop tables or columns unless explicitly asked by the user to do so.
39
- - **Explain First:** Always explain why a query is slow and how your index/refactor fixes it.
40
-
41
- ## 🌳 3. Decision Tree
42
-
43
- ```text
44
- Is it an N+1 Query problem?
45
- ├── YES → Use Eager Loading (e.g., `.include()` in Prisma) or a DataLoader pattern.
46
- └── NO → Is it a slow filtering/sorting issue?
47
- ├── YES → Add a database Index (B-Tree, Hash, etc.) to the relevant columns.
48
- └── NO → Refactor the raw SQL/ORM logic to be more efficient.
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Analyze query execution plans if available
16
+ - Suggest non-breaking performance fixes
17
+ must_not:
18
+ - Change database engine or major architecture without consent
49
19
  ```
50
20
 
51
- ## 🤝 4. Handoff Pipeline
52
-
53
- 1. `validate`: Run tests using `qk-validation-gate` to ensure no data regressions.
54
- 2. `complete`: Generate the Database Optimization report.
55
-
56
- ## 📝 5. Output Format
21
+ ## Policies
22
+ ```yaml
23
+ prefer:
24
+ - Adding indexes before rewriting complex queries
25
+ ```
57
26
 
58
- Vui lòng trả kết quả bằng Tiếng Việt.
27
+ ## Escalation
28
+ ```yaml
29
+ ask:
30
+ - For exact slow query logs if not provided
31
+ ```
59
32
 
60
- - **Tóm tắt (Summary):** Vấn đề gì đã được giải quyết.
61
- - **Chi tiết (Changes):** Cách khắc phục (đánh index hay refactor code).
62
- - **Hiệu năng (Performance):** Giải thích tại sao cách mới lại nhanh hơn.
63
- - **Xác thực (Verification):** ...
33
+ ## Output
34
+ - Optimization plan and SQL patches
35
+ ```
@@ -1,53 +1,37 @@
1
1
  ---
2
2
  name: qk-design-to-code
3
- version: 3.1.5
4
- updated: 2026-07-02
5
- description: Chuyển đổi thiết kế từ Figma/Images thành các UI component hoàn chỉnh, chuẩn pixel.
6
3
  category: frontend
7
- behavior: development
8
- intent: implement-feature
9
- priority: high
10
- tags: [ui, figma, frontend, styling, css]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User uploads an image mockup or provides a design requirement for a UI component.
13
- inputs: [Image/Mockup, Framework choice]
14
- outputs: [Code component, CSS/Tailwind classes]
15
- allowed_tools: [write_to_file, read_file]
16
- pipeline: [analyze, implement, engineering-standard, validate, complete]
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-design-to-code - Standard Operating Procedure
20
-
21
- > **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.
22
-
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Deconstruct Design):**
26
- - Look at the provided mockup.
27
- - Break it down from Outside-In (Container -> Rows -> Columns -> Elements).
28
- 2. **Plan (Token Mapping):**
29
- - Map colors, fonts, and spacings to existing Design System Tokens (e.g., Tailwind classes `text-primary-500`, `gap-4`).
30
- 3. **Implement (Code Construction):**
31
- - Write the semantic HTML (`<article>`, `<section>`, `<nav>`).
32
- - Apply styling.
33
- 4. **Validate (Responsive Check):**
34
- - Ensure the component uses relative units where necessary and scales on mobile.
35
-
36
- ## 🛡️ 2. Constraints & Rules
37
-
38
- - **No Magic Values:** Do not use random hex codes or pixel values if a Design System is available.
39
- - **Accessibility:** Always include `alt` for images and `aria-label` for icon-only buttons.
40
-
41
- ## 🤝 3. Handoff Pipeline
42
-
43
- 1. `engineering-standard`: Ensure the UI component has no business logic.
44
- 2. `validate`: Trigger `qk-ui-audit` checks.
45
- 3. `complete`: Generate the UI Component Report.
46
-
47
- ## 📝 4. Output Format
48
-
49
- Vui lòng trả kết quả bằng Tiếng Việt.
50
-
51
- - **Tóm tắt (Summary):** Tên Component vừa tạo.
52
- - **Chi tiết (Changes):** File chứa component.
53
- - **Rủi ro (Risks):** Vấn đề responsive nếu có.
7
+ # qk-design-to-code
8
+
9
+ ## Scope
10
+ - Converting Figma/UI designs into pixel-perfect frontend code (Execute)
11
+
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Use the project's existing design system / tokens
16
+ - Ensure responsive layouts
17
+ must_not:
18
+ - Hardcode magic numbers for spacing/colors
19
+ - Invent new UI components if existing ones suffice
20
+ ```
21
+
22
+ ## Policies
23
+ ```yaml
24
+ prefer:
25
+ - Semantic HTML elements
26
+ - CSS Grid / Flexbox over absolute positioning
27
+ ```
28
+
29
+ ## Escalation
30
+ ```yaml
31
+ stop:
32
+ - Design assets or requirements are ambiguous
33
+ ```
34
+
35
+ ## Output
36
+ - Frontend components and stylesheets
37
+ ```
@@ -1,62 +1,36 @@
1
1
  ---
2
2
  name: qk-docs
3
- version: 3.1.5
4
- updated: 2026-07-02
5
- description: Viết và duy trì tài liệu dự án để con người có thể dễ dàng đọc hiểu.
6
- category: documentation
7
- behavior: static-analysis
8
- intent: maintain
9
- priority: low
10
- tags: [docs, markdown, jsdoc, readme, architecture, mermaid]
11
- platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User asks to write docs, generate architecture diagrams, update README, or write JSDoc.
13
- inputs: [Source code, Task context]
14
- outputs: [Markdown Documentation, JSDoc]
15
- allowed_tools: [read_file, write_to_file]
16
- pipeline: [analyze, implement, validate, complete]
3
+ category: utilities
4
+ version: 6.0.0
17
5
  ---
18
6
 
19
- # 🛠️ qk-docs - Standard Operating Procedure
7
+ # qk-docs
20
8
 
21
- > **Goal:** Đóng vai trò là "Technical Writer". Viết tài liệu (README, API Docs, Code Comments) rõ ràng, dễ hiểu cho con người.
9
+ ## Scope
10
+ - Writing and maintaining project documentation for human readability (Execute)
22
11
 
23
- ## 🔄 1. Chain of Thought (SOP)
24
-
25
- 1. **Analyze (Context Extraction):**
26
- - Read the target source code to understand its Inputs, Outputs, and side effects.
27
- 2. **Implement (Drafting):**
28
- - Write Markdown or JSDoc comments.
29
- - Structure: Description -> Parameters -> Returns -> Warnings/Notes.
30
- 3. **Validate (Review Examples):**
31
- - ALWAYS provide 1-2 real-world code examples demonstrating how to use the function/API.
32
- 4. **Complete (Format):**
33
- - Ensure proper Markdown syntax (bolding, code blocks with languages).
34
-
35
- ## 🛡️ 2. Constraints & Rules
36
-
37
- - **Human Friendly:** Avoid overly academic language. Explain it as if explaining to a junior developer.
38
- - **Language Hybrid:** If writing Vietnamese documentation, keep technical keywords (props, state, endpoint, fetch) in English.
39
-
40
- ## 🌳 3. Decision Tree
41
-
42
- ```text
43
- Is this a System Architecture or Flow?
44
- ├── YES → Create Mermaid diagrams (Architecture, Sequence) and save to `/docs/`.
45
- └── NO → Is this an API Documentation?
46
- ├── YES → Use standard REST/GraphQL documentation layout (Endpoint, Method, Body, Response).
47
- └── NO → Is it a Component Documentation?
48
- ├── YES → Document the Props interface and usage examples.
49
- └── NO → Write standard JSDoc or update README.
12
+ ## Constraints
13
+ ```yaml
14
+ must:
15
+ - Keep documentation in sync with the actual codebase
16
+ - Use clear, accessible language
17
+ must_not:
18
+ - Generate overly verbose or redundant docs
19
+ - Invent features that don't exist in the code
50
20
  ```
51
21
 
52
- ## 🤝 4. Handoff Pipeline
53
-
54
- 1. `complete`: Generate the Docs and save them to the project files.
55
-
56
- ## 📝 5. Output Format
22
+ ## Policies
23
+ ```yaml
24
+ prefer:
25
+ - Examples and code snippets over pure text
26
+ ```
57
27
 
58
- Vui lòng trả kết quả bằng Tiếng Việt.
28
+ ## Escalation
29
+ ```yaml
30
+ stop:
31
+ - The codebase logic is too ambiguous to document accurately
32
+ ```
59
33
 
60
- - **Tóm tắt (Summary):** Tài liệu nào đã được tạo/cập nhật.
61
- - **Chi tiết (Changes):** Cấu trúc tài liệu.
62
- - **Xác thực (Verification):** Yêu cầu User đọc lướt qua tài liệu.
34
+ ## Output
35
+ - Markdown documentation files
36
+ ```