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.
- package/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/_template/SKILL.md +154 -0
- package/_template/examples/example-en.md +49 -0
- package/_template/examples/example-vi.md +49 -0
- package/bin/install.js +56 -0
- package/docs/CHI_TIET_SKILLS.md +117 -0
- package/docs/HUONG_DAN_SU_DUNG.md +102 -0
- package/package.json +34 -0
- package/skills/backend/auth-security/SKILL.md +94 -0
- package/skills/backend/backend-architecture/SKILL.md +123 -0
- package/skills/backend/database-engineer/SKILL.md +102 -0
- package/skills/backend/deployment/SKILL.md +94 -0
- package/skills/engineering/agent-orchestrator/SKILL.md +177 -0
- package/skills/engineering/api-integration/SKILL.md +378 -0
- package/skills/engineering/bug-fix/SKILL.md +211 -0
- package/skills/engineering/context-manager/SKILL.md +174 -0
- package/skills/engineering/git-engineer/SKILL.md +302 -0
- package/skills/engineering/migration/SKILL.md +282 -0
- package/skills/engineering/project-audit/SKILL.md +278 -0
- package/skills/engineering/refactor/SKILL.md +220 -0
- package/skills/frontend/accessibility-audit/SKILL.md +119 -0
- package/skills/frontend/component-generator/SKILL.md +134 -0
- package/skills/frontend/design-system/SKILL.md +135 -0
- package/skills/frontend/form-builder/SKILL.md +138 -0
- package/skills/frontend/frontend-architecture/SKILL.md +153 -0
- package/skills/frontend/frontend-debug/SKILL.md +131 -0
- package/skills/frontend/frontend-performance/SKILL.md +127 -0
- package/skills/frontend/frontend-testing/SKILL.md +144 -0
- package/skills/frontend/state-management/SKILL.md +138 -0
- package/skills/frontend/table-crud-generator/SKILL.md +125 -0
- package/skills/frontend/ui-builder/SKILL.md +150 -0
- package/skills.json +667 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: state-management
|
|
3
|
+
description: >-
|
|
4
|
+
Xác định và triển khai chiến lược quản lý state phù hợp (Zustand, Redux, React Query, Local State).
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: frontend
|
|
7
|
+
tags: [state, redux, zustand, react-query, context, pinia, data-flow]
|
|
8
|
+
platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# State Management
|
|
12
|
+
|
|
13
|
+
> **Language rule:**
|
|
14
|
+
> Use **English** for: code, store names, action types, library names.
|
|
15
|
+
> Use **the user's language** for: explanations, summaries, and questions.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Trigger
|
|
20
|
+
|
|
21
|
+
Activate this skill when:
|
|
22
|
+
- User asks to "store this data", "share state between components", or "cache API results"
|
|
23
|
+
- Prop drilling becomes excessive (>3 levels deep)
|
|
24
|
+
- Integrating complex UI interactions that need memory (e.g., shopping cart, multi-step wizard)
|
|
25
|
+
- Managing async server data and loading/error states
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Scope
|
|
30
|
+
|
|
31
|
+
- ✅ Decide which state layer to use based on the data's lifecycle and scope
|
|
32
|
+
- ✅ Implement local state (`useState`, `useReducer`, `ref`)
|
|
33
|
+
- ✅ Implement global UI state (Zustand, Pinia, Context, Redux)
|
|
34
|
+
- ✅ Implement server state (React Query, SWR, Apollo)
|
|
35
|
+
- ✅ Ensure state is immutable and updates correctly
|
|
36
|
+
- ✅ Prevent race conditions and stale state bugs
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Non-goals
|
|
41
|
+
|
|
42
|
+
- ❌ Do NOT introduce a new state management library if the project already uses one
|
|
43
|
+
- ❌ Do NOT put server data (API responses) in a global UI store (like Redux) if React Query is available
|
|
44
|
+
- ❌ Do NOT use global state for something that should be local (e.g., a modal's `isOpen` state)
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Workflow
|
|
49
|
+
|
|
50
|
+
### Phase 1 — State Classification
|
|
51
|
+
|
|
52
|
+
Analyze the data the user wants to manage and classify it:
|
|
53
|
+
|
|
54
|
+
1. **Local UI State:** Only needed by one component (e.g., toggle button, input value).
|
|
55
|
+
2. **Shared UI State:** Needed by multiple components, but not saved to DB (e.g., dark mode, cart items, selected filters).
|
|
56
|
+
3. **Server State:** Data fetched from an API. Needs caching, refetching, and loading states.
|
|
57
|
+
4. **URL State:** Data that should be shareable or survive refresh (e.g., search query `?q=shoes`, current page).
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### Phase 2 — Strategy Selection
|
|
62
|
+
|
|
63
|
+
Based on the classification and project stack (`project-audit`), choose the tool:
|
|
64
|
+
|
|
65
|
+
| State Type | Recommended Tool |
|
|
66
|
+
|------------|------------------|
|
|
67
|
+
| Local UI | `useState`, `useReducer` |
|
|
68
|
+
| Shared UI | Zustand, Pinia, Redux, Context API |
|
|
69
|
+
| Server | React Query, RTK Query, Apollo, SWR |
|
|
70
|
+
| URL | React Router `useSearchParams`, Next.js `useRouter` |
|
|
71
|
+
|
|
72
|
+
**Rule:** Always respect existing project conventions. If they use Redux for everything, use Redux.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Phase 3 — Implementation
|
|
77
|
+
|
|
78
|
+
Generate the required code.
|
|
79
|
+
|
|
80
|
+
**Example for Server State (React Query):**
|
|
81
|
+
- Create query key factory
|
|
82
|
+
- Create custom hook (`useUserList`)
|
|
83
|
+
- Handle `isLoading`, `isError`, and `data`
|
|
84
|
+
|
|
85
|
+
**Example for Global UI State (Zustand):**
|
|
86
|
+
- Create store file (`userStore.ts`)
|
|
87
|
+
- Define state interface and initial values
|
|
88
|
+
- Define update actions (mutations)
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Phase 4 — Validation
|
|
93
|
+
|
|
94
|
+
- [ ] Does it update correctly without mutating state directly?
|
|
95
|
+
- [ ] Are unnecessary re-renders avoided?
|
|
96
|
+
- [ ] Is server state properly cached and invalidated after mutations?
|
|
97
|
+
- [ ] Is it placed in the correct directory (e.g., `src/store/` or `src/hooks/`)?
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Decision Tree
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
Is the data fetched from a backend API?
|
|
105
|
+
├── Yes → Use Server State (React Query / SWR / RTK Query)
|
|
106
|
+
└── No → Is the data only needed in one component and its direct children?
|
|
107
|
+
├── Yes → Use Local State (`useState`)
|
|
108
|
+
└── No → Is the data used across many distinct branches of the app?
|
|
109
|
+
├── Yes → Use Global State (Zustand / Redux)
|
|
110
|
+
└── No → Use Context API or lift state up
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Output Format
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
🧠 State Management Plan
|
|
119
|
+
─────────────────────────────────────────────────
|
|
120
|
+
State Type: [Server / Global UI / Local / URL]
|
|
121
|
+
Tool Used: [React Query / Zustand / useState / etc.]
|
|
122
|
+
|
|
123
|
+
Implementation:
|
|
124
|
+
✅ [File 1] — [Store / Hook definition]
|
|
125
|
+
✅ [File 2] — [Component integration]
|
|
126
|
+
|
|
127
|
+
⚠️ Considerations:
|
|
128
|
+
• [Note on caching, stale time, or performance]
|
|
129
|
+
|
|
130
|
+
🔗 Next Steps:
|
|
131
|
+
State is ready. Use the hook in your component.
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Examples
|
|
137
|
+
|
|
138
|
+
See `examples/` folder.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: table-crud-generator
|
|
3
|
+
description: >-
|
|
4
|
+
Tạo các bảng dữ liệu admin với đầy đủ tính năng phân trang, sắp xếp, lọc và thao tác thêm/sửa/xóa (CRUD).
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: frontend
|
|
7
|
+
tags: [table, data-grid, crud, admin, pagination, sorting]
|
|
8
|
+
platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Table & CRUD Generator
|
|
12
|
+
|
|
13
|
+
> **Language rule:**
|
|
14
|
+
> Use **English** for: code, column names, API endpoints, technical features.
|
|
15
|
+
> Use **the user's language** for: explanations, summaries, and table headers/UI text (if requested).
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Trigger
|
|
20
|
+
|
|
21
|
+
Activate this skill when:
|
|
22
|
+
- User says "create an admin table", "build a user list", "add data grid"
|
|
23
|
+
- User needs a view to manage a list of entities with CRUD capabilities
|
|
24
|
+
- A feature requires complex data presentation (sorting, filtering, pagination)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Scope
|
|
29
|
+
|
|
30
|
+
- ✅ Generate a data table using design system components or libraries (e.g., TanStack Table)
|
|
31
|
+
- ✅ Implement client-side or server-side pagination, sorting, and filtering
|
|
32
|
+
- ✅ Add UI actions for Create, Edit, and Delete (modals or routing)
|
|
33
|
+
- ✅ Integrate with `api-integration` hooks for data fetching and mutations
|
|
34
|
+
- ✅ Handle loading, error, and empty states gracefully
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Non-goals
|
|
39
|
+
|
|
40
|
+
- ❌ Do NOT build the backend API for the CRUD operations (assume they exist or delegate)
|
|
41
|
+
- ❌ Do NOT use raw `<table>` tags if a powerful data-grid library is already installed
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
### Phase 1 — Data Model & Requirements
|
|
48
|
+
|
|
49
|
+
1. Understand the entity (e.g., `User`, `Product`).
|
|
50
|
+
2. Identify columns to display.
|
|
51
|
+
3. Determine operations needed (e.g., just Read/Delete, or full CRUD).
|
|
52
|
+
4. Decide on Pagination strategy: Server-side (URL params) or Client-side (in-memory).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Phase 2 — Table Component Setup
|
|
57
|
+
|
|
58
|
+
1. Check for table libraries (e.g., `@tanstack/react-table`, MUI DataGrid, AntD Table).
|
|
59
|
+
2. Define column definitions (headers, accessor keys, cell formatters).
|
|
60
|
+
3. Set up the table UI wrapper.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### Phase 3 — Data Integration
|
|
65
|
+
|
|
66
|
+
Connect to the state/API layer (e.g., React Query).
|
|
67
|
+
- `useQuery` for fetching the list. Pass pagination/sorting state.
|
|
68
|
+
- Handle `isLoading` → show skeleton or spinner.
|
|
69
|
+
- Handle empty data → show empty state component.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### Phase 4 — CRUD Actions
|
|
74
|
+
|
|
75
|
+
Implement actions (usually in an "Actions" column or toolbar):
|
|
76
|
+
- **Create:** Button opening a Modal (delegate to `form-builder`) or routing to `/new`.
|
|
77
|
+
- **Edit:** Button opening an Edit Modal or routing to `/edit/:id`.
|
|
78
|
+
- **Delete:** Button opening a confirmation dialog, calling delete mutation on confirm.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Decision Tree
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Is the dataset large (requires backend pagination)?
|
|
86
|
+
├── Yes → Implement Server-side pagination (sync state with URL search params)
|
|
87
|
+
└── No → Implement Client-side pagination (fetch all once, slice in UI)
|
|
88
|
+
|
|
89
|
+
Does the project use TanStack Table (React Table)?
|
|
90
|
+
├── Yes → Use `useReactTable` to manage table state and column definitions
|
|
91
|
+
└── No → Use the project's specific UI library table component
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Output Format
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
📊 Table & CRUD Generated
|
|
100
|
+
─────────────────────────────────────────────────
|
|
101
|
+
Entity: [Entity Name]
|
|
102
|
+
Features: [Pagination (Server), Sorting, CRUD actions]
|
|
103
|
+
|
|
104
|
+
Components Created:
|
|
105
|
+
✅ [Entity]Table.tsx
|
|
106
|
+
✅ [Entity]Columns.tsx
|
|
107
|
+
✅ DeleteConfirmModal.tsx
|
|
108
|
+
|
|
109
|
+
Integration:
|
|
110
|
+
- Fetching: Linked to `use[Entity]List` hook
|
|
111
|
+
- Mutations: Linked to Create/Update/Delete hooks
|
|
112
|
+
|
|
113
|
+
🔗 Next Steps:
|
|
114
|
+
If Create/Edit forms are needed, delegate to `form-builder`.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Validation Checklist
|
|
120
|
+
|
|
121
|
+
- [ ] Columns are defined correctly
|
|
122
|
+
- [ ] Loading and empty states are handled
|
|
123
|
+
- [ ] Pagination/sorting state is managed properly
|
|
124
|
+
- [ ] CRUD actions trigger the correct mutations or navigations
|
|
125
|
+
- [ ] Delete actions have a confirmation step
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-builder
|
|
3
|
+
description: >-
|
|
4
|
+
Xây dựng các màn hình và layout phức tạp từ yêu cầu, tái sử dụng component và đảm bảo responsive.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: frontend
|
|
7
|
+
tags: [ui, layout, screens, pages, styling, responsive]
|
|
8
|
+
platforms: [antigravity, claude-code, kilo-code, cursor, windsurf]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# UI Builder
|
|
12
|
+
|
|
13
|
+
> **Language rule:**
|
|
14
|
+
> Use **English** for: code, component names, CSS classes, technical patterns.
|
|
15
|
+
> Use **the user's language** for: explanations, questions, and summaries.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Trigger
|
|
20
|
+
|
|
21
|
+
Activate this skill when:
|
|
22
|
+
- User wants to create a new page, screen, or view
|
|
23
|
+
- User provides a mockup, wireframe, or visual description
|
|
24
|
+
- User asks to "build a layout", "create a dashboard", "make the profile page"
|
|
25
|
+
- Refactoring a large, messy view into a structured layout
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Scope
|
|
30
|
+
|
|
31
|
+
- ✅ Translate requirements into a component hierarchy
|
|
32
|
+
- ✅ Build layouts using Grid, Flexbox, and project styling conventions
|
|
33
|
+
- ✅ Ensure responsive design (mobile-first or desktop-first based on project)
|
|
34
|
+
- ✅ Integrate existing shared components (Buttons, Cards, Inputs) via `design-system` rules
|
|
35
|
+
- ✅ Define placeholders for data and logic (to be filled by `api-integration` or `state-management`)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Non-goals
|
|
40
|
+
|
|
41
|
+
- ❌ Do NOT build backend APIs
|
|
42
|
+
- ❌ Do NOT implement complex global state (delegate to `state-management`)
|
|
43
|
+
- ❌ Do NOT invent new core UI components if they already exist in the design system
|
|
44
|
+
- ❌ Do NOT write raw HTML (`<button>`) if a shared component (`<Button>`) exists
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Workflow
|
|
49
|
+
|
|
50
|
+
### Phase 1 — Requirement Analysis
|
|
51
|
+
|
|
52
|
+
1. Understand the goal: What screen are we building?
|
|
53
|
+
2. Identify major sections: Header, Sidebar, Main Content, Footer, Modals.
|
|
54
|
+
3. Identify data requirements: What data will populate this view? (Use mock data initially).
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### Phase 2 — Component Hierarchy Planning
|
|
59
|
+
|
|
60
|
+
Break the screen down into smaller components.
|
|
61
|
+
**Rule of thumb:** If a section has complex logic or is reusable, it should be a separate component.
|
|
62
|
+
|
|
63
|
+
*Example:*
|
|
64
|
+
```text
|
|
65
|
+
UserProfilePage
|
|
66
|
+
├── ProfileHeader
|
|
67
|
+
│ ├── Avatar
|
|
68
|
+
│ └── UserStats
|
|
69
|
+
├── UserSettingsForm (delegate to form-builder)
|
|
70
|
+
└── UserActivityList
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### Phase 3 — Design System Integration
|
|
76
|
+
|
|
77
|
+
*(Relies on output from `design-system` skill)*
|
|
78
|
+
Identify which existing components will be used for each part of the hierarchy.
|
|
79
|
+
|
|
80
|
+
- Buttons → `<Button>`
|
|
81
|
+
- Layouts → `<Container>`, `<Grid>`
|
|
82
|
+
- Typography → `<Typography variant="h2">` or Tailwind text classes
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### Phase 4 — Implementation
|
|
87
|
+
|
|
88
|
+
Write the code.
|
|
89
|
+
1. Build the layout skeleton first (Flexbox/Grid).
|
|
90
|
+
2. Add static/mock data to visualize the structure.
|
|
91
|
+
3. Apply styling for layout, spacing, and typography.
|
|
92
|
+
4. Ensure responsive behavior (e.g., stack columns on mobile).
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### Phase 5 — Validation
|
|
97
|
+
|
|
98
|
+
- [ ] Does it match the requirements?
|
|
99
|
+
- [ ] Is it responsive?
|
|
100
|
+
- [ ] Does it strictly use the design system?
|
|
101
|
+
- [ ] Is the code clean and well-structured (not one giant file)?
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Decision Tree
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Is a section of the UI highly complex or forms a distinct logical unit?
|
|
109
|
+
├── Yes → Extract it into its own component file (e.g., `ProfileHeader.tsx`)
|
|
110
|
+
└── No → Keep it inline in the main layout file for now
|
|
111
|
+
|
|
112
|
+
Does a required base component (e.g., DatePicker) exist in the project?
|
|
113
|
+
├── Yes → Import and use it
|
|
114
|
+
└── No → Use a standard HTML fallback or instruct `component-generator` to build it later
|
|
115
|
+
|
|
116
|
+
Is the UI data-heavy (like a complex form or table)?
|
|
117
|
+
├── Yes → Delegate specific sections to `form-builder` or `table-crud-generator`
|
|
118
|
+
└── No → Build it fully within `ui-builder`
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Output Format
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
🎨 UI Builder Summary
|
|
127
|
+
─────────────────────────────────────────────────
|
|
128
|
+
Screen: [Name of the screen/view built]
|
|
129
|
+
|
|
130
|
+
Component Hierarchy:
|
|
131
|
+
[Tree showing parent and child components]
|
|
132
|
+
|
|
133
|
+
📁 Files Created/Modified:
|
|
134
|
+
✅ [path/to/Page.tsx]
|
|
135
|
+
✅ [path/to/SubComponent.tsx]
|
|
136
|
+
|
|
137
|
+
🛠️ Implementation Details:
|
|
138
|
+
- Responsive: [Yes - describe breakpoints used]
|
|
139
|
+
- Mock Data: [Added placeholders for API integration]
|
|
140
|
+
|
|
141
|
+
🔗 Next Steps:
|
|
142
|
+
→ Need to wire up API? Route to `api-integration`.
|
|
143
|
+
→ Need complex state? Route to `state-management`.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Examples
|
|
149
|
+
|
|
150
|
+
See `examples/` folder.
|