ai-developer-skill-os 8.2.0 → 8.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 (79) hide show
  1. package/.agents/LICENSE +21 -21
  2. package/.agents/README.md +90 -90
  3. package/.agents/docs/CHI_TIET_SKILLS.md +125 -125
  4. package/.agents/docs/MIGRATION-CLEANUP-V8.1.3.md +36 -36
  5. package/.agents/docs/MIGRATION-STATUS.md +35 -35
  6. package/.agents/docs/MIGRATION-V8.md +10 -10
  7. package/.agents/docs/V8-CERTIFICATION.md +27 -27
  8. package/.agents/docs/decisions/ADR-001-v8-migration.md +58 -58
  9. package/.agents/docs/decisions/ADR-002-workflow-separation.md +50 -50
  10. package/.agents/docs/decisions/ADR-003-registry-generated.md +54 -54
  11. package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +27 -27
  12. package/.agents/registry/graph.json +4 -8
  13. package/.agents/registry/index.yaml +3 -4
  14. package/.agents/registry/skills-index.yml +525 -525
  15. package/.agents/rules/coding.md +10 -0
  16. package/.agents/rules/command-safety.md +37 -14
  17. package/.agents/rules/priorities.yml +13 -2
  18. package/.agents/rules/security.md +47 -7
  19. package/.agents/rules/skill-quality.md +32 -8
  20. package/.agents/skills/_template/SKILL.md +133 -132
  21. package/.agents/skills/_template/capability.yaml +20 -20
  22. package/.agents/skills/_template/evals/scorecard.yaml +19 -19
  23. package/.agents/skills/qk-access-policy/SKILL.md +4 -1
  24. package/.agents/skills/qk-agent-observability/SKILL.md +111 -0
  25. package/.agents/skills/qk-agent-observability/references/scorecard.yaml +80 -0
  26. package/.agents/skills/qk-ai-builder/SKILL.md +74 -5
  27. package/.agents/skills/qk-api-lifecycle/SKILL.md +4 -2
  28. package/.agents/skills/qk-bug-resolution/SKILL.md +3 -21
  29. package/.agents/skills/qk-code-review/SKILL.md +188 -189
  30. package/.agents/skills/qk-context-loader/SKILL.md +3 -47
  31. package/.agents/skills/qk-data-lifecycle/SKILL.md +7 -2
  32. package/.agents/skills/qk-db-optimizer/SKILL.md +3 -2
  33. package/.agents/skills/qk-design-system-engineering/SKILL.md +235 -112
  34. package/.agents/skills/qk-devops-platform/SKILL.md +241 -117
  35. package/.agents/skills/qk-docs/SKILL.md +3 -1
  36. package/.agents/skills/qk-engineering-standard/SKILL.md +4 -75
  37. package/.agents/skills/qk-engineering-standard/references/anti-patterns.md +121 -0
  38. package/.agents/skills/qk-engineering-standard/rules/frontend.md +1 -1
  39. package/.agents/skills/qk-fe-api-integration/SKILL.md +13 -32
  40. package/.agents/skills/qk-feature-delivery/SKILL.md +54 -202
  41. package/.agents/skills/qk-frontend-architecture/SKILL.md +258 -134
  42. package/.agents/skills/qk-help/SKILL.md +21 -159
  43. package/.agents/skills/qk-orchestrator/SKILL.md +2 -78
  44. package/.agents/skills/qk-orchestrator/references/routing-table.md +15 -3
  45. package/.agents/skills/qk-product-specification/SKILL.md +253 -130
  46. package/.agents/skills/qk-production-release/SKILL.md +32 -67
  47. package/.agents/skills/qk-project-bootstrap/SKILL.md +59 -8
  48. package/.agents/skills/qk-project-health/SKILL.md +4 -2
  49. package/.agents/skills/qk-project-memory/SKILL.md +3 -1
  50. package/.agents/skills/qk-security-audit/SKILL.md +259 -135
  51. package/.agents/skills/qk-system-evolution/SKILL.md +18 -68
  52. package/.agents/skills/qk-test-engineering/SKILL.md +262 -139
  53. package/.agents/skills/qk-ui-audit/SKILL.md +16 -89
  54. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +2 -2
  55. package/.agents/skills/qk-ui-builder/SKILL.md +482 -509
  56. package/.agents/skills/qk-ui-builder/references/component-cookbook.md +455 -1191
  57. package/.agents/skills/qk-ui-system-builder/SKILL.md +1 -5
  58. package/.agents/skills/qk-validation-gate/SKILL.md +0 -74
  59. package/.agents/skills/qk-web-quality-gate/SKILL.md +232 -114
  60. package/.agents/workflows/_schema.yml +146 -109
  61. package/.agents/workflows/bug-resolution.yml +121 -101
  62. package/.agents/workflows/code-review.yml +93 -77
  63. package/.agents/workflows/documentation.yml +90 -75
  64. package/.agents/workflows/feature-delivery.yml +120 -103
  65. package/.agents/workflows/refactor.yml +99 -81
  66. package/.agents/workflows/research.yml +75 -60
  67. package/.agents/workflows/security-audit.yml +115 -72
  68. package/.agents/workflows/skill-evolution.yml +97 -65
  69. package/.agents/workflows/spec-driven-development.yml +87 -57
  70. package/CHANGELOG.md +10 -0
  71. package/README.md +90 -90
  72. package/bin/install.js +330 -180
  73. package/package.json +2 -2
  74. package/.agents/CHANGELOG.md +0 -131
  75. package/.agents/learnings/draft/README.md +0 -37
  76. package/.agents/reports/RELEASE-CHECKLIST.md +0 -29
  77. package/.agents/reports/architecture-audit.md +0 -13
  78. package/.agents/reports/graph-health.md +0 -20
  79. package/.agents/reports/skill-audit.md +0 -215
