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,9 +1,9 @@
1
- ---
1
+ ---
2
2
  # ── Identity ───────────────────────────────────────────────
3
3
  name: qk-web-quality-gate
4
- version: 9.1.0
4
+ version: 9.2.0
5
5
  status: experimental
6
- description: "Kiểm toán tổng thể chất lượng Web: Accessibility (A11y), SEO, Web Performance, Security, UX Heuristics."
6
+ description: "Đo lường chất lượng kỹ thuật Web: Accessibility violations (WCAG), Core Web Vitals, Lighthouse score, SEO tags, security headers. Output là số đo và lỗi kỹ thuật cụ thể. Dùng skill này khi user nhắc đến: a11y, accessibility, wcag, lighthouse, core web vitals, seo audit, page speed, performance score, security headers — KHÔNG dùng cho review thiết kế UI hay spacing."
7
7
  platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
8
 
9
9
  # ── V9: Classification ─────────────────────────────────────
@@ -24,12 +24,17 @@ complexity:
24
24
  has_external_dependency: true
25
25
  has_breaking_change: false
26
26
 
27
- triggers:
28
- - "kiểm tra web"
29
- - "tối ưu web"
30
- - "lighthouse"
31
- - "audit ui"
32
- - "core web vitals"
27
+ triggers:
28
+ - "a11y"
29
+ - "accessibility"
30
+ - "wcag"
31
+ - "lighthouse"
32
+ - "core web vitals"
33
+ - "seo audit"
34
+ - "page speed"
35
+ - "performance score"
36
+ - "security headers"
37
+
33
38
 
34
39
  # ── V8: References ─────────────────────────────────────────
35
40
  workflow: feature-delivery
@@ -43,7 +48,8 @@ tools:
43
48
  - terminal
44
49
 
45
50
  related_skills:
46
- - qk-frontend-architecture
51
+ - qk-ui-audit
52
+ - qk-ui-builder
47
53
 
48
54
  knowledge_scope:
49
55
  domain:
@@ -85,7 +91,7 @@ latency: slow
85
91
  risk: low
86
92
  side_effects: read_only
87
93
  produces: [report]
88
- consumes: [user-description]
94
+ consumes: [user-description, source-code]
89
95
 
90
96
  token_budget:
91
97
  max_files_read: 5
@@ -93,403 +99,99 @@ token_budget:
93
99
  max_shell_commands: 2
94
100
  stop_early: true
95
101
 
96
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
102
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
97
103
  ---
98
104
 
99
- # qk-web-quality-gate — Web Quality Auditor
105
+ # qk-web-quality-gate — Web Quality, A11y & Performance Auditor
100
106
 
101
107
  > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
102
108
 
