ai-developer-skill-os 2.1.1 → 3.0.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.
- package/.agents/AGENTS.md +48 -0
- package/README.md +77 -130
- package/knowledge/frontend/react.md +27 -0
- package/package.json +1 -1
- package/skills/qk-access-policy/SKILL.md +40 -127
- package/skills/qk-ai-builder/SKILL.md +41 -33
- package/skills/qk-api-lifecycle/SKILL.md +62 -420
- package/skills/qk-bug-resolution/SKILL.md +65 -371
- package/skills/qk-context-loader/SKILL.md +47 -206
- package/skills/qk-data-lifecycle/SKILL.md +60 -135
- package/skills/qk-design-to-code/SKILL.md +46 -33
- package/skills/qk-docs/SKILL.md +52 -335
- package/skills/qk-documentation-system/SKILL.md +38 -33
- package/skills/qk-engineering-standard/SKILL.md +61 -171
- package/skills/qk-feature-delivery/SKILL.md +63 -432
- package/skills/qk-help/SKILL.md +37 -95
- package/skills/qk-orchestrator/SKILL.md +52 -272
- package/skills/qk-policy-engine/SKILL.md +52 -33
- package/skills/qk-production-release/SKILL.md +45 -127
- package/skills/qk-project-bootstrap/SKILL.md +43 -33
- package/skills/qk-project-health/SKILL.md +56 -650
- package/skills/qk-project-memory/SKILL.md +35 -33
- package/skills/qk-system-evolution/SKILL.md +63 -315
- package/skills/qk-ui-audit/SKILL.md +58 -152
- package/skills/qk-ui-system-builder/SKILL.md +40 -444
- package/skills/qk-validation-gate/SKILL.md +59 -33
- package/templates/bug-report.md +21 -0
- package/templates/design-report.md +21 -0
- package/templates/feature-report.md +20 -0
- package/templates/review-report.md +21 -0
|
@@ -1,371 +1,65 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-bug-resolution
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- ✅ Reproduce the reported bug
|
|
68
|
-
- ✅ Identify the root cause (not just the symptom)
|
|
69
|
-
- ✅ Apply a minimal, targeted fix
|
|
70
|
-
- ✅ Verify the fix with evidence (tests, logs, comparison)
|
|
71
|
-
- ✅ Prevent recurrence with guards or tests
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Non-goals
|
|
76
|
-
|
|
77
|
-
- ❌ Do NOT refactor code outside the buggy area
|
|
78
|
-
- ❌ Do NOT change public APIs unless the bug requires it
|
|
79
|
-
- ❌ Do NOT silence errors with empty `try/catch` or blind `?.` / `!`
|
|
80
|
-
- ❌ Do NOT change formatting or unrelated code
|
|
81
|
-
- ❌ Do NOT mark as done without verifying the fix
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Severity Levels
|
|
86
|
-
|
|
87
|
-
| Level | Meaning |
|
|
88
|
-
|-------|---------|
|
|
89
|
-
| P0 | Production down, data loss, security breach |
|
|
90
|
-
| P1 | Core feature broken, blocking users |
|
|
91
|
-
| P2 | Non-critical feature broken, workaround exists |
|
|
92
|
-
| P3 | Edge case, cosmetic, minor annoyance |
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Workflow
|
|
97
|
-
|
|
98
|
-
### Phase 1 — Triage & Understand
|
|
99
|
-
|
|
100
|
-
Before touching code, gather:
|
|
101
|
-
- What is the symptom? (error message, wrong behavior, crash)
|
|
102
|
-
- What is the expected behavior?
|
|
103
|
-
- How to reproduce? (steps, conditions, environment)
|
|
104
|
-
- What changed recently? (git log, deployment, dependency update)
|
|
105
|
-
- What is the severity and impact scope?
|
|
106
|
-
|
|
107
|
-
If critical information is missing → ask before proceeding.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
### Phase 2 — Reproduce the Issue
|
|
112
|
-
|
|
113
|
-
1. Write a failing test or script that triggers the bug
|
|
114
|
-
2. Confirm the bug is consistently reproducible
|
|
115
|
-
3. For intermittent bugs → identify timing, data, or environment conditions
|
|
116
|
-
4. Document the exact reproduction steps
|
|
117
|
-
|
|
118
|
-
> Rule: **Never skip reproduction.** A fix without a repro is a guess.
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### Phase 3 — Localize the Problem
|
|
123
|
-
|
|
124
|
-
1. Read the stack trace top-down, following frames inside project code
|
|
125
|
-
2. Use logs, breakpoints, or `git blame` / `git bisect` to narrow scope
|
|
126
|
-
3. Identify the exact file and line where the failure originates
|
|
127
|
-
4. Trace the data flow that leads to the failure
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
### Phase 4 — Root Cause Analysis
|
|
132
|
-
|
|
133
|
-
Answer: *Why does this happen? What condition triggers it?*
|
|
134
|
-
|
|
135
|
-
Common root cause categories:
|
|
136
|
-
- Logic error (wrong condition, wrong operator)
|
|
137
|
-
- Off-by-one or boundary case
|
|
138
|
-
- Null / undefined / missing data
|
|
139
|
-
- Async timing or race condition
|
|
140
|
-
- Type mismatch
|
|
141
|
-
- Stale state or stale closure
|
|
142
|
-
- Config or environment issue
|
|
143
|
-
- API contract change
|
|
144
|
-
- Dependency version change
|
|
145
|
-
|
|
146
|
-
Use 5 Whys: keep asking "why" until you reach the actual cause, not just the symptom.
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
### Phase 5 — Apply the Fix
|
|
151
|
-
|
|
152
|
-
Rules:
|
|
153
|
-
- Fix the root cause, not the symptom
|
|
154
|
-
- Smallest possible change that fully resolves the issue
|
|
155
|
-
- Keep existing code style, naming, and conventions
|
|
156
|
-
- Handle related edge cases to prevent similar bugs
|
|
157
|
-
- Remove all debug code, console.logs, and temporary patches
|
|
158
|
-
- Do not change public APIs unless strictly required
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
### Phase 6 — Verify the Result
|
|
163
|
-
|
|
164
|
-
- [ ] The failing test from Phase 2 now passes
|
|
165
|
-
- [ ] Run the related test suite — no new failures
|
|
166
|
-
- [ ] Run lint and type-check — clean
|
|
167
|
-
- [ ] Manually reproduce the original steps — bug is gone
|
|
168
|
-
- [ ] No regressions in adjacent functionality
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
### Phase 7 — Report & Prevent
|
|
173
|
-
|
|
174
|
-
Summarize and propose prevention:
|
|
175
|
-
- What was the root cause?
|
|
176
|
-
- What was changed and why?
|
|
177
|
-
- Are there similar patterns elsewhere in the codebase?
|
|
178
|
-
- Should a test be added to prevent regression?
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Decision Tree
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
Is the bug reproducible?
|
|
186
|
-
├── No → Isolate timing, data, environment conditions first
|
|
187
|
-
└── Yes → Is the root cause known?
|
|
188
|
-
├── No → Run Phase 3-4 (localize + analyze)
|
|
189
|
-
└── Yes → Apply minimal fix → verify → report
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
Is the fix risky (touches shared code / public API)?
|
|
194
|
-
├── Yes → Confirm scope with user before applying
|
|
195
|
-
└── No → Apply fix
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Output Format
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
🐛 Bug Report
|
|
204
|
-
─────────────────────────────────────────────────
|
|
205
|
-
Symptom: [What broke + how to reproduce]
|
|
206
|
-
Root cause: [Exact file:line — why it happens]
|
|
207
|
-
Severity: [P0 / P1 / P2 / P3]
|
|
208
|
-
|
|
209
|
-
🔧 Fix Applied
|
|
210
|
-
─────────────────────────────────────────────────
|
|
211
|
-
Changed: [File(s) modified]
|
|
212
|
-
Change: [What was changed and why it's minimal]
|
|
213
|
-
|
|
214
|
-
✅ Verification
|
|
215
|
-
─────────────────────────────────────────────────
|
|
216
|
-
Tests: [Test name / command — PASSED]
|
|
217
|
-
Lint/Types: [Clean / warnings noted]
|
|
218
|
-
Manual: [Reproduced original steps — bug gone]
|
|
219
|
-
Regression: [No new failures]
|
|
220
|
-
|
|
221
|
-
🛡️ Prevention
|
|
222
|
-
─────────────────────────────────────────────────
|
|
223
|
-
Test added: [Yes / No — reason]
|
|
224
|
-
Similar areas to check: [file or pattern to review]
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## Validation Checklist
|
|
230
|
-
|
|
231
|
-
- [ ] Bug was reproduced before fixing
|
|
232
|
-
- [ ] Root cause identified at exact file:line with explanation
|
|
233
|
-
- [ ] Fix is minimal — only changes what's needed
|
|
234
|
-
- [ ] Failing test now passes
|
|
235
|
-
- [ ] Related tests and lint/type-check clean
|
|
236
|
-
- [ ] No debug code left behind
|
|
237
|
-
- [ ] Side effects documented
|
|
238
|
-
- [ ] Prevention strategy noted
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
## Examples
|
|
243
|
-
|
|
244
|
-
See `examples/` folder.
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
# Frontend Debugger
|
|
251
|
-
|
|
252
|
-
> **Language rule:**
|
|
253
|
-
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
254
|
-
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
255
|
-
> The user may write in any language — detect and match it automatically.
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
## Trigger
|
|
260
|
-
|
|
261
|
-
Activate this skill when:
|
|
262
|
-
- User reports a UI-specific bug ("screen is blank", "button doesn't work")
|
|
263
|
-
- React throws a Hydration Error (`Text content did not match. Server: "A" Client: "B"`)
|
|
264
|
-
- React throws an infinite loop error (`Too many re-renders`)
|
|
265
|
-
- CSS styling is broken or overflowing unexpectedly
|
|
266
|
-
- Form validation behaves incorrectly
|
|
267
|
-
|
|
268
|
-
**Note:** For backend or general logic bugs, use `bug-fix`. For performance issues, use `frontend-performance`.
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
|
-
## Scope
|
|
273
|
-
|
|
274
|
-
- ✅ Diagnose and fix React hydration mismatches (Next.js / SSR)
|
|
275
|
-
- ✅ Fix infinite loops in `useEffect` and missing dependencies
|
|
276
|
-
- ✅ Resolve state staleness (stale closures in async functions or hooks)
|
|
277
|
-
- ✅ Fix CSS layout issues (Flexbox/Grid blowouts, z-index stacking context)
|
|
278
|
-
- ✅ Provide a targeted, minimal fix that doesn't break other UI elements
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## Non-goals
|
|
283
|
-
|
|
284
|
-
- ❌ Do NOT rewrite the entire component to fix a small CSS bug
|
|
285
|
-
- ❌ Do NOT disable hydration checks (`suppressHydrationWarning`) unless absolutely necessary and justified
|
|
286
|
-
- ❌ Do NOT apply quick-fixes (like `// @ts-ignore` or wrapping everything in `setTimeout`) without understanding the root cause
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## Workflow
|
|
291
|
-
|
|
292
|
-
### Phase 1 — Reproduction & Isolation
|
|
293
|
-
|
|
294
|
-
1. Identify the exact error message or visual symptom.
|
|
295
|
-
2. Isolate the component causing the issue.
|
|
296
|
-
3. Determine the environment (SSR, CSR, mobile, specific browser).
|
|
297
|
-
|
|
298
|
-
---
|
|
299
|
-
|
|
300
|
-
### Phase 2 — Common Issue Diagnosis
|
|
301
|
-
|
|
302
|
-
**Hydration Errors (Next.js/SSR):**
|
|
303
|
-
- Cause: Rendering `window`, `localStorage`, or random data (e.g., `Math.random()`, Dates) on the first pass.
|
|
304
|
-
- Fix: Move client-only rendering inside a `useEffect` (isMounted pattern) or use dynamic imports with `ssr: false`.
|
|
305
|
-
|
|
306
|
-
**Too many re-renders:**
|
|
307
|
-
- Cause: Updating state directly in the render body, or inside a `useEffect` without proper dependencies.
|
|
308
|
-
- Fix: Move state updates into event handlers, or fix `useEffect` dependencies.
|
|
309
|
-
|
|
310
|
-
**Stale Closures:**
|
|
311
|
-
- Cause: A `useEffect` or `useCallback` is using old state because it's missing from the dependency array.
|
|
312
|
-
- Fix: Add dependencies, use refs (`useRef`) for mutable values, or use functional state updates (`setState(prev => prev + 1)`).
|
|
313
|
-
|
|
314
|
-
**CSS Z-Index/Stacking Issues:**
|
|
315
|
-
- Cause: Missing `position: relative/absolute` on parent, or a new stacking context was created.
|
|
316
|
-
- Fix: Inspect parent elements, adjust `z-index`, or use Portals for modals.
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
### Phase 3 — Fix Application
|
|
321
|
-
|
|
322
|
-
Apply the minimal fix required to resolve the issue while preserving surrounding logic and styles.
|
|
323
|
-
|
|
324
|
-
---
|
|
325
|
-
|
|
326
|
-
## Decision Tree
|
|
327
|
-
|
|
328
|
-
```
|
|
329
|
-
Is it a Hydration Error?
|
|
330
|
-
├── Yes → Is it caused by client-side APIs (window/localStorage)?
|
|
331
|
-
│ ├── Yes → Use `useEffect` to delay rendering until mounted
|
|
332
|
-
│ └── No → Check for mismatched HTML tags (e.g., <p> inside <p>)
|
|
333
|
-
└── No → Proceed to next check
|
|
334
|
-
|
|
335
|
-
Is it an infinite loop?
|
|
336
|
-
├── Yes → Check `useEffect` dependencies. Are objects/arrays re-created every render?
|
|
337
|
-
│ ├── Yes → Memoize them (`useMemo`) or move outside component
|
|
338
|
-
│ └── No → Ensure `setState` isn't called unconditionally in render
|
|
339
|
-
└── No → Proceed
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
---
|
|
343
|
-
|
|
344
|
-
## Output Format
|
|
345
|
-
|
|
346
|
-
```
|
|
347
|
-
🪲 Frontend Debug Report
|
|
348
|
-
─────────────────────────────────────────────────
|
|
349
|
-
Symptom: [Description of the bug]
|
|
350
|
-
Root Cause: [Explanation of why it failed, e.g., Stale Closure in useEffect]
|
|
351
|
-
|
|
352
|
-
🔧 Fix Applied:
|
|
353
|
-
[Brief description of the code change]
|
|
354
|
-
|
|
355
|
-
✅ Verification:
|
|
356
|
-
- Error no longer throws
|
|
357
|
-
- UI renders correctly
|
|
358
|
-
|
|
359
|
-
⚠️ Notes:
|
|
360
|
-
[Any side effects or things to watch out for]
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
|
-
## Validation Checklist
|
|
366
|
-
|
|
367
|
-
- [ ] Root cause clearly identified (not just patched)
|
|
368
|
-
- [ ] Fix is minimal and targeted
|
|
369
|
-
- [ ] No Hydration warnings remain
|
|
370
|
-
- [ ] Component doesn't infinitely loop
|
|
371
|
-
- [ ] No regression on related UI
|
|
1
|
+
---
|
|
2
|
+
name: qk-bug-resolution
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Fix bugs and prevent regressions.
|
|
6
|
+
category: engineering
|
|
7
|
+
priority: high
|
|
8
|
+
tags: [bug, debug, regression]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: User reports an error or crash.
|
|
11
|
+
inputs: [Error log, Bug description, File path]
|
|
12
|
+
outputs: [Fixed code, Verification report]
|
|
13
|
+
allowed_tools: [run_command, read_file, grep_search]
|
|
14
|
+
pipeline: [analyze, implement, engineering-standard, validate, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-bug-resolution - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** Định vị nguyên nhân, sửa lỗi triệt để, và đảm bảo lỗi không bị lặp lại (Regression Prevention).
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Root Cause Analysis):**
|
|
23
|
+
- Read the provided error log or bug description.
|
|
24
|
+
- Trace the error to the exact file and line of code.
|
|
25
|
+
- Identify if the bug is a syntax error, logic error, state issue, or boundary case.
|
|
26
|
+
2. **Plan (Fix Strategy):**
|
|
27
|
+
- Determine the minimal change required to fix the bug.
|
|
28
|
+
- If the bug is UI-related, refer to frontend knowledge (e.g., `knowledge/frontend/react.md`).
|
|
29
|
+
3. **Execute (Implement Fix):**
|
|
30
|
+
- Modify the source code exactly where needed.
|
|
31
|
+
- Do NOT rewrite unrelated code blocks.
|
|
32
|
+
4. **Verify (Validation):**
|
|
33
|
+
- Provide steps to test the fix.
|
|
34
|
+
- Ensure backward compatibility.
|
|
35
|
+
|
|
36
|
+
## 🛡️ 2. Constraints & Rules
|
|
37
|
+
- **No Guesses:** Do not assume the shape of an API response. Print it or read the type definitions first.
|
|
38
|
+
- **Minimal Fix:** Always prefer a 1-line fix over a 100-line refactor, unless the architecture is fundamentally broken.
|
|
39
|
+
- **Clean Up:** Remove any `console.log()` or debugger statements introduced during the debugging process.
|
|
40
|
+
|
|
41
|
+
## 🌳 3. Decision Tree
|
|
42
|
+
```text
|
|
43
|
+
Is there a Stack Trace?
|
|
44
|
+
├── YES → Use grep_search to find the exact file and line number.
|
|
45
|
+
└── NO → Ask the user for the file path or use grep_search with keywords from the bug description.
|
|
46
|
+
|
|
47
|
+
Is the bug related to State/Re-rendering?
|
|
48
|
+
├── YES → Load `knowledge/frontend/react.md` to check for stale closures or missing dependencies.
|
|
49
|
+
└── NO → Proceed with standard logic debugging.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 🤝 4. Handoff Pipeline
|
|
53
|
+
After implementing the fix, map to the pipeline:
|
|
54
|
+
1. `engineering-standard`: Ensure the fix follows naming and architecture rules.
|
|
55
|
+
2. `validate`: Run linters and tests (via `qk-validation-gate` equivalent).
|
|
56
|
+
3. `complete`: Output the final report.
|
|
57
|
+
|
|
58
|
+
## 📝 5. Output Format
|
|
59
|
+
Vui lòng sử dụng template `templates/bug-report.md` (Báo Cáo Xử Lý Lỗi) để phản hồi lại cho người dùng bằng Tiếng Việt. Nội dung bao gồm:
|
|
60
|
+
- Summary
|
|
61
|
+
- Changes
|
|
62
|
+
- Root Cause
|
|
63
|
+
- Verification
|
|
64
|
+
- Risks
|
|
65
|
+
- Next Action
|