ai-developer-skill-os 8.2.1 → 8.3.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 (78) hide show
  1. package/.agents/LICENSE +21 -21
  2. package/.agents/README.md +90 -90
  3. package/.agents/docs/CHI_TIET_SKILLS.md +125 -125
  4. package/.agents/docs/MIGRATION-CLEANUP-V8.1.3.md +36 -36
  5. package/.agents/docs/MIGRATION-STATUS.md +35 -35
  6. package/.agents/docs/MIGRATION-V8.md +10 -10
  7. package/.agents/docs/V8-CERTIFICATION.md +27 -27
  8. package/.agents/docs/decisions/ADR-001-v8-migration.md +58 -58
  9. package/.agents/docs/decisions/ADR-002-workflow-separation.md +50 -50
  10. package/.agents/docs/decisions/ADR-003-registry-generated.md +54 -54
  11. package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +27 -27
  12. package/.agents/registry/graph.json +4 -8
  13. package/.agents/registry/index.yaml +3 -4
  14. package/.agents/registry/skills-index.yml +525 -525
  15. package/.agents/rules/coding.md +10 -0
  16. package/.agents/rules/command-safety.md +37 -14
  17. package/.agents/rules/priorities.yml +13 -2
  18. package/.agents/rules/security.md +47 -7
  19. package/.agents/rules/skill-quality.md +32 -8
  20. package/.agents/skills/_template/SKILL.md +133 -132
  21. package/.agents/skills/_template/capability.yaml +20 -20
  22. package/.agents/skills/_template/evals/scorecard.yaml +19 -19
  23. package/.agents/skills/qk-access-policy/SKILL.md +4 -1
  24. package/.agents/skills/qk-agent-observability/SKILL.md +111 -0
  25. package/.agents/skills/qk-agent-observability/references/scorecard.yaml +80 -0
  26. package/.agents/skills/qk-ai-builder/SKILL.md +74 -5
  27. package/.agents/skills/qk-api-lifecycle/SKILL.md +4 -2
  28. package/.agents/skills/qk-bug-resolution/SKILL.md +3 -21
  29. package/.agents/skills/qk-code-review/SKILL.md +188 -186
  30. package/.agents/skills/qk-context-loader/SKILL.md +3 -11
  31. package/.agents/skills/qk-data-lifecycle/SKILL.md +6 -1
  32. package/.agents/skills/qk-db-optimizer/SKILL.md +3 -2
  33. package/.agents/skills/qk-design-system-engineering/SKILL.md +235 -112
  34. package/.agents/skills/qk-devops-platform/SKILL.md +241 -117
  35. package/.agents/skills/qk-docs/SKILL.md +3 -1
  36. package/.agents/skills/qk-engineering-standard/SKILL.md +4 -75
  37. package/.agents/skills/qk-engineering-standard/references/anti-patterns.md +121 -0
  38. package/.agents/skills/qk-engineering-standard/rules/frontend.md +1 -1
  39. package/.agents/skills/qk-fe-api-integration/SKILL.md +13 -32
  40. package/.agents/skills/qk-feature-delivery/SKILL.md +53 -221
  41. package/.agents/skills/qk-frontend-architecture/SKILL.md +258 -134
  42. package/.agents/skills/qk-help/SKILL.md +21 -159
  43. package/.agents/skills/qk-orchestrator/SKILL.md +2 -34
  44. package/.agents/skills/qk-orchestrator/references/routing-table.md +15 -3
  45. package/.agents/skills/qk-product-specification/SKILL.md +253 -130
  46. package/.agents/skills/qk-production-release/SKILL.md +31 -66
  47. package/.agents/skills/qk-project-bootstrap/SKILL.md +58 -7
  48. package/.agents/skills/qk-project-health/SKILL.md +4 -2
  49. package/.agents/skills/qk-project-memory/SKILL.md +3 -1
  50. package/.agents/skills/qk-security-audit/SKILL.md +259 -135
  51. package/.agents/skills/qk-system-evolution/SKILL.md +17 -67
  52. package/.agents/skills/qk-test-engineering/SKILL.md +262 -139
  53. package/.agents/skills/qk-ui-audit/SKILL.md +16 -89
  54. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +2 -2
  55. package/.agents/skills/qk-ui-builder/SKILL.md +482 -509
  56. package/.agents/skills/qk-ui-builder/references/component-cookbook.md +455 -1191
  57. package/.agents/skills/qk-ui-system-builder/SKILL.md +1 -5
  58. package/.agents/skills/qk-validation-gate/SKILL.md +0 -74
  59. package/.agents/skills/qk-web-quality-gate/SKILL.md +232 -114
  60. package/.agents/workflows/_schema.yml +146 -109
  61. package/.agents/workflows/bug-resolution.yml +121 -101
  62. package/.agents/workflows/code-review.yml +93 -77
  63. package/.agents/workflows/documentation.yml +90 -75
  64. package/.agents/workflows/feature-delivery.yml +120 -103
  65. package/.agents/workflows/refactor.yml +99 -81
  66. package/.agents/workflows/research.yml +75 -60
  67. package/.agents/workflows/security-audit.yml +115 -72
  68. package/.agents/workflows/skill-evolution.yml +97 -65
  69. package/.agents/workflows/spec-driven-development.yml +87 -57
  70. package/README.md +90 -90
  71. package/bin/install.js +330 -180
  72. package/package.json +2 -2
  73. package/.agents/CHANGELOG.md +0 -131
  74. package/.agents/learnings/draft/README.md +0 -37
  75. package/.agents/reports/RELEASE-CHECKLIST.md +0 -29
  76. package/.agents/reports/architecture-audit.md +0 -13
  77. package/.agents/reports/graph-health.md +0 -20
  78. package/.agents/reports/skill-audit.md +0 -215