@@ -4,7 +4,7 @@
4
4
 
5
5
  ---
6
6
 
7
- ## 🔄 [Merged from qk-frontend-architecture]
7
+ ## Referenced by: qk-frontend-architecture (file-placement subset)
8
8
 
9
9
  # Frontend Architecture
10
10
 
@@ -140,7 +140,7 @@ On missing precondition:
140
140
  **Decision:**
141
141
  ```
142
142
  IF wrapper/client found (e.g., apiClient.ts, axiosInstance.ts)
143
- → Use it. NEVER bypass with raw fetch/axios.
143
+ → Use it. Ưu tiên bọc (wrap) bằng TanStack Query (useQuery/useMutation) nếu có thể. NEVER bypass with raw fetch/axios in components.
144
144
  → Confidence: HIGH → go to Phase 2
145
145
 
146
146
  ELSE IF no wrapper found
@@ -157,20 +157,22 @@ ELSE IF conflicting patterns found (mix of fetch + axios + rtk)
157
157
 
158
158
  ---
159
159
 
160
- ### Phase 2 — Generate Types
160
+ ### Phase 2 — Generate Types & Validation
161
161
 
162
162
  **Steps:**
163
- 1. Parse provided JSON payload → extract all fields with types
164
- 2. Generate TypeScript interface (Request + Response)
165
- 3. Flag any field that could be `null` or optional
163
+ 1. Parse provided JSON payload → extract all fields
164
+ 2. Generate **Zod schema** (`z.object({...})`) for runtime validation
165
+ 3. Export TypeScript interface via inferred Zod type (`export type Response = z.infer<typeof schema>`)
166
+ 4. Flag any field that could be `null` or optional with `.nullable()` or `.optional()`
166
167
 
167
168
  **Decision:**
168
169
  ```
169
170
  IF all fields clearly typed from JSON
171
+ → Khởi tạo Zod schema chính xác.
170
172
  → Confidence: HIGH → go to Phase 3
171
173
 
172
174
  ELSE IF some fields ambiguous (null | undefined)
173
- → Mark as optional (?:) + add comment "// verify with backend"
175
+ → Mark as optional in Zod (`.optional()`) + add comment "// verify with backend"
174
176
  → Confidence: MEDIUM → go to Phase 3
175
177
 
176
178
  ELSE IF nested objects contain mixed null/non-null patterns
@@ -182,10 +184,11 @@ ELSE IF nested objects contain mixed null/non-null patterns
182
184
  ### Phase 3 — Implement Service + UI Binding
183
185
 
184
186
  **Steps:**
