ai-developer-skill-os 3.1.5 → 5.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.
Files changed (95) hide show
  1. package/README.md +15 -19
  2. package/_template/SKILL.md +37 -133
  3. package/framework/KERNEL.md +58 -0
  4. package/framework/bias-library/cosmetic-refactor.md +21 -0
  5. package/framework/bias-library/enterprise-crud.md +21 -0
  6. package/framework/bias-library/fake-ui-slop.md +20 -0
  7. package/framework/bias-library/hallucinated-tools.md +20 -0
  8. package/framework/bias-library/missing-ui-states.md +19 -0
  9. package/framework/bias-library/over-indexing.md +20 -0
  10. package/framework/bias-library/swallow-errors.md +19 -0
  11. package/framework/bias-library/ui-only-security.md +17 -0
  12. package/framework/dial-library/complexity-budget.md +13 -0
  13. package/framework/dial-library/granularity.md +13 -0
  14. package/framework/dial-library/optimization-strategy.md +13 -0
  15. package/framework/dial-library/strictness.md +13 -0
  16. package/framework/rule-library/delegation-only.md +9 -0
  17. package/framework/rule-library/minimal-diff.md +9 -0
  18. package/package.json +1 -1
  19. package/skills/qk-access-policy/SKILL.md +40 -30
  20. package/skills/qk-ai-builder/SKILL.md +39 -30
  21. package/skills/qk-api-lifecycle/SKILL.md +39 -54
  22. package/skills/qk-bug-resolution/SKILL.md +39 -58
  23. package/skills/qk-context-loader/SKILL.md +36 -35
  24. package/skills/qk-data-lifecycle/SKILL.md +37 -49
  25. package/skills/qk-db-optimizer/SKILL.md +37 -44
  26. package/skills/qk-design-to-code/SKILL.md +40 -35
  27. package/skills/qk-docs/SKILL.md +37 -43
  28. package/skills/qk-engineering-standard/SKILL.md +39 -51
  29. package/skills/qk-feature-delivery/SKILL.md +39 -56
  30. package/skills/qk-help/SKILL.md +36 -28
  31. package/skills/qk-orchestrator/SKILL.md +40 -43
  32. package/skills/qk-policy-engine/SKILL.md +36 -41
  33. package/skills/qk-production-release/SKILL.md +40 -36
  34. package/skills/qk-project-bootstrap/SKILL.md +39 -32
  35. package/skills/qk-project-health/SKILL.md +36 -44
  36. package/skills/qk-project-memory/SKILL.md +38 -24
  37. package/skills/qk-system-evolution/SKILL.md +36 -51
  38. package/skills/qk-ui-audit/SKILL.md +37 -46
  39. package/skills/qk-ui-system-builder/SKILL.md +38 -29
  40. package/skills/qk-validation-gate/SKILL.md +34 -47
  41. package/taste-skill/.claude-plugin/marketplace.json +20 -0
  42. package/taste-skill/.claude-plugin/plugin.json +19 -0
  43. package/taste-skill/.github/FUNDING.yml +1 -0
  44. package/taste-skill/.github/copilot-instructions.md +11 -0
  45. package/taste-skill/CHANGELOG.md +111 -0
  46. package/taste-skill/LICENSE +21 -0
  47. package/taste-skill/README.md +212 -0
  48. package/taste-skill/assets/.gitkeep +0 -0
  49. package/taste-skill/assets/readme-banner.webp +0 -0
  50. package/taste-skill/assets/readme-buttons/btn-agent-skills.webp +0 -0
  51. package/taste-skill/assets/readme-buttons/btn-changelog.webp +0 -0
  52. package/taste-skill/assets/readme-buttons/btn-mit.webp +0 -0
  53. package/taste-skill/assets/readme-buttons/btn-site.webp +0 -0
  54. package/taste-skill/assets/readme-buttons/btn-tools.webp +0 -0
  55. package/taste-skill/assets/readme-cta-tasteskill.svg +5 -0
  56. package/taste-skill/assets/sponsors/animations-dev.webp +0 -0
  57. package/taste-skill/assets/sponsors/emil-animations-dev.webp +0 -0
  58. package/taste-skill/assets/taste-skill-logo.png +0 -0
  59. package/taste-skill/assets/taste-skill-logo.webp +0 -0
  60. package/taste-skill/assets/vercel-oss-program-badge.svg +44 -0
  61. package/taste-skill/examples/floria-bottom.webp +0 -0
  62. package/taste-skill/examples/floria-full.webp +0 -0
  63. package/taste-skill/examples/floria-top.webp +0 -0
  64. package/taste-skill/research/README.md +8 -0
  65. package/taste-skill/research/laziness/README.md +25 -0
  66. package/taste-skill/research/laziness/findings/empirical-results.md +58 -0
  67. package/taste-skill/research/laziness/findings/references.md +20 -0
  68. package/taste-skill/research/laziness/remediation/architectural-patterns.md +55 -0
  69. package/taste-skill/research/laziness/remediation/parameter-tuning.md +44 -0
  70. package/taste-skill/research/laziness/remediation/prompt-engineering.md +52 -0
  71. package/taste-skill/research/laziness/remediation/reference-prompts.md +79 -0
  72. package/taste-skill/research/laziness/root-causes/cognitive-shortcuts.md +23 -0
  73. package/taste-skill/research/laziness/root-causes/output-limits.md +39 -0
  74. package/taste-skill/research/laziness/root-causes/rlhf-and-compute.md +27 -0
  75. package/taste-skill/research/laziness/root-causes/training-data-bias.md +28 -0
  76. package/taste-skill/scripts/build-emil-sponsor-row.mjs +41 -0
  77. package/taste-skill/scripts/convert-readme-assets-webp.mjs +142 -0
  78. package/taste-skill/scripts/process-readme-buttons.mjs +108 -0
  79. package/taste-skill/scripts/process-sponsor-badge.mjs +83 -0
  80. package/taste-skill/skill.sh +25 -0
  81. package/taste-skill/skills/brandkit/SKILL.md +798 -0
  82. package/taste-skill/skills/brutalist-skill/SKILL.md +92 -0
  83. package/taste-skill/skills/gpt-tasteskill/SKILL.md +74 -0
  84. package/taste-skill/skills/image-to-code-skill/SKILL.md +1228 -0
  85. package/taste-skill/skills/imagegen-frontend-mobile/SKILL.md +1465 -0
  86. package/taste-skill/skills/imagegen-frontend-web/SKILL.md +987 -0
  87. package/taste-skill/skills/llms.txt +13 -0
  88. package/taste-skill/skills/minimalist-skill/SKILL.md +85 -0
  89. package/taste-skill/skills/output-skill/SKILL.md +49 -0
  90. package/taste-skill/skills/redesign-skill/SKILL.md +178 -0
  91. package/taste-skill/skills/soft-skill/SKILL.md +98 -0
  92. package/taste-skill/skills/stitch-skill/DESIGN.md +121 -0
  93. package/taste-skill/skills/stitch-skill/SKILL.md +184 -0
  94. package/taste-skill/skills/taste-skill/SKILL.md +1206 -0
  95. package/taste-skill/skills/taste-skill-v1/SKILL.md +226 -0
