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