@@ -1,186 +1,188 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-code-review
4
- version: 8.0.0
5
- status: stable
6
- description: "Elite AI/Code Review System: Kiểm toán, Review code và cấu hình AI với tư duy Architect, áp dụng 4-Phase Review."
7
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
-
9
- # ── V8: Classification ─────────────────────────────────────
10
- type: utility
11
-
12
- intent:
13
- - code-review
14
- - quality-assurance
15
- - architecture-review
16
- - ai-config-audit
17
-
18
- complexity:
19
- level: high
20
- criteria:
21
- files_affected: "1-15"
22
- has_behavior_change: false
23
- has_external_dependency: false
24
- has_breaking_change: false
25
-
26
- triggers:
27
- - "review code"
28
- - "code review"
29
- - "kiểm tra code"
30
- - "đánh giá code"
31
- - "review skin"
32
- - "review rule"
33
- - "review ai"
34
-
35
- selection:
36
- priority: high
37
- confidence_threshold: 0.85
38
-
39
- # ── V8: References ─────────────────────────────────────────
40
- workflow: code-review
41
-
42
- rules:
43
- - global
44
-
45
- tools:
46
- - filesystem
47
-
48
- related_skills:
49
- - qk-validation-gate
50
- - qk-engineering-standard
51
- - qk-project-health
52
-
53
- knowledge_scope:
54
- owns:
55
- - code-review-standards
56
- - ai-configuration-review
57
- - feedback-delivery
58
- references:
59
- - architecture
60
- - security-best-practices
61
-
62
- # ── V8: Verification ───────────────────────────────────────
63
- verification:
64
- required: true
65
- strategy: review
66
-
67
- # ── V8: Knowledge links ────────────────────────────────────
68
- examples: []
69
- learnings: []
70
-
71
- # ── V7 Runtime ─────────────────────────────────────────────
72
- execution_mode: deterministic
73
- cost: high
74
- latency: medium
75
- risk: low
76
- side_effects: read_only
77
- produces: [report]
78
- consumes: [source-code, rules, workflows]
79
-
80
- token_budget:
81
- max_files_read: 10
82
- max_lines_per_read: 300
83
- max_shell_commands: 2
84
- stop_early: true
85
-
86
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
87
- ---
88
-
89
- # qk-code-review — Elite Review System
90
-
91
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
92
-
93
- Biến quá trình Code Review từ "bắt bẻ" (gatekeeping) thành "chia sẻ tri thức" (knowledge sharing) thông qua phản hồi mang tính xây dựng, phân tích có hệ thống và hợp tác cải tiến.
94
-
95
- ---
96
-
97
- ## Preconditions
98
-
99
- - [ ] Xác định rõ đối tượng cần review: Mã nguồn phần mềm (React, Java, etc.) hay Cấu hình AI (Skin, Rules, Workflows).
100
- - [ ] Cung cấp ngữ cảnh hoặc mục tiêu của đoạn code/cấu hình cần review.
101
-
102
- ```
103
- On missing precondition → EXIT: BLOCKED
104
- Report: "Missing: Vui lòng cung cấp ngữ cảnh hoặc chỉ định rõ file cần review."
105
- ```
106
-
107
- ---
108
-
109
- ## Dynamic Context Loading (Tải Ngữ Cảnh Động)
110
-
111
- > **CHỈ ĐỌC KHI CẦN (on-demand):** Chỉ mở file references/ nếu có vấn đề cụ thể cần xác minh. Đừng đọc trước khi chưa thấy vấn đề.
112
-
113
- - **Nếu review AI Config** và phát hiện vấn đề schema/anti-pattern → đọc `references/ai/v8-schema-validation.md` HOẶC `references/ai/ai-anti-patterns.md` (không cần đọc cả 2 nếu không liên quan).
114
- - **Nếu review Code** và gặp vấn đề ngôn ngữ cụ thể → đọc `references/languages/[tên-ngôn-ngữ].md`.
115
- - **Nếu review cross-cutting** và cần xác minh architecture → đọc `references/cross-cutting/architecture-review-guide.md`.
116
- - **Default (80% trường hợp):** Dùng kiến thức sẵn, không đọc references.
117
-
118
- ---
119
-
120
- ## 4-Phase Review Process
121
-
122
- Là một AI Architect, quá trình review phải tuân thủ nghiêm ngặt 4 giai đoạn sau:
123
-
124
- ### Phase 1: Context Gathering & Loading (Thu thập & Nạp Ngữ Cảnh)
125
- - Đọc file tả (PR, Issue) hoặc yêu cầu của người dùng.
126
- - **Thực thi Dynamic Context Loading** (đọc các file reference cần thiết như đã định nghĩa ở trên).
127
-
128
- ### Phase 2: High-Level Review (Kiến trúc & Chuẩn mực)
129
- - **Đối với AI Config:** Kiểm tra cấu trúc V8 (Identity, Intent, Complexity, Triggers).
130
- - **Đối với Code Phần mềm:** Kiểm tra SOLID, Coupling/Cohesion, Performance, Security (Tham chiếu theo `cross-cutting` guides).
131
-
132
- ### Phase 3: Deep-dive & Logic Review (Phân tích chi tiết)
133
- - **Đối với AI Config:** Kiểm tra rủi ro "ảo giác" (hallucination), token abuse, side-effects, stop_early.
134
- - **Đối với Code Phần mềm:** soát edge cases, lỗi logic chuyên sâu theo từng ngôn ngữ (Tham chiếu theo `languages` guides).
135
-
136
- ### Phase 4: Summary & Decision (Tổng hợp & Quyết định)
137
- - Đưa ra báo cáo theo `Output Format`.
138
- - Gắn nhãn `Severity Tags` rõ ràng.
139
-
140
- ---
141
-
142
- ## Feedback Principles (Nguyên tắc Phản hồi)
143
-
144
- - **Collaborative Language (Ngôn từ hợp tác)**: Thay vì ra lệnh ("Sửa cái này thành X", "Bỏ dòng này đi"), hãy dùng câu hỏi gợi mở ("Nếu chúng ta dùng X ở đây thì có tối ưu hiệu năng hơn không?", "Có vẻ logic này bị lặp, chúng ta extract nó ra hàm riêng được không?").
145
- - **Differentiate Severity (Phân biệt mức độ)**: Bắt buộc sử dụng các nhãn sau để phân loại mức độ phản hồi:
146
- - 🔴 `[blocking]` - Lỗi nghiêm trọng (VD: Security flaw, thiếu token_budget). Bắt buộc phải sửa.
147
- - 🟡 `[important]` - Lỗi quan trọng (VD: Performance leak, trigger quá rộng). Nên sửa hoặc cần thảo luận.
148
- - 🟢 `[nit]` - Cải thiện nhỏ (VD: Lỗi chính tả, format, naming). Không bắt buộc.
149
- - 💡 `[suggestion]` - Cách tiếp cận hoặc thư viện thay thế để tham khảo.
150
- - 📚 `[learning]` - Giải thích nguyên (Why) để chia sẻ kiến thức, không yêu cầu hành động.
151
- - 🎉 `[praise]` - Lời khen cho đoạn code / logic thiết kế tốt.
152
-
153
- ---
154
-
155
- ## Output Format
156
-
157
- ```markdown
158
- ## qk-code-review Report
159
- ─────────────────────────────────────────────────
160
- **Target:** [Tên file / Chức năng]
161
- **Status:** SUCCESS | BLOCKED | FAILED | PARTIAL
162
-
163
- ### 📊 Executive Summary
164
- [1-2 câu tóm tắt chất lượng tổng thể của mã nguồn/cấu hình. VD: "Kiến trúc rõ ràng, nhưng tiềm ẩn rủi ro lặp vô hạn ở dòng 45."]
165
-
166
- ### 🔍 Findings & Recommendations
167
-
168
- [Nhóm các findings theo mức độ nghiêm trọng giảm dần. LUÔN đính kèm snippet / file line nếu có thể]
169
-
170
- - 🔴 `[blocking]`: [Vấn đề nghiêm trọng]
171
- - *Location*: `file.ts:L45`
172
- - *Feedback*: [Câu hỏi/Gợi ý sửa chữa]
173
-
174
- - 🟡 `[important]`: [Vấn đề quan trọng]
175
- - 💡 `[suggestion]`: [Gợi ý cải thiện]
176
- - 🟢 `[nit]`: [Góp ý nhỏ]
177
- - 🎉 `[praise]`: [Khen ngợi]
178
-
179
- ### 🛠️ Suggested Fixes (Optional)
180
- [Cung cấp Code diff hoặc YAML chuẩn xác để user dễ dàng copy & paste. TUYỆT ĐỐI KHÔNG tự sửa file nếu user chưa yêu cầu]
181
-
182
- ### ✅ Verdict
183
- - [ ] Approve (Có thể merge/deploy ngay)
184
- - [ ] Changes Requested (Cần sửa các mục `[blocking]`)
185
- - [ ] Comment (Chỉ gợi ý, quyền quyết định ở user)
186
- ```
1
+ ---
2
+ # ── Identity ───────────────────────────────────────────────
3
+ name: qk-code-review
4
+ version: 8.0.0
5
+ status: stable
6
+ description: "Elite AI/Code Review System: Kiểm toán, Review code và cấu hình AI với tư duy Architect, áp dụng 4-Phase Review."
7
+ platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
+
9
+ # ── V8: Classification ─────────────────────────────────────
10
+ type: utility
11
+
12
+ intent:
13
+ - code-review
14
+ - quality-assurance
15
+ - architecture-review
16
+ - ai-config-audit
17
+
18
+ complexity:
19
+ level: high
20
+ criteria:
21
+ files_affected: "1-15"
22
+ has_behavior_change: false
23
+ has_external_dependency: false
24
+ has_breaking_change: false
25
+
26
+ triggers:
27
+ - "review code"
28
+ - "code review"
29
+ - "kiểm tra code"
30
+ - "đánh giá code"
31
+ - "review skin"
32
+ - "review rule"
33
+ - "review ai"
34
+
35
+ selection:
36
+ priority: high
37
+ confidence_threshold: 0.85
38
+
39
+ # ── V8: References ─────────────────────────────────────────
40
+ workflow: code-review
41
+
42
+ rules:
43
+ - global
44
+
45
+ tools:
46
+ - filesystem
47
+
48
+ related_skills:
49
+ - qk-validation-gate
50
+ - qk-engineering-standard
51
+ - qk-project-health
52
+
53
+ knowledge_scope:
54
+ owns:
55
+ - code-review-standards
56
+ - ai-configuration-review
57
+ - feedback-delivery
58
+ references:
59
+ - architecture
60
+ - security
61
+ - anti-patterns
62
+
63
+ # ── V8: Verification ───────────────────────────────────────
64
+ verification:
65
+ required: true
66
+ strategy: review
67
+
68
+ # ── V8: Knowledge links ────────────────────────────────────
69
+ examples: []
70
+ learnings: []
71
+
72
+ # ── V7 Runtime ─────────────────────────────────────────────
73
+ execution_mode: deterministic
74
+ cost: high
75
+ latency: medium
76
+ risk: low
77
+ side_effects: read_only
78
+ produces: [report]
79
+ consumes: [source-code, rules, workflows]
80
+
81
+ token_budget:
82
+ max_files_read: 10
83
+ max_lines_per_read: 300
84
+ max_shell_commands: 2
85
+ stop_early: true
86
+
87
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
88
+ ---
89
+
90
+ # qk-code-review — Elite Review System
91
+
92
+ > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
93
+
94
+ Biến quá trình Code Review từ "bắt bẻ" (gatekeeping) thành "chia sẻ tri thức" (knowledge sharing) thông qua phản hồi mang tính xây dựng, phân tích có hệ thống và hợp tác cải tiến.
95
+
96
+ ---
97
+
98
+ ## Preconditions
99
+
100
+ - [ ] Xác định đối tượng cần review: nguồn phần mềm (React, Java, etc.) hay Cấu hình AI (Skin, Rules, Workflows).
101
+ - [ ] Cung cấp ngữ cảnh hoặc mục tiêu của đoạn code/cấu hình cần review.
102
+
103
+ ```
104
+ On missing precondition EXIT: BLOCKED
105
+ Report: "Missing: Vui lòng cung cấp ngữ cảnh hoặc chỉ định rõ file cần review."
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Dynamic Context Loading (Tải Ngữ Cảnh Động)
111
+
112
+ > **CHỈ ĐỌC KHI CẦN (on-demand):** Chỉ mở file references/ nếu có vấn đề cụ thể cần xác minh. Đừng đọc trước khi chưa thấy vấn đề.
113
+
114
+ - **Nếu review AI Config** và phát hiện vấn đề schema/anti-pattern → đọc `references/ai/v8-schema-validation.md` HOẶC `references/ai/ai-anti-patterns.md` (không cần đọc cả 2 nếu không liên quan).
115
+ - **Nếu review Code** và gặp vấn đề ngôn ngữ cụ thể → đọc `references/languages/[tên-ngôn-ngữ].md`.
116
+ - **Nếu review cross-cutting** cần xác minh architecture đọc `references/cross-cutting/architecture-review-guide.md`.
117
+ - **Default (80% trường hợp):** Dùng kiến thức có sẵn, không đọc references.
118
+
119
+ ---
120
+
121
+ ## 4-Phase Review Process
122
+
123
+ Là một AI Architect, quá trình review phải tuân thủ nghiêm ngặt 4 giai đoạn sau:
124
+
125
+ ### Phase 1: Context Gathering & Loading (Thu thập & Nạp Ngữ Cảnh)
126
+ - Đọc file tả (PR, Issue) hoặc yêu cầu của người dùng.
127
+ - **Thực thi Dynamic Context Loading** (đọc các file reference cần thiết như đã định nghĩa ở trên).
128
+
129
+ ### Phase 2: High-Level Review (Kiến trúc & Chuẩn mực)
130
+ - **Đối với AI Config:** Kiểm tra cấu trúc V8 (Identity, Intent, Complexity, Triggers).
131
+ - **Đối với Code Phần mềm:** Kiểm tra SOLID, Coupling/Cohesion, Performance, Security. **BẮT BUỘC đối chiếu với luật chống rác mã (R-C-09) và ranh giới Zero-Trust (R-SEC-04). Vi phạm sẽ bị đánh tag `[blocking]`.**
132
+
133
+ ### Phase 3: Deep-dive & Logic Review (Phân tích chi tiết)
134
+ - **Đối với AI Config:** Kiểm tra rủi ro "ảo giác" (hallucination), token abuse, side-effects, stop_early.
135
+ - **Đối với Code Phần mềm:** Rà soát edge cases, lỗi logic chuyên sâu theo từng ngôn ngữ (Tham chiếu theo `languages` guides).
136
+
137
+ ### Phase 4: Summary & Decision (Tổng hợp & Quyết định)
138
+ - Đưa ra báo cáo theo `Output Format`.
139
+ - Gắn nhãn `Severity Tags` rõ ràng.
140
+
141
+ ---
142
+
143
+ ## Feedback Principles (Nguyên tắc Phản hồi)
144
+
145
+ - **Collaborative Language (Ngôn từ hợp tác)**: Thay ra lệnh ("Sửa cái này thành X", "Bỏ dòng này đi"), hãy dùng câu hỏi gợi mở ("Nếu chúng ta dùng X ở đây thì có tối ưu hiệu năng hơn không?", "Có vẻ logic này bị lặp, chúng ta extract nó ra hàm riêng được không?").
146
+ - **Differentiate Severity (Phân biệt mức độ)**: Bắt buộc sử dụng các nhãn sau để phân loại mức độ phản hồi:
147
+ - 🔴 `[blocking]` - Lỗi nghiêm trọng (VD: Security flaw, thiếu token_budget). Bắt buộc phải sửa.
148
+ - 🟡 `[important]` - Lỗi quan trọng (VD: Performance leak, trigger quá rộng). Nên sửa hoặc cần thảo luận.
149
+ - 🟢 `[nit]` - Cải thiện nhỏ (VD: Lỗi chính tả, format, naming). Không bắt buộc.
150
+ - 💡 `[suggestion]` - Cách tiếp cận hoặc thư viện thay thế để tham khảo.
151
+ - 📚 `[learning]` - Giải thích nguyên (Why) để chia sẻ kiến thức, không yêu cầu hành động.
152
+ - 🎉 `[praise]` - Lời khen cho đoạn code / logic thiết kế tốt.
153
+
154
+ ---
155
+
156
+ ## Output Format
157
+
158
+ ```markdown
159
+ ## qk-code-review Report
160
+ ─────────────────────────────────────────────────
161
+ **Target:** [Tên file / Chức năng]
162
+ **Status:** SUCCESS | BLOCKED | FAILED | PARTIAL
163
+
164
+ ### 📊 Executive Summary
165
+ [1-2 câu tóm tắt chất lượng tổng thể của mã nguồn/cấu hình. VD: "Kiến trúc rõ ràng, nhưng tiềm ẩn rủi ro lặp vô hạn ở dòng 45."]
166
+
167
+ ### 🔍 Findings & Recommendations
168
+
169
+ [Nhóm các findings theo mức độ nghiêm trọng giảm dần. LUÔN đính kèm snippet / file line nếu có thể]
170
+
171
+ - 🔴 `[blocking]`: [Vấn đề nghiêm trọng]
172
+ - *Location*: `file.ts:L45`
173
+ - *Feedback*: [Câu hỏi/Gợi ý sửa chữa]
174
+
175
+ - 🟡 `[important]`: [Vấn đề quan trọng]
176
+ - 💡 `[suggestion]`: [Gợi ý cải thiện]
177
+ - 🟢 `[nit]`: [Góp ý nhỏ]
178
+ - 🎉 `[praise]`: [Khen ngợi]
179
+
180
+ ### 🛠️ Suggested Fixes (Optional)
181
+ [Cung cấp Code diff hoặc YAML chuẩn xác để user dễ dàng copy & paste. TUYỆT ĐỐI KHÔNG tự sửa file nếu user chưa yêu cầu]
182
+
183
+ ### Verdict
184
+ - [ ] Approve ( thể merge/deploy ngay)
185
+ - [ ] Changes Requested (Cần sửa các mục `[blocking]`)
186
+ - [ ] Comment (Chỉ là gợi ý, quyền quyết định ở user)
187
+ ```
188
+
@@ -54,6 +54,7 @@ knowledge_scope:
54
54
  references:
55
55
  - coding
56
56
  - repository-structure
57
+ - anti-patterns
57
58
 
58
59
  # ── V8: Verification ───────────────────────────────────────
59
60
  verification:
@@ -85,7 +86,6 @@ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
85
86
 
86
87
  > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
87
88
 
88
-
89
89
  ## Preconditions
90
90
  - [ ] Entry point file or module name is specified
91
91
  - [ ] Repository is accessible
@@ -96,7 +96,6 @@ On missing precondition:
96
96
  Message: "Vui lòng chỉ định entry point (file hoặc module cần map)."
97
97
  ```