@@ -1,48 +1,57 @@
1
1
  ---
2
2
  name: qk-ai-builder
3
- version: 3.1.5
4
- updated: 2026-07-02
3
+ version: 5.0.0
4
+ updated: 2026-07-03
5
5
  description: Thiết kế AI Logic, Prompts, RAG pipelines, và các Agents.
6
6
  category: ai
7
- behavior: development
8
- intent: implement-feature
9
- priority: medium
10
7
  tags: [ai, llm, prompt-engineering, rag, agents]
11
8
  platforms: [claude-code, cursor, windsurf, gemini-cli]
12
- trigger: User asks to build a chatbot, add AI features, or write prompts.
13
- inputs: [AI Requirements]
14
- outputs: [AI Logic, Prompts, RAG setup]
15
- allowed_tools: [run_command, write_to_file]
16
- pipeline: [analyze, design, implement, validate, complete]
17
9
  ---
18
10
 
19
- # 🛠️ qk-ai-builder - Standard Operating Procedure
11
+ # 🛠️ qk-ai-builder
20
12
 
21
- > **Goal:** "AI Engineer". Xây dựng các tính năng thông minh bằng LLM (Chatbot, RAG pipeline, Agent workflows).
13
+ > **Inheritance:** Kỹ năng này tuân thủ Kiến trúc v5.0 của `framework/KERNEL.md`.
14
+ > Output bắt buộc là Decision Summary.
22
15
 