103
- ## Memory Workflow
104
-
105
- ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
106
- - 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:
107
- - **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.
108
- - **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.
109
-
110
- ---
111
-
112
- ### Pre-flight Retrieve (Trước khi thực thi)
113
- - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
114
- bắt buộc tra cứu:
115
- - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
116
-
117
- - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
118
- - Architecture
119
- - Hard Bug
120
- - Convention
121
- - Pattern
122
- - Tech Debt Pattern
123
- - 👉 *Domain Focus:* Convention / Hard Bug (vd: chỉ số Core Web Vitals LCP/CLS, rủi ro bot SEO/A11y).
124
-
125
- - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
126
- Không được xem Memory là Source of Truth.
127
- 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.
128
-
129
- ---
130
-
131
- ### Learning Flow (AI tự học có kiểm soát)
132
- - 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:
133
- - Hard Bug có khả năng tái diễn.
134
- - Pattern làm việc lặp lại trong dự án.
135
- - Convention hoặc quy tắc kiến trúc mới.
136
- - Quyết định Architecture quan trọng.
137
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
138
- - 👉 *Domain Harvest:* Mẫu tối ưu hiệu năng web (vd: chiến lược lazyload hình ảnh, bundle partition).
139
-
140
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
141
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
142
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
143
-
144
- ---
145
-
146
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
147
- Sau khi hoàn thành task:
148
- - AI đánh giá các Candidate Memory đã tạo.
149
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
150
- - Đề xuất người dùng xem xét.
151
- - Gửi yêu cầu phê duyệt thông qua:
152
- - `/learn`
153
- - `qk-project-memory`
154
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
155
-
156
- ```
157
- .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
158
- ```
159
-
160
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
161
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
162
-
163
- ---
164
-
165
- ### Ignore (Không đưa vào Memory)
166
- Không lưu:
167
- - Trace log của một session đơn lẻ.
168
- - Temporary debugging data.
169
- - Output của một lần chạy test/scan.
170
- - Report health tạm thời của một đợt kiểm tra.
171
- - Lỗi nhỏ chỉ xảy ra một lần.
172
- - Thông tin không có khả năng tái sử dụng.
173
- - 👉 *Domain Ignore:* Report Lighthouse của lần đo test tạm thời.
174
-
175
- ---
176
-
177
- ### Golden Rule
178
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
179
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
180
-
181
- ---
182
-
183
-
184
-
185
- ### Pre-flight Retrieve (Trước khi thực thi)
186
- - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
187
- bắt buộc tra cứu:
188
- - `.agents/knowledge/index.yaml` (Shared Project Knowledge)
189
- - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
190
-
191
- - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
192
- - Architecture
193
- - Hard Bug
194
- - Convention
195
- - Pattern
196
- - Tech Debt Pattern
197
- - 👉 *Domain Focus:* Convention / Hard Bug (vd: chỉ số Core Web Vitals LCP/CLS, rủi ro bot SEO/A11y).
198
-
199
- - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
200
- Không được xem Memory là Source of Truth.
201
- 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.
202
-
203
- ---
204
-
205
- ### Learning Flow (AI tự học có kiểm soát)
206
- - 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:
207
- - Hard Bug có khả năng tái diễn.
208
- - Pattern làm việc lặp lại trong dự án.
209
- - Convention hoặc quy tắc kiến trúc mới.
210
- - Quyết định Architecture quan trọng.
211
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
212
- - 👉 *Domain Harvest:* Mẫu tối ưu hiệu năng web (vd: chiến lược lazyload hình ảnh, bundle partition).
213
-
214
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
215
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
216
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
217
-
218
- ---
219
-
220
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
221
- Sau khi hoàn thành task:
222
- - AI đánh giá các Candidate Memory đã tạo.
223
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
224
- - Đề xuất người dùng xem xét.
225
- - Gửi yêu cầu phê duyệt thông qua:
226
- - `/learn`
227
- - `qk-project-memory`
228
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
229
-
230
- ```
231
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
232
- ```
233
-
234
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
235
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
236
-
237
- ---
238
-
239
- ### Ignore (Không đưa vào Memory)
240
- Không lưu:
241
- - Trace log của một session đơn lẻ.
242
- - Temporary debugging data.
243
- - Output của một lần chạy test/scan.
244
- - Report health tạm thời của một đợt kiểm tra.
245
- - Lỗi nhỏ chỉ xảy ra một lần.
246
- - Thông tin không có khả năng tái sử dụng.
247
- - 👉 *Domain Ignore:* Report Lighthouse của lần đo test tạm thời.
248
-
249
- ---
250
-
251
- ### Golden Rule
252
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
253
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
254
-
255
- ---
256
- ---
257
-
258
- ### Learning Flow (AI tự học có kiểm soát)
259
- - 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:
260
- - Hard Bug có khả năng tái diễn.
261
- - Pattern làm việc lặp lại trong dự án.
262
- - Convention hoặc quy tắc kiến trúc mới.
263
- - Quyết định Architecture quan trọng.
264
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
265
- - 👉 *Domain Harvest:* Mẫu tối ưu hiệu năng web (vd: chiến lược lazyload hình ảnh, bundle partition).
266
-
267
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
268
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
269
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
270
-
271
- ---
272
-
273
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
274
- Sau khi hoàn thành task:
275
- - AI đánh giá các Candidate Memory đã tạo.
276
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
277
- - Đề xuất người dùng xem xét.
278
- - Gửi yêu cầu phê duyệt thông qua:
279
- - `/learn`
280
- - `qk-project-memory`
281
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
282
-
283
- ```
284
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
285
- ```
286
-
287
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
288
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
289
-
290
- ---
291
-
292
- ### Ignore (Không đưa vào Memory)
293
- Không lưu:
294
- - Trace log của một session đơn lẻ.
295
- - Temporary debugging data.
296
- - Output của một lần chạy test/scan.
297
- - Report health tạm thời của một đợt kiểm tra.
298
- - Lỗi nhỏ chỉ xảy ra một lần.
299
- - Thông tin không có khả năng tái sử dụng.
300
- - 👉 *Domain Ignore:* Report Lighthouse của lần đo test tạm thời.
301
-
302
- ---
303
-
304
- ### Golden Rule
305
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
306
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
307
-
308
- ---
309
- ---
310
-
311
- ### Learning Flow (AI tự học có kiểm soát)
312
- - 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:
313
- - Hard Bug có khả năng tái diễn.
314
- - Pattern làm việc lặp lại trong dự án.
315
- - Convention hoặc quy tắc kiến trúc mới.
316
- - Quyết định Architecture quan trọng.
317
- - Tech Debt Pattern hoặc Code Smell có tính hệ thống.
318
- - 👉 *Domain Harvest:* Mẫu tối ưu hiệu năng web (vd: chiến lược lazyload hình ảnh, bundle partition).
319
-
320
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
321
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
322
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
323
-
324
- ---
325
-
326
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
327
- Sau khi hoàn thành task:
328
- - AI đánh giá các Candidate Memory đã tạo.
329
- - Nếu phát hiện tri thức có giá trị tái sử dụng:
330
- - Đề xuất người dùng xem xét.
331
- - Gửi yêu cầu phê duyệt thông qua:
332
- - `/learn`
333
- - `qk-project-memory`
334
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
335
-
336
- ```
337
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
338
- ```
339
-
340
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
341
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
342
-
343
- ---
344
-
345
- ### Ignore (Không đưa vào Memory)
346
- Không lưu:
347
- - Trace log của một session đơn lẻ.
348
- - Temporary debugging data.
349
- - Output của một lần chạy test/scan.
350
- - Report health tạm thời của một đợt kiểm tra.
351
- - Lỗi nhỏ chỉ xảy ra một lần.
352
- - Thông tin không có khả năng tái sử dụng.
353
- - 👉 *Domain Ignore:* Report Lighthouse của lần đo test tạm thời.
354
-
355
- ---
356
-
357
- ### Golden Rule
358
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
359
- > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
360
-
361
- ---
362
- ---
363
- ---
364
- ---
365
-
366
- ## Preconditions
367
- - [ ] Ứng dụng web đã có thể chạy hoặc code đã được viết một phần.
109
+ Chịu trách nhiệm đo lường và đánh giá các chỉ số chất lượng kỹ thuật của ứng dụng Web: **Accessibility (WCAG 2.1 AA) → Core Web Vitals (LCP, FID/INP, CLS) → SEO meta tags → Security Headers**. Xuất báo cáo định lượng và chỉ dẫn khắc phục cụ thể.
368
110
 
