ai-developer-skill-os 10.1.0 → 10.2.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 (98) hide show
  1. package/.agents/AGENTS.md +13 -0
  2. package/.agents/LICENSE +21 -21
  3. package/.agents/docs/ARCHITECTURE.md +56 -120
  4. package/.agents/docs/GOVERNANCE.md +3 -3
  5. package/.agents/docs/SPEC.md +137 -60
  6. package/.agents/docs/VERSIONING.md +25 -57
  7. package/.agents/docs/adr/0005-v10-platform-consolidation.md +50 -0
  8. package/.agents/docs/schemas/learning.schema.yml +22 -57
  9. package/.agents/docs/schemas/skill.schema.yml +116 -161
  10. package/.agents/docs/schemas/workflow.schema.yml +51 -26
  11. package/.agents/docs/skill-classification.md +1 -1
  12. package/.agents/registry/graph.json +171 -77
  13. package/.agents/registry/index.yaml +68 -35
  14. package/.agents/rules/coding.md +1 -1
  15. package/.agents/rules/command-safety.md +1 -1
  16. package/.agents/rules/global.md +1 -1
  17. package/.agents/rules/prompt-compiler.md +1 -1
  18. package/.agents/rules/safety.md +1 -1
  19. package/.agents/rules/security.md +1 -1
  20. package/.agents/rules/skill-quality.md +18 -3
  21. package/.agents/skills/_template/SKILL.md +238 -88
  22. package/.agents/skills/qk-api-data-discovery/SKILL.md +176 -190
  23. package/.agents/skills/qk-api-data-discovery/references/bronze-record-format.md +47 -0
  24. package/.agents/skills/qk-api-data-discovery/references/data-contract-yaml.md +72 -0
  25. package/.agents/skills/qk-api-data-discovery/references/discovery-report-template.md +110 -0
  26. package/.agents/skills/qk-backend-data/SKILL.md +150 -1
  27. package/.agents/skills/qk-bug-resolution/SKILL.md +153 -1
  28. package/.agents/skills/qk-bug-resolution/evals/scorecard.yaml +1 -1
  29. package/.agents/skills/qk-code-cleaner/SKILL.md +150 -1
  30. package/.agents/skills/qk-code-review/SKILL.md +195 -1
  31. package/.agents/skills/qk-code-review/evals/scorecard.yaml +1 -1
  32. package/.agents/skills/qk-code-review/references/ai/{v8-schema-validation.md → schema-validation.md} +2 -2
  33. package/.agents/skills/qk-code-review/references/cross-cutting/async-concurrency-patterns.md +515 -515
  34. package/.agents/skills/qk-code-review/references/cross-cutting/error-handling-principles.md +492 -492
  35. package/.agents/skills/qk-code-review/references/cross-cutting/n-plus-one-queries.md +309 -309
  36. package/.agents/skills/qk-code-review/references/cross-cutting/sql-injection-prevention.md +307 -307
  37. package/.agents/skills/qk-code-review/references/cross-cutting/xss-prevention.md +263 -263
  38. package/.agents/skills/qk-code-review/references/languages/angular.md +768 -768
  39. package/.agents/skills/qk-code-review/references/languages/c.md +890 -890
  40. package/.agents/skills/qk-code-review/references/languages/cpp.md +893 -893
  41. package/.agents/skills/qk-code-review/references/languages/css-less-sass.md +661 -661
  42. package/.agents/skills/qk-code-review/references/languages/django.md +985 -985
  43. package/.agents/skills/qk-code-review/references/languages/fastapi.md +580 -580
  44. package/.agents/skills/qk-code-review/references/languages/go.md +993 -993
  45. package/.agents/skills/qk-code-review/references/languages/java.md +409 -409
  46. package/.agents/skills/qk-code-review/references/languages/java8.md +586 -586
  47. package/.agents/skills/qk-code-review/references/languages/kotlin.md +1018 -1018
  48. package/.agents/skills/qk-code-review/references/languages/nestjs.md +593 -593
  49. package/.agents/skills/qk-code-review/references/languages/php.md +684 -684
  50. package/.agents/skills/qk-code-review/references/languages/python.md +1073 -1073
  51. package/.agents/skills/qk-code-review/references/languages/qt.md +757 -757
  52. package/.agents/skills/qk-code-review/references/languages/react.md +871 -871
  53. package/.agents/skills/qk-code-review/references/languages/ruby.md +964 -964
  54. package/.agents/skills/qk-code-review/references/languages/rust.md +846 -846
  55. package/.agents/skills/qk-code-review/references/languages/svelte.md +1064 -1064
  56. package/.agents/skills/qk-code-review/references/languages/swift.md +936 -936
  57. package/.agents/skills/qk-code-review/references/languages/typescript.md +1016 -1016
  58. package/.agents/skills/qk-code-review/references/languages/vue.md +924 -924
  59. package/.agents/skills/qk-code-review/references/languages/zig.md +440 -440
  60. package/.agents/skills/qk-devops-release/SKILL.md +150 -1
  61. package/.agents/skills/qk-feature-delivery/SKILL.md +153 -1
  62. package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
  63. package/.agents/skills/qk-orchestrator/SKILL.md +187 -2
  64. package/.agents/skills/qk-orchestrator/evals/scorecard.yaml +1 -1
  65. package/.agents/skills/qk-orchestrator/references/routing-table.md +1 -1
  66. package/.agents/skills/qk-product-spec/SKILL.md +150 -1
  67. package/.agents/skills/qk-prompt-compiler/SKILL.md +188 -65
  68. package/.agents/skills/qk-ui-engineer/SKILL.md +150 -1
  69. package/.agents/workflows/_schema.yml +146 -146
  70. package/.agents/workflows/bug-resolution.yml +155 -121
  71. package/.agents/workflows/code-review.yml +127 -93
  72. package/.agents/workflows/context-discovery.yml +128 -94
  73. package/.agents/workflows/documentation.yml +124 -90
  74. package/.agents/workflows/feature-delivery.yml +158 -124
  75. package/.agents/workflows/production-release.yml +207 -173
  76. package/.agents/workflows/prompt-compilation.yml +126 -0
  77. package/.agents/workflows/refactor.yml +136 -102
  78. package/.agents/workflows/security-audit.yml +149 -115
  79. package/.agents/workflows/shared/quality-gate.yml +3 -1
  80. package/.agents/workflows/skin-governance.yml +149 -115
  81. package/.agents/workflows/spec-driven-development.yml +78 -71
  82. package/CHANGELOG.md +61 -0
  83. package/README.md +3 -3
  84. package/bin/install.js +38 -51
  85. package/package.json +68 -74
  86. package/tooling/build-registry.js +226 -208
  87. package/tooling/run-aar.js +55 -126
  88. package/tooling/sync-versions.js +2 -2
  89. package/tooling/validate-graph.js +100 -87
  90. package/tooling/validate-skills.js +32 -14
  91. package/.agents/docs/decisions/ADR-001-v8-migration.md +0 -58
  92. package/.agents/docs/decisions/ADR-002-workflow-separation.md +0 -50
  93. package/.agents/docs/decisions/ADR-003-registry-generated.md +0 -54
  94. package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +0 -27
  95. package/.agents/registry/capability-graph.yml +0 -390
  96. package/.agents/registry/skills-index.yml +0 -305
  97. package/.agents/skills/_template/capability.yaml +0 -34
  98. package/.agents/skills/_template/evals/scorecard.yaml +0 -19
