ai-developer-skill-os 9.3.1 → 10.1.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 (185) hide show
  1. package/.agents/AGENTS.md +60 -40
  2. package/.agents/DEV_PROFILE.md +36 -2
  3. package/.agents/registry/graph.json +95 -342
  4. package/.agents/registry/index.yaml +61 -237
  5. package/.agents/rules/coding.md +30 -12
  6. package/.agents/rules/command-safety.md +19 -8
  7. package/.agents/rules/global.md +234 -28
  8. package/.agents/rules/prompt-compiler.md +170 -0
  9. package/.agents/skills/qk-api-data-discovery/SKILL.md +470 -0
  10. package/.agents/skills/qk-backend-data/SKILL.md +190 -0
  11. package/.agents/skills/qk-bug-resolution/SKILL.md +176 -248
  12. package/.agents/skills/qk-code-cleaner/SKILL.md +250 -0
  13. package/.agents/skills/qk-code-review/SKILL.md +126 -247
  14. package/.agents/skills/qk-devops-release/SKILL.md +145 -0
  15. package/.agents/skills/qk-feature-delivery/SKILL.md +179 -247
  16. package/.agents/skills/qk-orchestrator/SKILL.md +100 -151
  17. package/.agents/skills/qk-product-spec/SKILL.md +113 -0
  18. package/.agents/skills/qk-prompt-compiler/SKILL.md +321 -0
  19. package/.agents/skills/qk-ui-engineer/SKILL.md +137 -0
  20. package/.agents/workflows/feature-delivery.yml +1 -1
  21. package/.agents/workflows/production-release.yml +1 -1
  22. package/.agents/workflows/spec-driven-development.yml +109 -87
  23. package/CHANGELOG.md +16 -0
  24. package/README.md +125 -205
  25. package/bin/install.js +337 -329
  26. package/package.json +2 -2
  27. package/.agents/README.md +0 -90
  28. package/.agents/docs/CHI_TIET_SKILLS.md +0 -126
  29. package/.agents/docs/HUONG_DAN_SU_DUNG.md +0 -120
  30. package/.agents/docs/MIGRATION-CLEANUP-V8.1.3.md +0 -36
  31. package/.agents/docs/MIGRATION-STATUS.md +0 -35
  32. package/.agents/docs/MIGRATION-V8.md +0 -10
  33. package/.agents/docs/ROADMAP-V8.2.md +0 -78
  34. package/.agents/docs/V8-CERTIFICATION.md +0 -27
  35. package/.agents/skills/qk-access-policy/SKILL.md +0 -206
  36. package/.agents/skills/qk-access-policy/capability.yaml +0 -23
  37. package/.agents/skills/qk-access-policy/evals/scorecard.yaml +0 -36
  38. package/.agents/skills/qk-agent-observability/SKILL.md +0 -108
  39. package/.agents/skills/qk-agent-observability/capability.yaml +0 -29
  40. package/.agents/skills/qk-agent-observability/evals/scorecard.yaml +0 -29
  41. package/.agents/skills/qk-agent-observability/references/scorecard.yaml +0 -80
  42. package/.agents/skills/qk-ai-builder/SKILL.md +0 -254
  43. package/.agents/skills/qk-ai-builder/capability.yaml +0 -23
  44. package/.agents/skills/qk-ai-builder/evals/scorecard.yaml +0 -30
  45. package/.agents/skills/qk-api-consumer/SKILL.md +0 -256
  46. package/.agents/skills/qk-api-consumer/capability.yaml +0 -21
  47. package/.agents/skills/qk-api-consumer/evals/scorecard.yaml +0 -29
  48. package/.agents/skills/qk-api-lifecycle/SKILL.md +0 -251
  49. package/.agents/skills/qk-api-lifecycle/capability.yaml +0 -23
  50. package/.agents/skills/qk-api-lifecycle/evals/scorecard.yaml +0 -29
  51. package/.agents/skills/qk-bug-resolution/capability.yaml +0 -25
  52. package/.agents/skills/qk-code-review/capability.yaml +0 -23
  53. package/.agents/skills/qk-context-loader/SKILL.md +0 -198
  54. package/.agents/skills/qk-context-loader/capability.yaml +0 -23
  55. package/.agents/skills/qk-context-loader/evals/scorecard.yaml +0 -28
  56. package/.agents/skills/qk-data-engineer/SKILL.md +0 -253
  57. package/.agents/skills/qk-data-lifecycle/SKILL.md +0 -197
  58. package/.agents/skills/qk-data-lifecycle/capability.yaml +0 -23
  59. package/.agents/skills/qk-data-lifecycle/evals/scorecard.yaml +0 -29
  60. package/.agents/skills/qk-db-optimizer/SKILL.md +0 -210
  61. package/.agents/skills/qk-db-optimizer/capability.yaml +0 -22
  62. package/.agents/skills/qk-db-optimizer/evals/scorecard.yaml +0 -28
  63. package/.agents/skills/qk-design-system-engineering/SKILL.md +0 -193
  64. package/.agents/skills/qk-design-system-engineering/capability.yaml +0 -25
  65. package/.agents/skills/qk-design-system-engineering/evals/scorecard.yaml +0 -27
  66. package/.agents/skills/qk-devops-platform/SKILL.md +0 -198
  67. package/.agents/skills/qk-devops-platform/capability.yaml +0 -29
  68. package/.agents/skills/qk-devops-platform/evals/scorecard.yaml +0 -28
  69. package/.agents/skills/qk-docs/SKILL.md +0 -193
  70. package/.agents/skills/qk-docs/capability.yaml +0 -23
  71. package/.agents/skills/qk-docs/evals/scorecard.yaml +0 -27
  72. package/.agents/skills/qk-engineering-standard/SKILL.md +0 -89
  73. package/.agents/skills/qk-engineering-standard/capability.yaml +0 -23
  74. package/.agents/skills/qk-engineering-standard/evals/scorecard.yaml +0 -28
  75. package/.agents/skills/qk-engineering-standard/references/anti-patterns.md +0 -121
  76. package/.agents/skills/qk-engineering-standard/rules/backend.md +0 -122
  77. package/.agents/skills/qk-engineering-standard/rules/database.md +0 -3
  78. package/.agents/skills/qk-engineering-standard/rules/frontend.md +0 -152
  79. package/.agents/skills/qk-engineering-standard/rules/security.md +0 -3
  80. package/.agents/skills/qk-engineering-standard/rules/testing.md +0 -3
  81. package/.agents/skills/qk-fe-api-integration/SKILL.md +0 -704
  82. package/.agents/skills/qk-fe-api-integration/capability.yaml +0 -21
  83. package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +0 -29
  84. package/.agents/skills/qk-feature-delivery/capability.yaml +0 -24
  85. package/.agents/skills/qk-frontend-architecture/SKILL.md +0 -127
  86. package/.agents/skills/qk-frontend-architecture/capability.yaml +0 -28
  87. package/.agents/skills/qk-frontend-architecture/evals/scorecard.yaml +0 -28
  88. package/.agents/skills/qk-help/SKILL.md +0 -107
  89. package/.agents/skills/qk-help/capability.yaml +0 -20
  90. package/.agents/skills/qk-help/evals/scorecard.yaml +0 -13
  91. package/.agents/skills/qk-orchestrator/capability.yaml +0 -22
  92. package/.agents/skills/qk-product-specification/SKILL.md +0 -187
  93. package/.agents/skills/qk-product-specification/capability.yaml +0 -27
  94. package/.agents/skills/qk-product-specification/evals/scorecard.yaml +0 -27
  95. package/.agents/skills/qk-production-release/SKILL.md +0 -188
  96. package/.agents/skills/qk-production-release/capability.yaml +0 -27
  97. package/.agents/skills/qk-production-release/evals/scorecard.yaml +0 -28
  98. package/.agents/skills/qk-project-audit/SKILL.md +0 -174
  99. package/.agents/skills/qk-project-bootstrap/SKILL.md +0 -372
  100. package/.agents/skills/qk-project-bootstrap/capability.yaml +0 -23
  101. package/.agents/skills/qk-project-bootstrap/evals/scorecard.yaml +0 -28
  102. package/.agents/skills/qk-project-health/SKILL.md +0 -202
  103. package/.agents/skills/qk-project-health/capability.yaml +0 -23
  104. package/.agents/skills/qk-project-health/evals/scorecard.yaml +0 -27
  105. package/.agents/skills/qk-project-memory/SKILL.md +0 -303
  106. package/.agents/skills/qk-project-memory/capability.yaml +0 -23
  107. package/.agents/skills/qk-project-memory/evals/scorecard.yaml +0 -27
  108. package/.agents/skills/qk-refactor/SKILL.md +0 -243
  109. package/.agents/skills/qk-refactor/capability.yaml +0 -26
  110. package/.agents/skills/qk-refactor/evals/scorecard.yaml +0 -27
  111. package/.agents/skills/qk-security-audit/SKILL.md +0 -280
  112. package/.agents/skills/qk-security-audit/capability.yaml +0 -29
  113. package/.agents/skills/qk-security-audit/evals/scorecard.yaml +0 -27
  114. package/.agents/skills/qk-system-evolution/SKILL.md +0 -625
  115. package/.agents/skills/qk-system-evolution/capability.yaml +0 -24
  116. package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +0 -26
  117. package/.agents/skills/qk-test-engineering/SKILL.md +0 -215
  118. package/.agents/skills/qk-test-engineering/capability.yaml +0 -28
  119. package/.agents/skills/qk-test-engineering/evals/scorecard.yaml +0 -26
  120. package/.agents/skills/qk-ui-audit/SKILL.md +0 -175
  121. package/.agents/skills/qk-ui-audit/capability.yaml +0 -23
  122. package/.agents/skills/qk-ui-audit/evals/scorecard.yaml +0 -26
  123. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +0 -136
  124. package/.agents/skills/qk-ui-builder/SKILL.md +0 -521
  125. package/.agents/skills/qk-ui-builder/capability.yaml +0 -29
  126. package/.agents/skills/qk-ui-builder/evals/scorecard.yaml +0 -26
  127. package/.agents/skills/qk-ui-builder/references/anti-patterns.md +0 -295
  128. package/.agents/skills/qk-ui-builder/references/color.md +0 -115
  129. package/.agents/skills/qk-ui-builder/references/component-cookbook.md +0 -458
  130. package/.agents/skills/qk-ui-builder/references/copy.md +0 -250
  131. package/.agents/skills/qk-ui-builder/references/interaction-and-states.md +0 -115
  132. package/.agents/skills/qk-ui-builder/references/layout-and-space.md +0 -111
  133. package/.agents/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +0 -48
  134. package/.agents/skills/qk-ui-builder/references/macrostructures/02-long-document.md +0 -50
  135. package/.agents/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +0 -51
  136. package/.agents/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +0 -49
  137. package/.agents/skills/qk-ui-builder/references/macrostructures/05-workbench.md +0 -44
  138. package/.agents/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +0 -50
  139. package/.agents/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +0 -51
  140. package/.agents/skills/qk-ui-builder/references/macrostructures/08-photographic.md +0 -50
  141. package/.agents/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +0 -50
  142. package/.agents/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +0 -49
  143. package/.agents/skills/qk-ui-builder/references/macrostructures/12-letter.md +0 -49
  144. package/.agents/skills/qk-ui-builder/references/macrostructures/13-index-first.md +0 -49
  145. package/.agents/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +0 -48
  146. package/.agents/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +0 -48
  147. package/.agents/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +0 -51
  148. package/.agents/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +0 -48
  149. package/.agents/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +0 -48
  150. package/.agents/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +0 -50
  151. package/.agents/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +0 -48
  152. package/.agents/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +0 -45
  153. package/.agents/skills/qk-ui-builder/references/macrostructures.md +0 -38
  154. package/.agents/skills/qk-ui-builder/references/motion.md +0 -95
  155. package/.agents/skills/qk-ui-builder/references/responsive.md +0 -115
  156. package/.agents/skills/qk-ui-builder/references/slop-test.md +0 -135
  157. package/.agents/skills/qk-ui-builder/references/structure.md +0 -280
  158. package/.agents/skills/qk-ui-builder/references/themes/atmospheric.md +0 -53
  159. package/.agents/skills/qk-ui-builder/references/themes/carnival.md +0 -52
  160. package/.agents/skills/qk-ui-builder/references/themes/cobalt.md +0 -52
  161. package/.agents/skills/qk-ui-builder/references/themes/editorial.md +0 -52
  162. package/.agents/skills/qk-ui-builder/references/themes/garden.md +0 -52
  163. package/.agents/skills/qk-ui-builder/references/themes/hum.md +0 -52
  164. package/.agents/skills/qk-ui-builder/references/themes/lumen.md +0 -52
  165. package/.agents/skills/qk-ui-builder/references/themes/midnight.md +0 -52
  166. package/.agents/skills/qk-ui-builder/references/themes/modern-minimal.md +0 -52
  167. package/.agents/skills/qk-ui-builder/references/themes/playful.md +0 -52
  168. package/.agents/skills/qk-ui-builder/references/themes/specimen.md +0 -52
  169. package/.agents/skills/qk-ui-builder/references/themes/terminal.md +0 -52
  170. package/.agents/skills/qk-ui-builder/references/typography.md +0 -129
  171. package/.agents/skills/qk-ui-system-builder/SKILL.md +0 -183
  172. package/.agents/skills/qk-ui-system-builder/capability.yaml +0 -25
  173. package/.agents/skills/qk-ui-system-builder/evals/scorecard.yaml +0 -26
  174. package/.agents/skills/qk-upgrade/SKILL.md +0 -301
  175. package/.agents/skills/qk-upgrade/capability.yaml +0 -24
  176. package/.agents/skills/qk-upgrade/evals/scorecard.yaml +0 -26
  177. package/.agents/skills/qk-validation-gate/SKILL.md +0 -88
  178. package/.agents/skills/qk-validation-gate/capability.yaml +0 -23
  179. package/.agents/skills/qk-validation-gate/evals/scorecard.yaml +0 -26
  180. package/.agents/skills/qk-web-quality-gate/SKILL.md +0 -197
  181. package/.agents/skills/qk-web-quality-gate/capability.yaml +0 -24
  182. package/.agents/skills/qk-web-quality-gate/evals/scorecard.yaml +0 -26
  183. package/.agents/workflows/research.yml +0 -75
  184. package/.agents/workflows/skill-evolution.yml +0 -97
  185. package/tooling/fix-refactor.js +0 -8
