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-validation-gate
4
- version: 9.1.0
5
- status: stable
4
+ version: 9.2.1
5
+ status: relocated
6
6
  description: "Cổng kiểm tra chất lượng & Eval Pipeline bắt buộc — chạy linters, tests, và đánh giá scorecard.yaml định lượng cho AI Agent."
7
7
  platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
8
 
@@ -82,526 +82,7 @@ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
82
82
  ---
83
83
 
84
84
  # qk-validation-gate — Quality Gate
85
-
86
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
87
-
88
- ## Memory Workflow
89
-
90
- ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
91
- - 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:
92
- - **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.
93
- - **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.
94
-
95
- ---
96
-
97
- ### Pre-flight Retrieve (Trước khi thực thi)
98
- - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
99
- bắt buộc tra cứu:
100
- - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
101
-
102
- - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
103
- - Architecture
104
- - Hard Bug
105
- - Convention
106
- - Pattern
107
- - Tech Debt Pattern
108
- - 👉 *Domain Focus:* Convention / Architecture (vd: các ngưỡng scorecard, quy định zero hallucination).
109
-
110
- - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
111
- Không được xem Memory là Source of Truth.
112
- 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.
113
-
114
- ---
115
-
116
- ### Learning Flow (AI tự học có kiểm soát)
117
- - 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:
118
- - Hard Bug có khả năng tái diễn.
119
- - Pattern làm việc lặp lại trong dự án.
120
- - Convention hoặc quy tắc kiến trúc mới.
121
- - Quyết định Architecture quan trọng.
122
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
123
- - 👉 *Domain Harvest:* Bộ tiêu chí kiểm định mới (Scorecard metric) được tích hợp vào pipeline.
124
-
125
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
126
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
127
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
128
-
129
- ---
130
-
131
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
132
- Sau khi hoàn thành task:
133
- - AI đánh giá các Candidate Memory đã tạo.
134
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
135
- - Đề xuất người dùng xem xét.
136
- - Gửi yêu cầu phê duyệt thông qua:
137
- - `/learn`
138
- - `qk-project-memory`
139
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
140
-
141
- ```
142
- .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
143
- ```
144
-
145
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
146
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
147
-
148
- ---
149
-
150
- ### Ignore (Không đưa vào Memory)
151
- Không lưu:
152
- - Trace log của một session đơn lẻ.
153
- - Temporary debugging data.
154
- - Output của một lần chạy test/scan.
155
- - Report health tạm thời của một đợt kiểm tra.
156
- - Lỗi nhỏ chỉ xảy ra một lần.
157
- - Thông tin không có khả năng tái sử dụng.
158
- - 👉 *Domain Ignore:* Kết quả log pass/fail tạm thời của một build con.
159
-
160
- ---
161
-
162
- ### Golden Rule
163
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
164
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
165
-
166
- ---
167
-
168
-
169
-
170
- ### Pre-flight Retrieve (Trước khi thực thi)
171
- - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
172
- bắt buộc tra cứu:
173
- - `.agents/knowledge/index.yaml` (Shared Project Knowledge)
174
- - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
175
-
176
- - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
177
- - Architecture
178
- - Hard Bug
179
- - Convention
180
- - Pattern
181
- - Tech Debt Pattern
182
- - 👉 *Domain Focus:* Convention / Architecture (vd: các ngưỡng scorecard, quy định zero hallucination).
183
-
184
- - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
185
- Không được xem Memory là Source of Truth.
186
- 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.
187
-
188
- ---
189
-
190
- ### Learning Flow (AI tự học có kiểm soát)
191
- - 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:
192
- - Hard Bug có khả năng tái diễn.
193
- - Pattern làm việc lặp lại trong dự án.
194
- - Convention hoặc quy tắc kiến trúc mới.
195
- - Quyết định Architecture quan trọng.
196
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
197
- - 👉 *Domain Harvest:* Bộ tiêu chí kiểm định mới (Scorecard metric) được tích hợp vào pipeline.
198
-
199
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
200
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
201
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
202
-
203
- ---
204
-
205
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
206
- Sau khi hoàn thành task:
207
- - AI đánh giá các Candidate Memory đã tạo.
208
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
209
- - Đề xuất người dùng xem xét.
210
- - Gửi yêu cầu phê duyệt thông qua:
211
- - `/learn`
212
- - `qk-project-memory`
213
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
214
-
215
- ```
216
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
217
- ```
218
-
219
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
220
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
221
-
222
- ---
223
-
224
- ### Ignore (Không đưa vào Memory)
225
- Không lưu:
226
- - Trace log của một session đơn lẻ.
227
- - Temporary debugging data.
228
- - Output của một lần chạy test/scan.
229
- - Report health tạm thời của một đợt kiểm tra.
230
- - Lỗi nhỏ chỉ xảy ra một lần.
231
- - Thông tin không có khả năng tái sử dụng.
232
- - 👉 *Domain Ignore:* Kết quả log pass/fail tạm thời của một build con.
233
-
234
- ---
235
-
236
- ### Golden Rule
237
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
238
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
239
-
240
- ---
241
- ---
242
-
243
- ### Learning Flow (AI tự học có kiểm soát)
244
- - 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:
245
- - Hard Bug có khả năng tái diễn.
246
- - Pattern làm việc lặp lại trong dự án.
247
- - Convention hoặc quy tắc kiến trúc mới.
248
- - Quyết định Architecture quan trọng.
249
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
250
- - 👉 *Domain Harvest:* Bộ tiêu chí kiểm định mới (Scorecard metric) được tích hợp vào pipeline.
251
-
252
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
253
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
254
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
255
-
256
- ---
257
-
258
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
259
- Sau khi hoàn thành task:
260
- - AI đánh giá các Candidate Memory đã tạo.
261
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
262
- - Đề xuất người dùng xem xét.
263
- - Gửi yêu cầu phê duyệt thông qua:
264
- - `/learn`
265
- - `qk-project-memory`
266
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
267
-
268
- ```
269
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
270
- ```
271
-
272
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
273
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
274
-
275
- ---
276
-
277
- ### Ignore (Không đưa vào Memory)
278
- Không lưu:
279
- - Trace log của một session đơn lẻ.
280
- - Temporary debugging data.
281
- - Output của một lần chạy test/scan.
282
- - Report health tạm thời của một đợt kiểm tra.
283
- - Lỗi nhỏ chỉ xảy ra một lần.
284
- - Thông tin không có khả năng tái sử dụng.
285
- - 👉 *Domain Ignore:* Kết quả log pass/fail tạm thời của một build con.
286
-
287
- ---
288
-
289
- ### Golden Rule
290
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
291
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
292
-
293
- ---
294
- ---
295
-
296
- ### Learning Flow (AI tự học có kiểm soát)
297
- - 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:
298
- - Hard Bug có khả năng tái diễn.
299
- - Pattern làm việc lặp lại trong dự án.
300
- - Convention hoặc quy tắc kiến trúc mới.
301
- - Quyết định Architecture quan trọng.
302
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
303
- - 👉 *Domain Harvest:* Bộ tiêu chí kiểm định mới (Scorecard metric) được tích hợp vào pipeline.
304
-
305
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
306
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
307
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
308
-
309
- ---
310
-
311
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
312
- Sau khi hoàn thành task:
313
- - AI đánh giá các Candidate Memory đã tạo.
314
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
315
- - Đề xuất người dùng xem xét.
316
- - Gửi yêu cầu phê duyệt thông qua:
317
- - `/learn`
318
- - `qk-project-memory`
319
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
320
-
321
- ```
322
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
323
- ```
324
-
325
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
326
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
327
-
328
- ---
329
-
330
- ### Ignore (Không đưa vào Memory)
331
- Không lưu:
332
- - Trace log của một session đơn lẻ.
333
- - Temporary debugging data.
334
- - Output của một lần chạy test/scan.
335
- - Report health tạm thời của một đợt kiểm tra.
336
- - Lỗi nhỏ chỉ xảy ra một lần.
337
- - Thông tin không có khả năng tái sử dụng.
338
- - 👉 *Domain Ignore:* Kết quả log pass/fail tạm thời của một build con.
339
-
340
- ---
341
-
342
- ### Golden Rule
343
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
344
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
345
-
346
- ---
347
- ---
348
- ---
349
- ---
350
85
 