@@ -1,9 +1,11 @@
1
1
  ---
2
2
  name: qk-backend-data
3
- version: 10.1.0
3
+ version: 10.2.0
4
4
  status: stable
5
5
  subtitle: "API & Database"
6
6
  description: "Kỹ sư Backend & Cơ sở dữ liệu toàn diện: Thiết kế Zero-Trust API, quản lý Schema Migration an toàn, phân quyền RBAC/ABAC, tối ưu SQL EXPLAIN/ANALYZE và xây dựng Data Pipeline. Dùng khi: viết api, tạo endpoint, sửa database, migration, thêm cột, rbac, abac, phân quyền, auth middleware, tối ưu query, query chậm, slow query, n+1 query, data pipeline, etl, dbt — TUYỆT ĐỐI KHÔNG dùng cho việc code UI/CSS (dùng qk-ui-engineer) hoặc cấu hình hạ tầng k8s/cluster (dùng qk-devops-release)."
7
+ platforms: [antigravity, claude, opencode]
8
+ runtime_version: 1
7
9
  tools:
8
10
  - filesystem
9
11
  - terminal
@@ -39,6 +41,83 @@ triggers:
39
41
 
40
42
  ---
41
43
 
44
+ ## Memory Workflow
45
+
46
+ ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
47
+ - Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
48
+ - **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
49
+ - **Bảo mật Gitignore:** 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 thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
50
+
51
+ ---
52
+
53
+ ### Pre-flight Retrieve (Trước khi thực thi)
54
+ - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
55
+ bắt buộc tra cứu:
56
+ - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
57
+
58
+ - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
59
+ - Architecture
60
+ - Hard Bug
61
+ - Convention
62
+ - Pattern
63
+ - Tech Debt Pattern
64
+
65
+ - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
66
+ Không được xem Memory là Source of Truth.
67
+ Luôn xác minh lại bằng source code, configuration và trạng thái hiện tại của dự án trước khi áp dụng.
68
+
69
+ ---
70
+
71
+ ### Learning Flow (AI tự học có kiểm soát)
72
+ - Trong quá trình làm việc, AI được phép tự phát hiện và tạo **Candidate Memory** khi nhận thấy:
73
+ - Hard Bug có khả năng tái diễn.
74
+ - Pattern làm việc lặp lại trong dự án.
75
+ - Convention hoặc quy tắc kiến trúc mới.
76
+ - Quyết định Architecture quan trọng.
77
+ - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
78
+
79
+ - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
80
+ - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
81
+ - AI không được tự động Promote Candidate Memory thành Project Knowledge.
82
+
83
+ ---
84
+
85
+ ### Post-flight Harvest (Đề xuất → Phê duyệt)
86
+ Sau khi hoàn thành task:
87
+ - AI đánh giá các Candidate Memory đã tạo.
88
+ - Nếu phát hiện tri thức có giá trị tái sử dụng:
89
+ - Đề xuất người dùng xem xét.
90
+ - Gửi yêu cầu phê duyệt thông qua:
91
+ - `/learn`
92
+ - `qk-project-memory`
93
+ - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
94
+
95
+ ```
96
+ .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
97
+ ```
98
+
99
+ - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
100
+ - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
101
+
102
+ ---
103
+
104
+ ### Ignore (Không đưa vào Memory)
105
+ Không lưu:
106
+ - Trace log của một session đơn lẻ.
107
+ - Temporary debugging data.
108
+ - Output của một lần chạy test/scan.
109
+ - Report health tạm thời của một đợt kiểm tra.
110
+ - Lỗi nhỏ chỉ xảy ra một lần.
111
+ - Thông tin không có khả năng tái sử dụng.
112
+
113
+ ---
114
+
115
+ ### Golden Rule
116
+ > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
117
+ > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
118
+
119
+ ---
120
+
42
121
  ## 1. Nguyên Tắc Cốt Lõi & Luật Chống Over-Engineering