369
- ## Scope
370
- - Thực hiện kiểm toán A11y (Accessibility standards như WCAG).
371
- - Đánh giá Performance (Core Web Vitals, Bundle size, Lazy loading, Cache, Optimize images).
372
- - Kiểm tra SEO best practices (Meta tags, heading structure, semantic HTML).
373
- - Đánh giá UX Heuristics cơ bản.
374
- - Đưa ra khuyến nghị (Recommendation), không phải tự tay fix code nếu chưa được yêu cầu.
375
-
376
- ## Non-Goals
377
- - ❌ Provide implementation outside of Web Performance & Accessibility scope
378
- - ❌ Override explicit user directives without explanation
379
- - ❌ Guess ambiguous requirements without asking
380
-
381
- ## Priority Order
382
-
383
- | Priority | Task | Skip Threshold |
384
- |----------|------|----------------|
385
- | P1 | Core Web Performance & Accessibility analysis and decision making | Never |
386
- | P2 | Validation of existing patterns | Budget < 30% |
387
- | P3 | Detailed documentation generation | Budget < 50% |
388
- | P4 | Edge case exploration | Budget < 70% |
389
-
390
- ## Workflow
391
-
392
- ### Phase 1 — Context Loading
393
- **Steps:**
394
- 1. Read existing configuration and requirements related to Web Performance & Accessibility.
395
- 2. Check for missing preconditions.
396
-
397
- **Decision:**
398
- ```
399
- IF context is clear
400
- → Confidence: HIGH → go to Phase 2
401
- ELSE
402
- → EXIT: BLOCKED — ask user
403
- ```
111
+ ---
404
112
 
