ai-developer-skill-os 9.1.1 → 9.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 (63) hide show
  1. package/.agents/AGENTS.md +139 -42
  2. package/.agents/DEV_PROFILE.md +95 -0
  3. package/.agents/registry/capability-graph.yml +171 -334
  4. package/.agents/registry/graph.json +52 -18
  5. package/.agents/registry/index.yaml +66 -12
  6. package/.agents/registry/skills-index.yml +204 -447
  7. package/.agents/rules/coding.md +23 -0
  8. package/.agents/rules/global.md +44 -30
  9. package/.agents/skills/_template/SKILL.md +2 -300
  10. package/.agents/skills/qk-access-policy/SKILL.md +98 -393
  11. package/.agents/skills/qk-agent-observability/SKILL.md +3 -359
  12. package/.agents/skills/qk-ai-builder/SKILL.md +132 -485
  13. package/.agents/skills/qk-api-consumer/SKILL.md +256 -0
  14. package/.agents/skills/qk-api-consumer/capability.yaml +21 -0
  15. package/.agents/skills/qk-api-consumer/evals/scorecard.yaml +29 -0
  16. package/.agents/skills/qk-api-lifecycle/SKILL.md +133 -376
  17. package/.agents/skills/qk-bug-resolution/SKILL.md +128 -481
  18. package/.agents/skills/qk-code-review/SKILL.md +142 -340
  19. package/.agents/skills/qk-context-loader/SKILL.md +99 -391
  20. package/.agents/skills/qk-data-engineer/SKILL.md +253 -0
  21. package/.agents/skills/qk-data-lifecycle/SKILL.md +89 -408
  22. package/.agents/skills/qk-db-optimizer/SKILL.md +102 -408
  23. package/.agents/skills/qk-design-system-engineering/SKILL.md +76 -381
  24. package/.agents/skills/qk-devops-platform/SKILL.md +77 -383
  25. package/.agents/skills/qk-docs/SKILL.md +88 -414
  26. package/.agents/skills/qk-engineering-standard/SKILL.md +4 -508
  27. package/.agents/skills/qk-fe-api-integration/SKILL.md +343 -263
  28. package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +29 -29
  29. package/.agents/skills/qk-feature-delivery/SKILL.md +137 -365
  30. package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
  31. package/.agents/skills/qk-frontend-architecture/SKILL.md +5 -399
  32. package/.agents/skills/qk-help/evals/scorecard.yaml +13 -13
  33. package/.agents/skills/qk-orchestrator/SKILL.md +63 -422
  34. package/.agents/skills/qk-orchestrator/references/routing-table.md +10 -14
  35. package/.agents/skills/qk-product-specification/SKILL.md +70 -399
  36. package/.agents/skills/qk-production-release/SKILL.md +80 -457
  37. package/.agents/skills/qk-project-audit/SKILL.md +174 -0
  38. package/.agents/skills/qk-project-bootstrap/SKILL.md +244 -392
  39. package/.agents/skills/qk-project-health/SKILL.md +97 -416
  40. package/.agents/skills/qk-project-memory/SKILL.md +76 -21
  41. package/.agents/skills/qk-refactor/SKILL.md +167 -304
  42. package/.agents/skills/qk-security-audit/SKILL.md +141 -383
  43. package/.agents/skills/qk-security-audit/capability.yaml +1 -2
  44. package/.agents/skills/qk-system-evolution/SKILL.md +343 -263
  45. package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +26 -26
  46. package/.agents/skills/qk-test-engineering/SKILL.md +119 -429
  47. package/.agents/skills/qk-ui-audit/SKILL.md +73 -457
  48. package/.agents/skills/qk-ui-builder/SKILL.md +521 -482
  49. package/.agents/skills/qk-ui-system-builder/SKILL.md +68 -434
  50. package/.agents/skills/qk-upgrade/SKILL.md +301 -0
  51. package/.agents/skills/qk-upgrade/capability.yaml +24 -0
  52. package/.agents/skills/qk-upgrade/evals/scorecard.yaml +26 -0
  53. package/.agents/skills/qk-validation-gate/SKILL.md +4 -523
  54. package/.agents/skills/qk-web-quality-gate/SKILL.md +85 -383
  55. package/.agents/workflows/bug-resolution.yml +6 -6
  56. package/.agents/workflows/context-discovery.yml +94 -0
  57. package/.agents/workflows/feature-delivery.yml +8 -4
  58. package/.agents/workflows/refactor.yml +6 -3
  59. package/.agents/workflows/shared/quality-gate.yml +94 -0
  60. package/.agents/workflows/skin-governance.yml +115 -0
  61. package/README.md +152 -67
  62. package/package.json +2 -2
  63. package/tooling/build-registry.js +30 -8
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  # ── Identity ───────────────────────────────────────────────
3
3
  name: qk-engineering-standard
