ai-developer-skill-os 9.3.0 → 10.1.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 (185) hide show
  1. package/.agents/AGENTS.md +60 -40
  2. package/.agents/DEV_PROFILE.md +36 -2
  3. package/.agents/registry/graph.json +95 -342
  4. package/.agents/registry/index.yaml +61 -237
  5. package/.agents/rules/coding.md +30 -12
  6. package/.agents/rules/command-safety.md +19 -8
  7. package/.agents/rules/global.md +234 -28
  8. package/.agents/rules/prompt-compiler.md +170 -0
  9. package/.agents/skills/qk-api-data-discovery/SKILL.md +470 -0
  10. package/.agents/skills/qk-backend-data/SKILL.md +190 -0
  11. package/.agents/skills/qk-bug-resolution/SKILL.md +176 -248
  12. package/.agents/skills/qk-code-cleaner/SKILL.md +250 -0
  13. package/.agents/skills/qk-code-review/SKILL.md +126 -247
  14. package/.agents/skills/qk-devops-release/SKILL.md +145 -0
  15. package/.agents/skills/qk-feature-delivery/SKILL.md +179 -247
  16. package/.agents/skills/qk-orchestrator/SKILL.md +100 -151
  17. package/.agents/skills/qk-product-spec/SKILL.md +113 -0
  18. package/.agents/skills/qk-prompt-compiler/SKILL.md +321 -0
  19. package/.agents/skills/qk-ui-engineer/SKILL.md +137 -0
  20. package/.agents/workflows/feature-delivery.yml +1 -1
  21. package/.agents/workflows/production-release.yml +1 -1
  22. package/.agents/workflows/spec-driven-development.yml +109 -87
  23. package/CHANGELOG.md +54 -0
  24. package/README.md +125 -184
  25. package/bin/install.js +337 -329
  26. package/package.json +2 -2
  27. package/.agents/README.md +0 -90
  28. package/.agents/docs/CHI_TIET_SKILLS.md +0 -126
  29. package/.agents/docs/HUONG_DAN_SU_DUNG.md +0 -120
  30. package/.agents/docs/MIGRATION-CLEANUP-V8.1.3.md +0 -36
  31. package/.agents/docs/MIGRATION-STATUS.md +0 -35
  32. package/.agents/docs/MIGRATION-V8.md +0 -10
  33. package/.agents/docs/ROADMAP-V8.2.md +0 -78
  34. package/.agents/docs/V8-CERTIFICATION.md +0 -27
  35. package/.agents/skills/qk-access-policy/SKILL.md +0 -206
  36. package/.agents/skills/qk-access-policy/capability.yaml +0 -23
  37. package/.agents/skills/qk-access-policy/evals/scorecard.yaml +0 -36
  38. package/.agents/skills/qk-agent-observability/SKILL.md +0 -108
  39. package/.agents/skills/qk-agent-observability/capability.yaml +0 -29
  40. package/.agents/skills/qk-agent-observability/evals/scorecard.yaml +0 -29
  41. package/.agents/skills/qk-agent-observability/references/scorecard.yaml +0 -80
  42. package/.agents/skills/qk-ai-builder/SKILL.md +0 -254
  43. package/.agents/skills/qk-ai-builder/capability.yaml +0 -23
  44. package/.agents/skills/qk-ai-builder/evals/scorecard.yaml +0 -30
  45. package/.agents/skills/qk-api-consumer/SKILL.md +0 -256
  46. package/.agents/skills/qk-api-consumer/capability.yaml +0 -21
  47. package/.agents/skills/qk-api-consumer/evals/scorecard.yaml +0 -29
  48. package/.agents/skills/qk-api-lifecycle/SKILL.md +0 -251
  49. package/.agents/skills/qk-api-lifecycle/capability.yaml +0 -23
  50. package/.agents/skills/qk-api-lifecycle/evals/scorecard.yaml +0 -29
  51. package/.agents/skills/qk-bug-resolution/capability.yaml +0 -25
  52. package/.agents/skills/qk-code-review/capability.yaml +0 -23
  53. package/.agents/skills/qk-context-loader/SKILL.md +0 -198
  54. package/.agents/skills/qk-context-loader/capability.yaml +0 -23
  55. package/.agents/skills/qk-context-loader/evals/scorecard.yaml +0 -28
  56. package/.agents/skills/qk-data-engineer/SKILL.md +0 -253
  57. package/.agents/skills/qk-data-lifecycle/SKILL.md +0 -197
  58. package/.agents/skills/qk-data-lifecycle/capability.yaml +0 -23
  59. package/.agents/skills/qk-data-lifecycle/evals/scorecard.yaml +0 -29
  60. package/.agents/skills/qk-db-optimizer/SKILL.md +0 -210
  61. package/.agents/skills/qk-db-optimizer/capability.yaml +0 -22
  62. package/.agents/skills/qk-db-optimizer/evals/scorecard.yaml +0 -28
  63. package/.agents/skills/qk-design-system-engineering/SKILL.md +0 -193
  64. package/.agents/skills/qk-design-system-engineering/capability.yaml +0 -25
  65. package/.agents/skills/qk-design-system-engineering/evals/scorecard.yaml +0 -27
  66. package/.agents/skills/qk-devops-platform/SKILL.md +0 -198
  67. package/.agents/skills/qk-devops-platform/capability.yaml +0 -29
  68. package/.agents/skills/qk-devops-platform/evals/scorecard.yaml +0 -28
  69. package/.agents/skills/qk-docs/SKILL.md +0 -193
  70. package/.agents/skills/qk-docs/capability.yaml +0 -23
  71. package/.agents/skills/qk-docs/evals/scorecard.yaml +0 -27
  72. package/.agents/skills/qk-engineering-standard/SKILL.md +0 -89
  73. package/.agents/skills/qk-engineering-standard/capability.yaml +0 -23
  74. package/.agents/skills/qk-engineering-standard/evals/scorecard.yaml +0 -28
  75. package/.agents/skills/qk-engineering-standard/references/anti-patterns.md +0 -121
  76. package/.agents/skills/qk-engineering-standard/rules/backend.md +0 -122
  77. package/.agents/skills/qk-engineering-standard/rules/database.md +0 -3
  78. package/.agents/skills/qk-engineering-standard/rules/frontend.md +0 -152
  79. package/.agents/skills/qk-engineering-standard/rules/security.md +0 -3
  80. package/.agents/skills/qk-engineering-standard/rules/testing.md +0 -3
  81. package/.agents/skills/qk-fe-api-integration/SKILL.md +0 -704
  82. package/.agents/skills/qk-fe-api-integration/capability.yaml +0 -21
  83. package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +0 -29
  84. package/.agents/skills/qk-feature-delivery/capability.yaml +0 -24
  85. package/.agents/skills/qk-frontend-architecture/SKILL.md +0 -127
  86. package/.agents/skills/qk-frontend-architecture/capability.yaml +0 -28
  87. package/.agents/skills/qk-frontend-architecture/evals/scorecard.yaml +0 -28
  88. package/.agents/skills/qk-help/SKILL.md +0 -107
  89. package/.agents/skills/qk-help/capability.yaml +0 -20
  90. package/.agents/skills/qk-help/evals/scorecard.yaml +0 -13
  91. package/.agents/skills/qk-orchestrator/capability.yaml +0 -22
  92. package/.agents/skills/qk-product-specification/SKILL.md +0 -187
  93. package/.agents/skills/qk-product-specification/capability.yaml +0 -27
  94. package/.agents/skills/qk-product-specification/evals/scorecard.yaml +0 -27
  95. package/.agents/skills/qk-production-release/SKILL.md +0 -188
  96. package/.agents/skills/qk-production-release/capability.yaml +0 -27
  97. package/.agents/skills/qk-production-release/evals/scorecard.yaml +0 -28
  98. package/.agents/skills/qk-project-audit/SKILL.md +0 -174
  99. package/.agents/skills/qk-project-bootstrap/SKILL.md +0 -372
  100. package/.agents/skills/qk-project-bootstrap/capability.yaml +0 -23
  101. package/.agents/skills/qk-project-bootstrap/evals/scorecard.yaml +0 -28
  102. package/.agents/skills/qk-project-health/SKILL.md +0 -202
  103. package/.agents/skills/qk-project-health/capability.yaml +0 -23
  104. package/.agents/skills/qk-project-health/evals/scorecard.yaml +0 -27
  105. package/.agents/skills/qk-project-memory/SKILL.md +0 -303
  106. package/.agents/skills/qk-project-memory/capability.yaml +0 -23
  107. package/.agents/skills/qk-project-memory/evals/scorecard.yaml +0 -27
  108. package/.agents/skills/qk-refactor/SKILL.md +0 -243
  109. package/.agents/skills/qk-refactor/capability.yaml +0 -26
  110. package/.agents/skills/qk-refactor/evals/scorecard.yaml +0 -27
  111. package/.agents/skills/qk-security-audit/SKILL.md +0 -280
  112. package/.agents/skills/qk-security-audit/capability.yaml +0 -29
  113. package/.agents/skills/qk-security-audit/evals/scorecard.yaml +0 -27
  114. package/.agents/skills/qk-system-evolution/SKILL.md +0 -625
  115. package/.agents/skills/qk-system-evolution/capability.yaml +0 -24
  116. package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +0 -26
  117. package/.agents/skills/qk-test-engineering/SKILL.md +0 -215
  118. package/.agents/skills/qk-test-engineering/capability.yaml +0 -28
  119. package/.agents/skills/qk-test-engineering/evals/scorecard.yaml +0 -26
  120. package/.agents/skills/qk-ui-audit/SKILL.md +0 -175
  121. package/.agents/skills/qk-ui-audit/capability.yaml +0 -23
  122. package/.agents/skills/qk-ui-audit/evals/scorecard.yaml +0 -26
  123. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +0 -136
  124. package/.agents/skills/qk-ui-builder/SKILL.md +0 -521
  125. package/.agents/skills/qk-ui-builder/capability.yaml +0 -29
  126. package/.agents/skills/qk-ui-builder/evals/scorecard.yaml +0 -26
  127. package/.agents/skills/qk-ui-builder/references/anti-patterns.md +0 -295
  128. package/.agents/skills/qk-ui-builder/references/color.md +0 -115
  129. package/.agents/skills/qk-ui-builder/references/component-cookbook.md +0 -458
  130. package/.agents/skills/qk-ui-builder/references/copy.md +0 -250
  131. package/.agents/skills/qk-ui-builder/references/interaction-and-states.md +0 -115
  132. package/.agents/skills/qk-ui-builder/references/layout-and-space.md +0 -111
  133. package/.agents/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +0 -48
  134. package/.agents/skills/qk-ui-builder/references/macrostructures/02-long-document.md +0 -50
  135. package/.agents/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +0 -51
  136. package/.agents/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +0 -49
  137. package/.agents/skills/qk-ui-builder/references/macrostructures/05-workbench.md +0 -44
  138. package/.agents/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +0 -50
  139. package/.agents/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +0 -51
  140. package/.agents/skills/qk-ui-builder/references/macrostructures/08-photographic.md +0 -50
  141. package/.agents/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +0 -50
  142. package/.agents/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +0 -49
  143. package/.agents/skills/qk-ui-builder/references/macrostructures/12-letter.md +0 -49
  144. package/.agents/skills/qk-ui-builder/references/macrostructures/13-index-first.md +0 -49
  145. package/.agents/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +0 -48
  146. package/.agents/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +0 -48
  147. package/.agents/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +0 -51
  148. package/.agents/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +0 -48
  149. package/.agents/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +0 -48
  150. package/.agents/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +0 -50
  151. package/.agents/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +0 -48
  152. package/.agents/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +0 -45
  153. package/.agents/skills/qk-ui-builder/references/macrostructures.md +0 -38
  154. package/.agents/skills/qk-ui-builder/references/motion.md +0 -95
  155. package/.agents/skills/qk-ui-builder/references/responsive.md +0 -115
  156. package/.agents/skills/qk-ui-builder/references/slop-test.md +0 -135
  157. package/.agents/skills/qk-ui-builder/references/structure.md +0 -280
  158. package/.agents/skills/qk-ui-builder/references/themes/atmospheric.md +0 -53
  159. package/.agents/skills/qk-ui-builder/references/themes/carnival.md +0 -52
  160. package/.agents/skills/qk-ui-builder/references/themes/cobalt.md +0 -52
  161. package/.agents/skills/qk-ui-builder/references/themes/editorial.md +0 -52
  162. package/.agents/skills/qk-ui-builder/references/themes/garden.md +0 -52
  163. package/.agents/skills/qk-ui-builder/references/themes/hum.md +0 -52
  164. package/.agents/skills/qk-ui-builder/references/themes/lumen.md +0 -52
  165. package/.agents/skills/qk-ui-builder/references/themes/midnight.md +0 -52
  166. package/.agents/skills/qk-ui-builder/references/themes/modern-minimal.md +0 -52
  167. package/.agents/skills/qk-ui-builder/references/themes/playful.md +0 -52
  168. package/.agents/skills/qk-ui-builder/references/themes/specimen.md +0 -52
  169. package/.agents/skills/qk-ui-builder/references/themes/terminal.md +0 -52
  170. package/.agents/skills/qk-ui-builder/references/typography.md +0 -129
  171. package/.agents/skills/qk-ui-system-builder/SKILL.md +0 -183
  172. package/.agents/skills/qk-ui-system-builder/capability.yaml +0 -25
  173. package/.agents/skills/qk-ui-system-builder/evals/scorecard.yaml +0 -26
  174. package/.agents/skills/qk-upgrade/SKILL.md +0 -301
  175. package/.agents/skills/qk-upgrade/capability.yaml +0 -24
  176. package/.agents/skills/qk-upgrade/evals/scorecard.yaml +0 -26
  177. package/.agents/skills/qk-validation-gate/SKILL.md +0 -88
  178. package/.agents/skills/qk-validation-gate/capability.yaml +0 -23
  179. package/.agents/skills/qk-validation-gate/evals/scorecard.yaml +0 -26
  180. package/.agents/skills/qk-web-quality-gate/SKILL.md +0 -197
  181. package/.agents/skills/qk-web-quality-gate/capability.yaml +0 -24
  182. package/.agents/skills/qk-web-quality-gate/evals/scorecard.yaml +0 -26
  183. package/.agents/workflows/research.yml +0 -75
  184. package/.agents/workflows/skill-evolution.yml +0 -97
  185. package/tooling/fix-refactor.js +0 -8