405
- ### Phase 2 — Analysis & Strategy
406
- **Steps:**
407
- 1. Analyze the current state against Web Performance & Accessibility best practices.
408
- 2. Formulate strategy or audit report based on findings.
113
+ ## Preconditions
409
114
 
410
- **Decision:**
411
- ```
412
- IF strategy/audit is complete
413
- → Confidence: HIGH → go to Phase 3
414
- ELSE IF minor gaps exist
415
- → Confidence: MEDIUM → proceed with assumptions noted
416
- ```
115
+ Trước khi audit chất lượng web, AI BẮT BUỘC kiểm tra:
417
116
 
418
- ### Phase 3 Finalization
419
- **Steps:**
420
- 1. Generate final report or configuration.
421
- 2. Prepare handoff data for subsequent skills.
117
+ - [ ] Xác định trang hoặc component web cần kiểm tra.
118
+ - [ ] Xác định frontend framework và rendering method (SSR, SSG, CSR, Next.js, Nuxt) từ `.agents/DEV_PROFILE.md`.
119
+ - [ ] Đảm bảo có thể truy cập mã nguồn template HTML / JSX để đọc semantic tags.
120
+ - [ ] Nếu trang hoàn toàn là client-side SPA mà không có mã nguồn cấu trúc DOM:
121
+ → **EXIT: BLOCKED**
122
+ → Báo cáo user cung cấp URL môi trường staging hoặc file mã nguồn template tương ứng.
422
123
 
423
- ## Confidence Model
124
+ ---
424
125
 
425
- | Level | Condition | Action |
426
- |-------|-----------|--------|
427
- | HIGH | All preconditions met, context fully understood | Proceed directly |
428
- | MEDIUM | Some context missing but safe defaults exist | Proceed and note assumptions |
429
- | LOW | Core requirements missing | EXIT: BLOCKED |
126
+ ## Scope
430
127
 
431
- ## Severity (for findings)
128
+ Skill này làm:
129
+ - Kiểm toán Accessibility (A11y theo chuẩn WCAG 2.1 AA):
130
+ - Semantic HTML (`<main>`, `<nav>`, `<header>`, `<h1>-<h6>` thứ tự đúng).
131
+ - ARIA attributes (`aria-label`, `aria-expanded`, `aria-hidden`, `role`).
132
+ - Keyboard navigation (tab order, focus trap trong modals, skip links).
133
+ - Alt text cho hình ảnh và caption cho media.
134
+ - Phân tích Core Web Vitals & Performance:
135
+ - LCP (Largest Contentful Paint): Tối ưu hóa ảnh (next/image, webp, priority loading).
136
+ - CLS (Cumulative Layout Shift): Khai báo width/height cho hình ảnh, placeholder cho ad slots.
137
+ - INP/FID: Tối ưu bundle size, dynamic imports / code-splitting.
138
+ - Kiểm tra SEO Technical: Title tag, Meta description, OpenGraph tags, Canonical link, Robots/Sitemap.
139
+ - Kiểm tra HTTP Security Headers khuyến nghị: CSP, X-Frame-Options, HSTS.
140
+
141
+ ❌ Skill này KHÔNG làm:
142
+ - Đánh giá tính thẩm mỹ hoặc spacing thị giác (→ `qk-ui-audit`).
143
+ - Tự viết component UI mới từ đầu (→ `qk-ui-builder`).
144
+ - Thiết lập hạ tầng CDN hoặc server proxy Nginx/Cloudflare (→ `qk-devops-platform`).
432
145
 