185
- 1. Create/update service file (API calls only — no UI logic)
186
- 2. Bind to component: implement Loading state (skeleton/spinner)
187
- 3. Bind Success state: render data using generated types
188
- 4. Bind Error state: handle HTTP errors per table below
187
+ 1. Create/update service file: Viết API fetcher function.
188
+ 2. Viết Custom Hook bọc fetcher function bằng **TanStack Query** (`useQuery` hoặc `useMutation`).
189
+ 3. Bind to component: Dùng các states từ hook (`isLoading`, `isPending`, `isError`, `data`) thay tự tạo `useEffect`.
190
+ 4. Bind Error state: handle HTTP errors per table below.
191
+ 5. Kiểm duyệt ranh giới an toàn (R-SEC-04): Validate dữ liệu API trả về bằng Zod Schema ở (2) trước khi render.
189
192
 
190
193
  **HTTP Error Handling (mandatory for ALL integrations):**
191
194
  ```
@@ -356,25 +359,3 @@ Exit Code: [SUCCESS | PARTIAL | BLOCKED | FAILED]
356
359
 
357
360
  ---
358
361
 
359
- Consume backend API safely in frontend: identify existing client, generate types, implement service layer, and bind to UI with proper states.
360
- Triggered when user needs to integrate a backend API endpoint into a frontend application. Requires JSON payload sample and knowledge of existing API client patterns.
361
- - JSON payload sample (request/response)
362
- - API endpoint specification
363
- - Existing API client path (if any)
364
- - Component to bind (if specified)
365
- - Context graph (for existing patterns)
366
- 1. **Identify:** Find existing API client or confirm need for new one
367
- 2. **Generate:** Create TypeScript interfaces from JSON payload
368
- 3. **Implement:** Build service layer with proper HTTP methods
369
- 4. **Bind:** Connect to UI with Loading/Success/Error states
370
- 5. **Audit:** Verify no hardcoded URLs, no API in JSX, proper error handling
371
- - NEVER bypass existing wrapper with raw fetch/axios
372
- - MUST generate strict TypeScript interfaces (no `any`)
373
- - MUST handle all 3 UI states: Loading, Success, Error
374
- - MUST NOT exceed token_budget (max 3 files, 100 lines each, 1 shell command)
375
- - MUST stop early if confidence threshold reached
376
- - Zero-Trust: Use existing client pattern, never invent new one without approval
377
- - Type Safety: All API responses must have explicit TypeScript types
378
- - Error Handling: All HTTP errors must be handled per mandatory table
379
- - Separation: Service layer only — no API calls in presentational components
380
- ---
@@ -55,7 +55,8 @@ knowledge_scope:
55
55
  - requirement-analysis
56
56
  references:
57
57
  - testing
58
- - security-rules
58
+ - security
59
+ - anti-patterns
59
60
  - design-system
60
61
 
61
62
  # ── V8: Verification ───────────────────────────────────────
@@ -79,7 +80,7 @@ token_budget:
79
80
  max_files_read: 5
80
81
  max_lines_per_read: 150
81
82
  max_shell_commands: 2
82
- stop_early: false
83
+ stop_early: true
83
84
 
84
85
  exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
85
86
  ---
@@ -104,261 +105,112 @@ On missing precondition:
104
105
  ---
105
106
 
106
107
  ## Scope
107
- - ✅ Deliver a complete, verifiable feature end-to-end (FE + BE + API)
108
- - ✅ Adhere to project architecture from context graph
109
- - ✅ Adhere to DESIGN.md for any UI components
110
- - ✅ Self-audit before marking done
108
+ - ✅ Read requirements and design docs (Context Loading)
109
+ - ✅ Implement feature adhering to R-C-09 (Anti-slop) and R-SEC-04 (Zero-Trust)
110
+ - ✅ Write unit/integration tests as required
111
+ - ✅ Run self-audit using qk-validation-gate before finishing
111
112
 
112
113
  ## Non-Goals
113
- - ❌ Mix refactoring into feature work
114
- - ❌ Add dependencies without asking user first
115
- - ❌ Emit generic AI-slop UI or unverified logic
116
- - ❌ Ignore backward compatibility on existing APIs
117
- - ❌ Proceed with ambiguous requirements without user confirmation
118
- - ❌ Break existing API contracts — version or deprecate instead
114
+ - ❌ Skip validation gate
115
+ - ❌ Bypass R-SEC-04 (Zero-Trust) input validation
116
+ - ❌ Write 'spaghetti' code or giant God Files
119
117
 
120
118
  ---
121
119
 
122
120
  ## Priority Order
123
-
124
- | Priority | Task | Skip Threshold |
125
- |----------|------|----------------|
126
- | P1 | Core feature logic (happy path) | Never |
127
- | P2 | Error/loading/empty UI states | Budget < 30% |
128
- | P3 | Edge cases and validation | Budget < 50% |
129
- | P4 | Regression prevention (existing tests) | Budget < 60% |
130
- | P5 | Backend contract validation (API schema, DB migrations) | Budget < 60% |
131
- | P6 | Documentation + comments | Budget < 70% |
121
+ | P | Task | Skip Threshold |
122
+ |---|------|----------------|
123
+ | P1 | Load and read requirements & design | Never |
124
+ | P2 | Context Graph verification (dependencies) | Never |
125
+ | P3 | Implementation (Code) | Never |
126
+ | P4 | Testing & Validation Gate | Never |
127
+ | P5 | Documentation | Budget < 30% |
132
128
 
133
129
  ---
134
130
 
135
131
  ## Workflow
136
132
 
137
- ### Phase 1 — Requirements Clarification
138
-
139
- **Steps:**
140
- 1. Parse user request extract: what, where, acceptance criteria
141
- 2. Check ambiguity: Can I implement this without assumptions?
133
+ ### Phase 1 — Context Loading
134
+ 1. Read feature spec / requirements.
135
+ 2. Read `DESIGN.md` if UI is involved.
136
+ 3. Verify dependency graph via `qk-context-loader`.
142
137
 
143
138
  **Decision:**
144
- ```
145
- IF requirements are specific (what + where + expected behavior)
146
- → Confidence: HIGH → go to Phase 2
139
+ IF context is clear → go to Phase 2
140
+ ELSE EXIT: BLOCKED ask user
147
141
 