98
98
 
99
-
100
99
  ## Scope
101
100
  - ✅ Trace imports/exports from entry point
102
101
  - ✅ Build topological dependency graph (max depth 3)
@@ -108,7 +107,6 @@ On missing precondition:
108
107
  - ❌ Guess file names — only follow explicit imports
109
108
  - ❌ Load entire repo (max 5 files)
110
109
 
111
-
112
110
  ## Priority Order
113
111
 
114
112
  | Priority | Task | Skip Threshold |
@@ -118,7 +116,6 @@ On missing precondition:
118
116
  | P3 | Identify shared/risky modules | Budget < 60% |
119
117
  | P4 | Annotate with risk levels | Budget < 70% |
120
118
 
121
-
122
119
  ## Workflow
123
120
 
124
121
  ### Phase 1 — Entry Point Analysis
@@ -137,7 +134,6 @@ ELSE IF entry file not found
137
134
  → EXIT: BLOCKED — ask for correct path
138
135
  ```
139
136
 
140
-
141
137
  ### Phase 2 — Graph Traversal (Max Depth 3)
142
138
 
143
139
  **Steps:**
@@ -155,14 +151,13 @@ IF circular dependency detected
155
151
  → Continue building rest of graph
156
152
  ```
157
153
 
158
-
159
154
  ### Phase 3 — Risk Assessment & Output