433
- | Level | Definition |
434
- |-------|-----------|
435
- | CRITICAL | Severe violation of Web Performance & Accessibility principles |
436
- | HIGH | Significant risk or technical debt |
437
- | MEDIUM | Suboptimal pattern but functional |
438
- | LOW | Minor style or documentation issue |
146
+ ---
439
147
 
440
- ## Evidence Format
148
+ ## Execution Steps
441
149
 
150
+ ### Step 1 — Semantic & A11y DOM Inspection
442
151
  ```
443
- [SEVERITY] Context/File
444
- Issue: [what was found]
445
- Confidence: HIGH
446
- Recommendation: [actionable advice]
152
+ Inputs: Page/Component source code
153
+ Actions:
154
+ - Kiểm tra tính hợp lệ của cây phân cấp headings (h1 -> h2 -> h3, không nhảy cóc).
155
+ - Soát tất cả thẻ `<img>` thiếu `alt` hoặc thẻ tương tác (`<button>`, `<a>`) thiếu text/aria-label.
156
+ - Kiểm tra form inputs có gắn kèm `<label>` tường minh hay không.
157
+ Output: A11y violation list
447
158
  ```
448
159
 
449
- ## Retry Policy
160
+ ### Step 2 — Performance & Core Web Vitals Analysis
450
161
  ```
451
- Task fails due to missing context
452
- └─ Ask user for clarification
453
- ├─ Provided Retry Phase 1
454
- └─ Not provided EXIT: BLOCKED
162
+ Inputs: Asset imports, Rendering architecture
163
+ Actions:
164
+ - Kiểm tra cách load font chữ (font-display: swap) và CSS render-blocking.
165
+ - Phát hiện các ảnh dung lượng lớn chưa được responsive srcset hoặc nén modern formats (AVIF/WebP).
166
+ - Đánh giá chiến lược lazy-loading cho các components nằm dưới màn hình đầu tiên (below the fold).
167
+ Output: Web Vitals bottleneck map
455
168
  ```
456
169
 
457
- ## Escalation Rules
458
-
170
+ ### Step 3 — SEO & Security Header Audit
459
171
  ```
460
- BLOCKED: Missing critical context for Web Performance & Accessibility
461
- Missing:
462
- - [Specific requirement]
463
- Questions:
464
- 1. Bạn thể cung cấp thêm thông tin về yêu cầu này không?
465
- 2. Mục tiêu chính của bạn là gì?
466
- Recommended Assumptions: none
172
+ Inputs: HTML Head configuration, Next.js metadata / Nuxt useHead
173
+ Actions:
174
+ - Soát độ dài Title (50-60 ký tự) và Description (150-160 ký tự).
175
+ - Kiểm tra cấu hình thẻ mạng xã hội (og:image, og:title, twitter:card).
176
+ - Đánh giá Content Security Policy (CSP).
177
+ Output: SEO & Security posture report
467
178
  ```
468
179
 
469
- ## Handoff Contract
470
-
471
- ### Consumes
472
- ```json
473
- {
474
- "from": "user or qk-orchestrator",
475
- "required_fields": ["context"],
476
- "optional_fields": ["existing_config"]
477
- }
180
+ ### Step 4 — Remediation Guide Formulation
478
181
  ```
479
-
480
- ### Produces
481
- ```json
482
- {
483
- "to": "user or downstream skill",
484
- "output_fields": ["strategy_report", "exit_code"]
485
- }
182
+ Inputs: Findings across all categories
183
+ Actions:
184
+ - Tổng hợp thành bảng điểm định lượng và phân loại độ ưu tiên (P0: Blockers, P1: High, P2: Polish).
185
+ - Cung cấp đoạn code JSX/HTML sửa mẫu trực quan.
186
+ Exit: SUCCESS
486
187
  ```
487
188
 
488
- ## Exit Codes
189
+ ---
489
190
 
