ai-developer-skill-os 9.1.2 → 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 +37 -19
  5. package/.agents/registry/index.yaml +59 -13
  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 -377
  10. package/.agents/skills/qk-access-policy/SKILL.md +98 -473
  11. package/.agents/skills/qk-agent-observability/SKILL.md +3 -439
  12. package/.agents/skills/qk-ai-builder/SKILL.md +132 -565
  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 -456
  17. package/.agents/skills/qk-bug-resolution/SKILL.md +128 -561
  18. package/.agents/skills/qk-code-review/SKILL.md +142 -420
  19. package/.agents/skills/qk-context-loader/SKILL.md +99 -471
  20. package/.agents/skills/qk-data-engineer/SKILL.md +119 -340
  21. package/.agents/skills/qk-data-lifecycle/SKILL.md +89 -488
  22. package/.agents/skills/qk-db-optimizer/SKILL.md +102 -488
  23. package/.agents/skills/qk-design-system-engineering/SKILL.md +76 -461
  24. package/.agents/skills/qk-devops-platform/SKILL.md +77 -463
  25. package/.agents/skills/qk-docs/SKILL.md +88 -494
  26. package/.agents/skills/qk-engineering-standard/SKILL.md +4 -588
  27. package/.agents/skills/qk-fe-api-integration/SKILL.md +343 -343
  28. package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +29 -29
  29. package/.agents/skills/qk-feature-delivery/SKILL.md +137 -445
  30. package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
  31. package/.agents/skills/qk-frontend-architecture/SKILL.md +5 -479
  32. package/.agents/skills/qk-help/evals/scorecard.yaml +13 -13
  33. package/.agents/skills/qk-orchestrator/SKILL.md +63 -502
  34. package/.agents/skills/qk-orchestrator/references/routing-table.md +10 -14
  35. package/.agents/skills/qk-product-specification/SKILL.md +70 -479
  36. package/.agents/skills/qk-production-release/SKILL.md +80 -537
  37. package/.agents/skills/qk-project-audit/SKILL.md +174 -0
  38. package/.agents/skills/qk-project-bootstrap/SKILL.md +243 -471
  39. package/.agents/skills/qk-project-health/SKILL.md +97 -496
  40. package/.agents/skills/qk-project-memory/SKILL.md +76 -21
  41. package/.agents/skills/qk-refactor/SKILL.md +167 -384
  42. package/.agents/skills/qk-security-audit/SKILL.md +141 -463
  43. package/.agents/skills/qk-security-audit/capability.yaml +1 -2
  44. package/.agents/skills/qk-system-evolution/SKILL.md +343 -343
  45. package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +26 -26
  46. package/.agents/skills/qk-test-engineering/SKILL.md +119 -509
  47. package/.agents/skills/qk-ui-audit/SKILL.md +73 -537
  48. package/.agents/skills/qk-ui-builder/SKILL.md +521 -482
  49. package/.agents/skills/qk-ui-system-builder/SKILL.md +68 -514
  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 -603
  54. package/.agents/skills/qk-web-quality-gate/SKILL.md +85 -463
  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
@@ -0,0 +1,256 @@
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.
@@ -0,0 +1,21 @@
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: []
@@ -0,0 +1,29 @@
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đ)