43
122
 
44
123
  > **Core Principle:** Data integrity and security are non-negotiable. Prefer simple, direct, type-safe queries over multi-layered abstractions. Every schema change must have a safe rollback path.
@@ -188,3 +267,73 @@ Kiểm chứng thực tế (Verify Before Claim):
188
267
  • Query Plan: [Đã diệt trừ N+1 bằng Eager loading | Đã kiểm tra Index tĩnh]
189
268
  • Zero Hack: ✅ Không dùng as any, không tắt ràng buộc DB, không bypass auth
190
269
  ```
270
+
271
+ ---
272
+
273
+ ## 8. Mô Hình Độ Tin Cậy (Confidence Model)
274
+
275
+ | Level | Condition | Action |
276
+ |-------|-----------|--------|
277
+ | HIGH | Direct evidence available | Proceed |
278
+ | MEDIUM | Some assumptions needed | Note assumptions |
279
+ | LOW | Insufficient evidence | EXIT: BLOCKED |
280
+
281
+ ---
282
+
283
+ ## 9. Thoái Ra Mã (Exit Codes)
284
+
285
+ | Code | Meaning | When |
286
+ |------|---------|------|
287
+ | SUCCESS | Task completed and verified | All acceptance criteria met |
288
+ | PARTIAL | Task done with minor gaps | Some checks skipped |
289
+ | BLOCKED | Missing precondition or info | Ask user |
290
+ | FAILED | Task failed after max retries | Report error |
291
+
292
+ ---
293
+
294
+ ## 10. Bằng Chứng Định Dạng (Evidence Format)
295
+
296
+ ```
297
+ [SEVERITY] path/to/file.ts:LINE
298
+ Reason: [why this matters]
299
+ Confidence: [HIGH|MEDIUM|LOW]
300
+ Fix: [suggestion]
301
+ ```
302
+
303
+ ---
304
+
305
+ ## Platform-Specific Instructions
306
+
307
+ ### Antigravity (Google Gemini)
308
+ - Uses `.agents/AGENTS.md` as entry point
309
+ - Supports Cockpit integration
310
+ - Rewrite absolute paths for global mode
311
+ - `GEMINI.md` copied for global installs
312
+
313
+ ### Claude Code (Anthropic)
314
+ - Reads `.claude/CLAUDE.md` automatically
315
+ - Large context window (~200K tokens)
316
+ - Can handle full skill files without trimming
317
+ - Uses native tool format (Read, Write, Edit, Bash)
318
+
319
+ ### OpenCode (Open Source)
320
+ - Reads `.opencode/config.yaml`
321
+ - Context window ~128K tokens
322
+ - Keep skill files lean when possible
323
+ - Supports custom tool format
324
+
325
+ ---
326
+
327
+ ## Compliance
328
+
329
+ | Check | Status |
330
+ |-------|--------|
331
+ | Runtime Standard | 11/11 |
332
+ | Frontmatter Complete | ✅ |
333
+ | Platforms Field | ✅ |
334
+ | References Valid | ✅ |
335
+ | Decision Trees | PASS |
336
+ | Thresholds Defined | PASS |
337
+ | schema_version | 10.2.0 |
338
+ | runtime_version | 1 |
339
+ | platforms | [antigravity, claude, opencode] |
@@ -1,9 +1,11 @@
1
1
  ---
2
2
  name: qk-bug-resolution
3
- version: 10.1.0
3
+ version: 10.2.0
4
4
  status: stable
5
5
  subtitle: "Debug & Fix Bug"
6
6
  description: "Chẩn đoán nguyên nhân gốc rễ và khắc phục lỗi mã nguồn theo chu trình khép kín 4 bước (Triangulate → Root-Cause → Surgical Fix → Regression Shield). Dùng khi: fix bug, sửa lỗi, crash, error, exception, trace lỗi, điều tra nguyên nhân bug, not working, màn hình trắng, lỗi logic — TUYỆT ĐỐI KHÔNG dùng khi cần tái cấu trúc lớn (dùng qk-code-cleaner) hoặc làm tính năng mới (dùng qk-feature-delivery)."
7
+ platforms: [antigravity, claude, opencode]
8
+ runtime_version: 1
7
9
  tools:
8
10
  - filesystem
9
11
  - terminal
@@ -33,6 +35,86 @@ triggers:
33
35
 
34
36
  ---
35
37
 
38
+ ## Memory Workflow
39
+
40
+ ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
41
+ - Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
42
+ - **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
43
+ - **Bảo mật Gitignore:** 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 thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
44
+
45
+ ---
46
+
47
+ ### Pre-flight Retrieve (Trước khi thực thi)
48
+ - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
49
+ bắt buộc tra cứu:
50
+ - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
51
+
52
+ - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
53
+ - Architecture
54
+ - Hard Bug
55
+ - Convention
56
+ - Pattern
57
+ - Tech Debt Pattern
58
+ - 👉 *Domain Focus:* Hard Bug (vd: lỗi memory leak, race condition, lỗi thư viện tương tự từng gặp).
59
+
60
+ - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
61
+ Không được xem Memory là Source of Truth.
62
+ Luôn xác minh lại bằng source code, configuration và trạng thái hiện tại của dự án trước khi áp dụng.
63
+
64
+ ---
65
+
66
+ ### Learning Flow (AI tự học có kiểm soát)
67
+ - Trong quá trình làm việc, AI được phép tự phát hiện và tạo **Candidate Memory** khi nhận thấy:
68
+ - Hard Bug có khả năng tái diễn.
69
+ - Pattern làm việc lặp lại trong dự án.
70
+ - Convention hoặc quy tắc kiến trúc mới.
71
+ - Quyết định Architecture quan trọng.
72
+ - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
73
+ - 👉 *Domain Harvest:* Hard Bug mới có khả năng tái diễn (vd: nguyên nhân sâu xa của crash/leak để phòng ngừa).
74
+
75
+ - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
76
+ - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
77
+ - AI không được tự động Promote Candidate Memory thành Project Knowledge.
78
+
79
+ ---
80
+
81
+ ### Post-flight Harvest (Đề xuất → Phê duyệt)
82
+ Sau khi hoàn thành task:
83
+ - AI đánh giá các Candidate Memory đã tạo.
84
+ - Nếu phát hiện tri thức có giá trị tái sử dụng:
85
+ - Đề xuất người dùng xem xét.
86
+ - Gửi yêu cầu phê duyệt thông qua:
87
+ - `/learn`
88
+ - `qk-project-memory`
89
+ - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
90
+
91
+ ```
92
+ .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
93
+ ```
94
+
95
+ - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
96
+ - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
97
+
98
+ ---
99
+
100
+ ### Ignore (Không đưa vào Memory)
101
+ Không lưu:
102
+ - Trace log của một session đơn lẻ.
103
+ - Temporary debugging data.
104
+ - Output của một lần chạy test/scan.
105
+ - Report health tạm thời của một đợt kiểm tra.
106
+ - Lỗi nhỏ chỉ xảy ra một lần.
107
+ - Thông tin không có khả năng tái sử dụng.
108
+ - 👉 *Domain Ignore:* Lỗi nhỏ chỉ xảy ra một lần (vd: typo, quên import, thiếu ngoặc đơn giản).
109
+
110
+ ---
111
+
112
+ ### Golden Rule
113
+ > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
114
+ > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
115
+
116
+ ---
117
+
36
118
  ## 1. Nguyên Tắc Cốt Lõi & Luật Chống Over-Engineering
37
119
 
38
120
  > **Core Principle:** A bug fix must be surgical, evidence-based, and minimal. Never guess. Never refactor surrounding code during a bug fix.
@@ -183,3 +265,73 @@ Kiểm chứng thực tế (Verify Before Claim):
183
265
  📋 Kịch bản test tay dành cho người dùng:
184
266
  1. [Thao tác cụ thể để kích hoạt lại luồng và xác nhận lỗi đã hết]
185
267
  ```