4
- version: 9.1.0
5
- status: stable
4
+ version: 9.2.1
5
+ status: relocated
6
6
  description: "Ép buộc SOLID, DRY, Clean Code với ngưỡng số liệu cụ thể — không có rule mơ hồ."
7
7
  platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
8
 
@@ -83,511 +83,7 @@ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
83
83
  ---
84
84
 
85
85
  # qk-engineering-standard — Code Quality Enforcer
86
-
87
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
88
-
89
- ## Memory Workflow
90
-
91
- ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
92
- - 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:
93
- - **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.
94
- - **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.
95
-
96
- ---
97
-
98
- ### Pre-flight Retrieve (Trước khi thực thi)
99
- - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
100
- bắt buộc tra cứu:
101
- - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
102
-
103
- - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
104
- - Architecture
105
- - Hard Bug
106
- - Convention
107
- - Pattern
108
- - Tech Debt Pattern
109
- - 👉 *Domain Focus:* Convention / Architecture (vd: ngưỡng định lượng độ phức tạp cyclomatic, DRY, SOLID).
110
-
111
- - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
112
- Không được xem Memory là Source of Truth.
113
- 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.
114
-
115
- ---
116
-
117
- ### Learning Flow (AI tự học có kiểm soát)
118
- - 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:
119
- - Hard Bug có khả năng tái diễn.
120
- - Pattern làm việc lặp lại trong dự án.
121
- - Convention hoặc quy tắc kiến trúc mới.
122
- - Quyết định Architecture quan trọng.
123
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
124
- - 👉 *Domain Harvest:* Convention hoặc ranh giới kỹ thuật mới (vd: áp đặt giới hạn 100 dòng cho file AGENTS.md).
125
-
126
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
127
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
128
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
129
-
130
- ---
131
-
132
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
133
- Sau khi hoàn thành task:
134
- - AI đánh giá các Candidate Memory đã tạo.
135
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
136
- - Đề xuất người dùng xem xét.
137
- - Gửi yêu cầu phê duyệt thông qua:
138
- - `/learn`
139
- - `qk-project-memory`
140
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
141
-
142
- ```
143
- .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
144
- ```
145
-
146
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
147
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
148
-
149
- ---
150
-
151
- ### Ignore (Không đưa vào Memory)
152
- Không lưu:
153
- - Trace log của một session đơn lẻ.
154
- - Temporary debugging data.
155
- - Output của một lần chạy test/scan.
156
- - Report health tạm thời của một đợt kiểm tra.
157
- - Lỗi nhỏ chỉ xảy ra một lần.
158
- - Thông tin không có khả năng tái sử dụng.
159
- - 👉 *Domain Ignore:* Cảnh báo linter tạm thời.
160
-
161
- ---
162
-
163
- ### Golden Rule
164
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
165
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
166
-
167
- ---
168
-
169
-
170
-
171
- ### Pre-flight Retrieve (Trước khi thực thi)
172
- - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
173
- bắt buộc tra cứu:
174
- - `.agents/knowledge/index.yaml` (Shared Project Knowledge)
175
- - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
176
-
177
- - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
178
- - Architecture
179
- - Hard Bug
180
- - Convention
181
- - Pattern
182
- - Tech Debt Pattern
183
- - 👉 *Domain Focus:* Convention / Architecture (vd: ngưỡng định lượng độ phức tạp cyclomatic, DRY, SOLID).
184
-
185
- - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
186
- Không được xem Memory là Source of Truth.
187
- 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.
188
-
189
- ---
190
-
191
- ### Learning Flow (AI tự học có kiểm soát)
192
- - 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:
193
- - Hard Bug có khả năng tái diễn.
194
- - Pattern làm việc lặp lại trong dự án.
195
- - Convention hoặc quy tắc kiến trúc mới.
196
- - Quyết định Architecture quan trọng.
197
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
198
- - 👉 *Domain Harvest:* Convention hoặc ranh giới kỹ thuật mới (vd: áp đặt giới hạn 100 dòng cho file AGENTS.md).
199
-
200
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
201
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
202
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
203
-
204
- ---
205
-
206
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
207
- Sau khi hoàn thành task:
208
- - AI đánh giá các Candidate Memory đã tạo.
209
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
210
- - Đề xuất người dùng xem xét.
211
- - Gửi yêu cầu phê duyệt thông qua:
212
- - `/learn`
213
- - `qk-project-memory`
214
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
215
-
216
- ```
217
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
218
- ```
219
-
220
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
221
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
222
-
223
- ---
224
-
225
- ### Ignore (Không đưa vào Memory)
226
- Không lưu:
227
- - Trace log của một session đơn lẻ.
228
- - Temporary debugging data.
229
- - Output của một lần chạy test/scan.
230
- - Report health tạm thời của một đợt kiểm tra.
231
- - Lỗi nhỏ chỉ xảy ra một lần.
232
- - Thông tin không có khả năng tái sử dụng.
233
- - 👉 *Domain Ignore:* Cảnh báo linter tạm thời.
234
-
235
- ---
236
-
237
- ### Golden Rule
238
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
239
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
240
-
241
- ---
242
- ---
243
-
244
- ### Learning Flow (AI tự học có kiểm soát)
245
- - 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:
246
- - Hard Bug có khả năng tái diễn.
247
- - Pattern làm việc lặp lại trong dự án.
248
- - Convention hoặc quy tắc kiến trúc mới.
249
- - Quyết định Architecture quan trọng.
250
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
251
- - 👉 *Domain Harvest:* Convention hoặc ranh giới kỹ thuật mới (vd: áp đặt giới hạn 100 dòng cho file AGENTS.md).
252
-
253
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
254
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
255
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
256
-
257
- ---
258
-
259
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
260
- Sau khi hoàn thành task:
261
- - AI đánh giá các Candidate Memory đã tạo.
262
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
263
- - Đề xuất người dùng xem xét.
264
- - Gửi yêu cầu phê duyệt thông qua:
265
- - `/learn`
266
- - `qk-project-memory`
267
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
268
-
269
- ```
270
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
271
- ```
272
-
273
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
274
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
275
-
276
- ---
277
-
278
- ### Ignore (Không đưa vào Memory)
279
- Không lưu:
280
- - Trace log của một session đơn lẻ.
281
- - Temporary debugging data.
282
- - Output của một lần chạy test/scan.
283
- - Report health tạm thời của một đợt kiểm tra.
284
- - Lỗi nhỏ chỉ xảy ra một lần.
285
- - Thông tin không có khả năng tái sử dụng.
286
- - 👉 *Domain Ignore:* Cảnh báo linter tạm thời.
287
-
288
- ---
289
-
290
- ### Golden Rule
291
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
292
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
293
-
294
- ---
295
- ---
296
-
297
- ### Learning Flow (AI tự học có kiểm soát)
298
- - 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:
299
- - Hard Bug có khả năng tái diễn.
300
- - Pattern làm việc lặp lại trong dự án.
301
- - Convention hoặc quy tắc kiến trúc mới.
302
- - Quyết định Architecture quan trọng.
303
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
304
- - 👉 *Domain Harvest:* Convention hoặc ranh giới kỹ thuật mới (vd: áp đặt giới hạn 100 dòng cho file AGENTS.md).
305
-
306
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
307
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
308
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
309
-
310
- ---
311
-
312
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
313
- Sau khi hoàn thành task:
314
- - AI đánh giá các Candidate Memory đã tạo.
315
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
316
- - Đề xuất người dùng xem xét.
317
- - Gửi yêu cầu phê duyệt thông qua:
318
- - `/learn`
319
- - `qk-project-memory`
320
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
321
-
322
- ```
323
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
324
- ```
325
-
326
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
327
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
328
-
329
- ---
330
-
331
- ### Ignore (Không đưa vào Memory)
332
- Không lưu:
333
- - Trace log của một session đơn lẻ.
334
- - Temporary debugging data.
335
- - Output của một lần chạy test/scan.
336
- - Report health tạm thời của một đợt kiểm tra.
337
- - Lỗi nhỏ chỉ xảy ra một lần.
338
- - Thông tin không có khả năng tái sử dụng.
339
- - 👉 *Domain Ignore:* Cảnh báo linter tạm thời.
340
-
341
- ---
342
86
 