351
- ## Preconditions
352
- - [ ] Project has `package.json` with lint/test scripts (or equivalent for other runtimes)
353
- - [ ] Target scope is specified (specific files, or whole project)
354
-
355
- ```
356
- On missing precondition:
357
- EXIT: BLOCKED
358
- Message: "Không tìm thấy script lint/test. Vui lòng chỉ định lệnh kiểm tra."
359
- ```
360
-
361
- ## Scope & V8.2 Eval Pipeline
362
- - ✅ Run lint, type-check, tests, and security audit in sequence
363
- - ✅ **Execute V8.2 Eval Pipeline:** Read `scorecard.yaml` (or inherited schemas) and compute quantitative scores for AI/Agent outputs.
364
- - ✅ Enforce pass/fail with concrete thresholds (Code coverage >= 80%, Eval scorecard >= passing threshold, typically 80/100).
365
- - ✅ Validate Trace execution logs in `evals/traces/` to ensure zero hallucination and ground-truth compliance.
366
- - ✅ Report results with structured Evidence Format.
367
-
368
- ## Non-Goals
369
- - ❌ Fix failing tests or lint errors (fixes go to qk-bug-resolution)
370
- - ❌ Skip any gate check or eval scorecard unless user explicitly allows
371
- - ❌ Override failing thresholds with "ignore" flags or fabricated LLM scores without trace evidence
372
-
373
- ## Pass/Fail Thresholds (Non-Negotiable)
374
-
375
- ```yaml
376
- lint:
377
- errors: 0 # Zero tolerance for lint errors
378
- warnings: allowed # Warnings do not block
379
-
380
- typescript:
381
- errors: 0 # Zero type errors
382
-
383
- tests:
384
- coverage_minimum: 80% # Overall coverage
385
- unit_test_pass_rate: 100% # All unit tests must pass
386
- integration_test_pass_rate: 100%
387
-
388
- security:
389
- critical_vulnerabilities: 0
390
- high_vulnerabilities: 0
391
- medium_vulnerabilities: 5 # Max allowed (review required)
392
-
393
- build:
394
- must_succeed: true
395
- max_warnings: 5
396
- bundle_size_limit: 500KB # Gzipped (if applicable)
397
-
398
- eval_scorecard:
399
- default_passing_threshold: 80 # minimum weighted evaluation score
400
- trace_verification_required: true # must log tool executions in evals/traces
401
- zero_tolerance_hallucination: true
402
- ```
403
-
404
- ## Priority Order
405
-
406
- | Priority | Gate | Fail = Block? | Skip Allowed? |
407
- |----------|------|---------------|---------------|
408
- | P1 | Security audit (`npm audit`) | YES | Never |
409
- | P2 | TypeScript / type check | YES | Never |
410
- | P3 | Lint (errors only) | YES | Never |
411
- | P4 | Unit tests | YES | Never |
412
- | P5 | Integration tests | YES | Only if no integration tests exist |
413
- | P6 | Coverage check | YES if < 80% | Never |
414
- | P7 | Build | YES | Never |
415
- | P8 | Bundle size | WARN only | Budget < 80% |
416
-
417
- ## Workflow
418
-
419
- ### Phase 1 — Security Gate (P1)
420
-
421
- **Steps:**
422
- 1. Run: `npm audit --audit-level=high` (or equivalent)
423
- 2. Parse output for CRITICAL and HIGH
424
-
425
- **Decision:**
426
- ```
427
- IF 0 critical + 0 high
428
- → PASS P1 → go to Phase 2
429
-
430
- ELSE IF critical or high found
431
- → EXIT: FAILED immediately
432
- → Report: exact package name, CVE, severity
433
- ```
434
-
435
- ### Phase 2 — Type & Lint Gate (P2+P3)
436
-
437
- **Steps:**
438
- 1. Run: `npm run typecheck` (or `tsc --noEmit`)
439
- 2. Run: `npm run lint`
440
- 3. Parse error counts
441
-
442
- **Decision:**
443
- ```
444
- IF 0 type errors AND 0 lint errors
445
- → PASS P2+P3 → go to Phase 3
446
-
447
- ELSE IF type errors > 0
448
- → EXIT: FAILED — list each error with file:line
449
-
450
- ELSE IF lint errors > 0 (warnings OK)
451
- → EXIT: FAILED — list errors
452
- ```
453
-
454
- ### Phase 3 — Test Gate (P4+P5+P6)
455
-
456
- **Steps:**
457
- 1. Run: `npm test -- --coverage` (or equivalent)
458
- 2. Parse: pass/fail counts, coverage percentage
459
-
460
- **Decision:**
461
- ```
462
- IF all tests pass AND coverage ≥ 80%
463
- → PASS P4+P5+P6 → go to Phase 4
464
-
465
- ELSE IF any test fails
466
- → EXIT: FAILED — list failing test names
467
-
468
- ELSE IF coverage < 80%
469
- → EXIT: FAILED — show coverage report (file-level)
470
- ```
471
-
472
- **Retry Policy:**
473
- ```
474
- Test fail
475
- └─ Check if it's a flaky test (run once more)
476
- ├─ PASS on retry → note "flaky test detected", continue
477
- └─ FAIL on retry → EXIT: FAILED — not flaky, real failure
478
- ```
479
-
480
- ### Phase 4 — Build Gate (P7)
481
-
482
- **Steps:**
483
- 1. Run: `npm run build`
484
- 2. Check exit code + warnings count
485
-
486
- **Decision:**
487
- ```
488
- IF build succeeds AND warnings ≤ 5
489
- → EXIT: SUCCESS
490
-
491
- ELSE IF build fails
492
- → EXIT: FAILED
493
-
494
- ELSE IF warnings > 5
495
- → EXIT: PARTIAL — list warnings, continue to release if user confirms
496
- ```
497
-
498
- ## Confidence Model
499
-
500
- | Level | Condition | Action |
501
- |-------|-----------|--------|
502
- | HIGH | Command exit code 0/non-0, numeric output | Report directly |
503
- | MEDIUM | Inferred from partial output (truncated logs) | Note potential missing info |
504
- | LOW | Script not found or output format unknown | EXIT: BLOCKED — clarify commands |
505
-
506
- ## Severity
507
-
508
- | Level | Definition | Example |
509
- |-------|-----------|---------|
510
- | CRITICAL | Security vulnerability in production dependency | CVE in auth library |
511
- | HIGH | Type error or failing test | `Cannot read property of undefined` |
512
- | MEDIUM | Coverage below threshold | 67% coverage (threshold 80%) |
513
- | LOW | Build warning | Unused export |
514
-
515
- ## Evidence Format
516
-
517
- ```
518
- [SEVERITY] Gate: [SECURITY|TYPE|LINT|TEST|COVERAGE|BUILD]
519
- Command: [command that was run]
520
- Result: [PASS | FAIL — exact output snippet]
521
- Threshold: [what the threshold is]
522
- Actual: [what was measured]
523
- Fix: [where to look for the fix]
524
- ```
525
-
526
- **Example:**
527
- ```
528
- [HIGH] Gate: TEST
529
- Command: npm test -- --coverage
530
- Result: FAIL — 3 tests failed
531
- Threshold: 100% pass rate
532
- Actual: 47/50 tests passed
533
- Fix: See failing tests: auth.test.ts:L45, user.test.ts:L23, order.test.ts:L89
534
- ```
535
-
536
- ## Escalation Rules
537
-
538
- ```
539
- BLOCKED: Cannot run validation
540
- Missing:
541
- - npm scripts (lint, test, build) in package.json
542
- - OR test framework setup
543
- Questions:
544
- 1. Dùng lệnh gì để chạy lint? (e.g., eslint, biome, oxlint)
545
- 2. Dùng lệnh gì để chạy test? (e.g., vitest, jest, playwright)
546
- 3. Coverage threshold dự án quy định là bao nhiêu?
547
- Recommended Assumptions:
548
- - Standard: npm run lint + npm test + npm run build
549
- ```
550
-
551
- ## Handoff Contract
552
-
553
- ### Consumes
554
- ```json
555
- {
556
- "from": "user or qk-orchestrator",
557
- "required_fields": ["project_root"],
558
- "optional_fields": ["custom_commands", "custom_thresholds", "scope_files"]
559
- }
560
- ```
561
-
562
- ### Produces
563
- ```json
564
- {
565
- "to": "qk-production-release (if all pass)",
566
- "output_fields": ["gate_results", "coverage_percent", "violations_list", "exit_code"]
567
- }
568
- ```
569
-
570
- ## Output Format
571
-
572
- ```
573
- 🔒 Validation Gate Report
574
- ─────────────────────────────────────────────────
575
- Project: [path]
576
-
577
- Gate Results:
578
- P1 Security: [✅ PASS | ❌ FAIL — N critical, N high]
579
- P2 TypeScript: [✅ PASS | ❌ FAIL — N errors]
580
- P3 Lint: [✅ PASS | ❌ FAIL — N errors (N warnings)]
581
- P4 Unit Tests: [✅ PASS | ❌ FAIL — N/N passed]
582
- P5 Integration: [✅ PASS | ❌ FAIL | ⏭️ SKIPPED]
583
- P6 Coverage: [✅ PASS (N%) | ❌ FAIL (N% < 80%)]
584
- P7 Build: [✅ PASS | ❌ FAIL]
585
-
586
- Failures (action required):
587
- [SEVERITY] Gate — detail — Fix hint
588
-
589
- Exit Code: [SUCCESS | PARTIAL | BLOCKED | FAILED]
590
- ```
591
-
592
- ---
593
-
594
- ## Retry Policy
595
-
596
- ---
597
- ## Exit Codes
598
-
599
- | Code | Meaning | When |
600
- |------|---------|------|
601
- | SUCCESS | All gates passed, thresholds met | Safe to proceed to release |
602
- | PARTIAL | Build pass, but warnings > 5 OR integration skipped | User confirmation required |
603
- | BLOCKED | Cannot run — missing scripts or config | Setup required |
604
- | FAILED | Any gate failed at threshold | Do NOT release — fix first |
605
-
606
- ---
86
+ > **⚠️ ARCHIVED (v9.2.1):** Downgraded thành workflow step. Logic verify đã được embed vào step `verify` của `feature-delivery.yml`, `bug-resolution.yml`, `refactor.yml`. Không cần gọi trực tiếp.
607
87
 
88
+ > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.