23
- ## 🔄 1. Chain of Thought (SOP)
16
+ ---
17
+
18
+ ## 🎯 Mission (Scope)
19
+ - ✅ Xây dựng luồng AI/LLM, viết Prompts chuyên nghiệp.
20
+ - ❌ Do NOT dùng LLM để thay thế các logic cứng có thể giải quyết bằng Code (như tính toán).
24
21
 
25
- 1. **Analyze (Task Breakdown):**
26
- - Determine the AI use case (Classification, Generation, Chat, Search).
27
- 2. **Design (Prompt Engineering):**
28
- - Write clear System Prompts. Treat prompts like code (use variables, constraints).
29
- 3. **Implement (Integration):**
30
- - Use the appropriate SDK (LangChain, OpenAI SDK, Vercel AI).
31
- 4. **Validate (Safety Check):**
32
- - Ensure API keys are not hardcoded.
22
+ ---
33
23
 
34
- ## 🛡️ 2. Constraints & Rules
24
+ ## ⚙️ Capabilities (Cognitive Pipeline)
25
+ ```yaml
26
+ Pipeline:
27
+ - inference
28
+ - planning
29
+ - execution
30
+ - bias-review
31
+ - ship-check
32
+ ```
35
33
 
36
- - **JSON Parsing:** Always enforce JSON outputs if the AI response is consumed by the app, and handle parse errors.
34
+ ---
37
35
 
38
- ## 🤝 3. Handoff Pipeline
36
+ ## 🎛️ Dials (Hành vi)
37
+ ```yaml
38
+ Dials:
39
+ - id: complexity-budget
40
+ ```
39
41
 
40
- 1. `validate`: Send to validation gate.
41
- 2. `complete`: Output the AI Integration Report.
42
+ ---
42
43
 
43
- ## 📝 4. Output Format
44
+ ## 🛡️ Biases (Sửa lỗi mặc định)
45
+ ```yaml
46
+ Biases:
47
+ - id: swallow-errors # (Bỏ qua lỗi API gọi LLM thất bại)
48
+ - id: hallucinated-tools # (Tự bịa model không tồn tại)
49
+ ```
44
50
 
45
- Vui lòng trả kết quả bằng Tiếng Việt.
51
+ ---
46
52
 
47
- - **Tóm tắt (Summary):** Luồng AI đã thiết lập.
48
- - **Chi tiết (Changes):** Prompt và logic gọi API.
53
+ ## 🛫 Ship Criteria
54
+ ```yaml
55
+ Rules:
56
+ - id: end-to-end-validation
57
+ ```
@@ -1,72 +1,57 @@
1
1
  ---
2
2
  name: qk-api-lifecycle
3
- version: 3.1.5
4
- updated: 2026-07-02
3
+ version: 5.0.0
4
+ updated: 2026-07-03
5
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]
6
+ category: backend
7
+ tags: [api, rest, graphql, integration]
11
8
  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]
17
9
  ---
18
10
 
19
- # 🛠️ qk-api-lifecycle - Standard Operating Procedure
11
+ # 🛠️ qk-api-lifecycle
20
12
 
21
- > **Goal:** Quản 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.
13
+ > **Inheritance:** Kỹ năng này tuân thủ Kiến trúc v5.0 của `framework/KERNEL.md`.
14
+ > Output bắt buộc là Decision Summary.
22
15
 
