ai-developer-skill-os 1.5.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-developer-skill-os",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "Multi-agent skill package cho AI coding agents (Claude, Cursor, Windsurf, Antigravity) với 23 skills chuyên nghiệp.",
5
5
  "main": "bin/install.js",
6
6
  "bin": {
@@ -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