268
+
269
+ ---
270
+
271
+ ## 8. Mô Hình Độ Tin Cậy (Confidence Model)
272
+
273
+ | Level | Condition | Action |
274
+ |-------|-----------|--------|
275
+ | HIGH | Direct evidence available | Proceed |
276
+ | MEDIUM | Some assumptions needed | Note assumptions |
277
+ | LOW | Insufficient evidence | EXIT: BLOCKED |
278
+
279
+ ---
280
+
281
+ ## 9. Thoái Ra Mã (Exit Codes)
282
+
283
+ | Code | Meaning | When |
284
+ |------|---------|------|
285
+ | SUCCESS | Task completed and verified | All acceptance criteria met |
286
+ | PARTIAL | Task done with minor gaps | Some checks skipped |
287
+ | BLOCKED | Missing precondition or info | Ask user |
288
+ | FAILED | Task failed after max retries | Report error |
289
+
290
+ ---
291
+
292
+ ## 10. Bằng Chứng Định Dạng (Evidence Format)
293
+
294
+ ```
295
+ [SEVERITY] path/to/file.ts:LINE
296
+ Reason: [why this matters]
297
+ Confidence: [HIGH|MEDIUM|LOW]
298
+ Fix: [suggestion]
299
+ ```
300
+
301
+ ---
302
+
303
+ ## Platform-Specific Instructions
304
+
305
+ ### Antigravity (Google Gemini)
306
+ - Uses `.agents/AGENTS.md` as entry point
307
+ - Supports Cockpit integration
308
+ - Rewrite absolute paths for global mode
309
+ - `GEMINI.md` copied for global installs
310
+
311
+ ### Claude Code (Anthropic)
312
+ - Reads `.claude/CLAUDE.md` automatically
313
+ - Large context window (~200K tokens)
314
+ - Can handle full skill files without trimming
315
+ - Uses native tool format (Read, Write, Edit, Bash)
316
+
317
+ ### OpenCode (Open Source)
318
+ - Reads `.opencode/config.yaml`
319
+ - Context window ~128K tokens
320
+ - Keep skill files lean when possible
321
+ - Supports custom tool format
322
+
323
+ ---
324
+
325
+ ## Compliance
326
+
327
+ | Check | Status |
328
+ |-------|--------|
329
+ | Runtime Standard | 11/11 |
330
+ | Frontmatter Complete | ✅ |
331
+ | Platforms Field | ✅ |
332
+ | References Valid | ✅ |
333
+ | Decision Trees | PASS |
334
+ | Thresholds Defined | PASS |
335
+ | schema_version | 10.2.0 |
336
+ | runtime_version | 1 |
337
+ | platforms | [antigravity, claude, opencode] |
@@ -1,6 +1,6 @@
1
1
  name: qk-bug-resolution-eval