@@ -1,254 +0,0 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-ai-builder
4
- version: 9.2.0
5
- status: stable
6
- description: "Thiết kế và implement AI Agent hoặc RAG pipeline với eval criteria bắt buộc. Dùng skill này khi user nhắc đến: build ai, rag pipeline, prompt engineering, viết prompt, thiết kế agent, llm, vector database, embedding, retrieval, chatbot, ai logic, tạo skill — kể cả khi chỉ nói \"muốn AI trả lời từ tài liệu của mình\"."
7
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
-
9
- # ── V9: Classification ─────────────────────────────────────
10
- type: capability
11
-
12
- intent:
13
- - ai-integration
14
- - agent-behavior
15
-
16
- complexity:
17
- level: high
18
- criteria:
19
- files_affected: "1-5"
20
- has_behavior_change: true
21
- has_external_dependency: true
22
- has_breaking_change: false
23
-
24
- triggers:
25
- - "build ai"
26
- - "rag pipeline"
27
- - "prompt engineering"
28
- - "viết prompt"
29
- - "thiết kế agent"
30
- - "llm"
31
- - "vector database"
32
- - "embedding"
33
- - "retrieval"
34
- - "chatbot"
35
- - "ai logic"
36
- - "tạo skill"
37
-
38
-
39
- # ── V8: References ─────────────────────────────────────────
40
- workflow: feature-delivery
41
-
42
- rules:
43
- - global
44
- - coding
45
-
46
- tools:
47
- - filesystem
48
- - terminal
49
-
50
- related_skills:
51
- - qk-system-evolution
52
-
53
- knowledge_scope:
54
- owns:
55
- - agent-architecture
56
- - skill-generation
57
- references:
58
- - architecture
59
- - security
60
- - anti-patterns
61
-
62
- # ── V8: Verification ───────────────────────────────────────
63
- verification:
64
- required: true
65
- strategy: feature
66
-
67
- selection:
68
- priority: high
69
- confidence_threshold: 0.85
70
-
71
- examples: []
72
- learnings: []
73
-
74
- # ── V7 Runtime ─────────────────────────────────────────────
75
- execution_mode: deterministic
76
- cost: high
77
- latency: slow
78
- risk: high
79
- side_effects: edit_files
80
- produces: [code, schema]
81
- consumes: [user-description]
82
-
83
- token_budget:
84
- max_files_read: 3
85
- max_lines_per_read: 100
86
- max_shell_commands: 0
87
- stop_early: true
88
-
89
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
90
- ---
91
-
92
- # qk-ai-builder — AI Integration Designer
93
-
94
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
95
-
96
- Chịu trách nhiệm thiết kế và hiện thực hóa AI Agent, RAG pipelines, prompt systems và eval criteria. Cam kết chống hallucination, tối ưu hóa token budget, quản lý context window và bảo vệ dữ liệu nhạy cảm.
97
-
98
- ---
99
-
100
- ## Preconditions
101
-
102
- Trước khi triển khai bất kỳ hệ thống AI nào, AI BẮT BUỘC kiểm tra:
103
-
104
- - [ ] Xác định AI stack từ `.agents/DEV_PROFILE.md` (LLM provider, Vector DB, Framework như LangChain/LlamaIndex/Vercel AI SDK).
105
- - [ ] Xác định rõ Evaluation criteria: Tiêu chí đo lường độ chính xác (Relevance, Faithfulness, Hallucination rate).
106
- - [ ] Kiểm tra chính sách dữ liệu: Có dữ liệu PII (thông tin định danh cá nhân) hoặc secrets cần sanitize trước khi gửi LLM không?
107
- - [ ] Nếu không có phương án kiểm thử / eval criteria đo lường chất lượng AI:
108
- → **EXIT: BLOCKED**
109
- → Báo cáo user: Bắt buộc định nghĩa Eval criteria trước khi tiến hành code pipeline.
110
-
111
- ---
112
-
113
- ## Scope
114
-
115
- ✅ Skill này làm:
116
- - Thiết kế luồng RAG (Chunking, Embedding, Vector Search, Re-ranking, Context Augmentation).
117
- - Xây dựng Agent logic (Tool use, Function calling, Structured output, Memory loop).
118
- - Tối ưu hóa System Prompt: Vai trò, nhiệm vụ, định dạng output (JSON schema/Markdown), guardrails.
119
- - Xây dựng Eval suite và bộ test cases đánh giá định lượng câu trả lời của AI.
120
- - Quản lý token budget, streaming response, và cơ chế fallback khi LLM timeout/rate-limit.
121
-
122
- ❌ Skill này KHÔNG làm:
123
- - Huấn luyện hoặc fine-tune foundation models từ đầu (pre-training).
124
- - Viết giao diện Frontend Chatbot hoàn chỉnh (→ `qk-ui-builder` hoặc `qk-api-consumer`).
125
- - Quản lý hạ tầng GPU / Kubernetes cluster chạy model (→ `qk-devops-platform`).
126
-
127
- ---
128
-
129
- ## Execution Steps
130
-
131
- ### Step 1 — Architecture & Pipeline Design
132
- ```
133
- Inputs: Yêu cầu từ user, Data sources, DEV_PROFILE.md
134
- Actions:
135
- - Lựa chọn mô hình: Direct prompting vs RAG vs Agentic tool calling.
136
- - Thiết kế chiến lược chia nhỏ dữ liệu (Chunk size, chunk overlap) và vector embedding.
137
- - Xác định schema cho Structured Output (JSON Schema / Zod).
138
- Output: AI Architecture Specification
139
- ```
140
-
141
- ### Step 2 — Prompt Engineering & Guardrails
142
- ```
143
- Inputs: AI Architecture Specification
144
- Actions:
145
- - Viết System Prompt có cấu trúc rõ ràng: Role, Capabilities, Boundaries, Output Format.
146
- - Thiết lập Guardrails: Khử jailbreak, cấm hallucination khi thiếu dữ liệu, lọc PII.
147
- - Thiết lập vài ví dụ minh họa (Few-shot learning) nếu cần chuẩn hóa logic phức tạp.
148
- Output: Production-grade Prompt definitions
149
- ```
150
-
151
- ### Step 3 — Pipeline Implementation & Integration
152
- ```
153
- Inputs: Prompts, Schemas, AI SDK
154
- Actions:
155
- - Code pipeline tích hợp LLM client với error handling, retry backoff và fallback logic.
156
- - Kết nối Vector store / Document retriever và reranker (nếu là RAG).
157
- - Tích hợp function calling và parse structured outputs an toàn.
158
- Output: Functional AI Pipeline code
159
- ```
160
-
161
- ### Step 4 — Verification & Eval Execution
162
- ```
163
- Inputs: AI Pipeline, Test dataset
164
- Actions:
165
- - Chạy eval test cases để đo lường: Faithfulness (độ trung thực), Retrieval recall, Latency.
166
- - Đảm bảo token cost nằm trong ngân sách cho phép.
167
- Exit: SUCCESS nếu vượt qua các ngưỡng benchmark chất lượng đã cam kết.
168
- ```
169
-
170
- ---
171
-
172
- ## Prompt Template
173
-
174
- AI đọc `DEV_PROFILE.md` để biết LLM, vector DB, và pipeline framework đang dùng.
175
- Mô tả agent/pipeline cần build — AI thiết kế đúng kiến trúc, không generic.
176
-
177
- ```
178
- Build: [RAG pipeline / AI agent / prompt chain / eval suite / ...]
179
- Mục đích: [System này làm gì, cho ai dùng]
180
- Input: [User query / document / event / ...]
181
- Output: [Response format, citation style, action taken]
182
- Constraints: [Latency budget, cost/query, context window limit, PII rules]
183
- Eval: [Thành công trông như thế nào — metric cụ thể]
184
- ```
185
-
186
- ---
187
-
188
- ### Ví dụ theo use case:
189
-
190
- **RAG — Tài liệu nội bộ (OpenAI + pgvector + LangChain)**
191
- ```
192
- Build: RAG pipeline cho Q&A tài liệu nội bộ công ty
193
- Mục đích: Nhân viên hỏi về policy, quy trình, handbook — AI trả lời có citation
194
- Input: User question (text), corpus: 500 PDF files (~50k pages)
195
- Output: { answer: string, citations: [{doc, page, excerpt}], confidence: high|low }
196
- Constraints: Latency < 3s, cost < $0.01/query, không trả lời ngoài corpus
197
- Eval: Faithfulness > 0.85, Answer relevance > 0.80, No hallucination on factual Q
198
- ```
199
- → AI thiết kế: chunking strategy (semantic vs fixed với overlap),
200
- embedding model (text-embedding-3-small vs large — cost vs quality),
201
- pgvector index type (ivfflat vs hnsw), retrieval pipeline (vector search → rerank),
202
- system prompt với grounding enforcement, citation extraction,
203
- eval harness (RAGAS metrics), fallback khi confidence thấp.
204
-
205
- **Agentic — Tool-calling Agent (OpenAI + LangGraph)**
206
- ```
207
- Build: Customer support agent tự động xử lý refund requests
208
- Mục đích: Giảm ticket cho support team — tự xử lý 80% refund đơn giản
209
- Input: Customer message qua chat widget
210
- Output: Tự động: approve/reject refund, update order status, gửi email
211
- Escalate: chuyển human agent nếu case phức tạp
212
- Constraints: Không approve refund > $500 tự động, log mọi quyết định,
213
- PII không được gửi sang LLM ngoài (dùng on-premise model)
214
- Eval: Accuracy > 95% trên refund eligibility, escalation rate < 20%,
215
- False approve rate = 0% cho orders > $500
216
- ```
217
- → AI thiết kế: tool definitions (check_order, process_refund, escalate_to_human),
218
- LangGraph state machine cho multi-turn conversation,
219
- guardrails cho financial limits (rule-based, không phụ thuộc LLM),
220
- audit trail cho mọi action, PII redaction trước khi gửi LLM,
221
- human-in-the-loop node, eval test cases với adversarial inputs.
222
-
223
- **Prompt Engineering — Structured Output (Anthropic Claude)**
224
- ```
225
- Build: Pipeline extract thông tin từ hóa đơn PDF → JSON
226
- Mục đích: Tự động hóa nhập liệu kế toán — xử lý 1000 hóa đơn/ngày
227
- Input: PDF hóa đơn (scan hoặc digital), đa ngôn ngữ (VN, EN, JP)
228
- Output: { vendor, date, total, currency, lineItems: [], taxAmount, invoiceNumber }
229
- Constraints: Accuracy > 99% trên digital PDFs, > 95% trên scanned,
230
- Latency < 5s/invoice, cost < $0.005/invoice
231
- Eval: Field-level accuracy per invoice type, error rate theo language
232
- ```
233
- → AI thiết kế: PDF parsing strategy (PyMuPDF vs vision model),
234
- structured output với JSON schema (tool_use / response_format),
235
- few-shot examples cho từng invoice format,
236
- confidence scoring per field, human review queue cho low-confidence,
237
- batch processing pipeline, cost tracking per document type,
238
- A/B test prompt versions.
239
-
240
- **Eval Suite — Đánh giá AI system hiện có**
241
- ```
242
- Build: Eval pipeline cho RAG system đang chạy production
243
- Mục đích: Detect regression khi thay đổi prompt hoặc retrieval config
244
- Input: Golden dataset: 200 Q&A pairs có ground truth answers
245
- Output: Eval report: faithfulness, relevance, correctness per category,
246
- comparison vs baseline version
247
- Constraints: Eval phải chạy trong CI/CD, kết quả trong < 10 phút
248
- Eval: Chính eval này cần được validate bằng human judgment sample
249
- ```
250
- → AI thiết kế: RAGAS framework setup, golden dataset format,
251
- LLM-as-judge prompt design (với rubric rõ ràng),
252
- metric thresholds cho CI gate (fail build nếu faithfulness < 0.80),
253
- regression detection (compare vs previous run),
254
- human calibration workflow cho judge prompts.
@@ -1,23 +0,0 @@
1
- # Auto-generated from SKILL.md frontmatter
2
- schema_version: 1
3
- id: "qk-ai-builder"
4
- version: "9.1.0"
5
- description: "Thiết kế Governed AI Agent & RAG pipelines theo chuẩn V8.2 — Đóng gói bằng capability.yaml, data discipline 4-folder và Eval Pipeline."
6
- tools:
7
- - "filesystem"
8
- - "terminal"
9
- knowledge:
10
- owns:
11
- - "agent-architecture"
12
- - "skill-generation"
13
- references:
14
- - "architecture"
15
- - "security"
16
- - "anti-patterns"
17
- eval:
18
- scorecard: "evals/scorecard.yaml"
19
- decision_boundary:
20
- owns:
21
- - "qk-ai-builder"
22
- does_not_own: []
23
- conflicts_with: []
@@ -1,30 +0,0 @@
1
- name: qk-ai-builder-eval
2
- description: Đánh giá chất lượng thiết kế Agent & RAG Pipeline
3
- version: 9.1.0
4
- threshold: 90 # Yêu cầu rất cao vì liên quan đến an ninh (injection) và cấu trúc V8
5
-
6
- metrics:
7
- - id: prompt_design
8
- name: Thiết kế System Prompt
9
- description: Prompt có tuân thủ đúng cấu trúc chuẩn và giới hạn an toàn không?
10
- weight: 30
11
- criteria:
12
- - Có cấu trúc rõ ràng (ROLE, TASK, CONSTRAINTS) (10đ)
13
- - Có định dạng đầu ra (OUTPUT FORMAT) bằng JSON Schema chuẩn (10đ)
14
- - Có Examples (few-shot) để hướng dẫn LLM (10đ)
15
-
16
- - id: security_anti_injection
17
- name: Bảo mật Anti-Injection (R-SEC-04)
18
- description: Các biện pháp phòng ngừa Prompt Injection có được áp dụng không?
19
- weight: 40
20
- criteria:
21
- - Input của user được bọc trong thẻ XML `<user_input>...</user_input>` (20đ)
22
- - Output có chứa trường `confidence` để fallback/human review nếu kết quả có vấn đề (20đ)
23
-
24
- - id: v8_packaging
25
- name: Đóng gói chuẩn V8.2
26
- description: Kiến trúc 4-folder và file định nghĩa có đầy đủ không?
27
- weight: 30
28
- criteria:
29
- - Khởi tạo đúng cấu trúc 4 thư mục: prompts/, data/, agents/, evals/ (15đ)
30
- - Tự động sinh ra `capability.yaml` và `scorecard.yaml` cho skill mới (15đ)
@@ -1,256 +0,0 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-api-consumer
4
- version: 9.2.0
5
- status: stable
6
- description: "Consume API (REST/GraphQL/tRPC), quản lý State, xử lý loading/error/empty states, bind vào UI — bất kể FE framework nào, tuân thủ kiến trúc dự án. Dùng skill này khi user nhắc đến: tích hợp api, gọi api, fetch data, consume api, kết nối api, bind data, state management, api consumer — kể cả khi chỉ nói 'gọi endpoint này để hiển thị lên bảng'."
7
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
-
9
- # ── Classification ─────────────────────────────────────────
10
- type: capability
11
-
12
- intent:
13
- - api-integration
14
- - state-management
15
- - data-binding
16
-
17
- complexity:
18
- level: medium
19
- criteria:
20
- files_affected: "1-5"
21
- has_behavior_change: true
22
- has_external_dependency: true
23
- has_breaking_change: false
24
-
25
- triggers:
26
- - "tích hợp api"
27
- - "gọi api"
28
- - "fetch data"
29
- - "consume api"
30
- - "kết nối api"
31
- - "bind data"
32
- - "state management"
33
- - "api consumer"
34
-
35
-
36
- # ── References ─────────────────────────────────────────────
37
- workflow: feature-delivery
38
-
39
- rules:
40
- - global
41
- - coding
42
-
43
- tools:
44
- - filesystem
45
- - terminal
46
-
47
- related_skills:
48
- - qk-api-lifecycle # Nếu API chưa tồn tại → dùng qk-api-lifecycle trước
49
- - qk-ui-builder # Nếu cần build UI sau khi có data
50
-
51
- knowledge_scope:
52
- owns:
53
- - api-integration
54
- - state-management
55
- - data-binding
56
- - loading-error-empty-states
57
- references:
58
- - architecture
59
- - anti-patterns
60
-
61
- # ── Verification ───────────────────────────────────────────
62
- verification:
63
- required: true
64
- strategy: feature
65
-
66
- selection:
67
- priority: medium
68
- confidence_threshold: 0.80
69
-
70
- # ── Runtime ────────────────────────────────────────────────
71
- execution_mode: deterministic
72
- cost: medium
73
- latency: medium
74
- risk: low
75
- side_effects: edit_files
76
- produces: [code]
77
- consumes: [json-payload, context-graph]
78
-
79
- token_budget:
80
- max_files_read: 4
81
- max_lines_per_read: 120
82
- max_shell_commands: 1
83
- stop_early: true
84
-
85
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
86
- ---
87
-
88
- # qk-api-consumer — API Integration & State Binding
89
-
90
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
91
-
92
- ---
93
-
94
- ## Preconditions
95
-
96
- Trước khi bắt đầu, AI PHẢI xác nhận:
97
-
98
- - [ ] API endpoint đã tồn tại (có docs, OpenAPI spec, hoặc code thực tế)
99
- → Nếu chưa có: `BLOCKED` — chỉ dẫn dùng `qk-api-lifecycle` trước
100
- - [ ] Biết response schema (ít nhất success shape)
101
- → Nếu chưa biết: đọc route handler hoặc hỏi user cung cấp sample response
102
- - [ ] Biết auth requirement (public / JWT / API key)
103
- → Nếu chưa biết: đọc middleware config hoặc hỏi
104
-
105
- ---
106
-
107
- ## Scope
108
-
109
- ✅ Skill này làm:
110
- - Tạo service/hook/store để gọi API
111
- - Map response về đúng type/interface
112
- - Xử lý loading / error / empty states
113
- - Cache, refetch, invalidation strategy
114
- - Optimistic update khi cần
115
- - Bind data vào component
116
-
117
- ❌ Skill này KHÔNG làm:
118
- - Thiết kế API contract (→ `qk-api-lifecycle`)
119
- - Viết backend route handler (→ `qk-api-lifecycle`)
120
- - Xây dựng UI component từ đầu (→ `qk-ui-builder`)
121
- - Thiết kế DB schema (→ `qk-data-lifecycle`)
122
-
123
- ---
124
-
125
- ## Execution Steps
126
-
127
- ### Step 1 — Đọc API contract
128
- ```
129
- Inputs: API docs / route handler / OpenAPI spec
130
- Actions:
131
- - Xác định: method, path, auth header, request shape, response shape
132
- - Xác định: error codes (400/401/403/404/500) và error shape
133
- - Ghi lại: base URL pattern của project (axios instance? fetch wrapper?)
134
- Outputs: Typed interface cho Request + Response
135
- Exit: BLOCKED nếu không tìm được contract
136
- ```
137
-
138
- ### Step 2 — Xác định state strategy (theo stack từ DEV_PROFILE.md)
139
- ```
140
- Inputs: detected_stack (React Query / SWR / Zustand / Pinia / Redux / plain fetch)
141
- Actions:
142
- - React + React Query → useQuery / useMutation pattern
143
- - React + SWR → useSWR / useSWRMutation
144
- - React + Redux RTK → createApi slice
145
- - Vue + Pinia → defineStore + action
146
- - Vue + VueQuery → useQuery (vue-query)
147
- - Next.js Server Comp → async server component + fetch cache
148
- - Vanilla / no library → custom hook với useReducer
149
- - Angular → HttpClient service + RxJS
150
- - Không có DEV_PROFILE → hỏi user trước khi code
151
- Outputs: Quyết định state pattern
152
- ```
153
-
154
- ### Step 3 — Implement
155
- ```
156
- Actions:
157
- 3a. Tạo type definitions (TypeScript) hoặc JSDoc types (JavaScript)
158
- 3b. Tạo service function / API caller
159
- 3c. Tạo hook / store / query
160
- 3d. Handle 3 bắt buộc: loading state, error state, empty state
161
- 3e. Bind vào component (nếu được yêu cầu)
162
-
163
- Rules:
164
- - KHÔNG dùng `any` cho response type
165
- - KHÔNG silent-catch error (console.log rồi bỏ qua)
166
- - KHÔNG hardcode base URL — phải dùng env variable
167
- - Loading UI: skeleton ưu tiên hơn spinner cho content areas
168
- - Error: show actionable message, không "Something went wrong"
169
- ```
170
-
171
- ### Step 4 — Verify
172
- ```
173
- Actions:
174
- - Re-read code vừa viết, kiểm tra type safety
175
- - Kiểm tra error boundary có được set up không
176
- - Kiểm tra không có N+1 request (gọi API trong loop)
177
- - Kiểm tra cleanup (unsubscribe / AbortController nếu cần)
178
- ```
179
-
180
- ---
181
-
182
- ## Prompt Template
183
-
184
- AI đọc `DEV_PROFILE.md` để biết stack + state pattern. Cung cấp API contract — AI lo phần còn lại.
185
-
186
- ```
187
- API: [Method + Path — vd: GET /api/products]
188
- Auth: [public / user-jwt / api-key]
189
- Request: [Query params hoặc body nếu có]
190
- Response: [Mô tả hoặc paste sample JSON]
191
- Dùng ở: [Component / page nào sẽ hiển thị data này]
192
- Behavior: [Loading trông thế nào? Error hiện gì? Empty state ra sao?]
193
- ```
194
-
195
- ---
196
-
197
- ### Theo Role & Stack:
198
-
199
- **React + React Query (fe / fullstack)**
200
- ```
201
- API: GET /api/products?page=1&limit=20&category=shoes
202
- Auth: public
203
- Response: { data: Product[], total: number, hasNextPage: boolean }
204
- Dùng ở: ProductList.tsx — hiển thị grid sản phẩm có infinite scroll
205
- Behavior: Loading → skeleton grid 6 cards, Error → banner + retry button,
206
- Empty → "Không tìm thấy sản phẩm" + clear filter button
207
- ```
208
- → AI tạo: `useProducts(params)` hook với `useInfiniteQuery`, type `Product`,
209
- skeleton component, error boundary fallback, `getNextPageParam` logic.
210
-
211
- **Next.js 14 App Router (fullstack)**
212
- ```
213
- API: GET /api/dashboard/stats (internal — cùng Next.js app)
214
- Auth: session (NextAuth)
215
- Response: { revenue: number, orders: number, newUsers: number }
216
- Dùng ở: app/dashboard/page.tsx — Server Component
217
- Behavior: Suspense fallback với skeleton, error.tsx xử lý lỗi
218
- ```
219
- → AI tạo: async Server Component với `fetch` + `cache: 'no-store'`,
220
- `loading.tsx` skeleton, `error.tsx` boundary, session check với `getServerSession`.
221
-
222
- **Vue 3 + Pinia (fe / fullstack)**
223
- ```
224
- API: POST /api/cart/items (add to cart)
225
- Auth: user-jwt (Bearer token từ auth store)
226
- Request: { productId: string, quantity: number }
227
- Response: { cartId: string, items: CartItem[], total: number }
228
- Dùng ở: ProductCard.vue — nút "Add to Cart"
229
- Behavior: Optimistic: tăng cart count ngay, rollback nếu API fail
230
- ```
231
- → AI tạo: `useCartStore` Pinia store với `addItem` action,
232
- optimistic update + rollback pattern, toast notification on error,
233
- axios interceptor inject JWT từ `useAuthStore`.
234
-
235
- **Angular + HttpClient (fe)**
236
- ```
237
- API: GET /api/users/:id
238
- Auth: Bearer JWT
239
- Response: { id, name, email, role, createdAt }
240
- Dùng ở: UserProfileComponent
241
- Behavior: Loading spinner, error redirect về /login nếu 401
242
- ```
243
- → AI tạo: `UserService` injectable với `HttpClient`, `UserProfile` interface,
244
- `AsyncPipe` trong template, `HttpInterceptor` xử lý 401 → redirect.
245
-
246
- **data / ai-engineer (server-side data fetching)**
247
- ```
248
- API: POST /api/ingest/predictions (nhận batch từ ML pipeline)
249
- Auth: api-key (header: X-API-Key)
250
- Request: { batchId: string, predictions: Prediction[] }
251
- Response: { accepted: number, rejected: number, errors: ErrorItem[] }
252
- Dùng ở: Python consumer script — không phải UI
253
- Behavior: Retry 3 lần khi 5xx, log từng batch result, dead-letter queue khi fail
254
- ```
255
- → AI tạo: Python `httpx` async client, retry logic với exponential backoff,
256
- batch result logging, structured error handling per prediction.
@@ -1,21 +0,0 @@
1
- # Auto-generated from SKILL.md frontmatter
2
- schema_version: 1
3
- id: "qk-fe-api-integration"
4
- version: "9.1.0"
5
- description: "Consume API Backend, quản lý State, bind vào UI — tuân thủ kiến trúc Base dự án"
6
- tools:
7
- - "filesystem"
8
- - "terminal"
9
- knowledge:
10
- owns:
11
- - "api-integration"
12
- - "state-management"
13
- references:
14
- - "architecture"
15
- eval:
16
- scorecard: "evals/scorecard.yaml"
17
- decision_boundary:
18
- owns:
19
- - "qk-fe-api-integration"
20
- does_not_own: []
21
- conflicts_with: []
@@ -1,29 +0,0 @@
1
- name: qk-fe-api-integration-eval
2
- description: Đánh giá chất lượng tích hợp API vào giao diện Frontend
3
- version: 9.1.0
4
- threshold: 85 # Đảm bảo tính toàn vẹn của DTO, UI State và ranh giới bảo mật
5
-
6
- metrics:
7
- - id: type_and_validation
8
- name: Khởi tạo Types và Validation (Zod)
9
- description: Agent có gen ra Types và Zod schema từ JSON payload mẫu không?
10
- weight: 30
11
- criteria:
12
- - Khởi tạo chính xác Zod Schema và xuất TypeScript interfaces (15đ)
13
- - Phân biệt rõ ràng các trường bắt buộc và tùy chọn (.optional(), .nullable()) (15đ)
14
-
15
- - id: architecture_compliance
16
- name: Tuân thủ Kiến trúc dự án (Base Architecture)
17
- description: Agent có tái sử dụng API Client có sẵn không?
18
- weight: 30
19
- criteria:
20
- - Ưu tiên dùng wrapper có sẵn (Axios/TanStack Query) thay vì viết raw fetch tràn lan (15đ)
21
- - Tuyệt đối không hardcode Base URL vào trong component (15đ)
22
-
23
- - id: ui_state_handling
24
- name: Xử lý State giao diện toàn diện
25
- description: Có bao phủ đủ 3 trạng thái Loading, Success, Error không?
26
- weight: 40
27
- criteria:
28
- - Xử lý mượt mà trạng thái Loading và Success (20đ)
29
- - Có cơ chế bắt lỗi HTTP bài bản (401, 404, 500, Network Error) và map với Error state của giao diện (20đ)