ai-flow-dev 1.0.1
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/LICENSE +21 -0
- package/README.md +408 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +791 -0
- package/dist/cli.js.map +1 -0
- package/dist/fs-utils.d.ts +2 -0
- package/dist/fs-utils.d.ts.map +1 -0
- package/dist/fs-utils.js +46 -0
- package/dist/fs-utils.js.map +1 -0
- package/package.json +71 -0
- package/prompts/backend/flow-dev-feature.md +1318 -0
- package/prompts/backend/flow-dev-fix.md +903 -0
- package/prompts/backend/flow-dev-refactor.md +715 -0
- package/prompts/backend/flow-dev-review.md +401 -0
- package/prompts/backend/flow-dev-work.md +1129 -0
- package/prompts/backend/flow-docs-gen-phase-0.md +1840 -0
- package/prompts/backend/flow-docs-gen-phase-1.md +435 -0
- package/prompts/backend/flow-docs-gen-phase-2.md +460 -0
- package/prompts/backend/flow-docs-gen-phase-3.md +684 -0
- package/prompts/backend/flow-docs-gen-phase-4.md +516 -0
- package/prompts/backend/flow-docs-gen-phase-5.md +637 -0
- package/prompts/backend/flow-docs-gen-phase-6.md +465 -0
- package/prompts/backend/flow-docs-gen-phase-7.md +1207 -0
- package/prompts/backend/flow-docs-gen.md +820 -0
- package/prompts/backend/flow-docs-sync.md +526 -0
- package/prompts/backend/flow-project-init.md +248 -0
- package/prompts/backend/flow-project-roadmap.md +1159 -0
- package/prompts/frontend/flow-docs-gen-phase-0.md +494 -0
- package/prompts/frontend/flow-docs-gen-phase-1.md +449 -0
- package/prompts/frontend/flow-docs-gen-phase-2.md +983 -0
- package/prompts/frontend/flow-docs-gen-phase-3.md +685 -0
- package/prompts/frontend/flow-docs-gen-phase-4.md +480 -0
- package/prompts/frontend/flow-docs-gen-phase-5.md +483 -0
- package/prompts/frontend/flow-docs-gen-phase-6.md +570 -0
- package/prompts/frontend/flow-docs-gen-phase-7.md +582 -0
- package/prompts/frontend/flow-docs-gen.md +413 -0
- package/prompts/frontend/flow-docs-sync.md +561 -0
- package/prompts/mobile/flow-docs-gen-phase-0.md +387 -0
- package/prompts/mobile/flow-docs-gen-phase-1.md +530 -0
- package/prompts/mobile/flow-docs-gen-phase-2.md +584 -0
- package/prompts/mobile/flow-docs-gen-phase-3.md +659 -0
- package/prompts/mobile/flow-docs-gen-phase-4.md +363 -0
- package/prompts/mobile/flow-docs-gen-phase-5.md +369 -0
- package/prompts/mobile/flow-docs-gen-phase-6.md +490 -0
- package/prompts/mobile/flow-docs-gen-phase-7.md +407 -0
- package/prompts/mobile/flow-docs-gen.md +430 -0
- package/prompts/mobile/flow-docs-sync.md +634 -0
- package/templates/backend/.clauderules.template +111 -0
- package/templates/backend/.cursorrules.template +102 -0
- package/templates/backend/.env.example.template +122 -0
- package/templates/backend/README.template.md +200 -0
- package/templates/backend/ai-instructions.template.md +354 -0
- package/templates/backend/copilot-instructions.template.md +160 -0
- package/templates/backend/docs/api.template.md +251 -0
- package/templates/backend/docs/architecture.template.md +612 -0
- package/templates/backend/docs/business-flows.template.md +109 -0
- package/templates/backend/docs/code-standards.template.md +828 -0
- package/templates/backend/docs/contributing.template.md +163 -0
- package/templates/backend/docs/data-model.template.md +416 -0
- package/templates/backend/docs/operations.template.md +591 -0
- package/templates/backend/docs/testing.template.md +762 -0
- package/templates/backend/project-brief.template.md +176 -0
- package/templates/backend/specs/configuration.template.md +133 -0
- package/templates/backend/specs/security.template.md +422 -0
- package/templates/frontend/README.template.md +121 -0
- package/templates/frontend/ai-instructions.template.md +368 -0
- package/templates/frontend/docs/api-integration.template.md +390 -0
- package/templates/frontend/docs/components.template.md +567 -0
- package/templates/frontend/docs/error-handling.template.md +385 -0
- package/templates/frontend/docs/operations.template.md +123 -0
- package/templates/frontend/docs/performance.template.md +140 -0
- package/templates/frontend/docs/pwa.template.md +135 -0
- package/templates/frontend/docs/state-management.template.md +394 -0
- package/templates/frontend/docs/styling.template.md +779 -0
- package/templates/frontend/docs/testing.template.md +736 -0
- package/templates/frontend/project-brief.template.md +55 -0
- package/templates/frontend/specs/accessibility.template.md +111 -0
- package/templates/frontend/specs/configuration.template.md +520 -0
- package/templates/frontend/specs/security.template.md +197 -0
- package/templates/fullstack/README.template.md +282 -0
- package/templates/fullstack/ai-instructions.template.md +487 -0
- package/templates/fullstack/project-brief.template.md +197 -0
- package/templates/fullstack/specs/configuration.template.md +380 -0
- package/templates/mobile/AGENT.template.md +251 -0
- package/templates/mobile/README.template.md +195 -0
- package/templates/mobile/ai-instructions.template.md +221 -0
- package/templates/mobile/docs/app-store.template.md +163 -0
- package/templates/mobile/docs/architecture.template.md +100 -0
- package/templates/mobile/docs/native-features.template.md +137 -0
- package/templates/mobile/docs/navigation.template.md +81 -0
- package/templates/mobile/docs/offline-strategy.template.md +90 -0
- package/templates/mobile/docs/permissions.template.md +70 -0
- package/templates/mobile/docs/state-management.template.md +116 -0
- package/templates/mobile/docs/testing.template.md +146 -0
- package/templates/mobile/project-brief.template.md +97 -0
- package/templates/mobile/specs/build-configuration.template.md +116 -0
- package/templates/mobile/specs/deployment.template.md +114 -0
- package/templates/shared/AGENT.template.md +252 -0
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
## PHASE 3: System Architecture (15-20 min)
|
|
2
|
+
|
|
3
|
+
> **Order for this phase:** 3.1 β 3.2 β 3.3 β 3.4 β 3.5 β 3.6 β 3.7 β 3.8 β 3.9 β 3.10 β 3.11 β 3.12
|
|
4
|
+
|
|
5
|
+
> **π Scope-based behavior:**
|
|
6
|
+
>
|
|
7
|
+
> - **MVP:** Ask 3.1-3.6 (tech stack essentials) and 3.12 (API structure), skip 3.7-3.11 (advanced features), mark as "TBD"
|
|
8
|
+
> - **Production-Ready:** Ask all questions 3.1-3.12
|
|
9
|
+
> - **Enterprise:** Ask all questions 3.1-3.12 with emphasis on scalability and integrations
|
|
10
|
+
|
|
11
|
+
> **π Note:** If Phase 0 detected framework/language/dependencies, those will be pre-filled. Review and confirm.
|
|
12
|
+
|
|
13
|
+
### Objective
|
|
14
|
+
|
|
15
|
+
Define the technical stack, architecture patterns, and system design.
|
|
16
|
+
|
|
17
|
+
> **Note:** At the end of this phase, the AI will automatically generate a system architecture diagram in mermaid format, based on your answers. This diagram will be included in the docs/architecture.md document.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
#### π¨ MERMAID ARCHITECTURE DIAGRAM FORMAT - CRITICAL
|
|
22
|
+
|
|
23
|
+
**Use this exact format** for system architecture diagrams:
|
|
24
|
+
|
|
25
|
+
````markdown
|
|
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
|
|
83
|
+
|
|
84
|
+
**Common Architecture Patterns:**
|
|
85
|
+
|
|
86
|
+
```mermaid
|
|
87
|
+
graph TD
|
|
88
|
+
subgraph "Client Layer"
|
|
89
|
+
Web[Web App]
|
|
90
|
+
Mobile[Mobile App]
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
subgraph "API Layer"
|
|
94
|
+
Gateway[API Gateway]
|
|
95
|
+
Auth[Auth Service]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
subgraph "Business Layer"
|
|
99
|
+
Service1[User Service]
|
|
100
|
+
Service2[Order Service]
|
|
101
|
+
Service3[Payment Service]
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
subgraph "Data Layer"
|
|
105
|
+
DB[(PostgreSQL)]
|
|
106
|
+
Cache[(Redis)]
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
Web --> Gateway
|
|
110
|
+
Mobile --> Gateway
|
|
111
|
+
Gateway --> Auth
|
|
112
|
+
Gateway --> Service1
|
|
113
|
+
Gateway --> Service2
|
|
114
|
+
Service2 --> Service3
|
|
115
|
+
Service1 --> DB
|
|
116
|
+
Service2 --> DB
|
|
117
|
+
Service3 --> DB
|
|
118
|
+
Service1 --> Cache
|
|
119
|
+
Service2 --> Cache
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Best Practices:**
|
|
123
|
+
|
|
124
|
+
- Group related components using `subgraph`
|
|
125
|
+
- Show external services (Email, SMS, Payment gateways)
|
|
126
|
+
- Include monitoring and logging components
|
|
127
|
+
- Label protocols on connections (HTTPS, gRPC, WebSocket)
|
|
128
|
+
- Use consistent naming conventions
|
|
129
|
+
|
|
130
|
+
**Validation:** Preview at https://mermaid.live/ before committing
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
**3.1 Backend Framework**
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
[If detected from Phase 0, show:]
|
|
138
|
+
β
Framework Detected: [NestJS/FastAPI/Spring Boot/etc.]
|
|
139
|
+
β
Language: [TypeScript 5.3/Python 3.11/Java 21/etc.]
|
|
140
|
+
β
Runtime: [Node 20/Python 3.11/JVM 21/etc.]
|
|
141
|
+
|
|
142
|
+
Is this correct? (Y/N)
|
|
143
|
+
If no, please specify the correct framework and language.
|
|
144
|
+
|
|
145
|
+
[If NOT detected, ask:]
|
|
146
|
+
Which backend framework will you use?
|
|
147
|
+
|
|
148
|
+
Node.js (JavaScript):
|
|
149
|
+
A) π₯ Express.js - Popular (minimal, flexible, lightweight)
|
|
150
|
+
B) Hapi.js - Enterprise (configuration-driven)
|
|
151
|
+
|
|
152
|
+
TypeScript (Node.js):
|
|
153
|
+
C) β NestJS - Recommended (structured, enterprise-ready, decorators)
|
|
154
|
+
D) β‘ Fastify - Modern (high performance, schema validation)
|
|
155
|
+
|
|
156
|
+
Python:
|
|
157
|
+
E) β FastAPI - Recommended (modern, fast, auto-docs)
|
|
158
|
+
F) π₯ Django - Popular (batteries included, admin panel)
|
|
159
|
+
G) Flask - Minimal (micro-framework, flexible)
|
|
160
|
+
|
|
161
|
+
Java:
|
|
162
|
+
H) π Spring Boot - Enterprise standard
|
|
163
|
+
I) Quarkus - Modern (cloud-native, fast startup)
|
|
164
|
+
|
|
165
|
+
Go:
|
|
166
|
+
J) β‘ Gin - Popular (fast, minimalist)
|
|
167
|
+
K) Echo - Feature-rich (middleware, routing)
|
|
168
|
+
L) Fiber - Express-like (high performance)
|
|
169
|
+
|
|
170
|
+
Rust:
|
|
171
|
+
M) β‘ Actix-web - High performance (async, type-safe)
|
|
172
|
+
N) Rocket - Developer-friendly (macros, type-safe)
|
|
173
|
+
O) Axum - Modern (tokio-based, ergonomic)
|
|
174
|
+
|
|
175
|
+
Kotlin:
|
|
176
|
+
P) Ktor - Native Kotlin (coroutines, DSL)
|
|
177
|
+
Q) Spring Boot - Java interop (Kotlin support)
|
|
178
|
+
|
|
179
|
+
Other:
|
|
180
|
+
R) Ruby (Rails)
|
|
181
|
+
S) PHP (Laravel)
|
|
182
|
+
T) C# (.NET Core)
|
|
183
|
+
|
|
184
|
+
Your choice: __
|
|
185
|
+
Why?
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**3.2 Language & Version**
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
Primary programming language and version:
|
|
192
|
+
|
|
193
|
+
Language: **
|
|
194
|
+
Version: ** (e.g., Node 20, Python 3.11, Java 21)
|
|
195
|
+
|
|
196
|
+
Type system:
|
|
197
|
+
A) β Strongly typed - TypeScript, Java, Go (Recommended for large projects)
|
|
198
|
+
B) Dynamically typed - JavaScript, Python, Ruby
|
|
199
|
+
C) Gradually typed - Python with type hints
|
|
200
|
+
|
|
201
|
+
Package Manager:
|
|
202
|
+
A) β npm - Standard, comes with Node
|
|
203
|
+
B) π₯ pnpm - Fast, disk efficient
|
|
204
|
+
C) β‘ yarn - Popular alternative
|
|
205
|
+
D) π bun - Ultra fast (if using Bun runtime)
|
|
206
|
+
E) π pip/poetry (Python)
|
|
207
|
+
F) β Maven/Gradle (Java)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**3.3 Architecture Pattern**
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
What architecture pattern will you follow?
|
|
214
|
+
|
|
215
|
+
A) β Layered Architecture (Recommended for most projects)
|
|
216
|
+
- Presentation β Business Logic β Data Access
|
|
217
|
+
- Easy to understand and maintain
|
|
218
|
+
|
|
219
|
+
B) π Hexagonal/Clean Architecture (Enterprise)
|
|
220
|
+
- Core domain isolated from infrastructure
|
|
221
|
+
- Highly testable and flexible
|
|
222
|
+
|
|
223
|
+
C) π₯ MVC (Popular, traditional)
|
|
224
|
+
- Model-View-Controller separation
|
|
225
|
+
- Good for traditional web apps
|
|
226
|
+
|
|
227
|
+
D) π¦ Modular Monolith (Modern, scalable)
|
|
228
|
+
- Single deployment with independent modules
|
|
229
|
+
- Easier than microservices, more structured than monolith
|
|
230
|
+
- Good middle ground for growing applications
|
|
231
|
+
|
|
232
|
+
E) β‘ Microservices (Modern, complex)
|
|
233
|
+
- Multiple independent services
|
|
234
|
+
- Best for large-scale distributed systems
|
|
235
|
+
|
|
236
|
+
F) Other: __
|
|
237
|
+
|
|
238
|
+
Your choice: __
|
|
239
|
+
Why this pattern?
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**3.4 API Style**
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
What API style will you expose?
|
|
246
|
+
|
|
247
|
+
A) β REST API - Recommended (HTTP/JSON, standard, well-understood)
|
|
248
|
+
B) π₯ GraphQL - Popular (flexible queries, single endpoint)
|
|
249
|
+
C) β‘ gRPC - Modern (high performance, protobuf, microservices)
|
|
250
|
+
D) Mixed - REST + GraphQL or REST + gRPC
|
|
251
|
+
|
|
252
|
+
Your choice: __
|
|
253
|
+
|
|
254
|
+
API versioning strategy:
|
|
255
|
+
A) URL versioning (/v1/users, /v2/users)
|
|
256
|
+
B) Header versioning (Accept: application/vnd.api.v1+json)
|
|
257
|
+
C) No versioning yet (will add when needed)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**3.5 API Reference (Automated)**
|
|
261
|
+
|
|
262
|
+
````
|
|
263
|
+
The AI will automatically generate standard CRUD endpoints for each entity defined in Phase 2.
|
|
264
|
+
|
|
265
|
+
Please answer the following questions to define the global API conventions (these will apply to all endpoints unless otherwise specified):
|
|
266
|
+
|
|
267
|
+
**A) Authentication and Access Control**
|
|
268
|
+
1. Do all CRUD endpoints require authentication?
|
|
269
|
+
A) β Yes, all endpoints require authentication (recommended)
|
|
270
|
+
B) Only some (specify which ones)
|
|
271
|
+
C) No authentication required
|
|
272
|
+
|
|
273
|
+
2. Which roles can access each CRUD operation?
|
|
274
|
+
- GET (list): [admin, manager, user]
|
|
275
|
+
- GET (detail): [admin, manager, user]
|
|
276
|
+
- POST (create): [admin, manager, user]
|
|
277
|
+
- PUT (update): [admin, manager]
|
|
278
|
+
- DELETE (delete): [admin]
|
|
279
|
+
(Standard example: admin, manager, user. Adjust as needed.)
|
|
280
|
+
|
|
281
|
+
**B) Listing and Filter Conventions**
|
|
282
|
+
3. Which pagination scheme do you prefer?
|
|
283
|
+
A) β offset/limit (recommended)
|
|
284
|
+
B) cursor-based
|
|
285
|
+
C) No pagination
|
|
286
|
+
|
|
287
|
+
4. Which filter and sorting fields will be supported by default?
|
|
288
|
+
- Filters: [id, name, date, etc.]
|
|
289
|
+
- Sorting: [field, asc/desc]
|
|
290
|
+
|
|
291
|
+
5. How will filters be passed for GET list endpoints?
|
|
292
|
+
A) β Query parameters (recommended for simple filters)
|
|
293
|
+
Example: GET /users?name=John&status=active&page=1&limit=10
|
|
294
|
+
|
|
295
|
+
B) POST /search endpoint with body (for complex filters)
|
|
296
|
+
Example: POST /users/search
|
|
297
|
+
Body: { "filters": { "name": "John", "status": "active" }, "page": 1, "limit": 10 }
|
|
298
|
+
|
|
299
|
+
C) Both (query params for simple, POST /search for complex)
|
|
300
|
+
|
|
301
|
+
6. For POST/PUT/PATCH endpoints, will you use DTOs for request validation?
|
|
302
|
+
A) β Yes, strict DTOs with validation (recommended)
|
|
303
|
+
B) Accept raw JSON without strict schema
|
|
304
|
+
|
|
305
|
+
If yes, validation library: [from Phase 3.6 - class-validator, Zod, Pydantic, Joi]
|
|
306
|
+
|
|
307
|
+
**C) Error and Response Structure**
|
|
308
|
+
7. What error response format will be used?
|
|
309
|
+
A) Standard JSON:
|
|
310
|
+
```json
|
|
311
|
+
{
|
|
312
|
+
"error": "Descriptive message",
|
|
313
|
+
"code": 400,
|
|
314
|
+
"details": {}
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
B) Other (specify)
|
|
319
|
+
|
|
320
|
+
8. Which fields will be included in the default successful response?
|
|
321
|
+
- data, meta (pagination), links, etc.
|
|
322
|
+
|
|
323
|
+
**D) Relationships and Expansions**
|
|
324
|
+
9. Allow expanding relationships (include/expand)?
|
|
325
|
+
A) β Yes, support `include` parameter (recommended)
|
|
326
|
+
B) No, flat data only
|
|
327
|
+
|
|
328
|
+
**E) Custom Endpoint Example**
|
|
329
|
+
10. If you want to customize an endpoint (e.g., add special logic, validations, or unique parameters), describe the case here:
|
|
330
|
+
|
|
331
|
+
- [Brief description, example endpoint, parameters, special logic]
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
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
|
+
````
|
|
337
|
+
|
|
338
|
+
**3.6 Key Dependencies**
|
|
339
|
+
|
|
340
|
+
```
|
|
341
|
+
What major libraries/tools will you use?
|
|
342
|
+
|
|
343
|
+
ORM/Database:
|
|
344
|
+
A) TypeORM (Node.js)
|
|
345
|
+
B) Prisma (Node.js) β
|
|
346
|
+
C) Sequelize (Node.js)
|
|
347
|
+
D) SQLAlchemy (Python)
|
|
348
|
+
E) Hibernate (Java)
|
|
349
|
+
F) Other: __
|
|
350
|
+
|
|
351
|
+
Validation:
|
|
352
|
+
A) class-validator + class-transformer (NestJS) β
|
|
353
|
+
B) Joi (Node.js)
|
|
354
|
+
C) Zod (TypeScript)
|
|
355
|
+
D) Pydantic (Python) β
|
|
356
|
+
E) Yup (JavaScript)
|
|
357
|
+
|
|
358
|
+
Authentication:
|
|
359
|
+
A) Passport.js (Node.js) π₯
|
|
360
|
+
B) JWT libraries
|
|
361
|
+
C) Auth0/Clerk/Supabase Auth (External service)
|
|
362
|
+
D) Framework built-in
|
|
363
|
+
|
|
364
|
+
Other critical libraries:
|
|
365
|
+
-
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**3.7 Caching Strategy**
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
Will you use caching?
|
|
372
|
+
|
|
373
|
+
A) β Redis - Recommended (in-memory, fast, pub/sub)
|
|
374
|
+
B) Memcached - Simple key-value cache
|
|
375
|
+
C) Application-level - In-process caching (node-cache, etc.)
|
|
376
|
+
D) Database query cache
|
|
377
|
+
E) No caching (simple projects)
|
|
378
|
+
|
|
379
|
+
If using cache:
|
|
380
|
+
- What will be cached? (sessions, query results, computed data)
|
|
381
|
+
- Cache invalidation strategy? (TTL, manual, event-driven)
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**3.8 Background Jobs**
|
|
385
|
+
|
|
386
|
+
```
|
|
387
|
+
Do you need background/async jobs?
|
|
388
|
+
|
|
389
|
+
A) β Yes - Using queue system (Bull, BullMQ, Celery, Sidekiq)
|
|
390
|
+
B) Yes - Using cron jobs
|
|
391
|
+
C) Yes - Using serverless functions (Lambda, Cloud Functions)
|
|
392
|
+
D) No - All operations are synchronous
|
|
393
|
+
|
|
394
|
+
If yes, common job types:
|
|
395
|
+
- Email sending
|
|
396
|
+
- Report generation
|
|
397
|
+
- Data processing
|
|
398
|
+
- External API calls
|
|
399
|
+
- Cleanup tasks
|
|
400
|
+
- Other: __
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**3.9 File Storage**
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
How will you handle file uploads?
|
|
407
|
+
|
|
408
|
+
A) β Cloud storage - S3, Google Cloud Storage, Azure Blob β
|
|
409
|
+
B) Local filesystem - Storing on server disk
|
|
410
|
+
C) Database - Storing binary data in DB (not recommended for large files)
|
|
411
|
+
D) CDN - Cloudflare, CloudFront, etc.
|
|
412
|
+
E) Not needed
|
|
413
|
+
|
|
414
|
+
If storing files:
|
|
415
|
+
- File types: [images, PDFs, videos, documents, etc.]
|
|
416
|
+
- Max file size: __ MB
|
|
417
|
+
- Storage quota estimate: __ GB
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
**3.10 API Gateway**
|
|
421
|
+
|
|
422
|
+
```
|
|
423
|
+
Will you use an API Gateway?
|
|
424
|
+
|
|
425
|
+
A) β Yes - Using API Gateway (Kong, AWS API Gateway, Azure API Management, etc.)
|
|
426
|
+
B) No - Direct API access
|
|
427
|
+
|
|
428
|
+
If yes:
|
|
429
|
+
- Gateway: __
|
|
430
|
+
- Purpose: [Rate limiting, Authentication, Request routing, Load balancing, etc.]
|
|
431
|
+
- Routes: __
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**3.11 Real-time Communication**
|
|
435
|
+
|
|
436
|
+
```
|
|
437
|
+
Do you need real-time communication?
|
|
438
|
+
|
|
439
|
+
A) β WebSockets - Bidirectional communication (chat, notifications, live updates)
|
|
440
|
+
B) Server-Sent Events (SSE) - Server-to-client streaming (live feeds, updates)
|
|
441
|
+
C) Both - Different use cases
|
|
442
|
+
D) No - Standard HTTP requests only
|
|
443
|
+
|
|
444
|
+
If WebSockets or SSE:
|
|
445
|
+
- Use cases: __
|
|
446
|
+
- Library: __
|
|
447
|
+
- Authentication: __
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**3.12 Message Broker Details** (if using background jobs from 3.8)
|
|
451
|
+
|
|
452
|
+
```
|
|
453
|
+
What message broker will you use?
|
|
454
|
+
|
|
455
|
+
A) β RabbitMQ - Popular, reliable, feature-rich
|
|
456
|
+
B) π₯ Apache Kafka - High throughput, event streaming
|
|
457
|
+
C) β‘ AWS SQS - Managed, serverless
|
|
458
|
+
D) Google Pub/Sub - Managed, scalable
|
|
459
|
+
E) Redis Streams - Simple, fast
|
|
460
|
+
F) Other: __
|
|
461
|
+
|
|
462
|
+
Message patterns:
|
|
463
|
+
A) β Queue - Point-to-point messaging
|
|
464
|
+
B) Pub/Sub - Publish-subscribe pattern
|
|
465
|
+
C) Both - Different use cases
|
|
466
|
+
|
|
467
|
+
Delivery guarantees:
|
|
468
|
+
A) β At-least-once - Messages delivered at least once (may have duplicates)
|
|
469
|
+
B) Exactly-once - Messages delivered exactly once (more complex)
|
|
470
|
+
C) At-most-once - Messages may be lost (rarely used)
|
|
471
|
+
|
|
472
|
+
Dead letter queue:
|
|
473
|
+
A) β Yes - Handle failed messages
|
|
474
|
+
B) No
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
**3.13 API Documentation**
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
How will you document your API?
|
|
481
|
+
|
|
482
|
+
A) β Swagger/OpenAPI - Auto-generated from code (code-first)
|
|
483
|
+
- Tool: [@nestjs/swagger, FastAPI docs, Swagger UI, etc.]
|
|
484
|
+
- Endpoint: /api-docs or /swagger
|
|
485
|
+
|
|
486
|
+
B) π OpenAPI Spec - Write spec first, generate code (design-first)
|
|
487
|
+
- File: openapi.yaml
|
|
488
|
+
- Tool: [OpenAPI Generator, etc.]
|
|
489
|
+
|
|
490
|
+
C) Manual - Markdown documentation
|
|
491
|
+
- Not recommended (hard to keep in sync)
|
|
492
|
+
|
|
493
|
+
Your choice: __
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
**3.14 Service Mesh** (if microservices architecture)
|
|
497
|
+
|
|
498
|
+
```
|
|
499
|
+
Will you use a Service Mesh?
|
|
500
|
+
|
|
501
|
+
A) β Yes - Using Service Mesh (Istio, Linkerd, Consul Connect)
|
|
502
|
+
B) No - Not needed (monolith or simple microservices)
|
|
503
|
+
|
|
504
|
+
If yes:
|
|
505
|
+
- Mesh: __
|
|
506
|
+
- Features: [Service discovery, Load balancing, mTLS, Observability]
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
**3.15 External Integrations**
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
Will you integrate with external services?
|
|
513
|
+
|
|
514
|
+
Select all that apply:
|
|
515
|
+
|
|
516
|
+
π³ Payment Providers:
|
|
517
|
+
β‘ Stripe - Credit cards, subscriptions β
|
|
518
|
+
β‘ PayPal - Popular payment method
|
|
519
|
+
β‘ Square - POS and online payments
|
|
520
|
+
β‘ Mercado Pago - Latin America
|
|
521
|
+
β‘ Other: __
|
|
522
|
+
|
|
523
|
+
π§ Email Services:
|
|
524
|
+
β‘ AWS SES - Cost-effective, scalable β
|
|
525
|
+
β‘ SendGrid - Feature-rich, analytics
|
|
526
|
+
β‘ Mailgun - Developer-friendly
|
|
527
|
+
β‘ Postmark - Transactional focus
|
|
528
|
+
β‘ Resend - Modern, simple API β‘
|
|
529
|
+
β‘ Other: __
|
|
530
|
+
|
|
531
|
+
π± SMS/Messaging:
|
|
532
|
+
β‘ Twilio - SMS, WhatsApp, voice β
|
|
533
|
+
β‘ AWS SNS - Simple notifications
|
|
534
|
+
β‘ MessageBird - Multi-channel
|
|
535
|
+
β‘ Other: __
|
|
536
|
+
|
|
537
|
+
βοΈ Cloud Storage:
|
|
538
|
+
β‘ AWS S3 - Object storage standard β
|
|
539
|
+
β‘ Google Cloud Storage
|
|
540
|
+
β‘ Azure Blob Storage
|
|
541
|
+
β‘ Cloudflare R2 - S3-compatible, no egress fees β‘
|
|
542
|
+
β‘ Other: __
|
|
543
|
+
|
|
544
|
+
π Analytics:
|
|
545
|
+
β‘ Google Analytics - Web analytics
|
|
546
|
+
β‘ Mixpanel - Product analytics β
|
|
547
|
+
β‘ Segment - Data pipeline
|
|
548
|
+
β‘ PostHog - Open-source analytics β‘
|
|
549
|
+
β‘ Amplitude - Behavioral analytics
|
|
550
|
+
β‘ Other: __
|
|
551
|
+
|
|
552
|
+
π Monitoring/Error Tracking:
|
|
553
|
+
β‘ Sentry - Error tracking β
|
|
554
|
+
β‘ Datadog - Full observability π
|
|
555
|
+
β‘ New Relic - APM
|
|
556
|
+
β‘ LogRocket - Session replay
|
|
557
|
+
β‘ Other: __
|
|
558
|
+
|
|
559
|
+
πΊοΈ Maps/Location:
|
|
560
|
+
β‘ Google Maps API
|
|
561
|
+
β‘ Mapbox
|
|
562
|
+
β‘ OpenStreetMap
|
|
563
|
+
β‘ Other: __
|
|
564
|
+
|
|
565
|
+
π Authentication:
|
|
566
|
+
β‘ Auth0 - Identity platform π
|
|
567
|
+
β‘ Clerk - Modern auth β‘
|
|
568
|
+
β‘ Supabase Auth - Open-source
|
|
569
|
+
β‘ Firebase Auth - Google ecosystem
|
|
570
|
+
β‘ Other: __
|
|
571
|
+
|
|
572
|
+
π€ AI/ML Services:
|
|
573
|
+
β‘ OpenAI API - GPT models
|
|
574
|
+
β‘ Anthropic Claude - AI assistant
|
|
575
|
+
β‘ Google Gemini - Multimodal AI
|
|
576
|
+
β‘ AWS Bedrock - Managed AI
|
|
577
|
+
β‘ Other: __
|
|
578
|
+
|
|
579
|
+
π Communication:
|
|
580
|
+
β‘ Slack - Team notifications
|
|
581
|
+
β‘ Discord - Community integration
|
|
582
|
+
β‘ Webhooks - Custom integrations
|
|
583
|
+
β‘ Other: __
|
|
584
|
+
|
|
585
|
+
π Other Integrations:
|
|
586
|
+
β‘ GitHub/GitLab API
|
|
587
|
+
β‘ Calendar (Google/Outlook)
|
|
588
|
+
β‘ CRM (Salesforce, HubSpot)
|
|
589
|
+
β‘ Accounting (QuickBooks, Xero)
|
|
590
|
+
β‘ Other: __
|
|
591
|
+
|
|
592
|
+
---
|
|
593
|
+
|
|
594
|
+
For each selected, briefly describe the use case:
|
|
595
|
+
|
|
596
|
+
Example:
|
|
597
|
+
- Stripe: Process credit card payments for subscriptions
|
|
598
|
+
- AWS SES: Send transactional emails (order confirmations, password resets)
|
|
599
|
+
- Sentry: Track and alert on production errors
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
### Phase 3 Output
|
|
603
|
+
|
|
604
|
+
```
|
|
605
|
+
π PHASE 3 SUMMARY:
|
|
606
|
+
|
|
607
|
+
Framework: [name + version]
|
|
608
|
+
Language: [name + version]
|
|
609
|
+
Architecture: [pattern]
|
|
610
|
+
API Style: [REST/GraphQL/gRPC]
|
|
611
|
+
API Versioning: [strategy]
|
|
612
|
+
API Conventions: [auth, pagination, error format, expansions]
|
|
613
|
+
API Gateway: [yes/no + tool + purpose]
|
|
614
|
+
Real-time Communication: [WebSockets/SSE/none + use cases]
|
|
615
|
+
Message Broker: [tool + patterns + delivery guarantees]
|
|
616
|
+
API Documentation: [Swagger/OpenAPI/manual + strategy]
|
|
617
|
+
Service Mesh: [yes/no + tool if applicable]
|
|
618
|
+
Database: [from Phase 2]
|
|
619
|
+
ORM: [name]
|
|
620
|
+
Validation: [library]
|
|
621
|
+
Auth: [method]
|
|
622
|
+
Caching: [strategy]
|
|
623
|
+
Background Jobs: [yes/no + method]
|
|
624
|
+
File Storage: [strategy]
|
|
625
|
+
External Services: [list with use cases]
|
|
626
|
+
|
|
627
|
+
Is this correct? (Yes/No)
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
### π Generate Phase 3 Documents
|
|
633
|
+
|
|
634
|
+
**Before starting generation:**
|
|
635
|
+
|
|
636
|
+
```
|
|
637
|
+
π Loading context from previous phases...
|
|
638
|
+
β
Re-reading project-brief.md
|
|
639
|
+
β
Re-reading docs/data-model.md
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Once confirmed, generate:
|
|
643
|
+
|
|
644
|
+
**1. `docs/architecture.md`**
|
|
645
|
+
|
|
646
|
+
- Use template: `.ai-flow/templates/docs/architecture.template.md`
|
|
647
|
+
- Fill with system architecture, patterns, tech stack
|
|
648
|
+
- Include architecture diagram (mermaid format)
|
|
649
|
+
|
|
650
|
+
**2. `ai-instructions.md`**
|
|
651
|
+
|
|
652
|
+
- Use template: `.ai-flow/templates/ai-instructions.template.md`
|
|
653
|
+
- Fill with tech stack, framework, language, key dependencies
|
|
654
|
+
- Include NEVER/ALWAYS rules specific to chosen stack
|
|
655
|
+
- Generate idiomatic code examples for Controller, Service, Repository, DTO and Module placeholders, strictly following the selected Architecture Pattern (e.g., if Hexagonal, show Ports & Adapters).
|
|
656
|
+
|
|
657
|
+
```
|
|
658
|
+
β
Generated: docs/architecture.md
|
|
659
|
+
β
Generated: ai-instructions.md
|
|
660
|
+
|
|
661
|
+
π Please review these documents. Do you need to make any corrections?
|
|
662
|
+
|
|
663
|
+
A) β
Look perfect, continue to Phase 4
|
|
664
|
+
B) π I'll edit them now (I'll wait)
|
|
665
|
+
C) π Regenerate with changes (tell me what to modify)
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
**If user selects B:**
|
|
669
|
+
|
|
670
|
+
```
|
|
671
|
+
Perfect. Please edit the documents and type "ready" when you're done.
|
|
672
|
+
I'll re-read all files to update my context before continuing.
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
Then execute: `read_file()` for both documents to refresh context.
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
**Proceed to Phase 4 only after documents are validated.**
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## PHASE 4: Security & Authentication (15-20 min)
|
|
684
|
+
|