2
2
  description: Đánh giá chất lượng quy trình sửa lỗi (Bug Resolution)
3
- version: 9.1.0
3
+ version: 10.2.0
4
4
  threshold: 85 # Quy trình sửa lỗi cần bằng chứng rõ ràng và sửa đúng trọng tâm
5
5
 
6
6
  metrics:
@@ -1,9 +1,11 @@
1
1
  ---
2
2
  name: qk-code-cleaner
3
- version: 10.1.0
3
+ version: 10.2.0
4
4
  status: stable
5
5
  subtitle: "Refactor & Viết Test"
6
6
  description: "Kỹ nghệ Tái cấu trúc (Zero Behavior Change), Nâng cấp thư viện an toàn có Rollback và Xây dựng lưới kiểm thử tự động. Dùng khi: refactor code, tái cấu trúc hàm/file, extract function/hook, clean code, giảm độ phức tạp cyclomatic, nâng cấp dependency package, audit breaking changes, viết unit/integration test — TUYỆT ĐỐI KHÔNG dùng khi chỉ sửa bug đơn lẻ (dùng qk-bug-resolution) hoặc build tính năng mới (dùng qk-feature-delivery)."
7
+ platforms: [antigravity, claude, opencode]
8
+ runtime_version: 1
7
9
  tools:
8
10
  - filesystem
9
11
  - terminal
@@ -36,6 +38,83 @@ triggers:
36
38
 
37
39
  ---
38
40
 
41
+ ## Memory Workflow
42
+
43
+ ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
44
+ - Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
45
+ - **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
46
+ - **Bảo mật Gitignore:** 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 thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
47
+
48
+ ---
49
+
50
+ ### Pre-flight Retrieve (Trước khi thực thi)
51
+ - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
52
+ bắt buộc tra cứu:
53
+ - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
54
+
55
+ - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
56
+ - Architecture
57
+ - Hard Bug
58
+ - Convention
59
+ - Pattern
60
+ - Tech Debt Pattern
61
+
62
+ - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
63
+ Không được xem Memory là Source of Truth.
64
+ Luôn xác minh lại bằng source code, configuration và trạng thái hiện tại của dự án trước khi áp dụng.
65
+
66
+ ---
67
+
68
+ ### Learning Flow (AI tự học có kiểm soát)
69
+ - Trong quá trình làm việc, AI được phép tự phát hiện và tạo **Candidate Memory** khi nhận thấy:
70
+ - Hard Bug có khả năng tái diễn.
71
+ - Pattern làm việc lặp lại trong dự án.
72
+ - Convention hoặc quy tắc kiến trúc mới.
73
+ - Quyết định Architecture quan trọng.
74
+ - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
75
+
76
+ - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
77
+ - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
78
+ - AI không được tự động Promote Candidate Memory thành Project Knowledge.
79
+
80
+ ---
81
+
82
+ ### Post-flight Harvest (Đề xuất → Phê duyệt)
83
+ Sau khi hoàn thành task:
84
+ - AI đánh giá các Candidate Memory đã tạo.
85
+ - Nếu phát hiện tri thức có giá trị tái sử dụng:
86
+ - Đề xuất người dùng xem xét.
87
+ - Gửi yêu cầu phê duyệt thông qua:
88
+ - `/learn`
89
+ - `qk-project-memory`
90
+ - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
91
+
92
+ ```
93
+ .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
94
+ ```
95
+
96
+ - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
97
+ - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
98
+
99
+ ---
100
+
101
+ ### Ignore (Không đưa vào Memory)
102
+ Không lưu:
103
+ - Trace log của một session đơn lẻ.
104
+ - Temporary debugging data.
105
+ - Output của một lần chạy test/scan.
106
+ - Report health tạm thời của một đợt kiểm tra.
107
+ - Lỗi nhỏ chỉ xảy ra một lần.
108
+ - Thông tin không có khả năng tái sử dụng.
109
+
110
+ ---
111
+
112
+ ### Golden Rule
113
+ > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
114
+ > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
115
+
116
+ ---
117
+
39
118
  ## 1. Nguyên Tắc Cốt Lõi & Luật Chống Over-Engineering
