ai-developer-skill-os 1.5.2 → 1.6.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/README.md +2 -0
- package/docs/HUONG_DAN_SU_DUNG.md +3 -1
- package/package.json +1 -1
- package/skills/qk-api-integration/SKILL.md +0 -233
package/README.md
CHANGED
|
@@ -39,6 +39,8 @@ Hệ thống sẽ cung cấp cho bạn 2 tuỳ chọn cực kỳ linh hoạt:
|
|
|
39
39
|
- **(1) Local:** Cài vào thư mục ẩn `.qk-ai-skill-os/` ngay trong dự án. (Phù hợp khi làm việc nhóm, commit lên Git để ai cũng xài được).
|
|
40
40
|
- **(2) Global:** Cài thẳng vào ổ đĩa máy tính (Home Directory). Từ đó trở đi, bạn mở **BẤT KỲ DỰ ÁN NÀO** cũng sẽ tự động gọi được 23 kỹ năng mà không cần tải lại file! (Rất tuyệt vời cho cá nhân sử dụng).
|
|
41
41
|
|
|
42
|
+
> 💡 **Tính năng Tự động Dọn dẹp (Auto-Cleanup):** Mỗi khi cài đặt lại, hệ thống sẽ tự động quét và xóa sạch các kỹ năng phiên bản cũ để tối ưu dung lượng và tránh xung đột cho máy tính của bạn. Mọi thứ hoàn toàn tự động!
|
|
43
|
+
|
|
42
44
|
### Cách 2: Sử dụng Git Submodule
|
|
43
45
|
Nếu bạn không dùng Node.js, bạn có thể nhúng trực tiếp qua Git (Chỉ hỗ trợ dạng Local):
|
|
44
46
|
```bash
|
|
@@ -41,7 +41,9 @@ Hệ thống sẽ tự động tạo file cấu hình tương ứng (ví dụ `.
|
|
|
41
41
|
|
|
42
42
|
**Câu 2: Phạm vi cài đặt?**
|
|
43
43
|
- **(1) Local:** Cài vào thư mục ẩn `.qk-ai-skill-os/` (hoặc `.agents/` cho Gemini) ngay trong dự án. Rất phù hợp nếu dự án có nhiều người làm chung, bạn có thể commit thư mục này lên Git để ai cũng có skill.
|
|
44
|
-
- **(2) Global:** Cài thẳng vào ổ đĩa máy tính (Home Directory). Nếu bạn code một mình, hãy chọn tuỳ chọn này! Nó giúp bạn tiết kiệm dung lượng, và chỉ cần cài 1 lần là BẤT KỲ DỰ ÁN NÀO bạn mở lên, AI cũng tự động có đủ 23 kỹ năng (Đặc biệt siêu mượt với Antigravity/Gemini).
|
|
44
|
+
- **(2) Global:** Cài thẳng vào ổ đĩa máy tính (Home Directory). Nếu bạn code một mình, hãy chọn tuỳ chọn này! Nó giúp bạn tiết kiệm dung lượng, và chỉ cần cài 1 lần là BẤT KỲ DỰ ÁN NÀO bạn mở lên, AI cũng tự động có đủ 23 kỹ năng (Đặc biệt siêu mượt với Antigravity/Gemini).
|
|
45
|
+
|
|
46
|
+
> 💡 **Tính năng Tự động Dọn dẹp (Auto-Cleanup):** Mỗi khi cài đặt lại, hệ thống sẽ tự động quét và xóa sạch các kỹ năng phiên bản cũ để tối ưu dung lượng và tránh xung đột cho máy tính của bạn. Mọi thứ hoàn toàn tự động!
|
|
45
47
|
|
|
46
48
|
### Cho Gemini IDE / Antigravity
|
|
47
49
|
**Không cần cấu hình gì thêm!** Gemini/Antigravity sẽ tự động nhận diện các file trong `.agents/skills/` và sẵn sàng làm việc ngay.
|
package/package.json
CHANGED
|
@@ -37,239 +37,6 @@ Activate this skill when the user provides any of:
|
|
|
37
37
|
- ✅ Generate typed service/client, hooks/queries, and TypeScript types
|
|
38
38
|
- ✅ Follow and extend existing architecture — never duplicate it
|
|
39
39
|
- ✅ Handle special cases: file upload, file download, pagination, auth, WebSocket
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Non-goals
|
|
44
|
-
|
|
45
|
-
- ❌ Do NOT create a new HTTP client if one already exists
|
|
46
|
-
- ❌ Do NOT introduce a new state system if one is already in use
|
|
47
|
-
- ❌ Do NOT write UI logic inside the API layer
|
|
48
|
-
- ❌ Do NOT hardcode URLs, tokens, or secrets
|
|
49
|
-
- ❌ Do NOT use `any` when types can be inferred
|
|
50
|
-
- ❌ Do NOT overwrite existing files without explicit user approval
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Severity Levels
|
|
55
|
-
|
|
56
|
-
| Level | Meaning |
|
|
57
|
-
|-------|---------|
|
|
58
|
-
| P0 | Conflict with existing endpoint or type — must resolve before generating |
|
|
59
|
-
| P1 | Missing critical info (auth, response schema) — ask before proceeding |
|
|
60
|
-
| P2 | Naming or structure inconsistency — warn and apply best guess |
|
|
61
|
-
| P3 | Missing optional fields — document assumption and proceed |
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Workflow
|
|
66
|
-
|
|
67
|
-
### Phase 1 — Input Validation
|
|
68
|
-
|
|
69
|
-
Before parsing, verify:
|
|
70
|
-
- URL is valid and method is correct (GET/POST/PUT/PATCH/DELETE)
|
|
71
|
-
- Auth format is identifiable (Bearer, API Key, OAuth2, Basic, Cookie)
|
|
72
|
-
- Request info is present (path params, query params, body)
|
|
73
|
-
- Response structure is clear (JSON, binary, stream, paginated)
|
|
74
|
-
- Error cases are documented
|
|
75
|
-
|
|
76
|
-
If critical info is missing → **stop and ask**. Do not guess.
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"validation": {
|
|
81
|
-
"status": "VALID | INVALID | INCOMPLETE",
|
|
82
|
-
"confidence": 0.95,
|
|
83
|
-
"errors": [],
|
|
84
|
-
"warnings": [],
|
|
85
|
-
"input_type": "curl | openapi | postman | docs | code"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
### Phase 2 — API Contract Extraction
|
|
93
|
-
|
|
94
|
-
Extract the full contract:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
metadata:
|
|
98
|
-
name, domain, endpoint, method, version, description
|
|
99
|
-
|
|
100
|
-
request:
|
|
101
|
-
pathParams: { name, type, required }
|
|
102
|
-
queryParams: { name, type, required, default }
|
|
103
|
-
headers: { name, value, required }
|
|
104
|
-
body: { contentType, schema { field, type, required, nullable } }
|
|
105
|
-
auth: { type, location, name }
|
|
106
|
-
|
|
107
|
-
response:
|
|
108
|
-
success: { statusCode, contentType, schema, pagination? }
|
|
109
|
-
errors: [ { statusCode, message, businessCode? } ]
|
|
110
|
-
|
|
111
|
-
special:
|
|
112
|
-
rateLimit, timeout, retryable, streaming
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Map each field: `type`, `required`, `nullable`, `enum`, `example`.
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
### Phase 3 — Project Profile Detection
|
|
120
|
-
|
|
121
|
-
1. Check for `.api-config.json` at project root → use if present
|
|
122
|
-
2. Otherwise infer from:
|
|
123
|
-
- Framework: `package.json`, config files, imports
|
|
124
|
-
- HTTP client: existing axios instance, fetch wrapper, custom client
|
|
125
|
-
- State management: React Query, Redux, Zustand, Pinia, Apollo, Vuex
|
|
126
|
-
- Type system: `tsconfig.json`, JSDoc, plain JS
|
|
127
|
-
- Folder conventions: `services/`, `hooks/`, `api/`, `types/`, `adapters/`
|
|
128
|
-
- Naming: camelCase, PascalCase, snake_case, file patterns
|
|
129
|
-
3. Read 1-2 existing API files to capture exact patterns for imports, typing, error handling, naming
|
|
130
|
-
|
|
131
|
-
If project context is ambiguous → use conservative defaults and document all assumptions.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
### Phase 4 — Conflict Detection
|
|
136
|
-
|
|
137
|
-
Before generating code, check for:
|
|
138
|
-
|
|
139
|
-
| Conflict | Action |
|
|
140
|
-
|----------|--------|
|
|
141
|
-
| `ENDPOINT_DUPLICATE` — endpoint already exists | Reuse if same, warn if different |
|
|
142
|
-
| `FUNCTION_DUPLICATE` — function name conflicts | Warn, propose new name |
|
|
143
|
-
| `TYPE_DUPLICATE` — type already defined | Extend or reuse existing |
|
|
144
|
-
| `LOGIC_OVERLAP` — logic exists in another service | Consolidate, don't duplicate |
|
|
145
|
-
| `IMPORT_CONFLICT` — import path conflicts | Resolve before generating |
|
|
146
|
-
|
|
147
|
-
**P0 conflict → stop, report, wait for user decision before proceeding.**
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
### Phase 5 — Code Generation
|
|
152
|
-
|
|
153
|
-
Generate the minimum necessary set for the task:
|
|
154
|
-
|
|
155
|
-
#### TypeScript Types
|
|
156
|
-
```typescript
|
|
157
|
-
// Request types
|
|
158
|
-
export interface CreateUserRequest {
|
|
159
|
-
name: string;
|
|
160
|
-
email: string;
|
|
161
|
-
role?: UserRole;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Response types
|
|
165
|
-
export interface CreateUserResponse {
|
|
166
|
-
id: string;
|
|
167
|
-
name: string;
|
|
168
|
-
email: string;
|
|
169
|
-
createdAt: string;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Error types
|
|
173
|
-
export interface ApiError {
|
|
174
|
-
code: string;
|
|
175
|
-
message: string;
|
|
176
|
-
details?: Record<string, unknown>;
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
#### Service / API Layer
|
|
181
|
-
```typescript
|
|
182
|
-
// Thin layer: HTTP + mapping only. No UI, no business logic.
|
|
183
|
-
export const createUser = async (
|
|
184
|
-
data: CreateUserRequest
|
|
185
|
-
): Promise<CreateUserResponse> => {
|
|
186
|
-
const response = await apiClient.post<CreateUserResponse>('/users', data);
|
|
187
|
-
return response.data;
|
|
188
|
-
};
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
#### Hook / Query (if project uses React Query)
|
|
192
|
-
```typescript
|
|
193
|
-
export const useCreateUser = () => {
|
|
194
|
-
return useMutation<CreateUserResponse, ApiError, CreateUserRequest>({
|
|
195
|
-
mutationFn: createUser,
|
|
196
|
-
onSuccess: () => {
|
|
197
|
-
queryClient.invalidateQueries({ queryKey: ['users'] });
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
**If project uses Redux** → follow existing slice/thunk pattern.
|
|
204
|
-
**If project uses Zustand** → follow existing store pattern.
|
|
205
|
-
**If project uses Pinia/Vuex** → follow existing composable/action pattern.
|
|
206
|
-
|
|
207
|
-
Do NOT mix patterns.
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
### Phase 6 — Special Case Handling
|
|
212
|
-
|
|
213
|
-
#### File Upload (`multipart/form-data`)
|
|
214
|
-
```typescript
|
|
215
|
-
// Always use FormData — never send File object in JSON
|
|
216
|
-
const formData = new FormData();
|
|
217
|
-
formData.append('file', file);
|
|
218
|
-
formData.append('name', name);
|
|
219
|
-
await apiClient.post('/upload', formData, {
|
|
220
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
221
|
-
});
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
#### File Download (binary response)
|
|
225
|
-
```typescript
|
|
226
|
-
const response = await apiClient.get('/export', { responseType: 'blob' });
|
|
227
|
-
const url = URL.createObjectURL(response.data);
|
|
228
|
-
const a = document.createElement('a');
|
|
229
|
-
a.href = url;
|
|
230
|
-
a.download = filename;
|
|
231
|
-
a.click();
|
|
232
|
-
URL.revokeObjectURL(url);
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
#### Pagination
|
|
236
|
-
```typescript
|
|
237
|
-
interface PaginatedResponse<T> {
|
|
238
|
-
items: T[];
|
|
239
|
-
total: number;
|
|
240
|
-
page: number;
|
|
241
|
-
limit: number;
|
|
242
|
-
}
|
|
243
|
-
// Implement consistently with existing project pagination pattern
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
#### Authentication
|
|
247
|
-
- Follow existing auth mechanism (interceptor, header injection, cookie)
|
|
248
|
-
- Never hardcode tokens or credentials
|
|
249
|
-
- Refresh token logic belongs in the existing interceptor
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### Phase 7 — Quality Validation
|
|
254
|
-
|
|
255
|
-
Before marking as ready:
|
|
256
|
-
|
|
257
|
-
- [ ] TypeScript strict — compiles clean, no `any` without justification
|
|
258
|
-
- [ ] All functions/params have explicit types and return types
|
|
259
|
-
- [ ] No unused imports, no debug code
|
|
260
|
-
- [ ] Error handling complete (try/catch, `.catch`, fallback)
|
|
261
|
-
- [ ] No hardcoded URLs, tokens, or secrets — use env vars
|
|
262
|
-
- [ ] Naming matches project conventions
|
|
263
|
-
- [ ] Reuses existing HTTP client, interceptors, and query client
|
|
264
|
-
- [ ] JSDoc added for public API if project convention requires it
|
|
265
|
-
- [ ] React: dependency arrays correct, cleanup present, no race conditions
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
## Decision Tree
|
|
270
|
-
|
|
271
|
-
```
|
|
272
|
-
Is required info complete?
|
|
273
40
|
├── No → Ask for missing info (auth, response schema, base URL)
|
|
274
41
|
└── Yes → Check for conflicts
|
|
275
42
|
├── P0 conflict → Stop, report, wait for user decision
|