23
- ## 🔄 1. Chain of Thought (SOP)
16
+ ---
24
17
 
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.
18
+ ## 🎯 Mission (Scope)
19
+ - Thiết kế RESTful hoặc GraphQL API chuẩn mực.
20
+ - Do NOT trả về `200 OK` cho các response bị lỗi `error: true`.
39
21
 
40
- ## 🛡️ 2. Constraints & Rules
22
+ ---
41
23
 
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.
24
+ ## ⚙️ Capabilities (Cognitive Pipeline)
25
+ ```yaml
26
+ Pipeline:
27
+ - inference
28
+ - planning
29
+ - execution
30
+ - bias-review
31
+ - ship-check
32
+ ```
45
33
 
46
- ## 🌳 3. Decision Tree
34
+ ---
47
35
 
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.
36
+ ## 🎛️ Dials (Hành vi)
37
+ ```yaml
38
+ Dials:
39
+ - id: rest-strictness
56
40
  ```
57
41
 
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.
42
+ ---
63
43
 
64
- ## 📝 5. Output Format
44
+ ## 🛡️ Biases (Sửa lỗi mặc định)
45
+ ```yaml
46
+ Biases:
47
+ - id: swallow-errors
48
+ - id: enterprise-crud # (Dùng gRPC/Kafka cho API quá nhỏ)
49
+ ```
65
50
 
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:
51
+ ---
67
52
 
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ó).
53
+ ## 🛫 Ship Criteria
54
+ ```yaml
55
+ Rules:
56
+ - id: minimal-diff
57
+ ```
@@ -1,76 +1,57 @@
1
1
  ---
2
2
  name: qk-bug-resolution
3
- version: 3.1.5
4
- updated: 2026-07-02
3
+ version: 5.0.0
4
+ updated: 2026-07-03
5
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]
6
+ category: maintenance
7
+ tags: [bugfix, debugging, troubleshooting]
11
8
  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]
17
9
  ---
18
10
 
19
- # 🛠️ qk-bug-resolution - Standard Operating Procedure
11
+ # 🛠️ qk-bug-resolution
20
12
 
21
- > **Goal:** Định vị nguyên nhân, sửa lỗi triệt để, đảm bảo lỗi không bị lặp lại (Regression Prevention).
13
+ > **Inheritance:** Kỹ năng này tuân thủ Kiến trúc v5.0 của `framework/KERNEL.md`.
14
+ > Output bắt buộc là Decision Summary.
22
15
 
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.
16
+ ---
46
17
 
47
- ## 🌳 3. Decision Tree
18
+ ## 🎯 Mission (Scope)
19
+ - ✅ Tìm ra nguyên nhân gốc rễ (root cause) và sửa lỗi.
20
+ - ❌ Do NOT viết lại (rewrite) toàn bộ file thay vì sửa đúng dòng gây lỗi (The Rewrite Trap).
48
21
 
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.
22
+ ---
53
23
 
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.
24
+ ## ⚙️ Capabilities (Cognitive Pipeline)
25
+ ```yaml
26
+ Pipeline:
27
+ - inference
28
+ - planning
29
+ - execution
30
+ - bias-review
31
+ - ship-check
57
32
  ```
58
33
 
59
- ## 🤝 4. Handoff Pipeline
34
+ ---
60
35
 
61
- After implementing the fix, map to the pipeline:
36
+ ## 🎛️ Dials (Hành vi)
37
+ ```yaml
38
+ Dials:
39
+ - id: strictness
40
+ ```
62
41
 
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.
42
+ ---
66
43
 
67
- ## 📝 5. Output Format
44
+ ## 🛡️ Biases (Sửa lỗi mặc định)
45
+ ```yaml
46
+ Biases:
47
+ - id: swallow-errors
48
+ - id: cosmetic-refactor # (Tuyệt đối cấm refactor khi đang fix bug)
49
+ ```
68
50
 
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:
51
+ ---
70
52
 