343
- ### Golden Rule
344
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
345
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
346
-
347
- ---
348
- ---
349
- ---
350
- ---
351
-
352
- ## Preconditions
353
- - [ ] Target file(s) or module(s) are specified
354
-
355
- ```
356
- On missing precondition:
357
- EXIT: BLOCKED
358
- Message: "Vui lòng chỉ định file hoặc module cần kiểm tra."
359
- ```
360
-
361
- ## Scope
362
- - ✅ Detect violations with exact file:line references
363
- - ✅ Classify by severity with concrete thresholds
364
- - ✅ Suggest minimal, targeted refactors
365
-
366
- ## Non-Goals
367
- - ❌ Auto-fix code — report only (fixes go to qk-bug-resolution or qk-feature-delivery)
368
- - ❌ Rewrite architecture
369
- - ❌ Touch files outside the specified scope
370
-
371
- ## Concrete Thresholds (Non-Negotiable)
372
- **Các giới hạn dưới đây được dùng để định lượng vi phạm rác mã (R-C-09) và bảo mật (R-SEC-04):**
373
-
374
- ```yaml
375
- function:
376
- max_lines: 30 # Lines of code, excluding comments/blanks
377
- max_cyclomatic_complexity: 10
378
- max_parameters: 4
379
-
380
- file:
381
- max_lines: 300
382
- max_public_methods_per_class: 10 # God Class threshold
383
-
384
- dry:
385
- violation_threshold: 3 # Same logic duplicated in ≥ 3 places
386
-
387
- separation_of_concerns:
388
- violation: "File mixes UI rendering + API calls + State management"
389
-
390
- naming:
391
- min_variable_name_length: 2 # Single-letter vars (except i,j,k in loops)
392
- max_abbreviation_ratio: 0.3 # > 30% abbreviations in identifiers = violation
393
-
394
- dependency:
395
- max_imports_per_file: 15 # Beyond this: likely a God File
396
- ```
397
-
398
- ## Priority Order
399
-
400
- | Priority | Check | Severity | Skip Threshold |
401
- |----------|-------|----------|----------------|
402
- | P1 | Security violations (hardcoded secrets, SQL injection) | CRITICAL | Never |
403
- | P2 | God Functions > 30 lines / complexity > 10 | HIGH | Budget < 30% |
404
- | P3 | God Files > 300 lines / God Classes | HIGH | Budget < 40% |
405
- | P4 | DRY violations (3+ duplicates) | MEDIUM | Budget < 50% |
406
- | P5 | Mixed concerns in single file | MEDIUM | Budget < 60% |
407
- | P6 | Naming convention violations | LOW | Budget < 70% |
408
- | P7 | Excessive imports / coupling | LOW | Budget < 80% |
409
-
410
- ## Workflow
411
-
412
- ### Phase 1 — Scan for Critical & High Violations
413
-
414
- **Steps:**
415
- 1. `grep_search` — search for: hardcoded secrets, `console.log`, `eval(`, `any` types
416
- 2. `view_file[targeted]` — read function definitions to count lines and parameters
417
- 3. Log each violation with Evidence Format
418
-
419
- **Decision:**
420
- ```
421
- IF CRITICAL violation found (e.g., hardcoded API key)
422
- → Report immediately, mark EXIT: FAILED
423
- → Still continue scanning (don't stop at first critical)
424
-
425
- IF function line count > 30 OR complexity > 10
426
- → Log as [HIGH]
427
-
428
- IF file line count > 300
429
- → Log as [HIGH] — God File suspected
430
- ```
431
-
432
- **Exit When:**
433
- - All P1+P2+P3 checks done → go to Phase 2
434
- - Token budget < 30% → go to Phase 3 directly with PARTIAL flag
435
-
436
- ### Phase 2 — Scan for Medium & Low Violations
437
-
438
- **Steps:**
439
- 1. `grep_search` — find duplicate logic patterns (copy-paste code)
440
- 2. Check import counts per file
441
- 3. Check naming conventions
442
-
443
- **Decision:**
444
- ```
445
- IF same logic block appears ≥ 3 times
446
- → Log as [MEDIUM] DRY violation
447
-
448
- IF file has > 15 imports
449
- → Log as [LOW] — potential God File or tight coupling
450
-
451
- IF token budget < 50%
452
- → Skip P6+P7, go to Phase 3
453
- ```
454
-
455
- ### Phase 3 — Score & Report
456
-
457
- **Steps:**
458
- 1. Count violations by severity
459
- 2. Calculate health score: start at 100, deduct per violation
460
- 3. Generate report
461
-
462
- **Deduction Scale:**
463
- ```
464
- CRITICAL: -25 pts each
465
- HIGH: -10 pts each
466
- MEDIUM: -5 pts each
467
- LOW: -2 pts each
468
- ```
469
-
470
- **Decision:**
471
- ```
472
- IF score ≥ 80 AND no CRITICAL violations
473
- → EXIT: SUCCESS
474
-
475
- IF score 60–79 OR any HIGH violations
476
- → EXIT: PARTIAL — list fixes needed
477
-
478
- IF score < 60 OR any CRITICAL violations
479
- → EXIT: FAILED — requires immediate action
480
- ```
481
-
482
- ## Confidence Model
483
-
484
- | Level | Condition | Action |
485
- |-------|-----------|--------|
486
- | HIGH | Direct line count, exact pattern match | Report as violation |
487
- | MEDIUM | Inferred cyclomatic complexity without tool | Note estimate |
488
- | LOW | Architectural smell inferred from structure | Mark as "suspected — verify manually" |
489
-
490
- ## Severity
491
-
492
- | Level | Definition | Example |
493
- |-------|-----------|---------|
494
- | CRITICAL | Security risk or data integrity | Hardcoded secret, SQL injection via string concat |
495
- | HIGH | Technical debt that blocks scaling | Function 80 lines, God Class 15+ methods |
496
- | MEDIUM | DRY or SoC violation, fixable in < 1 hour | Same validation logic in 3 components |
497
- | LOW | Style/naming issue, non-blocking | Single-letter variable `x` outside loop |
498
-
499
- ## Evidence Format
500
-
501
- ```
502
- [SEVERITY] path/to/file.ts:LINE
503
- Rule: [FUNCTION_LENGTH | COMPLEXITY | DRY | SOC | NAMING | GOD_CLASS | SECRET]
504
- Reason: [specific measurement vs threshold]
505
- Confidence: [HIGH|MEDIUM|LOW]
506
- Fix: [one-line suggestion]
507
- Deduction: -N pts
508
- ```
509
-
510
- **Example:**
511
- ```
512
- [HIGH] src/services/order.service.ts:45
513
- Rule: FUNCTION_LENGTH
514
- Reason: Function `processOrder` is 87 lines (threshold: 30)
515
- Confidence: HIGH
516
- Fix: Extract payment logic to `processPayment()`, shipping to `scheduleShipment()`
517
- Deduction: -10 pts
518
- ```
519
-
520
- ## Retry Policy
521
- ```
522
- Audit is read-only — no retry needed.
523
- If file is inaccessible → skip and note in report as PARTIAL.
524
- ```
525
-
526
- ## Escalation Rules
527
-
528
- ```
529
- BLOCKED: No target specified
530
- Missing:
531
- - File path or module name to audit
532
- Questions:
533
- 1. Bạn muốn kiểm tra file nào hoặc toàn bộ module nào?
534
- 2. Có ngưỡng cụ thể nào bạn muốn thay đổi không? (mặc định: 30 lines/function)
535
- ```
536
-
537
- ## Handoff Contract
538
-
539
- ### Consumes
540
- ```json
541
- {
542
- "from": "user or qk-orchestrator",
543
- "required_fields": ["target_files_or_module"],
544
- "optional_fields": ["custom_thresholds"]
545
- }
546
- ```
547
-
548
- ### Produces
549
- ```json
550
- {
551
- "to": "user",
552
- "output_fields": ["health_score", "violations_list", "severity_counts", "exit_code"]
553
- }
554
- ```
555
-
556
- ## Output Format
557
-
558
- ```
559
- ⚙️ Engineering Standard Audit
560
- ─────────────────────────────────────────────────
561
- Target: [file or module]
562
-
563
- Health Score: [X/100]
564
- CRITICAL violations: [N] (-Npts)
565
- HIGH violations: [N] (-Npts)
566
- MEDIUM violations: [N] (-Npts)
567
- LOW violations: [N] (-Npts)
568
-
569
- Violations (priority order):
570
- [SEVERITY] file:LINE — Rule — reason — Fix — (-Xpts)
571
-
572
- Required Actions:
573
- 1. [Most critical fix]
574
- 2. [Second fix]
575
-
576
- Exit Code: [SUCCESS | PARTIAL | FAILED]
577
- ```
578
-
579
- ## Exit Codes
580
-
581
- | Code | Meaning | When |
582
- |------|---------|------|
583
- | SUCCESS | Score ≥ 80, no CRITICAL | Code meets V7.5 standards |
584
- | PARTIAL | Score 60–79 or incomplete scan | Some categories skipped |
585
- | BLOCKED | No target specified | Cannot audit without scope |
586
- | FAILED | Score < 60 or CRITICAL found | Immediate action required |
587
-
588
- ## References
589
- - Detailed thresholds with rationale: `references/thresholds.md`
590
- - Anti-Patterns Blacklist: `references/anti-patterns.md`
591
-
592
- ---
87
+ > **⚠️ ARCHIVED (v9.2.1):** Downgraded thành rule. Nội dung đã được merge vào `.agents/rules/coding.md` (R-C-10). Không cần gọi trực tiếp — áp dụng tự động trong mọi skill có `side_effects: edit_files`.
593
88
 
89
+ > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.