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.
Files changed (188) hide show
  1. package/.agents/AGENTS.md +44 -88
  2. package/.agents/CHANGELOG.md +69 -0
  3. package/.agents/LICENSE +21 -0
  4. package/.agents/README.md +59 -0
  5. package/.agents/_template/BEHAVIOR_SPEC.md +96 -0
  6. package/.agents/_template/examples/example-en.md +49 -0
  7. package/.agents/_template/examples/example-vi.md +49 -0
  8. package/.agents/docs/CHI_TIET_SKILLS.md +125 -0
  9. package/.agents/docs/GOVERNANCE.md +40 -0
  10. package/.agents/docs/HUONG_DAN_SU_DUNG.md +120 -0
  11. package/.agents/docs/SPEC.md +87 -0
  12. package/.agents/docs/adr/0001-intent-based-architecture.md +19 -0
  13. package/.agents/docs/adr/0002-kernel-freeze.md +21 -0
  14. package/.agents/docs/adr/0003-risk-based-verification.md +20 -0
  15. package/.agents/docs/adr/0004-progressive-evidence.md +19 -0
  16. package/.agents/docs/skill-classification.md +25 -0
  17. package/.agents/skills/qk-access-policy/SKILL.md +179 -0
  18. package/.agents/skills/qk-ai-builder/SKILL.md +215 -0
  19. package/.agents/skills/qk-api-lifecycle/SKILL.md +176 -0
  20. package/.agents/skills/qk-bug-resolution/SKILL.md +307 -0
  21. package/.agents/skills/qk-context-loader/SKILL.md +218 -0
  22. package/.agents/skills/qk-data-lifecycle/SKILL.md +192 -0
  23. package/.agents/skills/qk-db-optimizer/SKILL.md +196 -0
  24. package/.agents/skills/qk-design-to-code/SKILL.md +285 -0
  25. package/.agents/skills/qk-docs/SKILL.md +198 -0
  26. package/.agents/skills/qk-engineering-standard/SKILL.md +351 -0
  27. package/.agents/skills/qk-engineering-standard/rules/backend.md +122 -0
  28. package/.agents/skills/qk-engineering-standard/rules/database.md +3 -0
  29. package/.agents/skills/qk-engineering-standard/rules/frontend.md +152 -0
  30. package/.agents/skills/qk-engineering-standard/rules/security.md +3 -0
  31. package/.agents/skills/qk-engineering-standard/rules/testing.md +3 -0
  32. package/.agents/skills/qk-fe-api-integration/SKILL.md +326 -0
  33. package/.agents/skills/qk-feature-delivery/SKILL.md +305 -0
  34. package/.agents/skills/qk-help/SKILL.md +193 -0
  35. package/.agents/skills/qk-orchestrator/SKILL.md +277 -0
  36. package/.agents/skills/qk-orchestrator/references/routing-table.md +77 -0
  37. package/.agents/skills/qk-production-release/SKILL.md +284 -0
  38. package/.agents/skills/qk-project-bootstrap/SKILL.md +234 -0
  39. package/.agents/skills/qk-project-health/SKILL.md +199 -0
  40. package/.agents/skills/qk-project-memory/SKILL.md +172 -0
  41. package/.agents/skills/qk-system-evolution/SKILL.md +281 -0
  42. package/.agents/skills/qk-ui-audit/SKILL.md +314 -0
  43. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
  44. package/.agents/skills/qk-ui-system-builder/SKILL.md +221 -0
  45. package/.agents/skills/qk-validation-gate/SKILL.md +359 -0
  46. package/.agents/skills.json +819 -0
  47. package/.github/workflows/ci.yml +1 -1
  48. package/.qk-ai-skill-os/CHANGELOG.md +69 -0
  49. package/.qk-ai-skill-os/LICENSE +21 -0
  50. package/.qk-ai-skill-os/README.md +59 -0
  51. package/.qk-ai-skill-os/_template/BEHAVIOR_SPEC.md +96 -0
  52. package/.qk-ai-skill-os/_template/examples/example-en.md +49 -0
  53. package/.qk-ai-skill-os/_template/examples/example-vi.md +49 -0
  54. package/.qk-ai-skill-os/docs/CHI_TIET_SKILLS.md +125 -0
  55. package/.qk-ai-skill-os/docs/GOVERNANCE.md +40 -0
  56. package/.qk-ai-skill-os/docs/HUONG_DAN_SU_DUNG.md +120 -0
  57. package/.qk-ai-skill-os/docs/SPEC.md +87 -0
  58. package/.qk-ai-skill-os/docs/adr/0001-intent-based-architecture.md +19 -0
  59. package/.qk-ai-skill-os/docs/adr/0002-kernel-freeze.md +21 -0
  60. package/.qk-ai-skill-os/docs/adr/0003-risk-based-verification.md +20 -0
  61. package/.qk-ai-skill-os/docs/adr/0004-progressive-evidence.md +19 -0
  62. package/.qk-ai-skill-os/docs/skill-classification.md +25 -0
  63. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +121 -0
  64. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +179 -0
  65. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-api-integration/SKILL.md +389 -0
  66. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-auth-security/SKILL.md +96 -0
  67. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +125 -0
  68. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-bug-fix/SKILL.md +213 -0
  69. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-component-generator/SKILL.md +136 -0
  70. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-context-manager/SKILL.md +175 -0
  71. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-database-engineer/SKILL.md +104 -0
  72. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-deployment/SKILL.md +96 -0
  73. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-design-system/SKILL.md +137 -0
  74. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-form-builder/SKILL.md +140 -0
  75. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +155 -0
  76. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +133 -0
  77. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +129 -0
  78. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +146 -0
  79. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-git-engineer/SKILL.md +304 -0
  80. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-help/SKILL.md +68 -0
  81. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-migration/SKILL.md +284 -0
  82. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-project-audit/SKILL.md +280 -0
  83. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-refactor/SKILL.md +222 -0
  84. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-state-management/SKILL.md +140 -0
  85. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +127 -0
  86. package/.qk-ai-skill-os/skills/_archive_old_skills/qk-ui-builder/SKILL.md +152 -0
  87. package/.qk-ai-skill-os/skills/_template/SKILL.md +238 -0
  88. package/.qk-ai-skill-os/skills/qk-access-policy/SKILL.md +179 -0
  89. package/.qk-ai-skill-os/skills/qk-ai-builder/SKILL.md +221 -0
  90. package/.qk-ai-skill-os/skills/qk-api-lifecycle/SKILL.md +176 -0
  91. package/.qk-ai-skill-os/skills/qk-bug-resolution/SKILL.md +307 -0
  92. package/.qk-ai-skill-os/skills/qk-context-loader/SKILL.md +218 -0
  93. package/.qk-ai-skill-os/skills/qk-data-lifecycle/SKILL.md +192 -0
  94. package/.qk-ai-skill-os/skills/qk-db-optimizer/SKILL.md +196 -0
  95. package/.qk-ai-skill-os/skills/qk-design-to-code/SKILL.md +291 -0
  96. package/.qk-ai-skill-os/skills/qk-docs/SKILL.md +198 -0
  97. package/.qk-ai-skill-os/skills/qk-engineering-standard/SKILL.md +351 -0
  98. package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/backend.md +122 -0
  99. package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/database.md +3 -0
  100. package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/frontend.md +152 -0
  101. package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/security.md +3 -0
  102. package/.qk-ai-skill-os/skills/qk-engineering-standard/rules/testing.md +3 -0
  103. package/.qk-ai-skill-os/skills/qk-fe-api-integration/SKILL.md +326 -0
  104. package/.qk-ai-skill-os/skills/qk-feature-delivery/SKILL.md +305 -0
  105. package/.qk-ai-skill-os/skills/qk-help/SKILL.md +193 -0
  106. package/.qk-ai-skill-os/skills/qk-orchestrator/SKILL.md +277 -0
  107. package/.qk-ai-skill-os/skills/qk-orchestrator/references/routing-table.md +77 -0
  108. package/.qk-ai-skill-os/skills/qk-production-release/SKILL.md +290 -0
  109. package/.qk-ai-skill-os/skills/qk-project-bootstrap/SKILL.md +240 -0
  110. package/.qk-ai-skill-os/skills/qk-project-health/SKILL.md +199 -0
  111. package/.qk-ai-skill-os/skills/qk-project-memory/SKILL.md +172 -0
  112. package/.qk-ai-skill-os/skills/qk-system-evolution/SKILL.md +285 -0
  113. package/.qk-ai-skill-os/skills/qk-ui-audit/SKILL.md +314 -0
  114. package/.qk-ai-skill-os/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
  115. package/.qk-ai-skill-os/skills/qk-ui-system-builder/SKILL.md +225 -0
  116. package/.qk-ai-skill-os/skills/qk-validation-gate/SKILL.md +361 -0
  117. package/.qk-ai-skill-os/skills.json +819 -0
  118. package/CLAUDE.md +110 -0
  119. package/README.md +25 -3
  120. package/add_lang.js +21 -0
  121. package/add_lang.py +25 -0
  122. package/add_sections.py +53 -0
  123. package/bin/install.js +225 -170
  124. package/bin/lint.js +122 -0
  125. package/docs/CHI_TIET_SKILLS.md +26 -26
  126. package/docs/HUONG_DAN_SU_DUNG.md +3 -3
  127. package/docs/SPEC.md +70 -20
  128. package/framework/skill-schema.md +310 -0
  129. package/package.json +15 -4
  130. package/patch.js +15 -0
  131. package/patch.py +89 -0
  132. package/patch2.py +83 -0
  133. package/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +1 -0
  134. package/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +1 -0
  135. package/skills/_archive_old_skills/qk-api-integration/SKILL.md +1 -0
  136. package/skills/_archive_old_skills/qk-auth-security/SKILL.md +1 -0
  137. package/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +1 -0
  138. package/skills/_archive_old_skills/qk-bug-fix/SKILL.md +1 -0
  139. package/skills/_archive_old_skills/qk-component-generator/SKILL.md +1 -0
  140. package/skills/_archive_old_skills/qk-context-manager/SKILL.md +1 -0
  141. package/skills/_archive_old_skills/qk-database-engineer/SKILL.md +1 -0
  142. package/skills/_archive_old_skills/qk-deployment/SKILL.md +1 -0
  143. package/skills/_archive_old_skills/qk-design-system/SKILL.md +1 -0
  144. package/skills/_archive_old_skills/qk-form-builder/SKILL.md +1 -0
  145. package/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +1 -0
  146. package/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +1 -0
  147. package/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +1 -0
  148. package/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +1 -0
  149. package/skills/_archive_old_skills/qk-git-engineer/SKILL.md +1 -0
  150. package/skills/_archive_old_skills/qk-help/SKILL.md +1 -0
  151. package/skills/_archive_old_skills/qk-migration/SKILL.md +1 -0
  152. package/skills/_archive_old_skills/qk-project-audit/SKILL.md +1 -0
  153. package/skills/_archive_old_skills/qk-refactor/SKILL.md +1 -0
  154. package/skills/_archive_old_skills/qk-state-management/SKILL.md +1 -0
  155. package/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +1 -0
  156. package/skills/_archive_old_skills/qk-ui-builder/SKILL.md +1 -0
  157. package/skills/_template/SKILL.md +238 -0
  158. package/skills/qk-access-policy/SKILL.md +179 -39
  159. package/skills/qk-ai-builder/SKILL.md +215 -40
  160. package/skills/qk-api-lifecycle/SKILL.md +176 -46
  161. package/skills/qk-bug-resolution/SKILL.md +307 -46
  162. package/skills/qk-context-loader/SKILL.md +218 -43
  163. package/skills/qk-data-lifecycle/SKILL.md +192 -44
  164. package/skills/qk-db-optimizer/SKILL.md +196 -41
  165. package/skills/qk-design-to-code/SKILL.md +285 -46
  166. package/skills/qk-docs/SKILL.md +198 -40
  167. package/skills/qk-engineering-standard/SKILL.md +351 -42
  168. package/skills/qk-fe-api-integration/SKILL.md +326 -55
  169. package/skills/qk-feature-delivery/SKILL.md +305 -48
  170. package/skills/qk-help/SKILL.md +178 -23
  171. package/skills/qk-orchestrator/SKILL.md +277 -42
  172. package/skills/qk-orchestrator/references/routing-table.md +77 -0
  173. package/skills/qk-production-release/SKILL.md +284 -41
  174. package/skills/qk-project-bootstrap/SKILL.md +234 -38
  175. package/skills/qk-project-health/SKILL.md +199 -40
  176. package/skills/qk-project-memory/SKILL.md +172 -40
  177. package/skills/qk-system-evolution/SKILL.md +281 -40
  178. package/skills/qk-ui-audit/SKILL.md +314 -42
  179. package/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
  180. package/skills/qk-ui-system-builder/SKILL.md +221 -43
  181. package/skills/qk-validation-gate/SKILL.md +359 -40
  182. package/skills.json +813 -824
  183. package/specs/fixtures/user-payload.json +12 -0
  184. package/specs/regressions/api-integration-null-fields.yaml +19 -0
  185. package/temp_fix.js +61 -0
  186. package/tests/registry.test.js +1 -1
  187. package/update_template.js +28 -0
  188. package/skills/qk-policy-engine/SKILL.md +0 -39
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: qk-frontend-performance
3
+ description: >-
4
+ Tối ưu hóa hiệu năng frontend: giảm kích thước bundle, chặn re-render thừa, lazy load và cải thiện Web Vitals.
5
+ version: 1.0.0
6
+ category: frontend
7
+ tags: [performance, optimization, render, bundle-size, lazy-load, memoization]
8
+ platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
9
+ ---
10
+
11
+ # Frontend Performance Optimizer
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
+ ---
19
+
20
+ ## Trigger
21
+
22
+ Activate this skill when:
23
+ - User reports "app is slow", "loading takes too long", or "UI freezes"
24
+ - Core Web Vitals (LCP, FID/INP, CLS) are failing
25
+ - React DevTools shows excessive re-renders
26
+ - `project-audit` flags a performance issue (P2)
27
+ - Need to optimize images, bundle size, or data fetching
28
+
29
+ ---
30
+
31
+ ## Scope
32
+
33
+ - ✅ **Render Optimization:** Prevent unnecessary re-renders (React `memo`, `useMemo`, `useCallback`).
34
+ - ✅ **Bundle Optimization:** Code splitting, lazy loading components/routes (`React.lazy`, Next.js `dynamic`).
35
+ - ✅ **Asset Optimization:** Image optimization (WebP, Next/Image, lazy loading `loading="lazy"`).
36
+ - ✅ **Data Fetching:** Caching, prefetching, pagination, virtualization for large lists.
37
+ - ✅ **Core Web Vitals:** Fix layout shifts (CLS), improve Largest Contentful Paint (LCP).
38
+
39
+ ---
40
+
41
+ ## Non-goals
42
+
43
+ - ❌ Do NOT blindly wrap everything in `useMemo` or `React.memo` (this can degrade performance).
44
+ - ❌ Do NOT optimize prematurely if there is no measured performance issue.
45
+ - ❌ Do NOT rewrite business logic unless it is the direct cause of the bottleneck.
46
+
47
+ ---
48
+
49
+ ## Workflow
50
+
51
+ ### Phase 1 — Identify the Bottleneck
52
+
53
+ Determine what kind of performance issue it is:
54
+ 1. **Network/Load Time:** Slow initial page load, large bundle size, heavy images.
55
+ 2. **Render/Runtime:** UI is sluggish, typing lags, animation stutters (too many re-renders).
56
+ 3. **Data/Memory:** App crashes or slows down over time, large lists lagging.
57
+
58
+ ### Phase 2 — Common Fixes by Category
59
+
60
+ #### 1. Fixing Unnecessary Re-renders (React)
61
+ - Move state down to the smallest possible component.
62
+ - Use `React.memo` for heavy pure components that receive the same props.
63
+ - Stable references: Use `useMemo` for expensive calculations or object props, and `useCallback` for function props passed to memoized children.
64
+ - *Warning:* Measure first! Memoization has an upfront cost.
65
+
66
+ #### 2. Fixing Bundle Size (Code Splitting)
67
+ - Are large libraries (like `lodash`, `moment`, `echarts`) imported entirely? Use named imports or alternative libraries.
68
+ - Lazy load routes or heavy components below the fold:
69
+ ```typescript
70
+ const HeavyChart = React.lazy(() => import('./HeavyChart'));
71
+ // Wrap in <Suspense fallback={<Spinner />}>
72
+ ```
73
+
74
+ #### 3. Asset & UI Optimization
75
+ - Add fixed `width` and `height` to images to prevent Cumulative Layout Shift (CLS).
76
+ - Virtualize large lists (e.g., `react-window` or `@tanstack/react-virtual`) instead of rendering 1000 DOM nodes.
77
+ - Debounce rapid events (typing in search, window resize).
78
+
79
+ ---
80
+
81
+ ### Phase 3 — Implementation
82
+
83
+ Apply the targeted fix. Document why the fix improves performance.
84
+
85
+ ---
86
+
87
+ ## Decision Tree
88
+
89
+ ```
90
+ Is the issue related to initial load time?
91
+ ├── Yes → Focus on Code Splitting (lazy loading), Image Optimization, and bundle size reduction.
92
+ └── No → Is the UI lagging during interaction?
93
+ ├── Yes → Profile renders. Check for state updates triggering massive re-renders. Use `memo` or state colocation.
94
+ └── No → Is a specific list or table slow?
95
+ ├── Yes → Implement virtualization (react-window) or pagination.
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Output Format
101
+
102
+ ```
103
+ ⚡ Performance Optimization Report
104
+ ─────────────────────────────────────────────────
105
+ Target: [Component / Page]
106
+ Bottleneck: [Brief description, e.g., "Expensive list rendering on every keystroke"]
107
+
108
+ 🔧 Fixes Applied:
109
+ ✅ Extracted Search Input state to prevent list re-rendering
110
+ ✅ Wrapped heavy `ChartComponent` in `React.memo`
111
+ ✅ Lazy-loaded below-the-fold content (`Suspense`)
112
+
113
+ 📈 Expected Impact:
114
+ - Reduced re-renders on typing from O(N) to O(1)
115
+ - Initial JS bundle size reduced by ~X KB
116
+
117
+ ⚠️ Notes:
118
+ Please test this on lower-end devices to confirm smooth interactions.
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Validation Checklist
124
+
125
+ - [ ] Fix addresses the specific bottleneck
126
+ - [ ] No premature memoization applied blindly
127
+ - [ ] Layout shift (CLS) prevented (if changing images/layout)
128
+ - [ ] Application behavior remains completely unchanged
129
+
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: qk-frontend-testing
3
+ description: >-
4
+ Viết Unit, Component và E2E test bằng Jest, Vitest, RTL, Cypress. Tập trung vào hành vi người dùng.
5
+ version: 1.0.0
6
+ category: frontend
7
+ tags: [testing, jest, vitest, react-testing-library, cypress, playwright, tdd]
8
+ platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
9
+ ---
10
+
11
+ # Frontend Testing
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
+ ---
19
+
20
+ ## Trigger
21
+
22
+ Activate this skill when:
23
+ - User asks to "write tests for this", "add unit tests", or "test this component"
24
+ - Fixing a critical bug where a regression test is required
25
+ - Preparing for a major release and increasing test coverage
26
+ - Project audit flags missing tests for core business logic
27
+
28
+ ---
29
+
30
+ ## Scope
31
+
32
+ - ✅ **Unit Tests:** Test pure functions, utilities, and custom hooks.
33
+ - ✅ **Component Tests:** Test UI components using React Testing Library (RTL). Focus on user interactions and accessibility roles.
34
+ - ✅ **Mocking:** Mock API calls (MSW, Jest mocks), modules, and timers.
35
+ - ✅ **E2E Tests:** Write Cypress or Playwright tests for critical user flows.
36
+ - ✅ Follow the project's existing testing framework (Jest vs Vitest).
37
+
38
+ ---
39
+
40
+ ## Non-goals
41
+
42
+ - ❌ Do NOT test implementation details (e.g., checking if a specific state variable changed). Test what the user sees/does.
43
+ - ❌ Do NOT write brittle tests (e.g., querying by CSS class names). Use ARIA roles or `data-testid`.
44
+ - ❌ Do NOT introduce a new testing framework if one already exists.
45
+
46
+ ---
47
+
48
+ ## Workflow
49
+
50
+ ### Phase 1 — Environment Check
51
+
52
+ Identify the testing stack:
53
+ - Runner: Jest or Vitest?
54
+ - DOM: React Testing Library, Vue Test Utils?
55
+ - E2E: Cypress, Playwright?
56
+ - Mocking: MSW (Mock Service Worker), `jest.mock`, `vi.mock`?
57
+
58
+ ---
59
+
60
+ ### Phase 2 — Strategy & Coverage
61
+
62
+ Determine what needs testing:
63
+ 1. **Critical Path:** Can the user complete the primary action?
64
+ 2. **Edge Cases:** What happens on API failure? Empty state? Invalid input?
65
+ 3. **Accessibility:** Can elements be found by role?
66
+
67
+ ---
68
+
69
+ ### Phase 3 — Writing the Test (RTL Example)
70
+
71
+ 1. **Setup:** Render the component, wrap with necessary providers (Theme, Store, QueryClient).
72
+ 2. **Query:** Find elements using `screen.getByRole`, `screen.getByLabelText`, or `screen.getByText`.
73
+ 3. **Act:** Simulate user events using `userEvent` (preferred over `fireEvent`).
74
+ 4. **Assert:** Expect elements to be in the document, disabled, or display specific text.
75
+
76
+ *Example:*
77
+ ```typescript
78
+ it('submits the form when fields are valid', async () => {
79
+ const mockSubmit = vi.fn();
80
+ render(<LoginForm onSubmit={mockSubmit} />);
81
+
82
+ await userEvent.type(screen.getByLabelText(/email/i), 'test@example.com');
83
+ await userEvent.type(screen.getByLabelText(/password/i), 'password123');
84
+ await userEvent.click(screen.getByRole('button', { name: /login/i }));
85
+
86
+ expect(mockSubmit).toHaveBeenCalledWith({
87
+ email: 'test@example.com',
88
+ password: 'password123'
89
+ });
90
+ });
91
+ ```
92
+
93
+ ---
94
+
95
+ ### Phase 4 — Mocking
96
+
97
+ If the component makes API calls:
98
+ - Prefer MSW (Mock Service Worker) for network-level mocking.
99
+ - Fallback: Mock the API service module or custom hook.
100
+
101
+ ---
102
+
103
+ ## Decision Tree
104
+
105
+ ```
106
+ Are we testing a pure function or utility?
107
+ ├── Yes → Write a standard Unit Test (Jest/Vitest).
108
+ └── No → Are we testing a UI component?
109
+ ├── Yes → Use React Testing Library (focus on user behavior).
110
+ └── No → Are we testing a full page flow?
111
+ ├── Yes → Write an E2E test (Cypress/Playwright) or integration test.
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Output Format
117
+
118
+ ```
119
+ 🧪 Test Suite Generated
120
+ ─────────────────────────────────────────────────
121
+ Target: [ComponentName or Utility]
122
+ Type: [Unit / Component / E2E]
123
+ Framework: [Vitest + RTL]
124
+
125
+ Tests Added:
126
+ ✅ renders correctly in default state
127
+ ✅ displays error message on API failure
128
+ ✅ successfully submits user data
129
+
130
+ Mocking Used:
131
+ - MSW handlers for `/api/users`
132
+ - vi.fn() for onSubmit callback
133
+
134
+ 🔗 Next Steps:
135
+ Run `npm run test` to execute the suite.
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Validation Checklist
141
+
142
+ - [ ] Queries use accessible methods (`getByRole`, `getByLabelText`)
143
+ - [ ] Events simulated with `userEvent` (if applicable)
144
+ - [ ] External dependencies/APIs are properly mocked
145
+ - [ ] Tests verify observable behavior, not internal state
146
+
@@ -0,0 +1,304 @@
1
+ ---
2
+ name: qk-git-engineer
3
+ description: >-
4
+ Viết commit message chuẩn Conventional Commits, mô tả Pull Request, Changelog và Release Notes chuyên nghiệp.
5
+ version: 1.0.0
6
+ category: engineering
7
+ tags: [git, commit, pull-request, changelog, release, conventional-commits]
8
+ platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
9
+ ---
10
+
11
+ # Git Engineer
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
+ > 📌 **Standard followed:** [Conventional Commits v1.0.0](https://www.conventionalcommits.org/)
19
+
20
+ ---
21
+
22
+ ## Trigger
23
+
24
+ Activate this skill when:
25
+ - User wants to write a commit message
26
+ - User has finished a feature and needs a PR description
27
+ - User needs to generate a changelog for a release
28
+ - User asks "what should I commit?", "write PR", "release notes"
29
+ - User wants to clean up their git history before merging
30
+
31
+ ---
32
+
33
+ ## Scope
34
+
35
+ - ✅ Write commit messages (Conventional Commits format)
36
+ - ✅ Suggest logical commit groupings from a set of changes
37
+ - ✅ Write pull request titles and descriptions
38
+ - ✅ Generate CHANGELOG entries from commit history
39
+ - ✅ Write release notes (human-readable)
40
+ - ✅ Suggest branch naming conventions
41
+ - ✅ Review and improve existing commit messages
42
+
43
+ ---
44
+
45
+ ## Non-goals
46
+
47
+ - ❌ Do NOT run git commands without explicit user approval
48
+ - ❌ Do NOT force-push or rebase without warning
49
+ - ❌ Do NOT create commits that bundle unrelated changes
50
+ - ❌ Do NOT write vague messages like "fix stuff" or "updates"
51
+
52
+ ---
53
+
54
+ ## Conventional Commits Format
55
+
56
+ ```
57
+ <type>(<scope>): <description>
58
+
59
+ [optional body]
60
+
61
+ [optional footer(s)]
62
+ ```
63
+
64
+ ### Types
65
+
66
+ | Type | When to use |
67
+ |------|-------------|
68
+ | `feat` | New feature |
69
+ | `fix` | Bug fix |
70
+ | `docs` | Documentation only changes |
71
+ | `style` | Formatting, missing semicolons — no logic change |
72
+ | `refactor` | Code restructure without behavior change |
73
+ | `perf` | Performance improvement |
74
+ | `test` | Adding or fixing tests |
75
+ | `build` | Build system or dependency changes |
76
+ | `ci` | CI/CD configuration changes |
77
+ | `chore` | Other changes that don't modify src or test files |
78
+ | `revert` | Reverts a previous commit |
79
+
80
+ ### Breaking Changes
81
+
82
+ ```
83
+ feat!: remove deprecated login endpoint
84
+
85
+ BREAKING CHANGE: The /auth/login endpoint has been removed.
86
+ Use /auth/v2/login instead.
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Workflow
92
+
93
+ ### Phase 1 — Understand the Changes
94
+
95
+ Review what has changed:
96
+ 1. Read the diff or file list provided by the user
97
+ 2. Group changes by concern (feature, fix, refactor, docs, etc.)
98
+ 3. Identify if changes should be split into multiple commits or kept as one
99
+ 4. Note any breaking changes
100
+
101
+ ---
102
+
103
+ ### Phase 2 — Commit Message(s)
104
+
105
+ For each logical group of changes, write:
106
+
107
+ **Single commit:**
108
+ ```
109
+ feat(auth): add refresh token rotation
110
+
111
+ Implements automatic refresh token rotation on each use.
112
+ Old tokens are invalidated immediately after use to prevent
113
+ replay attacks.
114
+
115
+ Closes #142
116
+ ```
117
+
118
+ **Multiple commits (if changes should be split):**
119
+ ```
120
+ refactor(api): extract axios instance to lib/axios.ts
121
+
122
+ No behavior change — prepares for interceptor configuration.
123
+
124
+ ---
125
+
126
+ feat(api): add request retry interceptor
127
+
128
+ Automatically retries failed requests up to 3 times with
129
+ exponential backoff. Skips retry for 4xx errors.
130
+ ```
131
+
132
+ **Rules:**
133
+ - Subject line: ≤72 characters, imperative mood ("add" not "added")
134
+ - Body: explain *why*, not *what* (the diff shows what)
135
+ - Reference issues: `Closes #123`, `Fixes #456`, `Refs #789`
136
+
137
+ ---
138
+
139
+ ### Phase 3 — Pull Request Description
140
+
141
+ Structure:
142
+ ```markdown
143
+ ## Summary
144
+ [1-3 sentences describing what this PR does and why]
145
+
146
+ ## Changes
147
+ - [Specific change 1]
148
+ - [Specific change 2]
149
+ - [Specific change 3]
150
+
151
+ ## Testing
152
+ - [ ] Unit tests pass
153
+ - [ ] Manual testing: [describe what you tested]
154
+ - [ ] [Other relevant checks]
155
+
156
+ ## Breaking Changes
157
+ [None | Description of breaking change and migration path]
158
+
159
+ ## Screenshots / Demo
160
+ [If UI changes — attach before/after screenshots]
161
+
162
+ ## Related Issues
163
+ Closes #[issue number]
164
+ ```
165
+
166
+ ---
167
+
168
+ ### Phase 4 — Changelog Entry
169
+
170
+ Follow [Keep a Changelog](https://keepachangelog.com/) format:
171
+
172
+ ```markdown
173
+ ## [1.2.0] - 2026-07-01
174
+
175
+ ### Added
176
+ - Refresh token rotation for improved security (#142)
177
+ - Retry interceptor with exponential backoff (#138)
178
+
179
+ ### Changed
180
+ - Extracted axios instance to `src/lib/axios.ts` for cleaner configuration
181
+
182
+ ### Fixed
183
+ - Fixed race condition in useUserData hook causing stale state (#135)
184
+ - Resolved memory leak when component unmounts during fetch (#133)
185
+
186
+ ### Deprecated
187
+ - `GET /api/v1/users` — use `GET /api/v2/users` instead (removes in v2.0)
188
+
189
+ ### Removed
190
+ - Removed legacy `moment.js` dependency — migrated to `date-fns`
191
+
192
+ ### Security
193
+ - Updated `package-x` from 2.1.0 to 2.1.4 (CVE-2026-XXXX)
194
+ ```
195
+
196
+ ---
197
+
198
+ ### Phase 5 — Release Notes (Human-Readable)
199
+
200
+ For non-technical stakeholders:
201
+
202
+ ```markdown
203
+ # Release v1.2.0 — Security & Stability
204
+
205
+ ## What's new
206
+
207
+ **Better security**: Login sessions are now more secure with automatic
208
+ token rotation. Each time you use the app, your session is refreshed
209
+ automatically.
210
+
211
+ **More reliable**: The app now automatically retries failed requests,
212
+ so temporary network issues won't interrupt your workflow.
213
+
214
+ ## Bug fixes
215
+
216
+ - Fixed an issue where user data could appear stale after navigating
217
+ - Fixed a rare crash that occurred when closing the app during data loading
218
+
219
+ ## Under the hood
220
+
221
+ We've updated several internal libraries to keep the app fast, secure,
222
+ and maintainable.
223
+ ```
224
+
225
+ ---
226
+
227
+ ## Decision Tree
228
+
229
+ ```
230
+ What does the user need?
231
+ ├── Commit message → Phase 2 only
232
+ ├── PR description → Phase 3 (+ Phase 2 if commits not written)
233
+ ├── Changelog entry → Phase 4 (from commit list or diff)
234
+ └── Full release → Phase 2 + Phase 4 + Phase 5
235
+
236
+ Should changes be split into multiple commits?
237
+ ├── Changes are unrelated → Yes — split by concern
238
+ ├── Changes form one atomic feature → No — single commit
239
+ └── Unsure → Ask user
240
+
241
+ Is there a breaking change?
242
+ ├── Yes → Use `feat!` or `fix!` type + BREAKING CHANGE footer
243
+ └── No → Standard type
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Branch Naming Convention
249
+
250
+ ```
251
+ feature/short-description → new features
252
+ fix/short-description → bug fixes
253
+ refactor/short-description → refactoring
254
+ chore/dependency-upgrade → maintenance
255
+ release/v1.2.0 → release preparation
256
+ hotfix/critical-issue → urgent production fixes
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Output Format
262
+
263
+ ```
264
+ 📝 Git Output
265
+ ─────────────────────────────────────────────────
266
+ Type: [commit | PR | changelog | release-notes]
267
+
268
+ ─── Commit Message ───────────────────────────────
269
+ feat(scope): short imperative description
270
+
271
+ Body explaining why this change was made.
272
+ What problem does it solve?
273
+
274
+ Closes #123
275
+
276
+ ─── PR Title ─────────────────────────────────────
277
+ feat(scope): short imperative description
278
+
279
+ ─── PR Description ───────────────────────────────
280
+ [Formatted markdown PR body]
281
+
282
+ ─── Changelog ────────────────────────────────────
283
+ [Formatted changelog section]
284
+ ```
285
+
286
+ ---
287
+
288
+ ## Validation Checklist
289
+
290
+ - [ ] Commit type is correct (feat/fix/refactor/etc.)
291
+ - [ ] Subject line ≤72 chars, imperative mood, no period at end
292
+ - [ ] Breaking changes flagged with `!` and `BREAKING CHANGE:` footer
293
+ - [ ] Body explains *why*, not just *what*
294
+ - [ ] Issue references included (`Closes #N`)
295
+ - [ ] PR description covers: summary, changes, testing, breaking changes
296
+ - [ ] Changelog uses correct sections (Added/Changed/Fixed/etc.)
297
+ - [ ] No vague messages ("fix stuff", "updates", "wip")
298
+
299
+ ---
300
+
301
+ ## Examples
302
+
303
+ See `examples/` folder.
304
+
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: qk-help
3
+ description: >-
4
+ Tra cứu danh sách toàn bộ kỹ năng (skills) hiện có và đọc các mẹo (pro-tips) kết hợp kỹ năng để tăng tốc độ code.
5
+ version: 1.0.0
6
+ category: engineering
7
+ tags: [help, list, tips, guide, manual]
8
+ platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
9
+ ---
10
+
11
+ # 📚 Cẩm nang AI Developer Skill OS
12
+
13
+ > **Nhiệm vụ của bạn (AI):** Khi người dùng gọi lệnh `./qk-help`, hãy xuất ra màn hình (bằng tiếng Việt) danh sách các kỹ năng phân theo nhóm và các Mẹo sử dụng (Pro-tips) dưới đây một cách sinh động, dễ đọc (dùng markdown, in đậm, emoji). Không cần phân tích code, chỉ đóng vai trò là "Sách hướng dẫn sử dụng".
14
+
15
+ ---
16
+
17
+ ## 🎯 1. Danh sách Kỹ năng (Skills Directory)
18
+
19
+ Dưới đây là các kỹ năng chính bạn có thể gọi bằng cách gõ `./qk-[tên-kỹ-năng]`:
20
+
21
+ ### 🎨 Frontend (Giao diện)
22
+ - **`qk-ui-builder`**: Xây dựng UI, Layout, Component, Modal phức tạp.
23
+ - **`qk-table-crud-generator`**: Chuyên vẽ bảng danh sách (Table), phân trang, lọc và form Thêm/Sửa/Xóa.
24
+ - **`qk-form-builder`**: Chuyên làm Form nhập liệu, validate (Zod/Yup).
25
+ - **`qk-component-generator`**: Tạo Component độc lập, tái sử dụng (Button, Input, Card).
26
+ - **`qk-state-management`**: Xử lý Redux, Zustand, React Query.
27
+ - **`qk-frontend-debug`**: Bắt bệnh vỡ layout, infinite re-render, lỗi Hydration.
28
+ - **`qk-frontend-performance`**: Tối ưu tốc độ, chống re-render thừa.
29
+ - **`qk-frontend-architecture`**: Tư vấn kiến trúc thư mục Frontend.
30
+ - **`qk-frontend-testing`**: Viết Unit Test / E2E Test cho Frontend.
31
+ - **`qk-accessibility-audit`**: Sửa lỗi a11y, hỗ trợ Screen reader.
32
+
33
+ ### ⚙️ Engineering & Integration (Tích hợp)
34
+ - **`qk-api-integration`**: [Cực mạnh] Bóc tách tài liệu API (Curl, Postman) -> Gen Type, Service, Hook -> (Tùy chọn) Ốp thẳng vào UI.
35
+ - **`qk-refactor`**: Tối ưu, dọn dẹp mã nguồn sạch sẽ.
36
+ - **`qk-bug-fix`**: Chẩn đoán lỗi sâu và sửa an toàn.
37
+ - **`qk-project-audit`**: Quét toàn bộ dự án tìm nợ kỹ thuật.
38
+ - **`qk-git-engineer`**: Viết Commit / PR chuẩn Conventional.
39
+ - **`qk-migration`**: Nâng cấp version framework / thư viện.
40
+ - **`qk-agent-orchestrator`**: Kiến trúc sư, lên plan phân rã task lớn.
41
+ - **`qk-context-manager`**: Tóm tắt kiến trúc dự án.
42
+
43
+ ### 🗄️ Backend (Máy chủ)
44
+ - **`qk-database-engineer`**: Thiết kế Schema, ORM (Prisma/Drizzle), Migration.
45
+ - **`qk-backend-architecture`**: Setup kiến trúc Backend (Node/Nest/Python).
46
+ - **`qk-auth-security`**: Phân quyền RBAC, JWT, OAuth.
47
+ - **`qk-deployment`**: Viết Dockerfile, CI/CD Pipeline.
48
+
49
+ ---
50
+
51
+ ## 💡 2. Mẹo sử dụng Nâng cao (Pro-Tips)
52
+
53
+ ### Mẹo 1: Kết hợp Kỹ năng (Skill Chaining) 🔗
54
+ Đừng bắt AI làm từ A-Z bằng 1 câu prompt. Hãy gọi liên hoàn:
55
+ > *"Hãy dùng `./qk-api-integration` để bóc tách API này thành hook React Query. Sau đó dùng `./qk-table-crud-generator` vẽ cái Bảng hiển thị danh sách tích hợp hook đó."*
56
+
57
+ ### Mẹo 2: Chế độ "Một phát ăn ngay" (End-to-End) 🚀
58
+ Nếu bạn đã có sẵn 1 màn hình UI (chỉ thiếu data), hãy ép `qk-api-integration` làm End-to-End:
59
+ > *"./qk-api-integration Dưới đây là API Get Profile. Hãy khai báo Type, viết Hook và TÍCH HỢP THẲNG LUÔN vào file \`Profile.tsx\` đang mở."*
60
+
61
+ ### Mẹo 3: Truyền tham số ép buộc (Arguments) 🎯
62
+ Bạn có thể ép AI dùng công nghệ bạn muốn bằng cách thêm \`--tham_số\`:
63
+ > *"./qk-ui-builder --fw=react --css=tailwind Hãy vẽ màn hình Đăng nhập."*
64
+
65
+ ### Mẹo 4: Nhờ "Kiến trúc sư" phân việc 🧠
66
+ Nếu bạn có một tính năng quá lớn (ví dụ: Làm tính năng Giỏ Hàng), đừng tự chia việc, hãy gọi:
67
+ > *"./qk-agent-orchestrator Tôi muốn làm tính năng Giỏ hàng. Hãy phân tích và lên kế hoạch gọi các skill \`qk-\` nào cho phù hợp."*
68
+