71
- - Summary
72
- - Changes
73
- - Root Cause
74
- - Verification
75
- - Risks
76
- - Next Action
53
+ ## 🛫 Ship Criteria
54
+ ```yaml
55
+ Rules:
56
+ - id: minimal-diff # (Chỉ sửa dòng cần sửa)
57
+ ```
@@ -1,55 +1,56 @@
1
1
  ---
2
2
  name: qk-context-loader
3
- version: 3.1.5
4
- updated: 2026-07-02
3
+ version: 5.0.0
4
+ updated: 2026-07-03
5
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
6
  category: utilities
7
- behavior: static-analysis
8
- intent: review-code
9
- priority: medium
10
7
  tags: [context, filesystem, dependencies, graph]
11
8
  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]
17
9
  ---
18
10
 
19
- # 🛠️ qk-context-loader - Standard Operating Procedure
11
+ # 🛠️ qk-context-loader
20
12
 
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.
13
+ > **Inheritance:** Kỹ năng này tuân thủ Kiến trúc v5.0 của `framework/KERNEL.md`.
14
+ > Output bắt buộc là Decision Summary.
22
15
 
23
- ## 🔄 1. Chain of Thought (SOP)
16
+ ---
24
17
 
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.
18
+ ## 🎯 Mission (Scope)
19
+ - Tìm nạp các file phụ thuộc (Dependencies, Imports).
20
+ - Do NOT nạp toàn bộ repo hoặc thư mục `node_modules` gây phình Context Window.
33
21
 
34
- ## 🛡️ 2. Constraints & Rules
22
+ ---
35
23
 
36
- - **Token Optimization:** Do not load `node_modules` or massive minified build files. Extract only the exact logic needed.
24
+ ## ⚙️ Capabilities (Cognitive Pipeline)
25
+ ```yaml
26
+ Pipeline:
27
+ - inference
28
+ - planning
29
+ - execution
30
+ - bias-review
31
+ - ship-check
32
+ ```
37
33
 
38
- ## 🌳 3. Decision Tree
34
+ ---
39
35
 
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.
36
+ ## 🎛️ Dials (Hành vi)
37
+ ```yaml
38
+ Dials:
39
+ - id: complexity-budget
44
40
  ```
45
41
 
46
- ## 🤝 4. Handoff Pipeline
47
-
48
- 1. `complete`: Provide the context map to the Orchestrator or Target Skill.
42
+ ---
49
43
 
50
- ## 📝 5. Output Format
44
+ ## 🛡️ Biases (Sửa lỗi mặc định)
45
+ ```yaml
46
+ Biases:
47
+ - id: hallucinated-tools # (Đoán mò tên file thay vì tìm kiếm thật)
48
+ ```
51
49
 
52
- Vui lòng trả kết quả bằng Tiếng Việt.
50
+ ---
53
51
 
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.
52
+ ## 🛫 Ship Criteria
53
+ ```yaml
54
+ Rules:
55
+ - id: delegation-only # (Chỉ thu thập thông tin, cấm chỉnh sửa code)
56
+ ```
@@ -1,68 +1,56 @@
1
1
  ---
2
2
  name: qk-data-lifecycle
3
- version: 3.1.5
4
- updated: 2026-07-02
3
+ version: 5.0.0
4
+ updated: 2026-07-03
5
5
  description: Quản lý Database Schema, Migrations, và Repositories.
6
6
  category: database
7
- behavior: development
8
- intent: implement-feature
9
- priority: medium
10
- tags: [database, sql, migration, schema, orm]
7
+ tags: [database, schema, migrations, orm]
11
8
  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]
17
9
  ---
18
10
 
19
- # 🛠️ qk-data-lifecycle - Standard Operating Procedure
11
+ # 🛠️ qk-data-lifecycle
20
12
 
21
- > **Goal:** Quản 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.
13
+ > **Inheritance:** Kỹ năng này tuân thủ Kiến trúc v5.0 của `framework/KERNEL.md`.
14
+ > Output bắt buộc là Decision Summary.
22
15
 