148
- ELSE IF 1–2 ambiguous points
149
- ASK USER clarifying questions
150
- Confidence: MEDIUM WAIT for user response
151
- Do NOT proceed to Phase 2 until clarified
142
+ ### Phase 2 Implementation (Code)
143
+ 1. Write code in isolated steps.
144
+ 2. **BẮT BUỘC tuân thủ R-C-09 (Zero Slop) và R-SEC-04 (Zero Trust).**
145
+ 3. Keep functions < 30 lines, avoid God Files.
152
146
 
153
- ELSE IF core requirement unclear
154
- EXIT: BLOCKED ask clarifying questions
155
- ```
156
-
157
- **Exit When:**
158
- - Requirements understood → go to Phase 2
159
-
160
- ---
147
+ ### Phase 3 Testing
148
+ 1. Write unit tests / integration tests.
149
+ 2. Run test commands to verify.
161
150
 
162
- ### Phase 2Context Loading
163
-
164
- **Steps:**
165
- 1. If logic work: read context graph from `qk-context-loader` output
166
- 2. Identify: entry point, affected modules, existing patterns to reuse
167
- 3. If UI work: read `DESIGN.md` → extract tokens for this component
168
- 4. Document rollback plan — which files to revert if feature fails
151
+ ### Phase 4Validation Gate (Self-Audit)
152
+ 1. Hand off to `qk-validation-gate` or run linters.
153
+ 2. Fix any reported violations immediately.
169
154
 
170
155
  **Decision:**
171
- ```
172
- IF context graph available
173
- → Use it, proceed to Phase 3
174
-
175
- ELSE IF no context graph but simple task
176
- → Simple task = modifies ≤ 1 file, no new dependencies, no new API contracts
177
- → grep_search for entry point → minimal manual map
178
- → Confidence: MEDIUM → proceed to Phase 3
179
-
180
- ELSE IF complex task without context graph
181
- → EXIT: BLOCKED — run qk-context-loader first
182
- ```
183
-
184
- ---
185
-
186
- ### Phase 3 — Implementation
187
-
188
- **Steps (in order):**
189
- 1. Create/modify files using `replace_file_content` / `multi_replace_file_content`
190
- 2. Follow existing code patterns (from context graph)
191
- 3. For UI: use DESIGN.md tokens only — no hardcoded colors/sizes
192
- 4. Implement backend error handling: try/catch, transaction rollback, input validation
193
- 5. Handle all 3 UI states: Loading + Success + Error
194
-
195
- **Exit When:**
196
- - Happy path implemented → go to Phase 4
197
- - Blocked by missing dependency → EXIT: BLOCKED, ask user
198
-
199
- ---
200
-
201
- ### Phase 4 — Self-Audit
202
-
203
- **Steps:**
204
- 1. Re-read the code written (targeted view, ≤ 150 lines)
205
- 2. Check against: backward compat, DESIGN.md compliance, error states
206
- 3. Verify test coverage meets project threshold (default: ≥ 80%)
207
-
208
- **Decision:**
209
- ```
210
- IF all checks pass
211
- → EXIT: SUCCESS
212
-
213
- ELSE IF minor issues found (missing error state, style token)
214
- → Fix immediately, EXIT: SUCCESS
215
-
216
- ELSE IF significant issue (breaks existing API, wrong architecture)
217
- → Fix, note change in output, EXIT: FAILED — do not ship breaking changes as PARTIAL
218
-
219
- ELSE IF missing backend error handling
220
- → Fix immediately, EXIT: SUCCESS
221
- ```
156
+ IF validation passes → EXIT: SUCCESS
157
+ IF validation fails → Fix and retry
222
158
 
223
159
  ---
224
160
 
225
161
  ## Confidence Model
226
-
227
162
  | Level | Condition | Action |
228
163
  |-------|-----------|--------|
229
- | HIGH | Context graph available, DESIGN.md read, requirements clear | Implement directly |
230
- | MEDIUM | Some assumptions made (≤ 2) | Note assumptions in output |
231
- | LOW | Unclear requirements or missing context OR assumptions > 2 | EXIT: BLOCKED |
164
+ | HIGH | Requirements clear, tests pass, validation clean | Report SUCCESS |
165
+ | MEDIUM | Specs ambiguous, some assumptions made | Ask user to review |
166
+ | LOW | Lacking specs or API contracts | EXIT: BLOCKED |
232
167
 
233
168
  ---
234
169
 
235
- ## Severity (for self-audit findings)
236
-
170
+ ## Severity
237
171
  | Level | Definition |
238
172
  |-------|-----------|
239
- | CRITICAL | Feature breaks existing functionality |
240
- | HIGH | Missing required states (error/loading) or missing backend error handling |
241
- | MEDIUM | Not following DESIGN.md or project patterns |
242
- | LOW | Missing comments or minor style issue |
173
+ | CRITICAL | Broken functionality, security risk |
174
+ | HIGH | Missing tests, validation gate failed |
175
+ | MEDIUM | Minor UX issues |
176
+ | LOW | Code style issues |
243
177
 
244
178
  ---
245
179
 
246
- ## Evidence Format (Self-Audit)
247
-
180
+ ## Evidence Format
248
181
  ```
