ai-developer-skill-os 1.8.1 → 2.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/README.md +130 -171
- package/docs/CHI_TIET_SKILLS.md +89 -81
- package/docs/HUONG_DAN_SU_DUNG.md +120 -152
- package/package.json +1 -1
- package/skills/{qk-accessibility-audit → _archive_old_skills/qk-accessibility-audit}/SKILL.md +1 -1
- package/skills/{qk-agent-orchestrator → _archive_old_skills/qk-agent-orchestrator}/SKILL.md +1 -1
- package/skills/{qk-bug-fix → _archive_old_skills/qk-bug-fix}/SKILL.md +1 -1
- package/skills/{qk-component-generator → _archive_old_skills/qk-component-generator}/SKILL.md +1 -1
- package/skills/{qk-database-engineer → _archive_old_skills/qk-database-engineer}/SKILL.md +1 -1
- package/skills/{qk-design-system → _archive_old_skills/qk-design-system}/SKILL.md +1 -1
- package/skills/{qk-form-builder → _archive_old_skills/qk-form-builder}/SKILL.md +1 -1
- package/skills/{qk-frontend-architecture → _archive_old_skills/qk-frontend-architecture}/SKILL.md +1 -1
- package/skills/{qk-frontend-debug → _archive_old_skills/qk-frontend-debug}/SKILL.md +1 -1
- package/skills/{qk-frontend-performance → _archive_old_skills/qk-frontend-performance}/SKILL.md +1 -1
- package/skills/{qk-git-engineer → _archive_old_skills/qk-git-engineer}/SKILL.md +1 -1
- package/skills/_archive_old_skills/qk-help/SKILL.md +67 -0
- package/skills/{qk-state-management → _archive_old_skills/qk-state-management}/SKILL.md +1 -1
- package/skills/{qk-table-crud-generator → _archive_old_skills/qk-table-crud-generator}/SKILL.md +1 -1
- package/skills/qk-access-policy/SKILL.md +127 -0
- package/skills/qk-ai-builder/SKILL.md +33 -0
- package/skills/qk-api-lifecycle/SKILL.md +420 -0
- package/skills/qk-bug-resolution/SKILL.md +371 -0
- package/skills/qk-context-loader/SKILL.md +206 -0
- package/skills/qk-data-lifecycle/SKILL.md +135 -0
- package/skills/qk-design-to-code/SKILL.md +33 -0
- package/skills/qk-docs/SKILL.md +335 -0
- package/skills/qk-documentation-system/SKILL.md +33 -0
- package/skills/qk-engineering-standard/SKILL.md +171 -0
- package/skills/qk-engineering-standard/rules/backend.md +122 -0
- package/skills/qk-engineering-standard/rules/database.md +3 -0
- package/skills/qk-engineering-standard/rules/frontend.md +152 -0
- package/skills/qk-engineering-standard/rules/security.md +3 -0
- package/skills/qk-engineering-standard/rules/testing.md +3 -0
- package/skills/qk-feature-delivery/SKILL.md +432 -0
- package/skills/qk-help/SKILL.md +95 -67
- package/skills/qk-orchestrator/SKILL.md +272 -0
- package/skills/qk-policy-engine/SKILL.md +33 -0
- package/skills/qk-production-release/SKILL.md +127 -0
- package/skills/qk-project-bootstrap/SKILL.md +33 -0
- package/skills/qk-project-health/SKILL.md +650 -0
- package/skills/qk-project-memory/SKILL.md +33 -0
- package/skills/qk-system-evolution/SKILL.md +315 -0
- package/skills/qk-ui-audit/SKILL.md +152 -0
- package/skills/qk-ui-system-builder/SKILL.md +444 -0
- package/skills/qk-validation-gate/SKILL.md +33 -0
- /package/skills/{qk-api-integration → _archive_old_skills/qk-api-integration}/SKILL.md +0 -0
- /package/skills/{qk-auth-security → _archive_old_skills/qk-auth-security}/SKILL.md +0 -0
- /package/skills/{qk-backend-architecture → _archive_old_skills/qk-backend-architecture}/SKILL.md +0 -0
- /package/skills/{qk-context-manager → _archive_old_skills/qk-context-manager}/SKILL.md +0 -0
- /package/skills/{qk-deployment → _archive_old_skills/qk-deployment}/SKILL.md +0 -0
- /package/skills/{qk-frontend-testing → _archive_old_skills/qk-frontend-testing}/SKILL.md +0 -0
- /package/skills/{qk-migration → _archive_old_skills/qk-migration}/SKILL.md +0 -0
- /package/skills/{qk-project-audit → _archive_old_skills/qk-project-audit}/SKILL.md +0 -0
- /package/skills/{qk-refactor → _archive_old_skills/qk-refactor}/SKILL.md +0 -0
- /package/skills/{qk-ui-builder → _archive_old_skills/qk-ui-builder}/SKILL.md +0 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-api-lifecycle
|
|
3
|
+
purpose: Thiết kế Spec, Code Service, Types, Test, Docs cho API.
|
|
4
|
+
mode_supported: [standard]
|
|
5
|
+
input: [API requirement]
|
|
6
|
+
output: [API Service, Routes, Docs]
|
|
7
|
+
workflow: [1. Spec -> 2. Type -> 3. Service -> 4. Test -> 5. Docs]
|
|
8
|
+
allowed_tools: [write_to_file, run_command]
|
|
9
|
+
handoff_to: [qk-validation-gate]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 🛠️ qk-api-lifecycle - Quy Trình Vận Hành Chuẩn (SOP)
|
|
13
|
+
|
|
14
|
+
> **Mô tả:** Thiết kế Spec, Code Service, Types, Test, Docs cho API.
|
|
15
|
+
|
|
16
|
+
## 🎯 1. Mục Tiêu (Goal)
|
|
17
|
+
- Hoàn thành thành công tác vụ được giao liên quan đến nhiệm vụ của skill.
|
|
18
|
+
- Đảm bảo chất lượng mã nguồn và tính nhất quán của hệ thống.
|
|
19
|
+
|
|
20
|
+
## 🔄 2. Chuỗi Hành Động (Chain of Thought / SOP)
|
|
21
|
+
*(Bắt buộc AI phải suy nghĩ và làm theo đúng thứ tự)*
|
|
22
|
+
1. **Phân tích (Analyze):** Thu thập ngữ cảnh và hiểu rõ yêu cầu đầu vào.
|
|
23
|
+
2. **Lên kế hoạch (Plan):** Xác định các bước cần thay đổi/tạo mới dựa trên bộ luật (rules).
|
|
24
|
+
3. **Thực thi (Execute):** Tiến hành sửa đổi mã nguồn hoặc tạo tài liệu.
|
|
25
|
+
4. **Xác thực (Verify):** Đảm bảo đầu ra đáp ứng đúng yêu cầu và không vi phạm quy định.
|
|
26
|
+
|
|
27
|
+
## 🛡️ 3. Ràng Buộc & Quy Tắc (Constraints)
|
|
28
|
+
- CẤM bỏ qua việc kiểm tra `qk-engineering-standard` trước khi viết code.
|
|
29
|
+
- Mọi quyết định kỹ thuật phải dựa trên nội dung tại phần Deep Knowledge (nếu có).
|
|
30
|
+
|
|
31
|
+
## 🤝 4. Giao Thức Bàn Giao (Handoff Protocol)
|
|
32
|
+
- Đích đến: `qk-validation-gate`
|
|
33
|
+
- Nội dung bàn giao: Chuyển toàn bộ ngữ cảnh và kết quả đã thực thi cho bước tiếp theo.
|
|
34
|
+
|
|
35
|
+
## 📚 5. Kiến Thức Chuyên Sâu (Deep Knowledge)
|
|
36
|
+
|
|
37
|
+
*(Nền tảng kiến thức và quy tắc chi tiết kế thừa từ kỹ sư)*
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# API Integration Engineer
|
|
44
|
+
|
|
45
|
+
> **Language rule:**
|
|
46
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
47
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
48
|
+
> The user may write in any language — detect and match it automatically.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Trigger
|
|
53
|
+
|
|
54
|
+
Activate this skill when the user provides any of:
|
|
55
|
+
- `curl` command
|
|
56
|
+
- Swagger 2.0 / OpenAPI 3.0 (YAML or JSON)
|
|
57
|
+
- Postman collection or HAR file
|
|
58
|
+
- API documentation (endpoint, method, request/response)
|
|
59
|
+
- Code snippet to reverse-engineer (fetch/axios/custom client)
|
|
60
|
+
- Backend controller or route handler to mirror on the frontend
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Scope
|
|
65
|
+
|
|
66
|
+
- ✅ Parse and understand any API input format
|
|
67
|
+
- ✅ Extract the full API contract (request + response + errors)
|
|
68
|
+
- ✅ Detect existing project patterns (HTTP client, state layer, conventions)
|
|
69
|
+
- ✅ Generate typed service/client, hooks/queries, and TypeScript types
|
|
70
|
+
- ✅ Follow and extend existing architecture — never duplicate it
|
|
71
|
+
- ✅ Handle special cases: file upload, file download, pagination, auth, WebSocket
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Non-goals
|
|
76
|
+
|
|
77
|
+
- ❌ Do NOT create a new HTTP client if one already exists
|
|
78
|
+
- ❌ Do NOT introduce a new state system if one is already in use
|
|
79
|
+
- ❌ Do NOT hardcode URLs, tokens, or secrets
|
|
80
|
+
- ❌ Do NOT use `any` when types can be inferred
|
|
81
|
+
- ❌ Do NOT overwrite existing files without explicit user approval
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Severity Levels
|
|
86
|
+
|
|
87
|
+
| Level | Meaning |
|
|
88
|
+
|-------|---------|
|
|
89
|
+
| P0 | Conflict with existing endpoint or type — must resolve before generating |
|
|
90
|
+
| P1 | Missing critical info (auth, response schema) — ask before proceeding |
|
|
91
|
+
| P2 | Naming or structure inconsistency — warn and apply best guess |
|
|
92
|
+
| P3 | Missing optional fields — document assumption and proceed |
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Workflow
|
|
97
|
+
|
|
98
|
+
### Phase 1 — Input Validation
|
|
99
|
+
|
|
100
|
+
Before parsing, verify:
|
|
101
|
+
- URL is valid and method is correct (GET/POST/PUT/PATCH/DELETE)
|
|
102
|
+
- Auth format is identifiable (Bearer, API Key, OAuth2, Basic, Cookie)
|
|
103
|
+
- Request info is present (path params, query params, body)
|
|
104
|
+
- Response structure is clear (JSON, binary, stream, paginated)
|
|
105
|
+
- Error cases are documented
|
|
106
|
+
|
|
107
|
+
If critical info is missing → **stop and ask**. Do not guess.
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"validation": {
|
|
112
|
+
"status": "VALID | INVALID | INCOMPLETE",
|
|
113
|
+
"confidence": 0.95,
|
|
114
|
+
"errors": [],
|
|
115
|
+
"warnings": [],
|
|
116
|
+
"input_type": "curl | openapi | postman | docs | code"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### Phase 2 — API Contract Extraction
|
|
124
|
+
|
|
125
|
+
Extract the full contract:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
metadata:
|
|
129
|
+
name, domain, endpoint, method, version, description
|
|
130
|
+
|
|
131
|
+
request:
|
|
132
|
+
pathParams: { name, type, required }
|
|
133
|
+
queryParams: { name, type, required, default }
|
|
134
|
+
headers: { name, value, required }
|
|
135
|
+
body: { contentType, schema { field, type, required, nullable } }
|
|
136
|
+
auth: { type, location, name }
|
|
137
|
+
|
|
138
|
+
response:
|
|
139
|
+
success: { statusCode, contentType, schema, pagination? }
|
|
140
|
+
errors: [ { statusCode, message, businessCode? } ]
|
|
141
|
+
|
|
142
|
+
special:
|
|
143
|
+
rateLimit, timeout, retryable, streaming
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Map each field: `type`, `required`, `nullable`, `enum`, `example`.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Phase 3 — Project Profile Detection
|
|
151
|
+
|
|
152
|
+
1. Check for `.api-config.json` at project root → use if present
|
|
153
|
+
2. Otherwise infer from:
|
|
154
|
+
- Framework: `package.json`, config files, imports
|
|
155
|
+
- HTTP client: existing axios instance, fetch wrapper, custom client
|
|
156
|
+
- State management: React Query, Redux, Zustand, Pinia, Apollo, Vuex
|
|
157
|
+
- Type system: `tsconfig.json`, JSDoc, plain JS
|
|
158
|
+
- Folder conventions: `services/`, `hooks/`, `api/`, `types/`, `adapters/`
|
|
159
|
+
- Naming: camelCase, PascalCase, snake_case, file patterns
|
|
160
|
+
3. Read 1-2 existing API files to capture exact patterns for imports, typing, error handling, naming
|
|
161
|
+
|
|
162
|
+
If project context is ambiguous → use conservative defaults and document all assumptions.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### Phase 4 — Conflict Detection
|
|
167
|
+
|
|
168
|
+
Before generating code, check for:
|
|
169
|
+
|
|
170
|
+
| Conflict | Action |
|
|
171
|
+
|----------|--------|
|
|
172
|
+
| `ENDPOINT_DUPLICATE` — endpoint already exists | Reuse if same, warn if different |
|
|
173
|
+
| `FUNCTION_DUPLICATE` — function name conflicts | Warn, propose new name |
|
|
174
|
+
| `TYPE_DUPLICATE` — type already defined | Extend or reuse existing |
|
|
175
|
+
| `LOGIC_OVERLAP` — logic exists in another service | Consolidate, don't duplicate |
|
|
176
|
+
| `IMPORT_CONFLICT` — import path conflicts | Resolve before generating |
|
|
177
|
+
|
|
178
|
+
**P0 conflict → stop, report, wait for user decision before proceeding.**
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Phase 5 — Code Generation
|
|
183
|
+
|
|
184
|
+
Generate the minimum necessary set for the task:
|
|
185
|
+
|
|
186
|
+
#### TypeScript Types
|
|
187
|
+
```typescript
|
|
188
|
+
// Request types
|
|
189
|
+
export interface CreateUserRequest {
|
|
190
|
+
name: string;
|
|
191
|
+
email: string;
|
|
192
|
+
role?: UserRole;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Response types
|
|
196
|
+
export interface CreateUserResponse {
|
|
197
|
+
id: string;
|
|
198
|
+
name: string;
|
|
199
|
+
email: string;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Error types
|
|
204
|
+
export interface ApiError {
|
|
205
|
+
code: string;
|
|
206
|
+
message: string;
|
|
207
|
+
details?: Record<string, unknown>;
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
#### Service / API Layer
|
|
212
|
+
```typescript
|
|
213
|
+
// Thin layer: HTTP + mapping only. No UI, no business logic.
|
|
214
|
+
export const createUser = async (
|
|
215
|
+
data: CreateUserRequest
|
|
216
|
+
): Promise<CreateUserResponse> => {
|
|
217
|
+
const response = await apiClient.post<CreateUserResponse>('/users', data);
|
|
218
|
+
return response.data;
|
|
219
|
+
};
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Hook / Query (if project uses React Query)
|
|
223
|
+
```typescript
|
|
224
|
+
export const useCreateUser = () => {
|
|
225
|
+
return useMutation<CreateUserResponse, ApiError, CreateUserRequest>({
|
|
226
|
+
mutationFn: createUser,
|
|
227
|
+
onSuccess: () => {
|
|
228
|
+
queryClient.invalidateQueries({ queryKey: ['users'] });
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**If project uses Redux** → follow existing slice/thunk pattern.
|
|
235
|
+
**If project uses Zustand** → follow existing store pattern.
|
|
236
|
+
**If project uses Pinia/Vuex** → follow existing composable/action pattern.
|
|
237
|
+
|
|
238
|
+
Do NOT mix patterns.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### Phase 6 — Special Case Handling
|
|
243
|
+
|
|
244
|
+
#### File Upload (`multipart/form-data`)
|
|
245
|
+
```typescript
|
|
246
|
+
// Always use FormData — never send File object in JSON
|
|
247
|
+
const formData = new FormData();
|
|
248
|
+
formData.append('file', file);
|
|
249
|
+
formData.append('name', name);
|
|
250
|
+
await apiClient.post('/upload', formData, {
|
|
251
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### File Download (binary response)
|
|
256
|
+
```typescript
|
|
257
|
+
const response = await apiClient.get('/export', { responseType: 'blob' });
|
|
258
|
+
const url = URL.createObjectURL(response.data);
|
|
259
|
+
const a = document.createElement('a');
|
|
260
|
+
a.href = url;
|
|
261
|
+
a.download = filename;
|
|
262
|
+
a.click();
|
|
263
|
+
URL.revokeObjectURL(url);
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
#### Pagination
|
|
267
|
+
```typescript
|
|
268
|
+
interface PaginatedResponse<T> {
|
|
269
|
+
items: T[];
|
|
270
|
+
total: number;
|
|
271
|
+
page: number;
|
|
272
|
+
limit: number;
|
|
273
|
+
}
|
|
274
|
+
// Implement consistently with existing project pagination pattern
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Authentication
|
|
278
|
+
- Follow existing auth mechanism (interceptor, header injection, cookie)
|
|
279
|
+
- Never hardcode tokens or credentials
|
|
280
|
+
- Refresh token logic belongs in the existing interceptor
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### Phase 7 — Quality Validation
|
|
285
|
+
|
|
286
|
+
Before marking as ready:
|
|
287
|
+
|
|
288
|
+
- [ ] TypeScript strict — compiles clean, no `any` without justification
|
|
289
|
+
- [ ] All functions/params have explicit types and return types
|
|
290
|
+
- [ ] No unused imports, no debug code
|
|
291
|
+
- [ ] Error handling complete (try/catch, `.catch`, fallback)
|
|
292
|
+
- [ ] No hardcoded URLs, tokens, or secrets — use env vars
|
|
293
|
+
- [ ] Naming matches project conventions
|
|
294
|
+
- [ ] Reuses existing HTTP client, interceptors, and query client
|
|
295
|
+
- [ ] JSDoc added for public API if project convention requires it
|
|
296
|
+
- [ ] React: dependency arrays correct, cleanup present, no race conditions
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
### Phase 8 — End-to-End UI Integration (Optional / On-Demand)
|
|
301
|
+
|
|
302
|
+
If the user explicitly requests to integrate the API directly into the UI (End-to-End):
|
|
303
|
+
1. **Find Target Component:** Identify the UI component where the API should be called.
|
|
304
|
+
2. **Wire State:** Inject the generated Hook/Query/Service into the component.
|
|
305
|
+
3. **Handle States:** Implement Loading (spinners, skeletons), Error (toast, alert), and Success (redirect, form reset, table refetch) states in the UI.
|
|
306
|
+
4. **Data Binding:** Bind the API response data to the UI elements (Table rows, Dropdowns, etc.) and bind UI inputs to the API request payload.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Decision Tree
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
Is required info complete?
|
|
314
|
+
├── No → Ask for missing info (auth, response schema, base URL)
|
|
315
|
+
└── Yes → Check for conflicts
|
|
316
|
+
├── P0 conflict → Stop, report, wait for user decision
|
|
317
|
+
└── No P0 → Generate code following project patterns
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
Does project have existing HTTP client?
|
|
322
|
+
├── Yes → Extend it
|
|
323
|
+
└── No → Create minimal axios/fetch wrapper following project style
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
Does project use state management?
|
|
328
|
+
├── React Query → useMutation / useQuery pattern
|
|
329
|
+
├── Redux → slice + thunk / RTK Query
|
|
330
|
+
├── Zustand → store action
|
|
331
|
+
├── Pinia → action in store
|
|
332
|
+
└── None → Service function only
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Output Format
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
📋 API Contract
|
|
341
|
+
─────────────────────────────────────────────────
|
|
342
|
+
Name: [API name]
|
|
343
|
+
Endpoint: [METHOD /path]
|
|
344
|
+
Auth: [type]
|
|
345
|
+
Input: [brief description]
|
|
346
|
+
Output: [brief description]
|
|
347
|
+
|
|
348
|
+
🔍 Project Pattern Detected
|
|
349
|
+
─────────────────────────────────────────────────
|
|
350
|
+
HTTP client: [axios instance at src/lib/axios.ts]
|
|
351
|
+
State: [React Query]
|
|
352
|
+
Types path: [src/types/]
|
|
353
|
+
Service path: [src/services/]
|
|
354
|
+
Hook path: [src/hooks/]
|
|
355
|
+
|
|
356
|
+
⚠️ Assumptions
|
|
357
|
+
─────────────────────────────────────────────────
|
|
358
|
+
• [Assumption 1]
|
|
359
|
+
• [Assumption 2]
|
|
360
|
+
|
|
361
|
+
📁 Files Generated
|
|
362
|
+
─────────────────────────────────────────────────
|
|
363
|
+
[NEW] src/types/user.types.ts
|
|
364
|
+
[NEW] src/services/user.service.ts
|
|
365
|
+
[NEW] src/hooks/useCreateUser.ts
|
|
366
|
+
[EXTEND] src/services/index.ts
|
|
367
|
+
|
|
368
|
+
🔗 Next steps:
|
|
369
|
+
→ Import hook in your component
|
|
370
|
+
→ Add env var: VITE_API_BASE_URL
|
|
371
|
+
→ Test with: [example usage snippet]
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Validation Checklist
|
|
377
|
+
|
|
378
|
+
- [ ] All 7 phases completed
|
|
379
|
+
- [ ] Input validated — no missing critical fields
|
|
380
|
+
- [ ] Conflicts checked — none unresolved
|
|
381
|
+
- [ ] Types generated and strict
|
|
382
|
+
- [ ] Existing HTTP client reused
|
|
383
|
+
- [ ] Existing state pattern followed
|
|
384
|
+
- [ ] Special cases handled if applicable (upload, download, pagination, auth)
|
|
385
|
+
- [ ] No hardcoded secrets
|
|
386
|
+
- [ ] Output format produced with files listed
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Project Config Reference (`.api-config.json`)
|
|
391
|
+
|
|
392
|
+
```json
|
|
393
|
+
{
|
|
394
|
+
"framework": "React",
|
|
395
|
+
"httpClient": "axios",
|
|
396
|
+
"stateManagement": "react-query",
|
|
397
|
+
"typing": "typescript",
|
|
398
|
+
"conventions": {
|
|
399
|
+
"servicePath": "src/services/",
|
|
400
|
+
"typePath": "src/types/",
|
|
401
|
+
"hookPath": "src/hooks/",
|
|
402
|
+
"naming": "camelCase",
|
|
403
|
+
"fileNaming": "{name}.service.ts",
|
|
404
|
+
"typeFileNaming": "{Name}.types.ts",
|
|
405
|
+
"hookFileNaming": "use{Name}.ts"
|
|
406
|
+
},
|
|
407
|
+
"httpConfig": {
|
|
408
|
+
"baseURL": "process.env.VITE_API_URL",
|
|
409
|
+
"interceptor": "src/lib/axios.ts",
|
|
410
|
+
"authHeader": "Authorization",
|
|
411
|
+
"timeout": 30000
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Examples
|
|
419
|
+
|
|
420
|
+
See `examples/` folder.
|