ai-flow-dev 2.1.3 → 2.1.4
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 +25 -38
- package/dist/cli.js +68 -46
- package/dist/cli.js.map +1 -1
- package/package.json +5 -5
- package/prompts/backend/flow-build-phase-0.md +31 -63
- package/prompts/backend/flow-build-phase-1.md +9 -17
- package/prompts/backend/flow-build-phase-10.md +199 -585
- package/prompts/backend/flow-build-phase-2.md +152 -86
- package/prompts/backend/flow-build-phase-3.md +108 -68
- package/prompts/backend/flow-build-phase-4.md +5 -8
- package/prompts/backend/flow-build-phase-5.md +39 -12
- package/prompts/backend/flow-build-phase-6.md +29 -8
- package/prompts/backend/flow-build-phase-7.md +120 -40
- package/prompts/backend/flow-build-phase-8.md +28 -65
- package/prompts/backend/flow-build-phase-9.md +267 -1298
- package/prompts/backend/flow-build.md +881 -957
- package/prompts/backend/flow-dev-commit.md +27 -50
- package/prompts/backend/flow-dev-feature.md +1929 -2017
- package/prompts/backend/flow-dev-fix.md +936 -964
- package/prompts/backend/flow-dev-refactor.md +672 -701
- package/prompts/backend/flow-dev-review.md +356 -389
- package/prompts/backend/flow-dev-work.md +1066 -1118
- package/prompts/backend/flow-docs-sync.md +20 -196
- package/prompts/frontend/flow-build-phase-0.md +503 -484
- package/prompts/frontend/flow-build-phase-1.md +445 -433
- package/prompts/frontend/flow-build-phase-2.md +910 -957
- package/prompts/frontend/flow-build-phase-3.md +692 -664
- package/prompts/frontend/flow-build-phase-4.md +478 -463
- package/prompts/frontend/flow-build-phase-5.md +488 -467
- package/prompts/frontend/flow-build-phase-6.md +571 -550
- package/prompts/frontend/flow-build-phase-7.md +560 -592
- package/prompts/frontend/flow-build-phase-8.md +17 -42
- package/prompts/frontend/flow-build.md +457 -503
- package/prompts/frontend/flow-docs-sync.md +14 -35
- package/prompts/mobile/flow-build-phase-0.md +104 -97
- package/prompts/mobile/flow-build-phase-1.md +137 -122
- package/prompts/mobile/flow-build-phase-2.md +123 -130
- package/prompts/mobile/flow-build-phase-3.md +144 -149
- package/prompts/mobile/flow-build-phase-4.md +140 -132
- package/prompts/mobile/flow-build-phase-5.md +70 -70
- package/prompts/mobile/flow-build-phase-6.md +136 -134
- package/prompts/mobile/flow-build-phase-7.md +24 -58
- package/prompts/mobile/flow-build-phase-8.md +17 -42
- package/prompts/mobile/flow-build.md +47 -97
- package/prompts/mobile/flow-docs-sync.md +13 -32
- package/prompts/shared/mermaid-guidelines.md +106 -0
- package/prompts/shared/scope-levels.md +126 -0
- package/prompts/shared/story-points.md +65 -0
- package/prompts/shared/task-format.md +86 -0
- package/templates/AGENT.template.md +194 -15
- package/templates/backend/README.template.md +2 -32
- package/templates/backend/ai-instructions.template.md +2 -32
- package/templates/backend/copilot-instructions.template.md +2 -22
- package/templates/backend/docs/api.template.md +89 -20
- package/templates/backend/docs/architecture.template.md +165 -53
- package/templates/backend/docs/business-flows.template.md +7 -14
- package/templates/backend/docs/code-standards.template.md +2 -38
- package/templates/backend/docs/contributing.template.md +2 -16
- package/templates/backend/docs/data-model.template.md +125 -21
- package/templates/backend/docs/operations.template.md +179 -50
- package/templates/backend/docs/testing.template.md +2 -42
- package/templates/backend/project-brief.template.md +2 -28
- package/templates/backend/specs/configuration.template.md +2 -14
- package/templates/backend/specs/security.template.md +2 -32
- package/templates/frontend/README.template.md +2 -18
- package/templates/frontend/ai-instructions.template.md +2 -20
- package/templates/frontend/docs/api-integration.template.md +12 -30
- package/templates/frontend/docs/components.template.md +2 -28
- package/templates/frontend/docs/error-handling.template.md +11 -27
- package/templates/frontend/docs/operations.template.md +8 -18
- package/templates/frontend/docs/performance.template.md +8 -18
- package/templates/frontend/docs/pwa.template.md +8 -18
- package/templates/frontend/docs/state-management.template.md +2 -28
- package/templates/frontend/docs/styling.template.md +2 -26
- package/templates/frontend/docs/testing.template.md +2 -28
- package/templates/frontend/project-brief.template.md +2 -16
- package/templates/frontend/specs/accessibility.template.md +8 -18
- package/templates/frontend/specs/configuration.template.md +2 -24
- package/templates/frontend/specs/security.template.md +10 -24
- package/templates/fullstack/README.template.md +17 -47
- package/templates/fullstack/ai-instructions.template.md +17 -45
- package/templates/fullstack/project-brief.template.md +16 -42
- package/templates/fullstack/specs/configuration.template.md +16 -42
- package/templates/mobile/README.template.md +11 -29
- package/templates/mobile/ai-instructions.template.md +11 -27
- package/templates/mobile/docs/app-store.template.md +11 -29
- package/templates/mobile/docs/architecture.template.md +14 -38
- package/templates/mobile/docs/native-features.template.md +16 -44
- package/templates/mobile/docs/navigation.template.md +9 -23
- package/templates/mobile/docs/offline-strategy.template.md +10 -26
- package/templates/mobile/docs/permissions.template.md +9 -23
- package/templates/mobile/docs/state-management.template.md +12 -32
- package/templates/mobile/docs/testing.template.md +14 -38
- package/templates/mobile/project-brief.template.md +12 -30
- package/templates/mobile/specs/build-configuration.template.md +10 -26
- package/templates/mobile/specs/deployment.template.md +9 -23
|
@@ -142,13 +142,9 @@ C) Activity → (User | Organization | Deal) - activities linked to various obje
|
|
|
142
142
|
D) Other: __
|
|
143
143
|
|
|
144
144
|
→ Your selection (e.g., A, C): __
|
|
145
|
-
|
|
146
145
|
---
|
|
147
|
-
|
|
148
146
|
Your specific relationships (list main ones):
|
|
149
|
-
|
|
150
147
|
---
|
|
151
|
-
|
|
152
148
|
Your specific relationships (list main ones):
|
|
153
149
|
-
|
|
154
150
|
-
|
|
@@ -226,6 +222,155 @@ H) 🗂️ Partitioning - Split large tables by date/region/etc.
|
|
|
226
222
|
For each selected, provide brief detail:
|
|
227
223
|
```
|
|
228
224
|
|
|
225
|
+
**2.7.1 Soft Delete Configuration** (if A selected above)
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
How will you handle data deletion?
|
|
229
|
+
|
|
230
|
+
Field for soft delete:
|
|
231
|
+
A) ⭐ deleted_at (timestamp, null = active) - Recommended
|
|
232
|
+
B) is_deleted (boolean)
|
|
233
|
+
C) status field (e.g., status = 'deleted')
|
|
234
|
+
D) Custom: __
|
|
235
|
+
|
|
236
|
+
Entities with SOFT delete (keep record, mark as deleted):
|
|
237
|
+
- Users ✅
|
|
238
|
+
- Orders ✅
|
|
239
|
+
- Products ✅
|
|
240
|
+
- [List yours...]
|
|
241
|
+
|
|
242
|
+
Entities with HARD delete (permanent removal):
|
|
243
|
+
- Session tokens
|
|
244
|
+
- Temporary files
|
|
245
|
+
- Cart items after checkout
|
|
246
|
+
- [List yours...]
|
|
247
|
+
|
|
248
|
+
Permanent cleanup policy:
|
|
249
|
+
A) ⭐ Purge soft-deleted after __ days (recommended: 90)
|
|
250
|
+
B) Archive to cold storage after __ days
|
|
251
|
+
C) Never delete (compliance requirement)
|
|
252
|
+
|
|
253
|
+
Default query behavior:
|
|
254
|
+
A) ⭐ Exclude deleted by default (add scope/filter)
|
|
255
|
+
B) Include all, filter explicitly
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**2.7.2 State Machines** (for entities with lifecycle states)
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
Do any entities have defined state lifecycles?
|
|
262
|
+
|
|
263
|
+
A) ⭐ Yes - Define state machines
|
|
264
|
+
B) No - Simple status fields without transitions
|
|
265
|
+
|
|
266
|
+
If yes, define for each entity:
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
Entity: Order (example)
|
|
270
|
+
States: [draft, pending, confirmed, shipped, delivered, cancelled, refunded]
|
|
271
|
+
|
|
272
|
+
Valid Transitions:
|
|
273
|
+
- draft → pending (action: submit)
|
|
274
|
+
- pending → confirmed (action: pay) [requires: payment_id]
|
|
275
|
+
- pending → cancelled (action: cancel, or timeout: 24h)
|
|
276
|
+
- confirmed → shipped (action: ship) [requires: tracking_number]
|
|
277
|
+
- shipped → delivered (action: deliver)
|
|
278
|
+
- confirmed → refunded (action: refund)
|
|
279
|
+
- delivered → refunded (action: refund) [within: 30 days]
|
|
280
|
+
|
|
281
|
+
Invalid Transitions (explicitly forbidden):
|
|
282
|
+
- shipped → cancelled (cannot cancel after shipping)
|
|
283
|
+
- delivered → cancelled
|
|
284
|
+
|
|
285
|
+
Side Effects:
|
|
286
|
+
- pending → confirmed: send confirmation email, reserve inventory
|
|
287
|
+
- confirmed → cancelled: release inventory, refund payment
|
|
288
|
+
- shipped → delivered: send delivery notification
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
Your state machines:
|
|
292
|
+
|
|
293
|
+
Entity: __
|
|
294
|
+
States: __
|
|
295
|
+
Transitions: __
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**2.7.1 Domain-Driven Design Concepts** (Production-Ready and Enterprise only)
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
Will you use Domain-Driven Design (DDD) patterns?
|
|
302
|
+
|
|
303
|
+
A) ⭐ Yes - Using DDD tactical patterns
|
|
304
|
+
- Aggregate Roots for transactional boundaries
|
|
305
|
+
- Value Objects for immutable data
|
|
306
|
+
- Domain Events for decoupling
|
|
307
|
+
|
|
308
|
+
B) 🔥 Partial - Only Aggregate Roots
|
|
309
|
+
- Define aggregate roots for complex domains
|
|
310
|
+
- Keep entities grouped by aggregate
|
|
311
|
+
|
|
312
|
+
C) No - Simple CRUD patterns
|
|
313
|
+
- Standard entity relationships
|
|
314
|
+
- No aggregate boundaries
|
|
315
|
+
|
|
316
|
+
If using DDD (A or B):
|
|
317
|
+
|
|
318
|
+
What are your Aggregate Roots?
|
|
319
|
+
(Aggregate roots are the entry points to groups of related entities)
|
|
320
|
+
|
|
321
|
+
Examples:
|
|
322
|
+
- Order (with OrderItems, Shipping, Payment)
|
|
323
|
+
- User (with Profile, Preferences, Settings)
|
|
324
|
+
- Project (with Tasks, Members, Files)
|
|
325
|
+
|
|
326
|
+
Your Aggregate Roots:
|
|
327
|
+
1. __ (contains: __)
|
|
328
|
+
2. __ (contains: __)
|
|
329
|
+
3. __ (contains: __)
|
|
330
|
+
|
|
331
|
+
Domain Events (things that happen in your domain):
|
|
332
|
+
- UserRegistered
|
|
333
|
+
- OrderPlaced
|
|
334
|
+
- PaymentCompleted
|
|
335
|
+
- etc.
|
|
336
|
+
|
|
337
|
+
Your key domain events:
|
|
338
|
+
1.
|
|
339
|
+
2.
|
|
340
|
+
3.
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**2.7.4 Transaction Boundaries**
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
Which operations require database transactions?
|
|
347
|
+
|
|
348
|
+
List operations that must be atomic (all-or-nothing):
|
|
349
|
+
|
|
350
|
+
1. User Registration:
|
|
351
|
+
- Create User record
|
|
352
|
+
- Create Profile record
|
|
353
|
+
- Send welcome email (queue, not in transaction)
|
|
354
|
+
→ Rollback if: User or Profile creation fails
|
|
355
|
+
|
|
356
|
+
2. Order Creation:
|
|
357
|
+
- Create Order record
|
|
358
|
+
- Create OrderItems
|
|
359
|
+
- Reserve inventory
|
|
360
|
+
- Charge payment
|
|
361
|
+
→ Rollback if: Any step fails
|
|
362
|
+
|
|
363
|
+
3. [Your operations]:
|
|
364
|
+
- Step 1
|
|
365
|
+
- Step 2
|
|
366
|
+
→ Rollback if: __
|
|
367
|
+
|
|
368
|
+
Your transactional operations:
|
|
369
|
+
1.
|
|
370
|
+
2.
|
|
371
|
+
3.
|
|
372
|
+
```
|
|
373
|
+
|
|
229
374
|
**2.8 Database Indexes**
|
|
230
375
|
|
|
231
376
|
```
|
|
@@ -362,86 +507,9 @@ Is this correct? (Yes/No)
|
|
|
362
507
|
|
|
363
508
|
#### 🎨 MERMAID ER DIAGRAM FORMAT - CRITICAL
|
|
364
509
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
````markdown
|
|
368
|
-
```mermaid
|
|
369
|
-
erDiagram
|
|
370
|
-
USER ||--o{ ORDER : places
|
|
371
|
-
USER ||--o{ REVIEW : writes
|
|
372
|
-
PRODUCT ||--o{ ORDER_ITEM : contains
|
|
373
|
-
ORDER ||--o{ ORDER_ITEM : includes
|
|
374
|
-
|
|
375
|
-
USER {
|
|
376
|
-
string id PK "Primary Key"
|
|
377
|
-
string email UK "Unique Key"
|
|
378
|
-
string name
|
|
379
|
-
string hashedPassword
|
|
380
|
-
datetime createdAt
|
|
381
|
-
datetime updatedAt
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
ORDER {
|
|
385
|
-
string id PK
|
|
386
|
-
string userId FK "Foreign Key to USER"
|
|
387
|
-
decimal total
|
|
388
|
-
string status "pending, completed, cancelled"
|
|
389
|
-
datetime createdAt
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
PRODUCT {
|
|
393
|
-
string id PK
|
|
394
|
-
string name
|
|
395
|
-
text description
|
|
396
|
-
decimal price
|
|
397
|
-
int stock
|
|
398
|
-
datetime createdAt
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
ORDER_ITEM {
|
|
402
|
-
string id PK
|
|
403
|
-
string orderId FK
|
|
404
|
-
string productId FK
|
|
405
|
-
int quantity
|
|
406
|
-
decimal price
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
REVIEW {
|
|
410
|
-
string id PK
|
|
411
|
-
string userId FK
|
|
412
|
-
string productId FK
|
|
413
|
-
int rating "1-5 stars"
|
|
414
|
-
text comment
|
|
415
|
-
datetime createdAt
|
|
416
|
-
}
|
|
417
|
-
```
|
|
418
|
-
````
|
|
419
|
-
|
|
420
|
-
**Relationship Notation:**
|
|
421
|
-
|
|
422
|
-
- `||--o{` = One-to-Many (one to zero or more)
|
|
423
|
-
- `||--||` = One-to-One (one to exactly one)
|
|
424
|
-
- `}o--o{` = Many-to-Many (requires junction table)
|
|
425
|
-
- `||--|{` = One-to-Many (one to one or more)
|
|
426
|
-
|
|
427
|
-
**Field Notation:**
|
|
428
|
-
|
|
429
|
-
- `PK` = Primary Key
|
|
430
|
-
- `FK` = Foreign Key
|
|
431
|
-
- `UK` = Unique Key
|
|
432
|
-
- Add descriptions in quotes after field type for clarity
|
|
433
|
-
|
|
434
|
-
**Common Mistakes to Avoid:**
|
|
435
|
-
|
|
436
|
-
- ❌ ````Mermaid` (capital M - will not render)
|
|
437
|
-
- ❌ ```` mermaid` (extra space - will not render)
|
|
438
|
-
- ❌ Indenting the entire diagram with spaces/tabs
|
|
439
|
-
- ❌ Missing closing ` ``` ` fence
|
|
440
|
-
- ❌ Invalid entity/relationship syntax
|
|
441
|
-
|
|
442
|
-
**Validation:** Preview your diagram at https://mermaid.live/ or in VS Code markdown preview
|
|
510
|
+
> 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for ER diagram syntax, relationship notation, and common mistakes.
|
|
443
511
|
|
|
444
|
-
|
|
512
|
+
## **Example ER Diagram:**
|
|
445
513
|
|
|
446
514
|
```
|
|
447
515
|
✅ Generated: docs/data-model.md
|
|
@@ -463,8 +531,6 @@ Execute `read_file('docs/data-model.md')` to refresh context before continuing.
|
|
|
463
531
|
|
|
464
532
|
---
|
|
465
533
|
|
|
466
|
-
**Proceed to Phase 3 after document is generated and optionally reviewed.**
|
|
467
|
-
|
|
468
|
-
---
|
|
534
|
+
## **Proceed to Phase 3 after document is generated and optionally reviewed.**
|
|
469
535
|
|
|
470
536
|
## PHASE 3: System Architecture (15-20 min)
|
|
@@ -20,66 +20,9 @@ Define the technical stack, architecture patterns, and system design.
|
|
|
20
20
|
|
|
21
21
|
#### 🎨 MERMAID ARCHITECTURE DIAGRAM FORMAT - CRITICAL
|
|
22
22
|
|
|
23
|
-
**
|
|
23
|
+
> 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for architecture diagram syntax, node shapes, and styling.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
```mermaid
|
|
27
|
-
graph TD
|
|
28
|
-
Client[Client Application<br/>React/Mobile/Web]
|
|
29
|
-
LB[Load Balancer<br/>Nginx/ALB]
|
|
30
|
-
API[API Gateway<br/>Node.js/Express]
|
|
31
|
-
Auth[Auth Service<br/>JWT/OAuth]
|
|
32
|
-
Business[Business Logic Layer]
|
|
33
|
-
DB[(Primary Database<br/>PostgreSQL)]
|
|
34
|
-
Cache[(Redis Cache<br/>Session & Data)]
|
|
35
|
-
Queue[Message Queue<br/>RabbitMQ/SQS]
|
|
36
|
-
Storage[File Storage<br/>S3/MinIO]
|
|
37
|
-
Email[Email Service<br/>SendGrid/SES]
|
|
38
|
-
Monitor[Monitoring<br/>Prometheus/DataDog]
|
|
39
|
-
|
|
40
|
-
Client -->|HTTPS| LB
|
|
41
|
-
LB -->|Forward| API
|
|
42
|
-
API -->|Verify Token| Auth
|
|
43
|
-
API -->|Business Rules| Business
|
|
44
|
-
Business -->|Query/Write| DB
|
|
45
|
-
Business -->|Cache Check| Cache
|
|
46
|
-
Business -->|Async Tasks| Queue
|
|
47
|
-
Business -->|Upload/Download| Storage
|
|
48
|
-
Queue -->|Send Email| Email
|
|
49
|
-
API -->|Metrics| Monitor
|
|
50
|
-
Business -->|Logs| Monitor
|
|
51
|
-
|
|
52
|
-
style Client fill:#e1f5ff
|
|
53
|
-
style API fill:#fff4e1
|
|
54
|
-
style Auth fill:#ffe1e1
|
|
55
|
-
style DB fill:#e1ffe1
|
|
56
|
-
style Cache fill:#f0e1ff
|
|
57
|
-
style Queue fill:#ffe1f5
|
|
58
|
-
```
|
|
59
|
-
````
|
|
60
|
-
|
|
61
|
-
**Diagram Types:**
|
|
62
|
-
|
|
63
|
-
- `graph TD` = Top-Down flow (recommended for most architectures)
|
|
64
|
-
- `graph LR` = Left-Right flow (good for linear pipelines)
|
|
65
|
-
- `graph BT` = Bottom-Top (less common)
|
|
66
|
-
- `graph RL` = Right-Left (less common)
|
|
67
|
-
|
|
68
|
-
**Node Shapes:**
|
|
69
|
-
|
|
70
|
-
- `[Square Brackets]` = Services, applications, components
|
|
71
|
-
- `[(Cylinder)]` = Databases, persistent storage
|
|
72
|
-
- `([Rounded])` = Start/End points
|
|
73
|
-
- `{Diamond}` = Decision points
|
|
74
|
-
- `[[Double Square]]` = Subroutines
|
|
75
|
-
- `[/Parallelogram/]` = Input/Output
|
|
76
|
-
|
|
77
|
-
**Styling:**
|
|
78
|
-
|
|
79
|
-
- Use `<br/>` for line breaks in node labels
|
|
80
|
-
- Apply styles with: `style NodeName fill:#colorcode`
|
|
81
|
-
- Label connections: `A -->|Label Text| B`
|
|
82
|
-
- Use consistent colors for component types
|
|
25
|
+
**Example Architecture Diagram:**
|
|
83
26
|
|
|
84
27
|
**Common Architecture Patterns:**
|
|
85
28
|
|
|
@@ -127,9 +70,7 @@ graph TD
|
|
|
127
70
|
- Label protocols on connections (HTTPS, gRPC, WebSocket)
|
|
128
71
|
- Use consistent naming conventions
|
|
129
72
|
|
|
130
|
-
**Validation:** Preview at https://mermaid.live/ before committing
|
|
131
|
-
|
|
132
|
-
---
|
|
73
|
+
## **Validation:** Preview at https://mermaid.live/ before committing
|
|
133
74
|
|
|
134
75
|
**3.1 Backend Framework**
|
|
135
76
|
|
|
@@ -329,12 +270,115 @@ Please answer the following questions to define the global API conventions (thes
|
|
|
329
270
|
10. If you want to customize an endpoint (e.g., add special logic, validations, or unique parameters), describe the case here:
|
|
330
271
|
|
|
331
272
|
- [Brief description, example endpoint, parameters, special logic]
|
|
332
|
-
|
|
333
273
|
---
|
|
334
|
-
|
|
335
274
|
The AI will use these conventions to automatically document all CRUD endpoints for each entity in api.md. If you need additional or custom endpoints, you can add them manually later.
|
|
336
275
|
````
|
|
337
276
|
|
|
277
|
+
**3.5.1 Error Codes Catalog**
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
Will you use standardized error codes?
|
|
281
|
+
|
|
282
|
+
A) ⭐ Yes - Domain-specific error codes (recommended for APIs)
|
|
283
|
+
B) No - HTTP status codes only
|
|
284
|
+
|
|
285
|
+
If yes, define your error code format:
|
|
286
|
+
|
|
287
|
+
Format:
|
|
288
|
+
A) ⭐ Prefixed by domain: USER_001, ORDER_003, PAYMENT_005
|
|
289
|
+
B) Numeric ranges: 1000-1999 (Users), 2000-2999 (Orders)
|
|
290
|
+
C) Other: __
|
|
291
|
+
|
|
292
|
+
Define your error codes:
|
|
293
|
+
|
|
294
|
+
| Code | HTTP | Message | Resolution |
|
|
295
|
+
|---------------|------|--------------------------------|-------------------------------|
|
|
296
|
+
| USER_001 | 404 | User not found | Verify user ID exists |
|
|
297
|
+
| USER_002 | 409 | Email already registered | Use different email or login |
|
|
298
|
+
| USER_003 | 400 | Invalid email format | Provide valid email |
|
|
299
|
+
| AUTH_001 | 401 | Invalid credentials | Check username/password |
|
|
300
|
+
| AUTH_002 | 401 | Token expired | Refresh or re-authenticate |
|
|
301
|
+
| AUTH_003 | 403 | Insufficient permissions | Contact administrator |
|
|
302
|
+
| ORDER_001 | 400 | Empty cart | Add items before checkout |
|
|
303
|
+
| ORDER_002 | 400 | Insufficient stock | Reduce quantity or wait |
|
|
304
|
+
| PAYMENT_001 | 402 | Payment declined | Try different payment method |
|
|
305
|
+
| VALIDATION_001| 400 | Required field missing | Provide all required fields |
|
|
306
|
+
|
|
307
|
+
Your error codes:
|
|
308
|
+
| Code | HTTP | Message | Resolution |
|
|
309
|
+
|------|------|---------|------------|
|
|
310
|
+
| | | | |
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**3.5.2 Input Validation Rules Catalog**
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
Define validation rules for common fields across your API:
|
|
317
|
+
|
|
318
|
+
| Field Type | Rules | Error Message |
|
|
319
|
+
|----------------|------------------------------------------|----------------------------------|
|
|
320
|
+
| email | valid format, max 255, lowercase | Invalid email format |
|
|
321
|
+
| password | min 8, uppercase, lowercase, number | Password too weak |
|
|
322
|
+
| username | min 3, max 30, alphanumeric, no spaces | Invalid username format |
|
|
323
|
+
| phone | E.164 format or local format | Invalid phone number |
|
|
324
|
+
| url | valid URL, https only (optional) | Invalid URL format |
|
|
325
|
+
| date | ISO 8601 format, not in past (optional) | Invalid date format |
|
|
326
|
+
| price/amount | positive, max 2 decimals | Invalid amount |
|
|
327
|
+
| quantity | positive integer, max 9999 | Invalid quantity |
|
|
328
|
+
| id (UUID) | valid UUID v4 format | Invalid ID format |
|
|
329
|
+
| slug | lowercase, hyphens only, max 100 | Invalid slug format |
|
|
330
|
+
|
|
331
|
+
Entity-specific validation (example):
|
|
332
|
+
|
|
333
|
+
User:
|
|
334
|
+
- firstName: required, min 2, max 50, letters only
|
|
335
|
+
- lastName: required, min 2, max 50, letters only
|
|
336
|
+
- birthDate: valid date, must be 18+ years ago
|
|
337
|
+
|
|
338
|
+
Product:
|
|
339
|
+
- name: required, min 3, max 100
|
|
340
|
+
- price: required, positive, max 999999.99
|
|
341
|
+
- sku: required, unique, uppercase, alphanumeric
|
|
342
|
+
|
|
343
|
+
Your entity validations:
|
|
344
|
+
|
|
345
|
+
Entity: __
|
|
346
|
+
- field: [rules]
|
|
347
|
+
|
|
348
|
+
Entity: __
|
|
349
|
+
- field: [rules]
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
**3.5.3 Idempotency Strategy**
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
How will you handle duplicate requests (critical for payments, orders)?
|
|
356
|
+
|
|
357
|
+
A) ⭐ Idempotency keys - Client sends unique key per request
|
|
358
|
+
B) Natural idempotency - Use unique constraints (email, etc.)
|
|
359
|
+
C) Not needed - Operations are naturally idempotent
|
|
360
|
+
D) Combination of A + B
|
|
361
|
+
|
|
362
|
+
If using idempotency keys (A):
|
|
363
|
+
|
|
364
|
+
Header name:
|
|
365
|
+
A) ⭐ Idempotency-Key (standard)
|
|
366
|
+
B) X-Request-ID
|
|
367
|
+
C) Custom: __
|
|
368
|
+
|
|
369
|
+
Key storage:
|
|
370
|
+
A) ⭐ Redis with TTL (recommended)
|
|
371
|
+
B) Database table
|
|
372
|
+
|
|
373
|
+
TTL: __ hours (recommended: 24)
|
|
374
|
+
|
|
375
|
+
Which endpoints require idempotency?
|
|
376
|
+
- POST /orders ✅
|
|
377
|
+
- POST /payments ✅
|
|
378
|
+
- POST /users ✅
|
|
379
|
+
- [Your endpoints]: __
|
|
380
|
+
```
|
|
381
|
+
|
|
338
382
|
**3.6 Key Dependencies**
|
|
339
383
|
|
|
340
384
|
```
|
|
@@ -598,9 +642,7 @@ D) Accounting (QuickBooks, Xero)
|
|
|
598
642
|
E) Other: __
|
|
599
643
|
|
|
600
644
|
→ Your selection (e.g., A, B, C): __
|
|
601
|
-
|
|
602
645
|
---
|
|
603
|
-
|
|
604
646
|
For each selected, briefly describe the use case:
|
|
605
647
|
D) Other: __
|
|
606
648
|
|
|
@@ -610,9 +652,7 @@ B) Calendar (Google/Outlook)
|
|
|
610
652
|
C) CRM (Salesforce, HubSpot)
|
|
611
653
|
D) Accounting (QuickBooks, Xero)
|
|
612
654
|
E) Other: __
|
|
613
|
-
|
|
614
655
|
---
|
|
615
|
-
|
|
616
656
|
For each selected, briefly describe the use case:
|
|
617
657
|
|
|
618
658
|
Example:
|
|
@@ -461,9 +461,7 @@ Input Validation: [strategy + sanitization rules + size limits + file upload val
|
|
|
461
461
|
|
|
462
462
|
Is this correct? (Yes/No)
|
|
463
463
|
```
|
|
464
|
-
|
|
465
|
-
---
|
|
466
|
-
|
|
464
|
+
---
|
|
467
465
|
### 📄 Generate Phase 4 Documents
|
|
468
466
|
|
|
469
467
|
**Before starting generation:**
|
|
@@ -503,13 +501,12 @@ Documents have been created with all Phase 4 information.
|
|
|
503
501
|
|
|
504
502
|
**If user edits files:**
|
|
505
503
|
Re-read files to refresh context before continuing.
|
|
506
|
-
|
|
507
|
-
---
|
|
508
|
-
|
|
504
|
+
---
|
|
509
505
|
**Proceed to Phase 5 only after documents are validated.**
|
|
510
506
|
|
|
511
507
|
> ⚠️ **CRITICAL:** DO NOT generate README.md in this phase. README.md is ONLY generated in Phase 8 (step 8.5) after framework initialization.
|
|
508
|
+
---
|
|
509
|
+
## PHASE 5: Development Standards (15-20 min)
|
|
510
|
+
|
|
512
511
|
|
|
513
|
-
---
|
|
514
512
|
|
|
515
|
-
## PHASE 5: Development Standards (15-20 min)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
## PHASE 5: Code Standards (15-20 min)
|
|
2
2
|
|
|
3
|
-
> **Order for this phase:** 5.1 → 5.2 → 5.3 → 5.4 → 5.5 → 5.6 → 5.7 → 5.8 → 5.9 → 5.10 → 5.11
|
|
3
|
+
> **Order for this phase:** 5.1 → 5.2 → 5.3 → 5.4 → 5.5 → 5.6 → 5.7 → 5.8 → 5.9 → 5.10 → 5.11 → 5.12 → 5.13
|
|
4
4
|
|
|
5
5
|
> **📌 Scope-based behavior:**
|
|
6
6
|
>
|
|
7
|
-
> - **MVP:** Ask 5.1-5.5 only (formatting, naming, structure, coverage target, Git workflow), skip 5.6-5.
|
|
8
|
-
> - **Production-Ready:** Ask all questions 5.1-5.
|
|
9
|
-
> - **Enterprise:** Ask all questions 5.1-5.
|
|
7
|
+
> - **MVP:** Ask 5.1-5.5 only (formatting, naming, structure, coverage target, Git workflow), skip 5.6-5.13 (advanced practices)
|
|
8
|
+
> - **Production-Ready:** Ask all questions 5.1-5.13
|
|
9
|
+
> - **Enterprise:** Ask all questions 5.1-5.13 with emphasis on governance and documentation
|
|
10
10
|
|
|
11
11
|
### Objective
|
|
12
12
|
|
|
@@ -198,9 +198,7 @@ src/
|
|
|
198
198
|
Extensions/
|
|
199
199
|
|
|
200
200
|
Benefits: Scalable, easy to find related code, clear module boundaries
|
|
201
|
-
|
|
202
201
|
---
|
|
203
|
-
|
|
204
202
|
B) 🏆 Feature-based (Flat) - Simple projects
|
|
205
203
|
|
|
206
204
|
Flat structure within each feature (AI will adapt naming):
|
|
@@ -218,9 +216,7 @@ src/
|
|
|
218
216
|
...
|
|
219
217
|
|
|
220
218
|
Benefits: Simpler, fewer folders, good for small projects
|
|
221
|
-
|
|
222
219
|
---
|
|
223
|
-
|
|
224
220
|
C) Layer-based (Traditional) - Legacy style
|
|
225
221
|
|
|
226
222
|
Group by technical layer/type (AI will adapt naming):
|
|
@@ -244,9 +240,7 @@ src/
|
|
|
244
240
|
|
|
245
241
|
Benefits: Clear separation by type, familiar for MVC developers
|
|
246
242
|
Drawbacks: Hard to see feature boundaries, files scattered
|
|
247
|
-
|
|
248
243
|
---
|
|
249
|
-
|
|
250
244
|
D) Hybrid - Domain + Shared layers
|
|
251
245
|
|
|
252
246
|
Modules for features + shared technical folders (AI will adapt):
|
|
@@ -266,9 +260,7 @@ src/
|
|
|
266
260
|
|
|
267
261
|
Your choice: __
|
|
268
262
|
Why?
|
|
269
|
-
|
|
270
263
|
---
|
|
271
|
-
|
|
272
264
|
After you select, the AI will generate the exact folder structure with proper:
|
|
273
265
|
- File extensions (.ts, .py, .java, .go)
|
|
274
266
|
- Naming conventions (camelCase, snake_case, PascalCase)
|
|
@@ -564,6 +556,40 @@ E) Other: __
|
|
|
564
556
|
Log retention: __ days
|
|
565
557
|
```
|
|
566
558
|
|
|
559
|
+
**5.13 Custom Project Rules**
|
|
560
|
+
|
|
561
|
+
```
|
|
562
|
+
Do you have any project-specific rules for AI assistants?
|
|
563
|
+
|
|
564
|
+
❌ NEVER Rules (things that should NEVER be done):
|
|
565
|
+
|
|
566
|
+
Examples of NEVER rules:
|
|
567
|
+
- Never use ORM X, always use ORM Y
|
|
568
|
+
- Never modify files in the /legacy folder
|
|
569
|
+
- Never use inline styles in components
|
|
570
|
+
- Never bypass the API gateway
|
|
571
|
+
|
|
572
|
+
Your custom NEVER rules:
|
|
573
|
+
1. __
|
|
574
|
+
2. __
|
|
575
|
+
3. __
|
|
576
|
+
(Leave blank if none)
|
|
577
|
+
|
|
578
|
+
✅ ALWAYS Rules (things that should ALWAYS be done):
|
|
579
|
+
|
|
580
|
+
Examples of ALWAYS rules:
|
|
581
|
+
- Always use the company's error handling wrapper
|
|
582
|
+
- Always include tenant_id in database queries
|
|
583
|
+
- Always use the shared logging utility
|
|
584
|
+
- Always run security scan before commit
|
|
585
|
+
|
|
586
|
+
Your custom ALWAYS rules:
|
|
587
|
+
1. __
|
|
588
|
+
2. __
|
|
589
|
+
3. __
|
|
590
|
+
(Leave blank if none)
|
|
591
|
+
```
|
|
592
|
+
|
|
567
593
|
### Phase 5 Output
|
|
568
594
|
|
|
569
595
|
```
|
|
@@ -581,6 +607,7 @@ Complexity: [function length, cyclomatic complexity, parameters, nesting depth l
|
|
|
581
607
|
Git: [commit format (conventional/simple), branch naming convention]
|
|
582
608
|
Versioning: [scheme (SemVer/Date), migration strategy, changelog method, responsibility]
|
|
583
609
|
Logging Standards: [format (JSON/text), levels, context, aggregation tool, retention]
|
|
610
|
+
Custom Rules: [NEVER rules count, ALWAYS rules count]
|
|
584
611
|
|
|
585
612
|
Is this correct? (Yes/No)
|
|
586
613
|
```
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
> **Order for this phase:**
|
|
4
4
|
>
|
|
5
5
|
> - **MVP:** 6.1 → 6.2 (smoke tests) → 6.7 (CI basics)
|
|
6
|
-
> - **Production-Ready:** 6.1 → 6.2 → 6.3 → 6.4 → 6.5 → 6.6 → 6.7
|
|
7
|
-
> - **Enterprise:** 6.1 → 6.2 → 6.3 → 6.4 → 6.5 → 6.6 → 6.7 → 6.8 → 6.9
|
|
6
|
+
> - **Production-Ready:** 6.1 → 6.1b → 6.2 → 6.3 → 6.4 → 6.5 → 6.6 → 6.7
|
|
7
|
+
> - **Enterprise:** 6.1 → 6.1b → 6.2 → 6.3 → 6.4 → 6.5 → 6.6 → 6.7 → 6.8 → 6.9
|
|
8
8
|
|
|
9
9
|
> **📌 Scope-based behavior:**
|
|
10
10
|
>
|
|
@@ -46,6 +46,33 @@ Mocking library: **
|
|
|
46
46
|
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
**6.1b Testing Philosophy** (Production-Ready and Enterprise only)
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
What is your testing philosophy?
|
|
53
|
+
|
|
54
|
+
A) ⭐ Test-First (TDD) - Write tests before code
|
|
55
|
+
- Red-Green-Refactor cycle
|
|
56
|
+
- Higher initial effort, better design
|
|
57
|
+
- Best for: Complex business logic, critical systems
|
|
58
|
+
|
|
59
|
+
B) 🔥 Test-After - Write tests after implementation
|
|
60
|
+
- Faster initial development
|
|
61
|
+
- Risk of untested edge cases
|
|
62
|
+
- Best for: Rapid prototyping, time-sensitive features
|
|
63
|
+
|
|
64
|
+
C) ⚡ Behavior-Driven (BDD) - Write tests as specifications
|
|
65
|
+
- Given/When/Then format
|
|
66
|
+
- Business-readable tests
|
|
67
|
+
- Best for: Domain-heavy applications
|
|
68
|
+
|
|
69
|
+
D) 🏆 Hybrid - TDD for core logic, test-after for simple features
|
|
70
|
+
- Balance of speed and quality
|
|
71
|
+
- Pragmatic approach
|
|
72
|
+
|
|
73
|
+
Your choice: __
|
|
74
|
+
```
|
|
75
|
+
|
|
49
76
|
**6.2 Test Types**
|
|
50
77
|
|
|
51
78
|
```
|
|
@@ -417,9 +444,7 @@ Status: Exhaustive testing strategy with advanced scenarios
|
|
|
417
444
|
|
|
418
445
|
Is this correct? (Yes/No)
|
|
419
446
|
```
|
|
420
|
-
|
|
421
447
|
---
|
|
422
|
-
|
|
423
448
|
### 📄 Generate Phase 6 Documents
|
|
424
449
|
|
|
425
450
|
**Before starting generation:**
|
|
@@ -451,14 +476,10 @@ Document has been created with all Phase 6 information.
|
|
|
451
476
|
|
|
452
477
|
**If user edits file:**
|
|
453
478
|
Re-read file to refresh context before continuing.
|
|
454
|
-
|
|
455
479
|
---
|
|
456
|
-
|
|
457
480
|
**Proceed to Phase 7 only after documents are validated.**
|
|
458
481
|
|
|
459
482
|
> ⚠️ **CRITICAL:** DO NOT generate README.md in this phase. README.md is ONLY generated in Phase 8 (step 8.5) after framework initialization.
|
|
460
|
-
|
|
461
483
|
---
|
|
462
|
-
|
|
463
484
|
## PHASE 7: Operations & Deployment (10 min)
|
|
464
485
|
````
|