490
- | Code | Meaning | When |
491
- |------|---------|------|
492
- | SUCCESS | Web Performance & Accessibility task completed successfully | Strategy/audit generated |
493
- | PARTIAL | Task completed with assumptions | Medium confidence |
494
- | BLOCKED | Missing context | Cannot proceed |
495
- | FAILED | Critical conflict or error | Unresolvable constraint |
191
+ ## Prompt Template
192
+
193
+ ```
194
+ Trang / URL: [Đường dẫn file page hoặc route URL cần kiểm tra]
195
+ Trọng tâm audit: [A11y WCAG / Core Web Vitals / SEO Technical / Tất cả]
196
+ Vấn đề ghi nhận: [Chậm tải trang, lighthouse điểm đỏ, cảnh báo screen reader, ...]
197
+ ```
@@ -98,21 +98,21 @@ steps:
98
98
  condition: "file thuộc vùng auth/payment/permission/migration"
99
99
  message: "Patch này chạm vào code nhạy cảm. Xác nhận an toàn trước khi thay đổi."
100
100
  - id: verify
101
- name: "Xác minh fix"
102
- purpose: "Xác nhận bug đã được fix không có regression"
101
+ name: "Xác minh fix + quality gate"
102
+ purpose: "Xác nhận bug đã được fix, không có regression, code đạt quality threshold"
103
103
  required: true
104
104
  skip_if: null
105
105
  inputs:
106
106
  - patched_files
107
107
  outputs:
108
108
  - verification_result # PASS | FAIL | PARTIAL
109
- - evidence_of_fix # Re-read patched section
109
+ - evidence_of_fix
110
+ - quality_gate_result # PASS | FAIL
110
111
  actions:
111
112
  - "Re-read patched code section"
112
113
  - "Chạy test liên quan nếu có"
113
- - "Kiểm tra caller/dependent nếu interface thay đổi"
114
- - "Đảm bảo tuân thủ R-SEC-04 (Security Boundary)"
115
- - "Đảm bảo tuân thủ R-C-09 (Zero-Slop)"
114
+ - "Áp dụng shared quality gate xem: .agents/workflows/shared/quality-gate.yml"
115
+ - " Checklist: universal_checks + bug-resolution specific checks"
116
116
  - "Ghi log execution trace vào evals/traces/"
117
117
  exit_on_fail: FAILED
118
118
 