@@ -1,303 +0,0 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-project-memory
4
- version: 9.2.0
5
- status: stable
6
- description: "Quản trị Tri thức và Bộ nhớ dự án V1 (Local Private Mode) — Quản lý tại .ai-local/ như source code: tự động khởi tạo, bảo mật gitignore, có thể review, cập nhật và luôn có con người phê duyệt. Dùng skill này khi user nhắc đến: lưu context, project memory, ghi nhớ, /learn, lưu vào bộ nhớ, nhớ lại, tìm lại fact, lưu tri thức dự án — kể cả khi chỉ nói 'nhớ lại lỗi này để sau không mắc lại'."
7
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
-
9
- # ── V9: Classification ─────────────────────────────────────
10
- type: utility
11
-
12
- intent:
13
- - context-management
14
- - knowledge-retrieval
15
- - project-learning
16
-
17
- complexity:
18
- level: medium
19
- criteria:
20
- files_affected: "1-2"
21
- has_behavior_change: false
22
- has_external_dependency: false
23
- has_breaking_change: false
24
-
25
- triggers:
26
- - "lưu context"
27
- - "project memory"
28
- - "ghi nhớ"
29
- - "/learn"
30
- - "lưu vào bộ nhớ"
31
- - "nhớ lại"
32
- - "tìm lại fact"
33
- - "lưu tri thức dự án"
34
-
35
- # ── V9: References ─────────────────────────────────────────
36
- workflow: documentation
37
-
38
- rules:
39
- - global
40
- - coding
41
-
42
- tools:
43
- - filesystem
44
-
45
- related_skills:
46
- - qk-context-loader
47
- - qk-docs
48
-
49
- knowledge_scope:
50
- owns:
51
- - project-facts
52
- - verified-context
53
- - patterns
54
- - hard-bugs
55
- references:
56
- - architecture
57
- - convention
58
- - pattern
59
- - hard-bug
60
-
61
- # ── V9: Verification ───────────────────────────────────────
62
- verification:
63
- required: true
64
- strategy: human-approval
65
-
66
- selection:
67
- priority: high
68
- confidence_threshold: 1.0
69
-
70
- examples: []
71
- learnings: []
72
-
73
- # ── Runtime ─────────────────────────────────────────────
74
- execution_mode: deterministic
75
- cost: low
76
- latency: fast
77
- risk: low
78
- side_effects: edit_files
79
- produces: [knowledge-update]
80
- consumes: [source-code, task-outcome]
81
-
82
- token_budget:
83
- max_files_read: 3
84
- max_lines_per_read: 150
85
- max_shell_commands: 0
86
- stop_early: true
87
-
88
- exit_codes: [SUCCESS, BLOCKED, DISMISSED, FAILED]
89
- ---
90
-
91
- # qk-project-memory — Project Knowledge Management V1
92
-
93
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
94
-
95
- > **Kim chỉ nam tối thượng:** *"Knowledge phải được quản lý giống như source code: đơn giản, có thể xem xét (review), có thể cập nhật, có thể loại bỏ và luôn có con người chịu trách nhiệm phê duyệt."*
96
-
97
- ---
98
-
99
- ## Preconditions
100
-
101
- Trước khi đọc hoặc ghi vào bộ nhớ dự án:
102
-
103
- - [ ] Kiểm tra xem thư mục `.ai-local/` đã tồn tại chưa:
104
- - Nếu **chưa có**: Tự động tạo `.ai-local/AGENTS.md` và `.ai-local/knowledge/index.yaml` (Self-Init Protocol), đồng thời đảm bảo `.ai-local/` đã nằm trong `.gitignore`.
105
- - [ ] Xác định thao tác: **Tra cứu (Retrieve)** hay **Học/Ghi nhớ (/learn)**.
106
- - [ ] Với thao tác Ghi nhớ: Tri thức BẮT BUỘC phải thuộc 1 trong 4 danh mục cốt lõi:
107
- 1. `Architecture` (Cấu trúc nền tảng)
108
- 2. `Convention` (Quy ước viết code bất di bất dịch)
109
- 3. `Pattern` (Mẫu giải pháp lặp lại nhiều bước)
110
- 4. `Hard Bug` (Lỗi tốn nhiều thời gian xử lý)
111
- - [ ] Nếu là lỗi typo, format CSS vặt vãnh, hoặc CRUD tầm thường:
112
- → **EXIT: DISMISSED** (Bỏ qua để giữ sạch bộ nhớ).
113
-
114
- ---
115
-
116
- ## Scope
117
-
118
- ✅ Skill này làm:
119
- - Khởi tạo và duy trì bộ nhớ cục bộ an toàn tại `.ai-local/` (tách biệt khỏi git commit chung).
120
- - Tra cứu nhanh các quyết định kiến trúc, patterns và cách fix bug cũ trước khi giải quyết task mới.
121
- - Đề xuất bản thảo tri thức mới (Draft Proposal) dưới chuẩn YAML súc tích.
122
- - Xin phê duyệt rõ ràng từ lập trình viên (Human Approval Gate) trước khi lưu vĩnh viễn.
123
- - Lưu vết lịch sử theo cơ chế Zero-Overwrite (Chuyển trạng thái cũ sang `Archived` thay vì xóa mất dữ liệu).
124
-
125
- ❌ Skill này KHÔNG làm:
126
- - Tự động ghi ngầm tri thức mà không có sự đồng ý của con người.
127
- - Lưu trữ nhật ký hội thoại ("Hôm nay user bảo làm X...").
128
- - Dùng đường dẫn tuyệt đối máy cá nhân (`C:/...`, `D:/...`).
129
- - Thay thế mã nguồn thật (Memory chỉ là Navigator hỗ trợ định vị).
130
-
131
- ---
132
-
133
- ## 1. Chế Độ Lưu Trữ Local Private & Tự Động Khởi Tạo (Self-Init Protocol)
134
-
135
- Tri thức dự án V1 được chuẩn hóa duy nhất dưới chế độ **Local Private Mode** nhằm đảm bảo an toàn bảo mật riêng tư, tránh nhầm lẫn và không xâm phạm Git chính của team:
136
-
137
- ### Cấu Trúc Bộ Nhớ (.ai-local/)
138
- ```text
139
- .ai-local/
140
- ├── AGENTS.md ──> Bản đồ dự án (< 100 dòng)
141
- ├── knowledge/
142
- │ └── index.yaml ──> Kho tri thức 4 lĩnh vực
143
- └── candidates/ ──> Kho lưu Candidate Memory tạm thời
144
- ```
145
- - **Tự động Khởi tạo (Self-Init) & Gitignore Bắt Buộc:**
146
- - Bất cứ khi nào kích hoạt kỹ năng hoặc khi cần tra cứu/lưu trữ tri thức mà thư mục `.ai-local/` chưa tồn tại trong gốc dự án, AI **BẮT BUỘC** tự động tạo ngay cấu trúc thư mục này cùng các file `AGENTS.md` và `knowledge/index.yaml`.
147
- - AI **BẮT BUỘC** kiểm tra file `.gitignore` của dự án, nếu chưa có dòng `.ai-local/` thì phải tự động chèn vào ngay lập tức.
148
- - Tuyệt đối không dừng lại để hỏi ý kiến hay chờ phê duyệt về việc khởi tạo bộ nhớ local này. AI phải luôn chủ động để không bị bối rối về nơi tìm kiếm hay lưu trữ tri thức.
149
- - **Đã loại bỏ Shared Mode:** Không sử dụng hay tìm kiếm tại `.agents/knowledge/index.yaml` để thống nhất một nguồn tra cứu duy nhất từ `.ai-local/`.
150
-
151
- ---
152
-
153
- ## 2. Tiêu Chuẩn File 1: `AGENTS.md` (Bản Đồ Dự Án)
154
-
155
- - **Giới hạn cứng:** Tuyệt đối không vượt quá **100 dòng** (được parse trong < 5 giây).
156
- - **Quy tắc Quick Actions:** KHÔNG ghi đường dẫn file cụ thể nếu chưa ổn định để tránh gãy link khi refactor. Nhỏ gọn trỏ tới từ khóa tra cứu trong `index.yaml`.
157
-
158
- ### Mẫu Chuẩn `AGENTS.md`:
159
- ```markdown
160
- > [!IMPORTANT]
161
- > **MEMORY NAVIGATOR:** Memory chỉ dùng để giảm thời gian tìm kiếm, không thay thế việc đọc mã nguồn hiện tại.
162
-
163
- # Architecture (~15 dòng)
164
- - Framework: React + TypeScript + TanStack Router
165
- - State/Data: Axios Instance wrapper tại `src/services/httpClient.ts`
166
- - UI Style: TailwindCSS / Custom Component Library
167
-
168
- # Folder Map (~20 dòng)
169
- - `src/routes/`: Cấu hình routing (file-based routing)
170
- - `src/api/`: Các dịch vụ kết nối endpoint backend
171
- - `src/components/`: Component sử dụng lại trong toàn dự án
172
-
173
- # Quick Actions (~30 dòng)
174
- - Thêm / Sửa Menu -> Tra cứu Pattern "add-menu" trong `knowledge/index.yaml`
175
- - Xây dựng bảng dữ liệu -> Tra cứu Pattern "data-table" trong `knowledge/index.yaml`
176
- - Quy tắc gọi API -> Tra cứu Convention "api-wrapper" trong `knowledge/index.yaml`
177
-
178
- # Agent Rules (~20 dòng)
179
- 1. Luôn đọc `AGENTS.md` đầu tiên.
180
- 2. Tra cứu `knowledge/index.yaml` trước khi dùng lệnh tìm kiếm mù toàn dự án.
181
- 3. Hậu task: Chỉ đề xuất lưu nếu là Architecture, Convention, Pattern, hoặc Hard Bug.
182
- ```
183
-
184
- ---
185
-
186
- ## 3. Tiêu Chuẩn File 2: `knowledge/index.yaml` (Kho Tri Thức)
187
-
188
- ### Quy Tắc Lõi:
189
- 1. **Chỉ lưu 4 Loại Tri Thức duy nhất:**
190
- - `Architecture`: Nền tảng cấu trúc lớn.
191
- - `Convention`: Chuẩn mực viết code bắt buộc.
192
- - `Pattern`: Quy trình hành động tái sử dụng nhiều bước.
193
- - `Hard Bug`: Lỗi cực kỳ khó nhằn hoặc tốn nhiều thời gian fix (KHÔNG lưu lỗi typo, CSS lặt vặt, lỗi cú pháp tầm thường).
194
- 2. **Chỉ lưu Hành Động:** Đổi thẻ `summary` thành `steps` cho Pattern/Convention. AI nhìn là thực thi ngay.
195
- 3. **Hard Bug Tối Giản 3 Trường:** Chỉ giữ `cause`, `fix`, và `refs`.
196
- 4. **Lịch Sử An Toàn (Zero-Overwrite):** Khi một tri thức thay đổi hoặc lỗi thời, KHÔNG xóa đè. Chuyển trạng thái (`status`) của cụm cũ từ `Active` sang `Archived`, sau đó chèn cụm mới với trạng thái `Active`.
197
- 5. **Đường dẫn chuẩn thương mại:** Mọi `refs` bắt buộc dùng đường dẫn tương đối từ Root (`src/...`) và chỉ định tên Biểu tượng (Symbol/Component/Hook name), cấm dùng đường dẫn ổ đĩa tuyệt đối (`C:/...`, `D:/...`).
198
-
199
- ### Mẫu Chuẩn `index.yaml`:
200
- ```yaml
201
- # ==============================================================================
202
- # KHO TRI THỨC DỰ ÁN V1 (AI SKIN V9 ARCHITECTURE)
203
- # Lifecycle đơn giản: Active (Đang dùng) -> Archived (Lỗi thời/Lịch sử)
204
- # ==============================================================================
205
-
206
- knowledge:
207
- # --- PATTERN: CÔNG DỤNG LẶP LẠI ---------
208
- - id: add-menu
209
- type: Pattern
210
- status: Active
211
- tags: [menu, navigation, sidebar, router]
212
- steps:
213
- - 1. Cập nhật Sidebar hoặc Router config
214
- - 2. Khai báo quyền (access permissions) cho menu item mới
215
- - 3. Áp dụng chuẩn API hook tương ứng
216
- refs:
217
- - src/routes/_app.tsx#SidebarNavigation
218
- - src/config/permissions.ts#UserRoles
219
-
220
- # --- HARD BUG: CA BỆNH KHÓ NHẰN ---------
221
- - id: rerender-infinite-loop
222
- type: Hard Bug
223
- status: Active
224
- tags: [react, use-effect, leak]
225
- cause: "Fetch data trực tiếp bên trong useEffect mà dependency bị thay đổi tham chiếu liên tục"
226
- fix: "Sử dụng custom hook có sẵn hoặc bọc hàm bằng useCallback trước khi truyền vào useEffect"
227
- refs:
228
- - src/hooks/useAutoFetch.ts
229
-
230
- # --- CONVENTION: QUY BẰNG CẤM HOẶC BẮT BUỘC ---------
231
- - id: axios-only
232
- type: Convention
233
- status: Active
234
- steps:
235
- - Cấm tuyệt đối dùng fetch() hay axios mốc rỗng
236
- - Luôn import httpClient tích hợp sẵn token từ src/services/
237
- refs:
238
- - src/services/httpClient.ts
239
- ```
240
-
241
- ---
242
-
243
- ## Execution Steps — The `/learn` Lifecycle
244
-
245
- Bất kỳ lúc nào người dùng gõ `/learn`, `./qk-project-memory`, hoặc sau khi hoàn tất một task phức tạp có tham số yêu cầu ghi nhớ, Agent PHẢI tuân thủ theo 4 bước khép kín:
246
-
247
- ### Bước 1: Trả lời Câu Hỏi Lọc (Filtering Question)
248
- AI tự hỏi và đối chiếu: *"Task/Sự kiện vừa rồi có thuộc 1 trong 4 loại (Architecture, Convention, Pattern, Hard Bug) và có giá trị giảm thời gian cho task tương lai không?"*
249
- - Nếu **KHÔNG** (lỗi typo, trang trí CSS, CRUD đơn giản, sửa text): Trả về `DISMISSED: "Không phát hiện tri thức kiến trúc/bug khó giá trị dài hạn. Đã bỏ qua để giữ sạch bộ nhớ."` -> **Dừng lại ngay.**
250
- - Nếu **CÓ**: Sang Bước 2.
251
-
252
- ### Bước 2: Chuẩn Bị Bản Đề Xuất (Draft Proposal)
253
- AI tóm tắt nội dung tri thức dưới chuẩn đinh dạc của `index.yaml` (với 4 loại và trường `steps` / `cause-fix`).
254
- - Đối chiếu trong `index.yaml` xem có từ khóa/id trùng lặp hay không để chuẩn bị ghi chú `[Mới]` hoặc `[Cập nhật -> Archived cũ]`.
255
-
256
- ### Bước 3: Phê Duyệt Của Con Người (Human Approval - Bắt Buộc)
257
- Trình bày rõ trước người dùng trên chat:
258
- ```markdown
259
- 💡 [AI Skin Project Memory]: Phát hiện tri thức mới đáng ghi nhớ cho dự án.
260
- Đề xuất ghi vào `.ai-local/knowledge/index.yaml`:
261
-
262
- ... (Nội dung YAML tóm tắt) ...
263
-
264
- 👉 **Bạn có muốn xác nhận cập nhật tri thức này không? (Đồng ý / Chỉnh sửa / Bỏ qua)**
265
- ```
266
-
267
- ### Bước 4: Thực Thi Cập Nhật (Commit)
268
- - Sau khi được Người dùng xác nhận: Dùng tool (ví dụ `replace_file_content` hoặc `write_to_file`) để chèn thông tin mới vào `index.yaml` (hoặc `AGENTS.md` nếu chỉnh sơ đồ kiến trúc).
269
- - Báo cáo hoàn tất chu trình Ghi nhớ!
270
-
271
- ---
272
-
273
- ## 5. Bảng Exit Codes
274
-
275
- | Code | Ý Nghĩa | Hành Động Kế Tiếp |
276
- |------|---------|--------------------|
277
- | SUCCESS | Đã lưu hoặc đọc tri thức hợp lệ từ `index.yaml` / `AGENTS.md` | Hoàn thành |
278
- | BLOCKED | Đề xuất tri thức bị Người dùng từ chối (Hoặc thiếu quyền truy xuất file) | Không thay đổi bộ nhớ |
279
- | DISMISSED | Thao tác không thỏa mãn 4 tiêu chí lọc V1 (Chỉ là typo, css vặt) | Bỏ qua ghi nhớ nhằm sạch hệ thống |
280
- | FAILED | File bộ nhớ sai định dạng cú pháp YAML hoặc vi phạm giới hạn 100 dòng | Yêu cầu sửa/reset cấu trúc file |
281
-
282
- ---
283
-
284
- ## Prompt Template
285
-
286
- ```
287
- Lệnh: [/learn hoặc tra cứu tri thức]
288
- Tri thức: [Tóm tắt pattern, convention, kiến trúc, hoặc hard bug vừa xử lý]
289
- File liên quan:[Đường dẫn tương đối: vd: src/services/apiClient.ts]
290
- Mục đích: [Giúp AI trong tương lai không lặp lại lỗi hoặc mở đúng file]
291
- ```
292
-
293
- ### Ví dụ thao tác:
294
-
295
- **Lưu một Hard Bug vừa xử lý xong**
296
- ```
297
- Lệnh: /learn
298
- Tri thức: Hard Bug: Lỗi hydration mismatch trong Next.js do dùng new Date() trực tiếp trong component render.
299
- Khắc phục: Dùng useEffect để set client date hoặc dùng thư viện suppressHydrationWarning.
300
- File: src/components/HeaderClock.tsx
301
- ```
302
- → AI chuẩn bị bản draft YAML đề xuất theo chuẩn `index.yaml` và hỏi người dùng phê duyệt trước khi commit vào `.ai-local/knowledge/index.yaml`.
303
-
@@ -1,23 +0,0 @@
1
- # Auto-generated from SKILL.md frontmatter
2
- schema_version: 1
3
- id: "qk-project-memory"
4
- version: "9.1.0"
5
- description: "Lưu trữ và truy xuất ngữ cảnh dự án dài hạn — chỉ lưu fact đã xác minh, không lưu giả thuyết."
6
- tools:
7
- - "filesystem"
8
- - "terminal"
9
- knowledge:
10
- owns:
11
- - "project-facts"
12
- - "verified-context"
13
- references:
14
- - "architecture"
15
- - "security"
16
- - "anti-patterns"
17
- eval:
18
- scorecard: "evals/scorecard.yaml"
19
- decision_boundary:
20
- owns:
21
- - "qk-project-memory"
22
- does_not_own: []
23
- conflicts_with: []
@@ -1,27 +0,0 @@
1
- name: qk-project-memory-eval
2
- description: Đánh giá quá trình lưu trữ và truy xuất ngữ cảnh dài hạn (Project Memory)
3
- version: 9.1.0
4
- threshold: 85 # Yêu cầu độ chính xác cao khi ghi đè hoặc lưu trữ để tránh ảo giác
5
-
6
- metrics:
7
- - id: fact_verification
8
- name: Chỉ lưu trữ Sự thật (Fact), không lưu Giả thuyết
9
- description: Agent có kiểm chứng thông tin qua source code trước khi lưu vào Memory không?
10
- weight: 40
11
- criteria:
12
- - Tuyệt đối không lưu các giả định (assumptions) hoặc fact có Confidence LOW (20đ)
13
- - Có bằng chứng (file:line) đính kèm khi ghi dữ liệu (20đ)
14
-
15
- - id: zero_trust_memory
16
- name: An toàn dữ liệu trong Memory (Zero Trust)
17
- description: Agent có vô tình lưu thông tin nhạy cảm vào Memory không?
18
- weight: 35
19
- criteria:
20
- - KHÔNG lưu trữ PII, API Keys, raw JWTs hay credentials dưới dạng clear text (35đ)
21
-
22
- - id: ui_diversification
23
- name: Áp dụng UI Diversification
24
- description: Có lưu và kiểm tra lịch sử thiết kế để tránh UI lặp lại nhàm chán không?
25
- weight: 25
26
- criteria:
27
- - Đọc và ghi đúng vào file `ui-diversification.json` để ngăn chặn trùng lặp theme/macrostructure (25đ)
@@ -1,243 +0,0 @@
1
- ---
2
- name: qk-refactor
3
- version: 9.2.0
4
- status: stable
5
- description: "Tái cấu trúc code để dễ bảo trì, dễ test hơn — không thay đổi external behavior. Dùng skill này khi user nhắc đến: refactor, tái cấu trúc, tách file, extract function/component/module, clean code, reduce complexity, file quá dài, God class, quá nhiều responsibilities — kể cả khi chỉ nói \"file này lộn xộn quá\"."
6
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
7
-
8
- type: capability
9
-
10
- intent:
11
- - refactoring
12
- - code-cleanup
13
- - complexity-reduction
14
-
15
- complexity:
16
- level: medium
17
- criteria:
18
- files_affected: "2-5"
19
- has_behavior_change: false
20
- has_external_dependency: false
21
- has_breaking_change: false
22
-
23
- triggers:
24
- - "refactor"
25
- - "tái cấu trúc"
26
- - "tách file"
27
- - "extract function/component/module"
28
- - "clean code"
29
- - "reduce complexity"
30
- - "file quá dài"
31
- - "God class"
32
- - "quá nhiều responsibilities"
33
-
34
-
35
- selection:
36
- priority: medium
37
- confidence_threshold: 0.80
38
-
39
- workflow: refactor
40
-
41
- rules:
42
- - global
43
- - coding
44
- - safety
45
-
46
- tools:
47
- - filesystem
48
- - terminal
49
-
50
- related_skills:
51
- - qk-code-review
52
- - qk-project-health
53
-
54
- knowledge_scope:
55
- owns:
56
- - refactoring-patterns
57
- - code-smells
58
- references:
59
- - architecture
60
- - coding-standards
61
-
62
- verification:
63
- required: true
64
- strategy: refactor
65
-
66
- examples: []
67
- learnings: []
68
-
69
- execution_mode: deterministic
70
- cost: medium
71
- latency: medium
72
- risk: medium
73
- side_effects: edit_files
74
- produces: [code, report]
75
- consumes: [source-code]
76
-
77
- token_budget:
78
- max_files_read: 3
79
- max_lines_per_read: 150
80
- max_shell_commands: 2
81
- stop_early: true
82
-
83
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
84
- ---
85
-
86
- # qk-refactor - Safe Refactor
87
-
88
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
89
-
90
- Chịu trách nhiệm tái cấu trúc mã nguồn để tăng khả năng bảo trì, giảm độ phức tạp và tăng tính kiểm thử mà **TUYỆT ĐỐI KHÔNG làm thay đổi hành vi bên ngoài (External Behavior)**.
91
-
92
- ---
93
-
94
- ## Preconditions
95
-
96
- Trước khi tái cấu trúc bất kỳ file nào, AI BẮT BUỘC kiểm tra:
97
-
98
- - [ ] Xác định rõ mục tiêu refactor (tách file, giảm cognitive complexity, khử duplication, áp dụng Design Pattern).
99
- - [ ] Xác định public contracts (functions, classes, API routes, props) cần giữ nguyên vẹn.
100
- - [ ] Kiểm tra hệ thống test hiện có: có tests để verify behavior không?
101
- - [ ] Nếu yêu cầu refactor kèm theo thay đổi nghiệp vụ hoặc đổi behavior:
102
- → **EXIT: BLOCKED**
103
- → Báo cáo user: Tách riêng việc refactor (qk-refactor) và việc đổi tính năng (qk-feature-delivery).
104
-
105
- ---
106
-
107
- ## Scope
108
-
109
- ✅ Skill này làm:
110
- - Trích xuất hàm, component, custom hooks hoặc helper modules (Extract method/module).
111
- - Giảm độ phức tạp cyclomatic (lồng if/else sâu, switch case khổng lồ).
112
- - Khử trùng lặp mã nguồn (DRY) mà không tạo ra over-abstraction gượng ép.
113
- - Tối ưu đặt tên biến, hàm theo đúng quy ước sạch (Clean Code).
114
- - Bảo đảm 100% backward compatibility với các consumer của module.
115
-
116
- ❌ Skill này KHÔNG làm:
117
- - Sửa đổi business logic hoặc thay đổi đầu ra mong đợi của hệ thống.
118
- - Viết tính năng mới ngoài lề trong quá trình refactor.
119
- - Tự ý thay đổi schema cơ sở dữ liệu (→ `qk-data-lifecycle`).
120
-
121
- ---
122
-
123
- ## Execution Steps
124
-
125
- ### Step 1 — Current State & Contract Lock
126
- ```
127
- Inputs: Mã nguồn mục tiêu, Public interface
128
- Actions:
129
- - Phân tích luồng thực thi và các điểm vào/ra (inputs/outputs, exceptions).
130
- - Khóa (lock) contract công khai: không thay đổi signature của exported functions/components.
131
- - Kiểm tra test coverage hiện có (nếu có).
132
- Output: Refactor Safety Boundary
133
- ```
134
-
135
- ### Step 2 — Incremental Transformation
136
- ```
137
- Inputs: Target code, Safety boundary
138
- Actions:
139
- - Tách nhỏ từng phần (baby steps): trích xuất hàm con, module độc lập.
140
- - Thay thế cấu trúc lồng ghép bằng Guard Clauses (early return).
141
- - Di chuyển các helper/utility sang vị trí phù hợp theo kiến trúc dự án.
142
- Output: Refactored code
143
- ```
144
-
145
- ### Step 3 — Verification & Equivalence Check
146
- ```
147
- Inputs: Refactored code, Original tests
148
- Actions:
149
- - Chạy linter và typecheck: 0 type errors, 0 lint warnings.
150
- - Chạy tests để xác nhận tính tương đương hành vi (behavior equivalence).
151
- - So sánh diff để đảm bảo không xóa nhầm logic hay import.
152
- Exit: SUCCESS nếu code sạch hơn, pass linter/types và giữ nguyên behavior.
153
- ```
154
-
155
- ---
156
-
157
- ## Prompt Template
158
-
159
- AI đọc `DEV_PROFILE.md` để biết conventions. Mô tả vấn đề — AI đọc code thật trước khi refactor.
160
-
161
- ```
162
- Target: [File / module / function cần refactor — đường dẫn cụ thể]
163
- Vấn đề: [Code đang gây ra vấn đề gì — quá dài / khó test / lặp lại / ...]
164
- Mục tiêu: [Muốn đạt được gì sau refactor]
165
- Giữ nguyên: [Public interface / behavior / test cases không được đổi]
166
- ```
167
-
168
- ---
169
-
170
- ### Theo Role — AI refactor theo chiều sâu khác nhau:
171
-
172
- **role: fe**
173
- ```
174
- Target: src/pages/CheckoutPage.tsx (380 dòng)
175
- Vấn đề: Một file trộn lẫn: form state, API calls, validation, UI rendering,
176
- cart calculation — không test được, không reuse được
177
- Mục tiêu: Tách thành: CheckoutPage (UI) + useCheckout (logic hook) +
178
- checkoutSchema (validation) + cartUtils (calculation)
179
- Giữ nguyên: Props interface của CheckoutPage không đổi, behavior submit không đổi
180
- ```
181
- → AI refactor: custom hook extraction pattern, co-location vs separation of concerns,
182
- memoization opportunities (useMemo/useCallback), type narrowing sau khi tách.
183
-
184
- **role: be**
185
- ```
186
- Target: src/services/OrderService.ts (420 dòng)
187
- Vấn đề: God class — xử lý: tạo order, tính giá, gửi email, update inventory,
188
- generate invoice — vi phạm SRP, unit test không isolate được
189
- Mục tiêu: Tách ra theo domain: PricingService, InventoryService, NotificationService,
190
- OrderService chỉ orchestrate
191
- Giữ nguyên: Public method signatures của OrderService, không đổi DB transactions
192
- ```
193
- → AI refactor: dependency injection pattern, service boundary design,
194
- transaction scope sau khi tách (vẫn cần atomic), interface extraction cho testability.
195
-
196
- **role: fullstack**
197
- ```
198
- Target: src/features/products/ (toàn bộ folder)
199
- Vấn đề: Feature folder có: API route, DB query, FE component, type definitions
200
- — tất cả trong cùng 1 file products.ts (550 dòng)
201
- Mục tiêu: Feature-based architecture: products/api.ts, products/db.ts,
202
- products/components/, products/types.ts, products/hooks.ts
203
- Giữ nguyên: Import paths của các file khác đang dùng products types
204
- ```
205
- → AI refactor: barrel exports để preserve import paths, layer separation
206
- (presentation/business/data), shared types location, circular dependency check.
207
-
208
- **role: data**
209
- ```
210
- Target: transforms/order_metrics.sql (250 dòng)
211
- Vấn đề: SQL monolith — một query tính tất cả metrics, không reusable,
212
- debug khó, CTE lồng nhau 6 cấp
213
- Mục tiêu: Tách thành dbt models: stg_orders, int_order_items, fct_order_metrics
214
- Mỗi model làm đúng một việc
215
- Giữ nguyên: Output schema của fct_order_metrics không đổi (downstream depends on it)
216
- ```
217
- → AI refactor: dbt model layering (staging/intermediate/mart), ref() dependencies,
218
- incremental model strategy, documentation + schema.yml generation.
219
-
220
- **role: ai-engineer**
221
- ```
222
- Target: agents/rag_agent.py (300 dòng)
223
- Vấn đề: Monolithic RAG function — embed + retrieve + rerank + generate
224
- tất cả trong 1 hàm, không thể A/B test từng component
225
- Mục tiêu: Tách thành pipeline: Retriever, Reranker, Generator — mỗi class
226
- có interface rõ ràng, swap được implementation
227
- Giữ nguyên: Input/output interface của rag_agent() không đổi
228
- ```
229
- → AI refactor: Strategy pattern cho từng pipeline stage, dependency injection
230
- cho model/embedding, eval hooks tại từng stage, config-driven pipeline.
231
-
232
- **role: devops**
233
- ```
234
- Target: .github/workflows/deploy.yml (200 dòng)
235
- Vấn đề: Một workflow file làm tất cả: test + build + push image + deploy staging
236
- + deploy prod + notify — không reusable, khó debug khi fail
237
- Mục tiêu: Tách thành reusable workflows: test.yml, build-push.yml,
238
- deploy.yml (reusable), notify.yml — orchestrated từ main.yml
239
- Giữ nguyên: Trigger conditions và environment variables không đổi
240
- ```
241
- → AI refactor: GitHub reusable workflows pattern (workflow_call),
242
- matrix strategy cho multi-env deploy, secret scoping per environment,
243
- concurrency groups để tránh parallel deploys.
@@ -1,26 +0,0 @@
1
- schema_version: 1
2
- id: "qk-refactor"
3
- version: "9.1.0"
4
- description: "Tái cấu trúc và dọn dẹp mã nguồn để dễ bảo trì hơn mà không làm thay đổi logic hoạt động bên ngoài."
5
- dependencies:
6
- - "refactor"
7
- tools:
8
- - "filesystem"
9
- - "terminal"
10
- knowledge:
11
- owns:
12
- - "refactoring-patterns"
13
- - "code-smells"
14
- references:
15
- - "architecture"
16
- - "coding-standards"
17
- eval:
18
- scorecard: "evals/scorecard.yaml"
19
- decision_boundary:
20
- owns:
21
- - "refactoring-patterns"
22
- does_not_own:
23
- - "new-functionality"
24
- - "api-changes"
25
- conflicts_with: []
26
- delegates_to: []
@@ -1,27 +0,0 @@
1
- name: qk-refactor-eval
2
- description: Đánh giá an toàn và hiệu quả của tiến trình Refactor
3
- version: 9.1.0
4
- threshold: 90 # Yêu cầu an toàn rất cao, refactor không được làm hỏng tính năng
5
-
6
- metrics:
7
- - id: behavior_preservation
8
- name: Bảo toàn Logic (Behavior Preservation)
9
- description: Tái cấu trúc có làm thay đổi logic hoạt động hoặc API public không?
10
- weight: 40
11
- criteria:
12
- - Tuyệt đối không thêm tính năng mới trong quá trình refactor (20đ)
13
- - Không thay đổi chữ ký (signature) của các public API (20đ)
14
-
15
- - id: test_coverage_precondition
16
- name: Tiền điều kiện Kiểm thử (Tests)
17
- description: Agent có từ chối refactor nếu không có Tests bảo vệ không?
18
- weight: 35
19
- criteria:
20
- - Chặn (BLOCKED) và yêu cầu viết test nếu code chưa có coverage (35đ)
21
-
22
- - id: complexity_reduction
23
- name: Giảm Độ phức tạp (Complexity Reduction)
24
- description: Kết quả refactor có thực sự làm code sạch và dễ bảo trì hơn không?
25
- weight: 25
26
- criteria:
27
- - Tách hàm, loại bỏ code chết, giảm cyclomatic complexity rõ rệt (25đ)