160
155
 
161
156
  **Steps:**
162
157
  1. Identify: shared modules (imported by 3+ files) = HIGH risk to change
163
158
  2. Identify: entry points with many dependents = CRITICAL to change carefully
164
- 3. Generate graph in standard JSON + Markdown format
165
-
159
+ 3. **Identify: file trộn lẫn Server Logic Client UI, hoặc vi phạm ranh giới bảo mật R-SEC-04 = Bắt buộc flag [HIGH RISK].**
160
+ 4. Generate graph in standard JSON + Markdown format
166
161
 
167
162
  ## Output Format (Mandatory Schema)
168
163
 
@@ -190,7 +185,6 @@ IF circular dependency detected
190
185
  }
191
186
  ```
192
187
 
193
-
194
188
  ## Evidence Format
195
189
 
196
190
  ```
@@ -200,7 +194,6 @@ Imported by: [N files]
200
194
  Exports: [key exports]
201
195
  ```
202
196
 
203
-
204
197
  ## Handoff Contract
205
198
 
206
199
  ### Consumes
@@ -220,7 +213,6 @@ Exports: [key exports]
220
213
  }
221
214
  ```
222
215
 
223
-
224
216
  ## Exit Codes
225
217
 
226
218
  | Code | Meaning | When |
@@ -47,6 +47,8 @@ knowledge_scope:
47
47
  - migrations