249
- [SEVERITY] path/to/file.ts:LINE
250
- Issue: [what was found]
182
+ [SEVERITY] path/to/file.ts
183
+ Action: [What was implemented/fixed]
251
184
  Confidence: HIGH
252
- Fix: [applied immediately OR noted for follow-up]
253
- ```
254
-
255
- ---
256
-
257
- ## Escalation Rules
258
-
259
- ```
260
- BLOCKED: [specific reason]
261
- Missing:
262
- - [What's needed — context graph / DESIGN.md / clear requirements]
263
- Questions:
264
- 1. [Specific clarifying question]
265
- 2. [Second question if needed]
266
- Recommended Assumptions (if proceeding):
267
- - [Safe assumption 1]
268
- - [Safe assumption 2 — note these will be in output]
185
+ Validation: [PASS | FAIL]
269
186
  ```
270
187
 
271
188
  ---
272
189
 
273
190
  ## Handoff Contract
274
-
275
191
  ### Consumes
276
192
  ```json
277
193
  {
278
- "from": "qk-context-loader + user",
279
- "required_fields": ["feature_description", "context_graph"],
280
- "optional_fields": ["design_md_path", "acceptance_criteria"]
194
+ "from": "user or qk-product-specification",
195
+ "required_fields": ["feature_spec", "acceptance_criteria"]
281
196
  }
282
197
  ```
283
-
284
198
  ### Produces
285
199
  ```json
286
200
  {
287
201
  "to": "qk-validation-gate",
288
- "output_fields": ["changed_files", "assumptions_made", "self_audit_result", "exit_code"]
202
+ "output_fields": ["implemented_files", "test_status", "exit_code"]
289
203
  }
290
204
  ```
291
205
 
292
206
  ---
293
207
 
294
- ## Output Format
295
-
296
- ```
297
- 🚀 Feature Delivery
298
- ─────────────────────────────────────────────────
299
- Feature: [feature name]
300
- Confidence: [HIGH | MEDIUM]
301
-
302
- Implementation:
303
- ✅ [file:line — what was added/changed]
304
- ✅ [file:line — what was added/changed]
305
-
306
- Assumptions made:
307
- - [assumption 1 — safe/risky]
308
-
309
- Self-Audit:
310
- ✅ Backward compatible
311
- ✅ Error/Loading states handled
312
- ✅ DESIGN.md tokens used
313
- ✅ Backend error handling implemented
314
- ⚠️ [Any noted issue]
315
-
316
- Exit Code: [SUCCESS | PARTIAL | BLOCKED | FAILED]
317
- ```
318
-
319
- ---
320
-
321
208
  ## Exit Codes
322
-
323
209
  | Code | Meaning | When |
324
210
  |------|---------|------|
325
- | SUCCESS | Feature complete, self-audit passed | All states handled, patterns followed |
326
- | PARTIAL | Feature works but with minor gaps | Medium confidence, some skipped |
327
- | BLOCKED | Cannot proceed missing context/design/requirements | Stop and ask user |
328
- | FAILED | Cannot implement breaks existing system | Architectural conflict or API break |
329
-
330
- ---
331
-
332
- Deliver a complete, verifiable feature end-to-end (FE + BE + API) while adhering to project architecture and DESIGN.md.
333
- This skill is the primary execution skill for building new features. It requires clear requirements, context graph for architecture understanding, and DESIGN.md for UI work.
334
- - Feature description with acceptance criteria
335
- - Context graph (from qk-context-loader)
336
- - DESIGN.md path (if UI involved)
337
- - Existing codebase patterns
338
- - User approval for new dependencies
339
- 1. **Clarify:** Parse requirements, identify ambiguities, ask user if needed
340
- 2. **Load:** Read context graph and DESIGN.md tokens
341
- 3. **Implement:** Build feature following existing patterns
342
- 4. **Audit:** Self-audit for backward compat, error states, DESIGN.md compliance
343
- - MUST have context graph OR explicit confirmation for simple tasks
344
- - MUST have DESIGN.md tokens if UI is involved
345
- - MUST handle all 3 UI states: Loading, Success, Error
346
- - MUST NOT exceed token_budget (max 5 files, 150 lines each, 2 shell commands)
347
- - MUST NOT break existing API contracts without versioning
348
- - Zero-Trust: No assumptions without user confirmation
349
- - Backward Compat: Never break existing public APIs
350
- - Design First: UI must use DESIGN.md tokens only
351
- - Error Handling: Backend must have try/catch, validation, rollback
352
- ## Retry Policy
353
- ```
354
- Fix applied
355
- └─ Static verification (re-read fixed section)
356
- ├─ PASS → EXIT: SUCCESS
357
- └─ Issue detected → attempt 1 correction
358
- └─ Re-verify
359
- ├─ PASS → EXIT: SUCCESS
360
- └─ FAIL → EXIT: PARTIAL + report both attempts
361
- └─ Do NOT attempt 3rd fix — ESCALATE to user
362
- ```
211
+ | SUCCESS | Feature completed, tests pass, validation clean | Normal |
212
+ | PARTIAL | Feature mostly done, some minor issues | Budget hit |
213
+ | BLOCKED | Missing requirements or design | Cannot start |
214
+ | FAILED | Implementation fundamentally broken | Tests/Validation failed |
363
215
 
364
216
  ---