23
- ## 🔄 1. Chain of Thought (SOP)
16
+ ---
24
17
 
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`).
18
+ ## 🎯 Mission (Scope)
19
+ - Thiết kế cấu trúc CSDL viết file Migration an toàn.
20
+ - Do NOT xóa cột hoặc đổi tên cột đang dùng (DROP/RENAME) không dùng cơ chế "Expand & Contract".
37
21
 
38
- ## 🛡️ 2. Constraints & Rules
22
+ ---
39
23
 
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.
24
+ ## ⚙️ Capabilities (Cognitive Pipeline)
25
+ ```yaml
26
+ Pipeline:
27
+ - inference
28
+ - planning
29
+ - execution
30
+ - bias-review
31
+ - ship-check
32
+ ```
43
33
 
44
- ## 🌳 3. Decision Tree
34
+ ---
45
35
 
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.
36
+ ## 🎛️ Dials (Hành vi)
37
+ ```yaml
38
+ Dials:
39
+ - id: strictness
52
40
  ```
53
41
 
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.
42
+ ---
59
43
 
60
- ## 📝 5. Output Format
44
+ ## 🛡️ Biases (Sửa lỗi mặc định)
45
+ ```yaml
46
+ Biases:
47
+ - id: over-indexing # (Chống thói quen đánh index bừa bãi)
48
+ ```
61
49
 
62
- Vui lòng trả kết quả bằng Tiếng Việt.
50
+ ---
63
51
 
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.
52
+ ## 🛫 Ship Criteria
53
+ ```yaml
54
+ Rules:
55
+ - id: minimal-diff
56
+ ```
@@ -1,63 +1,56 @@
1
1
  ---
2
2
  name: qk-db-optimizer
3
- version: 1.0.0
4
- updated: 2026-07-02
3
+ version: 5.0.0
4
+ updated: 2026-07-03
5
5
  description: Tối ưu hóa Database (đánh Index, xử lý N+1 Queries, Slow Queries).
6
6
  category: database
7
- behavior: development
8
- intent: implement-feature
9
- priority: high
10
- tags: [database, optimize, sql, index, performance]
7
+ tags: [database, performance, optimization, queries]
11
8
  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]
17
9
  ---
18
10
 
19
- # 🛠️ qk-db-optimizer - Standard Operating Procedure
11
+ # 🛠️ qk-db-optimizer
20
12
 
21
- > **Goal:** Tối ưu hóa hiệu suất 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.
13
+ > **Inheritance:** Kỹ năng này tuân thủ Kiến trúc v5.0 của `framework/KERNEL.md`.
14
+ > Output bắt buộc là Decision Summary.
22
15
 
23
- ## 🔄 1. Chain of Thought (SOP)
16
+ ---
24
17
 
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.
18
+ ## 🎯 Mission (Scope)
19
+ - Tìm nguyên nhân gây nghẽn cổ chai DB đề xuất Query Optimization.
20
+ - Do NOT vội vàng đề xuất Redis/Cache trước khi fix tận gốc câu SQL lỗi.
35
21
 
36
- ## 🛡️ 2. Constraints & Rules
22
+ ---
37
23
 
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.
24
+ ## ⚙️ Capabilities (Cognitive Pipeline)
25
+ ```yaml
26
+ Pipeline:
27
+ - inference
28
+ - planning
29
+ - execution
30
+ - bias-review
31
+ - ship-check
32
+ ```
40
33
 
41
- ## 🌳 3. Decision Tree
34
+ ---
42
35
 
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.
36
+ ## 🎛️ Dials (Hành vi)
37
+ ```yaml
38
+ Dials:
39
+ - id: optimization-strategy
49
40
  ```
50
41
 
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.
42
+ ---
55
43
 
56
- ## 📝 5. Output Format
44
+ ## 🛡️ Biases (Sửa lỗi mặc định)
45
+ ```yaml
46
+ Biases:
47
+ - id: over-indexing
48
+ ```
57
49
 
58
- Vui lòng trả kết quả bằng Tiếng Việt.
50
+ ---
59
51
 
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):** ...
52
+ ## 🛫 Ship Criteria
53
+ ```yaml
54
+ Rules:
55
+ - id: minimal-diff
56
+ ```