48
48
  references:
49
49
  - architecture
50
+ - security
51
+ - anti-patterns
50
52
 
51
53
  # ── V8: Verification ───────────────────────────────────────
52
54
  verification:
@@ -80,7 +82,7 @@ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
80
82
 
81
83
  # qk-data-lifecycle — Database Schema & Repository Manager
82
84
 
83
- > **Language rule:** Code, identifiers, file names ? English. Explanations, summaries ? Vietnamese.
85
+ > **Language rule:** Code, identifiers, file names English. Explanations, summaries Vietnamese.
84
86
 
85
87
  ---
86
88
 
@@ -134,6 +136,9 @@ drop_column:
134
136
 
135
137
  rename_table:
136
138
  strategy: create new table → migrate → drop old (never ALTER TABLE RENAME in prod)
139
+
140
+ pii_data:
141
+ strategy: Khi add column chứa PII (Personal Identifiable Information), BẮT BUỘC áp dụng cơ chế hashing/encryption tương ứng (tuân thủ R-SEC-04).
137
142
  ```
138
143
 
139
144
  ---
@@ -47,6 +47,7 @@ knowledge_scope:
47
47
  - query-optimization
48
48
  references:
49
49
  - architecture
50
+ - anti-patterns
50
51
 
51
52
  # ── V8: Verification ───────────────────────────────────────
52
53
  verification:
@@ -80,7 +81,7 @@ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
80
81
 
81
82
  # qk-db-optimizer — Database Performance Tuner
82
83
 
83
- > **Language rule:** Code, identifiers, file names ? English. Explanations, summaries ? Vietnamese.
84
+ > **Language rule:** Code, identifiers, file names English. Explanations, summaries Vietnamese.
84
85
 
85
86
  ---
86
87
 
@@ -112,7 +113,7 @@ On missing precondition:
112
113
  | P | Issue Type | Action | Skip Threshold |
113
114
  |---|-----------|--------|----------------|
114
115
  | P1 | Sequential scan on large table (> 10k rows) | Add composite index | Never |
115
- | P2 | N+1 query pattern | Eager load / DataLoader | Budget < 30% |
116
+ | P2 | N+1 query pattern | Eager load / DataLoader (Ưu tiên theo chuẩn dự án, không tự chế query lồng) | Budget < 30% |
116
117
  | P3 | Missing JOIN (multiple queries for related data) | Rewrite with JOIN | Budget < 50% |
117
118
  | P4 | SELECT * (over-fetching) | Select specific columns | Budget < 60% |
118
119