40
119
 
41
120
  > **Core Principle:** Metrics are signals, not goals. Never refactor code merely to satisfy a metric. Optimize for maintainability, correctness, testability, and minimal risk.
@@ -248,3 +327,73 @@ Kiểm chứng thực tế (Verify Before Claim):
248
327
  ⚠️ Phương án Rollback nếu cần:
249
328
  • Lệnh: `git restore <các-file-đã-sửa>`
250
329
  ```
330
+
331
+ ---
332
+
333
+ ## 9. Mô Hình Độ Tin Cậy (Confidence Model)
334
+
335
+ | Level | Condition | Action |
336
+ |-------|-----------|--------|
337
+ | HIGH | Direct evidence available | Proceed |
338
+ | MEDIUM | Some assumptions needed | Note assumptions |
339
+ | LOW | Insufficient evidence | EXIT: BLOCKED |
340
+
341
+ ---
342
+
343
+ ## 10. Thoái Ra Mã (Exit Codes)
344
+
345
+ | Code | Meaning | When |
346
+ |------|---------|------|
347
+ | SUCCESS | Task completed and verified | All acceptance criteria met |
348
+ | PARTIAL | Task done with minor gaps | Some checks skipped |
349
+ | BLOCKED | Missing precondition or info | Ask user |
350
+ | FAILED | Task failed after max retries | Report error |
351
+
352
+ ---
353
+
354
+ ## 11. Bằng Chứng Định Dạng (Evidence Format)
355
+
356
+ ```
357
+ [SEVERITY] path/to/file.ts:LINE
358
+ Reason: [why this matters]
359
+ Confidence: [HIGH|MEDIUM|LOW]
360
+ Fix: [suggestion]
361
+ ```
362
+
363
+ ---
364
+
365
+ ## Platform-Specific Instructions
366
+
367
+ ### Antigravity (Google Gemini)
368
+ - Uses `.agents/AGENTS.md` as entry point
369
+ - Supports Cockpit integration
370
+ - Rewrite absolute paths for global mode
371
+ - `GEMINI.md` copied for global installs
372
+
373
+ ### Claude Code (Anthropic)
374
+ - Reads `.claude/CLAUDE.md` automatically
375
+ - Large context window (~200K tokens)
376
+ - Can handle full skill files without trimming
377
+ - Uses native tool format (Read, Write, Edit, Bash)
378
+
379
+ ### OpenCode (Open Source)
380
+ - Reads `.opencode/config.yaml`
381
+ - Context window ~128K tokens
382
+ - Keep skill files lean when possible
383
+ - Supports custom tool format
384
+
385
+ ---
386
+
387
+ ## Compliance
388
+
389
+ | Check | Status |
390
+ |-------|--------|
391
+ | Runtime Standard | 11/11 |
392
+ | Frontmatter Complete | ✅ |
393
+ | Platforms Field | ✅ |
394
+ | References Valid | ✅ |
395
+ | Decision Trees | PASS |
396
+ | Thresholds Defined | PASS |
397
+ | schema_version | 10.2.0 |
398
+ | runtime_version | 1 |
399
+ | platforms | [antigravity, claude, opencode] |