ai-developer-skill-os 7.0.2 → 7.5.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 +44 -88
- package/.agents/CHANGELOG.md +69 -0
- package/.agents/LICENSE +21 -0
- package/.agents/README.md +59 -0
- package/.agents/_template/BEHAVIOR_SPEC.md +96 -0
- package/.agents/_template/examples/example-en.md +49 -0
- package/.agents/_template/examples/example-vi.md +49 -0
- package/.agents/docs/CHI_TIET_SKILLS.md +125 -0
- package/.agents/docs/GOVERNANCE.md +40 -0
- package/.agents/docs/HUONG_DAN_SU_DUNG.md +120 -0
- package/.agents/docs/SPEC.md +87 -0
- package/.agents/docs/adr/0001-intent-based-architecture.md +19 -0
- package/.agents/docs/adr/0002-kernel-freeze.md +21 -0
- package/.agents/docs/adr/0003-risk-based-verification.md +20 -0
- package/.agents/docs/adr/0004-progressive-evidence.md +19 -0
- package/.agents/docs/skill-classification.md +25 -0
- package/.agents/skills/qk-access-policy/SKILL.md +179 -0
- package/.agents/skills/qk-ai-builder/SKILL.md +215 -0
- package/.agents/skills/qk-api-lifecycle/SKILL.md +176 -0
- package/.agents/skills/qk-bug-resolution/SKILL.md +307 -0
- package/.agents/skills/qk-context-loader/SKILL.md +218 -0
- package/.agents/skills/qk-data-lifecycle/SKILL.md +192 -0
- package/.agents/skills/qk-db-optimizer/SKILL.md +196 -0
- package/.agents/skills/qk-design-to-code/SKILL.md +285 -0
- package/.agents/skills/qk-docs/SKILL.md +198 -0
- package/.agents/skills/qk-engineering-standard/SKILL.md +351 -0
- package/.agents/skills/qk-engineering-standard/rules/backend.md +122 -0
- package/.agents/skills/qk-engineering-standard/rules/database.md +3 -0
- package/.agents/skills/qk-engineering-standard/rules/frontend.md +152 -0
- package/.agents/skills/qk-engineering-standard/rules/security.md +3 -0
- package/.agents/skills/qk-engineering-standard/rules/testing.md +3 -0
- package/.agents/skills/qk-fe-api-integration/SKILL.md +326 -0
- package/.agents/skills/qk-feature-delivery/SKILL.md +305 -0
- package/.agents/skills/qk-help/SKILL.md +193 -0
- package/.agents/skills/qk-orchestrator/SKILL.md +277 -0
- package/.agents/skills/qk-orchestrator/references/routing-table.md +77 -0
- package/.agents/skills/qk-production-release/SKILL.md +284 -0
- package/.agents/skills/qk-project-bootstrap/SKILL.md +234 -0
- package/.agents/skills/qk-project-health/SKILL.md +199 -0
- package/.agents/skills/qk-project-memory/SKILL.md +172 -0
- package/.agents/skills/qk-system-evolution/SKILL.md +281 -0
- package/.agents/skills/qk-ui-audit/SKILL.md +314 -0
- package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
- package/.agents/skills/qk-ui-system-builder/SKILL.md +221 -0
- package/.agents/skills/qk-validation-gate/SKILL.md +359 -0
- package/.agents/skills.json +819 -0
- package/.github/workflows/ci.yml +1 -1
- package/.qk-ai-skill-os/CHANGELOG.md +69 -0
- package/.qk-ai-skill-os/LICENSE +21 -0
- package/.qk-ai-skill-os/README.md +59 -0
- package/.qk-ai-skill-os/_template/BEHAVIOR_SPEC.md +96 -0
- package/.qk-ai-skill-os/_template/examples/example-en.md +49 -0
- package/.qk-ai-skill-os/_template/examples/example-vi.md +49 -0
- package/.qk-ai-skill-os/docs/CHI_TIET_SKILLS.md +125 -0
- package/.qk-ai-skill-os/docs/GOVERNANCE.md +40 -0
- package/.qk-ai-skill-os/docs/HUONG_DAN_SU_DUNG.md +120 -0
- package/.qk-ai-skill-os/docs/SPEC.md +87 -0
- package/.qk-ai-skill-os/docs/adr/0001-intent-based-architecture.md +19 -0
- package/.qk-ai-skill-os/docs/adr/0002-kernel-freeze.md +21 -0
- package/.qk-ai-skill-os/docs/adr/0003-risk-based-verification.md +20 -0
- package/.qk-ai-skill-os/docs/adr/0004-progressive-evidence.md +19 -0
- package/.qk-ai-skill-os/docs/skill-classification.md +25 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +121 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +179 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-api-integration/SKILL.md +389 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-auth-security/SKILL.md +96 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +125 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-bug-fix/SKILL.md +213 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-component-generator/SKILL.md +136 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-context-manager/SKILL.md +175 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-database-engineer/SKILL.md +104 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-deployment/SKILL.md +96 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-design-system/SKILL.md +137 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-form-builder/SKILL.md +140 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +155 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +133 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +129 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +146 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-git-engineer/SKILL.md +304 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-help/SKILL.md +68 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-migration/SKILL.md +284 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-project-audit/SKILL.md +280 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-refactor/SKILL.md +222 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-state-management/SKILL.md +140 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +127 -0
- package/.qk-ai-skill-os/skills/_archive_old_skills/qk-ui-builder/SKILL.md +152 -0
- package/.qk-ai-skill-os/skills/_template/SKILL.md +238 -0
- package/.qk-ai-skill-os/skills/qk-access-policy/SKILL.md +179 -0
- package/.qk-ai-skill-os/skills/qk-ai-builder/SKILL.md +221 -0
- package/.qk-ai-skill-os/skills/qk-api-lifecycle/SKILL.md +176 -0
- package/.qk-ai-skill-os/skills/qk-bug-resolution/SKILL.md +307 -0
- package/.qk-ai-skill-os/skills/qk-context-loader/SKILL.md +218 -0
- package/.qk-ai-skill-os/skills/qk-data-lifecycle/SKILL.md +192 -0
- package/.qk-ai-skill-os/skills/qk-db-optimizer/SKILL.md +196 -0
- package/.qk-ai-skill-os/skills/qk-design-to-code/SKILL.md +291 -0
- package/.qk-ai-skill-os/skills/qk-docs/SKILL.md +198 -0
- package/.qk-ai-skill-os/skills/qk-engineering-standard/SKILL.md +351 -0
- package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/backend.md +122 -0
- package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/database.md +3 -0
- package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/frontend.md +152 -0
- package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/security.md +3 -0
- package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/testing.md +3 -0
- package/.qk-ai-skill-os/skills/qk-fe-api-integration/SKILL.md +326 -0
- package/.qk-ai-skill-os/skills/qk-feature-delivery/SKILL.md +305 -0
- package/.qk-ai-skill-os/skills/qk-help/SKILL.md +193 -0
- package/.qk-ai-skill-os/skills/qk-orchestrator/SKILL.md +277 -0
- package/.qk-ai-skill-os/skills/qk-orchestrator/references/routing-table.md +77 -0
- package/.qk-ai-skill-os/skills/qk-production-release/SKILL.md +290 -0
- package/.qk-ai-skill-os/skills/qk-project-bootstrap/SKILL.md +240 -0
- package/.qk-ai-skill-os/skills/qk-project-health/SKILL.md +199 -0
- package/.qk-ai-skill-os/skills/qk-project-memory/SKILL.md +172 -0
- package/.qk-ai-skill-os/skills/qk-system-evolution/SKILL.md +285 -0
- package/.qk-ai-skill-os/skills/qk-ui-audit/SKILL.md +314 -0
- package/.qk-ai-skill-os/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
- package/.qk-ai-skill-os/skills/qk-ui-system-builder/SKILL.md +225 -0
- package/.qk-ai-skill-os/skills/qk-validation-gate/SKILL.md +361 -0
- package/.qk-ai-skill-os/skills.json +819 -0
- package/CLAUDE.md +110 -0
- package/README.md +25 -3
- package/add_lang.js +21 -0
- package/add_lang.py +25 -0
- package/add_sections.py +53 -0
- package/bin/install.js +225 -170
- package/bin/lint.js +122 -0
- package/docs/CHI_TIET_SKILLS.md +26 -26
- package/docs/HUONG_DAN_SU_DUNG.md +3 -3
- package/docs/SPEC.md +70 -20
- package/framework/skill-schema.md +310 -0
- package/package.json +15 -4
- package/patch.js +15 -0
- package/patch.py +89 -0
- package/patch2.py +83 -0
- package/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-api-integration/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-auth-security/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-bug-fix/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-component-generator/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-context-manager/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-database-engineer/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-deployment/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-design-system/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-form-builder/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-git-engineer/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-help/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-migration/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-project-audit/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-refactor/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-state-management/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-ui-builder/SKILL.md +1 -0
- package/skills/_template/SKILL.md +238 -0
- package/skills/qk-access-policy/SKILL.md +179 -39
- package/skills/qk-ai-builder/SKILL.md +215 -40
- package/skills/qk-api-lifecycle/SKILL.md +176 -46
- package/skills/qk-bug-resolution/SKILL.md +307 -46
- package/skills/qk-context-loader/SKILL.md +218 -43
- package/skills/qk-data-lifecycle/SKILL.md +192 -44
- package/skills/qk-db-optimizer/SKILL.md +196 -41
- package/skills/qk-design-to-code/SKILL.md +285 -46
- package/skills/qk-docs/SKILL.md +198 -40
- package/skills/qk-engineering-standard/SKILL.md +351 -42
- package/skills/qk-fe-api-integration/SKILL.md +326 -55
- package/skills/qk-feature-delivery/SKILL.md +305 -48
- package/skills/qk-help/SKILL.md +178 -23
- package/skills/qk-orchestrator/SKILL.md +277 -42
- package/skills/qk-orchestrator/references/routing-table.md +77 -0
- package/skills/qk-production-release/SKILL.md +284 -41
- package/skills/qk-project-bootstrap/SKILL.md +234 -38
- package/skills/qk-project-health/SKILL.md +199 -40
- package/skills/qk-project-memory/SKILL.md +172 -40
- package/skills/qk-system-evolution/SKILL.md +281 -40
- package/skills/qk-ui-audit/SKILL.md +314 -42
- package/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
- package/skills/qk-ui-system-builder/SKILL.md +221 -43
- package/skills/qk-validation-gate/SKILL.md +359 -40
- package/skills.json +813 -824
- package/specs/fixtures/user-payload.json +12 -0
- package/specs/regressions/api-integration-null-fields.yaml +19 -0
- package/temp_fix.js +61 -0
- package/tests/registry.test.js +1 -1
- package/update_template.js +28 -0
- package/skills/qk-policy-engine/SKILL.md +0 -39
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-migration
|
|
3
|
+
description: >-
|
|
4
|
+
Nâng cấp dependency, chuyển đổi framework và thay thế thư viện một cách an toàn với chiến lược không downtime.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: engineering
|
|
7
|
+
tags: [migration, upgrade, dependencies, breaking-change, npm, framework]
|
|
8
|
+
platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Migration & Dependency Upgrade
|
|
12
|
+
|
|
13
|
+
> **Language rule:**
|
|
14
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
15
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
16
|
+
> The user may write in any language — detect and match it automatically.
|
|
17
|
+
|
|
18
|
+
> ⚠️ **Always create a rollback plan before starting any migration.**
|
|
19
|
+
> Never apply breaking upgrades to production without a verified fallback.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Trigger
|
|
24
|
+
|
|
25
|
+
Activate this skill when:
|
|
26
|
+
- User wants to upgrade a package or dependency
|
|
27
|
+
- Framework has a new major version (React 17→19, Vue 2→3, Next.js 13→15)
|
|
28
|
+
- A library is deprecated or has a security vulnerability (CVE)
|
|
29
|
+
- User wants to replace one library with another
|
|
30
|
+
- `project-audit` flagged outdated or risky dependencies (P1/P2)
|
|
31
|
+
- User says "update packages", "upgrade to v5", "migrate to new version"
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Scope
|
|
36
|
+
|
|
37
|
+
- ✅ Dependency version upgrades (patch, minor, major)
|
|
38
|
+
- ✅ Framework version migrations with breaking changes
|
|
39
|
+
- ✅ Library replacement (swap one library for another)
|
|
40
|
+
- ✅ Package conflict resolution
|
|
41
|
+
- ✅ Configuration updates required by new versions
|
|
42
|
+
- ✅ Code changes required by breaking API changes
|
|
43
|
+
- ✅ Rollback planning
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Non-goals
|
|
48
|
+
|
|
49
|
+
- ❌ Do NOT upgrade everything at once — always upgrade incrementally
|
|
50
|
+
- ❌ Do NOT skip reading the changelog/migration guide
|
|
51
|
+
- ❌ Do NOT ignore peer dependency warnings without investigating
|
|
52
|
+
- ❌ Do NOT apply breaking changes without a rollback plan
|
|
53
|
+
- ❌ Do NOT upgrade dev dependencies and prod dependencies in the same step
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Severity Levels
|
|
58
|
+
|
|
59
|
+
| Level | Meaning |
|
|
60
|
+
|-------|---------|
|
|
61
|
+
| P0 | Security vulnerability (CVE) — upgrade immediately |
|
|
62
|
+
| P1 | Breaking change affecting core functionality |
|
|
63
|
+
| P2 | Deprecated API with upcoming removal |
|
|
64
|
+
| P3 | Minor version lag — low risk, upgrade when convenient |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Migration Types
|
|
69
|
+
|
|
70
|
+
| Type | Risk | Strategy |
|
|
71
|
+
|------|------|----------|
|
|
72
|
+
| **Patch** (1.0.x → 1.0.y) | Low | Upgrade directly, verify tests |
|
|
73
|
+
| **Minor** (1.x.0 → 1.y.0) | Low-Medium | Read changelog, upgrade, verify |
|
|
74
|
+
| **Major** (x.0.0 → y.0.0) | High | Read migration guide, upgrade incrementally, test thoroughly |
|
|
75
|
+
| **Framework** (React 17→19) | Very High | Follow official migration guide step by step |
|
|
76
|
+
| **Library swap** | High | Strangler fig pattern — migrate incrementally |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Workflow
|
|
81
|
+
|
|
82
|
+
### Phase 1 — Audit Current State
|
|
83
|
+
|
|
84
|
+
Before upgrading:
|
|
85
|
+
1. List all dependencies with current versions
|
|
86
|
+
2. Identify which are outdated (use `npm outdated` / `pnpm outdated`)
|
|
87
|
+
3. Check for known CVEs (`npm audit` / `pnpm audit`)
|
|
88
|
+
4. Classify each outdated package by migration type and risk
|
|
89
|
+
5. Check peer dependency constraints
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm outdated # See what's outdated
|
|
93
|
+
npm audit # Security vulnerabilities
|
|
94
|
+
npx depcheck # Unused dependencies
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Phase 2 — Read Migration Guide
|
|
100
|
+
|
|
101
|
+
For every major version upgrade:
|
|
102
|
+
1. Read the official CHANGELOG or migration guide
|
|
103
|
+
2. List all breaking changes that affect the project
|
|
104
|
+
3. List all deprecated APIs still in use
|
|
105
|
+
4. Estimate effort: number of files to change, complexity of changes
|
|
106
|
+
|
|
107
|
+
Document findings before touching any code.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### Phase 3 — Plan the Migration
|
|
112
|
+
|
|
113
|
+
Create an ordered upgrade sequence:
|
|
114
|
+
|
|
115
|
+
**Rules:**
|
|
116
|
+
- Security fixes first (P0)
|
|
117
|
+
- Dev dependencies before prod dependencies (lower risk)
|
|
118
|
+
- Upgrade one major dependency at a time — not everything together
|
|
119
|
+
- Group related packages (e.g., all `@tanstack/*` together)
|
|
120
|
+
|
|
121
|
+
**Example order:**
|
|
122
|
+
```
|
|
123
|
+
Step 1: Security patch — package-x 2.1.0 → 2.1.4 (CVE fix)
|
|
124
|
+
Step 2: Dev tools — eslint 8 → 9 (no runtime impact)
|
|
125
|
+
Step 3: Minor upgrades — axios 1.4 → 1.7 (non-breaking)
|
|
126
|
+
Step 4: Major upgrade — react-query 4 → 5 (breaking — separate PR)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### Phase 4 — Create Rollback Plan
|
|
132
|
+
|
|
133
|
+
Before applying any change:
|
|
134
|
+
```
|
|
135
|
+
Rollback method:
|
|
136
|
+
Option A: git revert / git checkout to previous state
|
|
137
|
+
Option B: Pin version in package.json to previous known-good version
|
|
138
|
+
Option C: Feature flag to disable new behavior
|
|
139
|
+
|
|
140
|
+
Rollback trigger:
|
|
141
|
+
- Tests fail after upgrade
|
|
142
|
+
- Runtime errors in staging
|
|
143
|
+
- Performance regression detected
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### Phase 5 — Execute the Upgrade
|
|
149
|
+
|
|
150
|
+
For each package in the plan:
|
|
151
|
+
|
|
152
|
+
1. **Upgrade package:**
|
|
153
|
+
```bash
|
|
154
|
+
npm install package-name@version
|
|
155
|
+
# or
|
|
156
|
+
pnpm add package-name@version
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
2. **Update configuration** (if required by new version)
|
|
160
|
+
|
|
161
|
+
3. **Fix breaking changes** in code:
|
|
162
|
+
- Update import paths
|
|
163
|
+
- Replace deprecated APIs
|
|
164
|
+
- Update type signatures
|
|
165
|
+
- Update config files
|
|
166
|
+
|
|
167
|
+
4. **Run verification** (see Phase 6) before moving to next package
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### Phase 6 — Verify After Each Step
|
|
172
|
+
|
|
173
|
+
After every upgrade step:
|
|
174
|
+
- [ ] `npm install` / `pnpm install` — no resolution errors
|
|
175
|
+
- [ ] `npm run build` — builds successfully
|
|
176
|
+
- [ ] `npm run type-check` — no new TypeScript errors
|
|
177
|
+
- [ ] `npm run lint` — clean
|
|
178
|
+
- [ ] `npm test` — all tests pass
|
|
179
|
+
- [ ] Manual smoke test of affected features
|
|
180
|
+
|
|
181
|
+
**If any check fails → rollback this step before continuing.**
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### Phase 7 — Library Replacement (Strangler Fig Pattern)
|
|
186
|
+
|
|
187
|
+
When replacing one library with another (e.g., moment → date-fns):
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Step 1: Install new library alongside old one
|
|
191
|
+
Step 2: Create adapter/wrapper that abstracts the library
|
|
192
|
+
Step 3: Migrate usage file by file (not all at once)
|
|
193
|
+
Step 4: Verify each file after migration
|
|
194
|
+
Step 5: Remove old library when 100% migrated
|
|
195
|
+
Step 6: Remove adapter if no longer needed
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
This allows incremental migration with rollback possible at any step.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Decision Tree
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
What type of upgrade?
|
|
206
|
+
├── Patch/Minor → Upgrade directly, run tests
|
|
207
|
+
├── Major → Read changelog → plan → upgrade → verify
|
|
208
|
+
└── Framework → Follow official migration guide step by step
|
|
209
|
+
|
|
210
|
+
Security vulnerability?
|
|
211
|
+
├── P0 (critical) → Upgrade immediately, prioritize over other work
|
|
212
|
+
└── P1/P2 → Include in next planned upgrade cycle
|
|
213
|
+
|
|
214
|
+
Library replacement?
|
|
215
|
+
└── Use strangler fig pattern — never replace all at once
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Output Format
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
📦 Migration Report
|
|
224
|
+
─────────────────────────────────────────────────
|
|
225
|
+
Scope: [What was upgraded / migrated]
|
|
226
|
+
Type: [Patch / Minor / Major / Framework / Library swap]
|
|
227
|
+
Risk: [Low / Medium / High]
|
|
228
|
+
|
|
229
|
+
Changes:
|
|
230
|
+
✅ package-x: 2.1.0 → 2.1.4 (CVE fix — no code changes)
|
|
231
|
+
✅ axios: 1.4.0 → 1.7.2 (minor — updated interceptor config)
|
|
232
|
+
✅ react: 18.2.0 → 19.0.0 (major — updated 12 files)
|
|
233
|
+
|
|
234
|
+
Breaking changes handled:
|
|
235
|
+
• [Description of breaking change and how it was resolved]
|
|
236
|
+
|
|
237
|
+
📋 Rollback plan:
|
|
238
|
+
git revert <commit-hash> or pin to previous version in package.json
|
|
239
|
+
|
|
240
|
+
✅ Verification:
|
|
241
|
+
Build: PASS
|
|
242
|
+
Types: Clean
|
|
243
|
+
Tests: PASS (N tests)
|
|
244
|
+
Lint: Clean
|
|
245
|
+
Smoke test: PASS
|
|
246
|
+
|
|
247
|
+
⚠️ Known issues / follow-up:
|
|
248
|
+
• [Any remaining deprecated APIs to address]
|
|
249
|
+
• [Any packages still pending upgrade]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Validation Checklist
|
|
255
|
+
|
|
256
|
+
- [ ] Migration guide read for every major version change
|
|
257
|
+
- [ ] Rollback plan documented before starting
|
|
258
|
+
- [ ] Upgraded incrementally — one major change at a time
|
|
259
|
+
- [ ] `npm audit` clean after upgrade
|
|
260
|
+
- [ ] Build, types, lint, tests all pass
|
|
261
|
+
- [ ] Smoke test of affected features complete
|
|
262
|
+
- [ ] No new peer dependency warnings left unresolved
|
|
263
|
+
- [ ] Breaking changes documented in output
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Common Migration Cheat Sheet
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
React 17 → 18: Concurrent mode, new root API, Suspense updates
|
|
271
|
+
React 18 → 19: Server components, new hooks (useActionState), ref as prop
|
|
272
|
+
Vue 2 → 3: Composition API, new reactivity system, breaking changes in lifecycle
|
|
273
|
+
Next.js 12 → 13: App Router introduced (pages/ still works)
|
|
274
|
+
Next.js 13 → 14: Server Actions stable, metadata API
|
|
275
|
+
Next.js 14 → 15: React 19, async params, updated caching defaults
|
|
276
|
+
TanStack Query 4 → 5: New API (no more isLoading/isError split), object syntax
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Examples
|
|
282
|
+
|
|
283
|
+
See `examples/` folder.
|
|
284
|
+
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-project-audit
|
|
3
|
+
description: >-
|
|
4
|
+
Kiểm toán toàn bộ dự án để phát hiện bug ẩn, rủi ro bảo mật, vấn đề hiệu năng và nợ kỹ thuật trước khi sửa code.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: engineering
|
|
7
|
+
tags: [audit, review, bug-detection, architecture, security, performance]
|
|
8
|
+
platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Project Audit
|
|
12
|
+
|
|
13
|
+
> **Language rule:**
|
|
14
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
15
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
16
|
+
> The user may write in any language — detect and match it automatically.
|
|
17
|
+
|
|
18
|
+
> ⚠️ **CRITICAL: Do NOT modify any code during audit.**
|
|
19
|
+
> The audit produces a report. Changes happen only after the user reviews and approves.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Trigger
|
|
24
|
+
|
|
25
|
+
Activate this skill when:
|
|
26
|
+
- User says "audit", "review", "health check", "what's wrong with my project"
|
|
27
|
+
- Before starting a large feature or refactor
|
|
28
|
+
- After inheriting a codebase
|
|
29
|
+
- Before a major release
|
|
30
|
+
- When the system behaves unexpectedly and the root cause is unknown
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Scope
|
|
35
|
+
|
|
36
|
+
- ✅ Detect hidden bugs, race conditions, and unstable areas
|
|
37
|
+
- ✅ Review architecture and separation of concerns
|
|
38
|
+
- ✅ Identify security vulnerabilities
|
|
39
|
+
- ✅ Find performance bottlenecks
|
|
40
|
+
- ✅ Audit dependencies (outdated, risky, unused)
|
|
41
|
+
- ✅ Produce prioritized findings with recommended fixes
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Non-goals
|
|
46
|
+
|
|
47
|
+
- ❌ Do NOT fix anything during the audit
|
|
48
|
+
- ❌ Do NOT refactor code
|
|
49
|
+
- ❌ Do NOT make assumptions — document uncertainty instead
|
|
50
|
+
- ❌ Do NOT audit `node_modules`, `dist`, `build`, `.git`
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Audit Modes
|
|
55
|
+
|
|
56
|
+
Choose based on context:
|
|
57
|
+
|
|
58
|
+
| Mode | Scope | When to use |
|
|
59
|
+
|------|-------|-------------|
|
|
60
|
+
| **Quick** | Changed files only (git diff / recent edits) | Fast pre-commit check, small bug scope |
|
|
61
|
+
| **Standard** | Current feature / module being worked on | Default — before implementing changes |
|
|
62
|
+
| **Full** | Entire repository | Onboarding, pre-release, inherited codebase |
|
|
63
|
+
|
|
64
|
+
**Default: Standard mode.**
|
|
65
|
+
Use Full mode only when explicitly requested or before a major release.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Severity Levels
|
|
70
|
+
|
|
71
|
+
All findings use this shared scale:
|
|
72
|
+
|
|
73
|
+
| Level | Label | Meaning |
|
|
74
|
+
|-------|-------|---------|
|
|
75
|
+
| P0 | Critical | Security breach, data loss, production crash — fix immediately |
|
|
76
|
+
| P1 | High | Bug affecting core functionality — fix before shipping |
|
|
77
|
+
| P2 | Medium | Performance issue or bad pattern — schedule soon |
|
|
78
|
+
| P3 | Low | Technical debt, code smell — fix when possible |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Workflow
|
|
83
|
+
|
|
84
|
+
### Phase 1 — Project Discovery
|
|
85
|
+
|
|
86
|
+
*(Use `context-manager` if project context is not yet loaded)*
|
|
87
|
+
|
|
88
|
+
Analyze:
|
|
89
|
+
- Framework, language, build system
|
|
90
|
+
- Folder structure and architecture style
|
|
91
|
+
- Key dependencies and their versions
|
|
92
|
+
- Entry points, routing, data flow
|
|
93
|
+
|
|
94
|
+
Output: **Project Overview** (2-5 lines)
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Phase 2 — Architecture Review
|
|
99
|
+
|
|
100
|
+
Check:
|
|
101
|
+
|
|
102
|
+
**Separation of concerns:**
|
|
103
|
+
- Are UI components mixing API calls and business logic?
|
|
104
|
+
- Are services doing too much?
|
|
105
|
+
- Is there duplicated logic across modules?
|
|
106
|
+
|
|
107
|
+
**Folder structure:**
|
|
108
|
+
- Does file placement follow the declared architecture?
|
|
109
|
+
- Are there misplaced files or responsibilities?
|
|
110
|
+
|
|
111
|
+
**Patterns:**
|
|
112
|
+
- Are patterns applied consistently? (hooks, services, stores)
|
|
113
|
+
- Are there anti-patterns? (prop drilling, God components, circular imports)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Phase 3 — Bug Detection
|
|
118
|
+
|
|
119
|
+
#### Frontend
|
|
120
|
+
|
|
121
|
+
Check for:
|
|
122
|
+
- `useEffect` with missing or wrong dependency arrays
|
|
123
|
+
- State updates after component unmount (memory leak)
|
|
124
|
+
- Missing cleanup in subscriptions, timers, event listeners
|
|
125
|
+
- Stale closures in async callbacks
|
|
126
|
+
- Race conditions in data fetching
|
|
127
|
+
- Infinite re-render loops
|
|
128
|
+
- `key` prop issues in lists
|
|
129
|
+
|
|
130
|
+
#### Backend
|
|
131
|
+
|
|
132
|
+
Check for:
|
|
133
|
+
- Unhandled promise rejections
|
|
134
|
+
- Missing input validation
|
|
135
|
+
- Incorrect HTTP status codes
|
|
136
|
+
- Transaction issues (missing rollback on error)
|
|
137
|
+
- Race conditions in concurrent operations
|
|
138
|
+
|
|
139
|
+
#### API Layer
|
|
140
|
+
|
|
141
|
+
Check for:
|
|
142
|
+
- Inconsistent response handling
|
|
143
|
+
- Missing error states
|
|
144
|
+
- Duplicate requests without debounce/cancellation
|
|
145
|
+
- Missing loading/error/empty states in UI
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Phase 4 — Security Audit
|
|
150
|
+
|
|
151
|
+
Check for:
|
|
152
|
+
- Hardcoded secrets, tokens, credentials in code
|
|
153
|
+
- Sensitive data in `localStorage` or URL params
|
|
154
|
+
- Missing authentication/authorization checks
|
|
155
|
+
- SQL injection or NoSQL injection risks
|
|
156
|
+
- XSS vulnerabilities (dangerouslySetInnerHTML, unsanitized input)
|
|
157
|
+
- Insecure direct object references (IDOR)
|
|
158
|
+
- CORS misconfiguration
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### Phase 5 — Performance Audit
|
|
163
|
+
|
|
164
|
+
Check for:
|
|
165
|
+
- Large bundle size (missing code splitting, lazy loading)
|
|
166
|
+
- Expensive computations on every render (missing `useMemo`, `useCallback`)
|
|
167
|
+
- Unnecessary re-renders (missing `memo`, wrong dependency arrays)
|
|
168
|
+
- N+1 query problems
|
|
169
|
+
- Missing pagination on large datasets
|
|
170
|
+
- Unoptimized images or assets
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### Phase 6 — Dependency Audit
|
|
175
|
+
|
|
176
|
+
Check:
|
|
177
|
+
- Outdated packages with known CVEs
|
|
178
|
+
- Packages with very low maintenance (abandoned)
|
|
179
|
+
- Duplicate packages doing the same job
|
|
180
|
+
- Unused dependencies in `package.json`
|
|
181
|
+
- Major version gaps that indicate deferred upgrades
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Decision Tree
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
Which audit mode?
|
|
189
|
+
├── Quick → Read only git diff / recently changed files
|
|
190
|
+
├── Standard → Read current feature/module files + related
|
|
191
|
+
└── Full → Scan entire src/ directory systematically
|
|
192
|
+
|
|
193
|
+
Issue found → Assess severity:
|
|
194
|
+
├── P0 → Flag immediately, recommend pausing current work
|
|
195
|
+
├── P1 → Include in required fixes before shipping
|
|
196
|
+
├── P2 → Include in scheduled improvements
|
|
197
|
+
└── P3 → Log as technical debt
|
|
198
|
+
|
|
199
|
+
No issues found in area → Mark as ✅ Clean
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Output Format
|
|
205
|
+
|
|
206
|
+
### Executive Summary
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
🏥 Project Health Report
|
|
210
|
+
─────────────────────────
|
|
211
|
+
Health: [Excellent / Good / Needs Attention / Critical]
|
|
212
|
+
Risk Level: [Low / Medium / High / Critical]
|
|
213
|
+
Audit Mode: [Quick / Standard / Full]
|
|
214
|
+
Files Reviewed: [N]
|
|
215
|
+
Total Findings: [N] (P0: N · P1: N · P2: N · P3: N)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Findings (one per issue)
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
───────────────────────────────
|
|
222
|
+
ID: AUDIT-001
|
|
223
|
+
Severity: P1 — High
|
|
224
|
+
Location: src/hooks/useUserData.ts:47
|
|
225
|
+
Problem: useEffect fetches data but missing cleanup — causes state update
|
|
226
|
+
on unmounted component, triggering React warning and potential
|
|
227
|
+
memory leak under slow networks.
|
|
228
|
+
Impact: Console errors in production, potential memory leak.
|
|
229
|
+
Root cause: No AbortController or isMounted flag used.
|
|
230
|
+
Fix: Add AbortController + cleanup return in useEffect.
|
|
231
|
+
Effort: ~15 min
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Priority Roadmap
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
🗺️ Fix Roadmap
|
|
238
|
+
──────────────────
|
|
239
|
+
P0 — Fix immediately (before anything else):
|
|
240
|
+
• [AUDIT-00X] [Brief description]
|
|
241
|
+
|
|
242
|
+
P1 — Fix before shipping:
|
|
243
|
+
• [AUDIT-00X] [Brief description]
|
|
244
|
+
|
|
245
|
+
P2 — Schedule this sprint:
|
|
246
|
+
• [AUDIT-00X] [Brief description]
|
|
247
|
+
|
|
248
|
+
P3 — Technical debt backlog:
|
|
249
|
+
• [AUDIT-00X] [Brief description]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Next Steps
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
🔗 Recommended next skills:
|
|
256
|
+
→ bug-fix (for P0/P1 issues)
|
|
257
|
+
→ refactor (for architecture issues)
|
|
258
|
+
→ migration (for outdated dependencies)
|
|
259
|
+
→ frontend-performance (for P2 performance issues)
|
|
260
|
+
|
|
261
|
+
⏳ Awaiting your approval to proceed with fixes.
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Validation Checklist
|
|
267
|
+
|
|
268
|
+
- [ ] Correct audit mode selected for the task
|
|
269
|
+
- [ ] All 6 phases covered (or scoped ones for Quick/Standard)
|
|
270
|
+
- [ ] Every finding has: ID, severity, location, problem, root cause, fix, effort
|
|
271
|
+
- [ ] Priority roadmap is ordered correctly (P0 first)
|
|
272
|
+
- [ ] No code was modified during audit
|
|
273
|
+
- [ ] User informed — awaiting approval before any changes
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Examples
|
|
278
|
+
|
|
279
|
+
See `examples/` folder.
|
|
280
|
+
|