@@ -0,0 +1,94 @@
1
+ name: context-discovery
2
+ version: 9.2.0
3
+ description: "Pipeline load context dự án và vẽ dependency graph trước khi thực hiện task — ngăn hallucination kiến trúc."
4
+
5
+ owner:
6
+ type: engineering
7
+ maintained_by: qk-team
8
+
9
+ verification_profile: review
10
+
11
+ triggers:
12
+ - "load context"
13
+ - "tìm hiểu codebase"
14
+ - "explore architecture"
15
+ - "explain the codebase"
16
+ - "trace dependency"
17
+ - "hiểu project"
18
+ - "which skill should i use"
19
+ - "help me choose"
20
+
21
+ ide_binding:
22
+ slash_command: "/discover"
23
+ aliases: ["/context", "/explore", "/research"]
24
+
25
+ steps:
26
+ - id: define_scope
27
+ name: "Xác định phạm vi cần khám phá"
28
+ purpose: "Biết chính xác cần tìm hiểu gì để phục vụ task tiếp theo"
29
+ required: true
30
+ inputs:
31
+ - task_goal # Task người dùng muốn làm sau context load
32
+ outputs:
33
+ - discovery_questions # Các câu hỏi cụ thể cần trả lời
34
+ - entry_points # Files/folders bắt đầu đọc
35
+ actions:
36
+ - "Đặt 3-5 câu hỏi cụ thể cần trả lời (không đọc mọi thứ)"
37
+ - "Ưu tiên: package.json / go.mod / pyproject.toml → biết stack"
38
+ - "Sau đó: src/ structure → biết architecture pattern"
39
+ exit_on_fail: BLOCKED
40
+
41
+ - id: detect_stack
42
+ name: "Phát hiện Stack & Architecture"
43
+ purpose: "Xác định tech stack, project type, và conventions đang dùng"
44
+ required: true
45
+ inputs:
46
+ - entry_points
47
+ outputs:
48
+ - detected_stack # language, framework, DB, CSS, test runner...
49
+ - project_type # web-app / api / data-pipeline / monorepo / ai-agent
50
+ - architecture_pattern # feature-based / domain / layered / atomic
51
+ actions:
52
+ - "Đọc package.json / requirements.txt / go.mod / Cargo.toml"
53
+ - "Đọc cấu trúc thư mục src/ (1 level sâu)"
54
+ - "Tìm config files: tsconfig, prisma/schema, docker-compose, .env.example"
55
+ - "Đọc tối đa 2-3 file entry point để xác nhận pattern"
56
+
57
+ - id: map_dependencies
58
+ name: "Vẽ Dependency Map"
59
+ purpose: "Hiểu component nào phụ thuộc vào component nào"
60
+ required: false
61
+ skip_if: "Task không cần hiểu cross-component dependencies"
62
+ inputs:
63
+ - detected_stack
64
+ - entry_points
65
+ outputs:
66
+ - dependency_map # Key components + their relationships
67
+ - critical_paths # Paths hay bị ảnh hưởng khi thay đổi
68
+ context_budget: 100
69
+ actions:
70
+ - "Dùng grep_search để trace imports, không đọc toàn bộ file"
71
+ - "Đọc targeted sections (≤ 100 lines per read)"
72
+ - "Ghi lại circular deps hay God File nếu phát hiện"
73
+
74
+ - id: synthesize
75
+ name: "Tổng hợp Context"
76
+ purpose: "Đóng gói kết quả sẵn sàng inject vào skill thực thi tiếp theo"
77
+ required: true
78
+ inputs:
79
+ - detected_stack
80
+ - dependency_map
81
+ - discovery_questions
82
+ outputs:
83
+ - context_summary # Stack + Architecture + Key files
84
+ - skill_recommendation # Skill phù hợp nhất cho task hiện tại
85
+ - warnings # Deprecated patterns, risks, anti-patterns phát hiện
86
+ actions:
87
+ - "Viết summary dạng bullet (không dài hơn 10 dòng)"
88
+ - "Đề xuất skill phù hợp nhất nếu chưa được chọn"
89
+ - "Flag pattern cũ hoặc vi phạm convention"
90
+ - "Ghi log execution trace vào evals/traces/ nếu có"
91
+
92
+ escalation:
93
+ max_retries: 1
94
+ on_failure: "Report partial findings với confidence level, list files chưa đọc được"
@@ -98,7 +98,7 @@ steps:
98
98
 
99
99
  - id: verify
100
100
  name: "Verify implementation"
101
- purpose: "Xác nhận feature hoạt động đúng theo acceptance criteria"
101
+ purpose: "Xác nhận feature hoạt động đúng theo acceptance criteria — quality gate bắt buộc"
102
102
  required: true
103
103
  skip_if: null
104
104
  inputs:
@@ -107,11 +107,15 @@ steps:
107
107
  - modified_files
108
108
  outputs:
109
109
  - verification_result
110
- - unmet_criteria # Any criteria not yet met
110
+ - unmet_criteria
111
+ - quality_gate_result # PASS | PARTIAL | FAIL
111
112
  actions:
112
- - "Đối chiếu từng acceptance criterion"
113
+ - "Đối chiếu từng acceptance criterion — list unmet nếu có"
113
114
  - "Re-read key implementation sections"
114
- - "Run tests nếu có"
115
+ - "Run linter nếu có (npm run lint / ruff / eslint)"
116
+ - "Run tests nếu có (npm test / pytest / go test)"
117
+ - "Áp dụng shared quality gate → xem: .agents/workflows/shared/quality-gate.yml"
118
+ - " Checklist: universal_checks + feature-delivery specific checks"
115
119
  - "Ghi log execution trace vào evals/traces/"
116
120
  exit_on_fail: PARTIAL
117
121