ai-flow-dev 1.2.0 → 1.4.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 +14 -8
- package/dist/cli.js +16 -7
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/prompts/backend/flow-bootstrap-phase-8.md +290 -34
- package/prompts/backend/flow-bootstrap-phase-9.md +441 -58
- package/prompts/backend/flow-bootstrap.md +108 -107
- package/prompts/backend/flow-dev-feature.md +447 -68
- package/prompts/backend/flow-dev-fix.md +81 -8
- package/templates/{shared/AGENT.template.md → AGENT.template.md} +1 -1
- package/templates/mobile/AGENT.template.md +0 -251
|
@@ -99,9 +99,22 @@ Ask these 6 questions one by one with progress indicator:
|
|
|
99
99
|
|
|
100
100
|
- What are the top 3 measurable objectives for this project?
|
|
101
101
|
|
|
102
|
-
4. **System Type**
|
|
102
|
+
4. **System Type** (Critical for auto-suggestions)
|
|
103
103
|
|
|
104
|
-
- What type of system are you building?
|
|
104
|
+
- What type of system are you building?
|
|
105
|
+
|
|
106
|
+
**Options:**
|
|
107
|
+
|
|
108
|
+
- A) E-commerce (Product catalog, cart, checkout)
|
|
109
|
+
- B) SaaS (Multi-tenant, subscriptions, RBAC)
|
|
110
|
+
- C) CRM (Contacts, leads, sales pipeline)
|
|
111
|
+
- D) Social Network (Users, posts, feeds, messaging)
|
|
112
|
+
- E) Content Management (Articles, media, publishing)
|
|
113
|
+
- F) Project Management (Projects, tasks, boards)
|
|
114
|
+
- G) API Platform (API keys, rate limiting, webhooks)
|
|
115
|
+
- H) Marketplace (Buyers, sellers, listings)
|
|
116
|
+
- I) IoT Platform (Devices, sensors, commands)
|
|
117
|
+
- J) Other (will use generic defaults)
|
|
105
118
|
|
|
106
119
|
5. **Core Data Entities** (if new project - skip if Phase 0 detected)
|
|
107
120
|
|
|
@@ -110,81 +123,94 @@ Ask these 6 questions one by one with progress indicator:
|
|
|
110
123
|
6. **Backend Framework** (if new project - skip if Phase 0 detected)
|
|
111
124
|
- Which backend framework will you use? (NestJS/FastAPI/Spring Boot/etc.)
|
|
112
125
|
|
|
113
|
-
### Step 2: Auto-Generate Suggestions
|
|
126
|
+
### Step 2: Auto-Generate Intelligent Suggestions
|
|
114
127
|
|
|
115
|
-
Based on the 6 critical answers, automatically
|
|
128
|
+
Based on the 6 critical answers, automatically generate comprehensive suggestions using AI reasoning.
|
|
116
129
|
|
|
117
|
-
**
|
|
130
|
+
**Suggestion Logic:**
|
|
118
131
|
|
|
119
|
-
|
|
120
|
-
// Phase 1 (Business) - Auto-suggest based on system type
|
|
121
|
-
IF system_type == "E-commerce":
|
|
122
|
-
target_users = "B2C + Mobile/Web apps"
|
|
123
|
-
core_features = ["Authentication", "Product catalog", "Shopping cart", "Checkout", "Order management"]
|
|
132
|
+
For each phase, suggest defaults based on:
|
|
124
133
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
- **System Type** - E-commerce needs cart/checkout, SaaS needs multi-tenancy, etc.
|
|
135
|
+
- **Framework** - NestJS → Prisma, FastAPI → SQLAlchemy, Django → Django ORM
|
|
136
|
+
- **Scope** - MVP → simple setup, Production → robust setup, Enterprise → full observability
|
|
128
137
|
|
|
129
|
-
|
|
130
|
-
database = "PostgreSQL" (default for most projects)
|
|
131
|
-
orm = MATCH framework:
|
|
132
|
-
NestJS → "Prisma"
|
|
133
|
-
FastAPI → "SQLAlchemy"
|
|
134
|
-
Spring Boot → "Hibernate/JPA"
|
|
138
|
+
**What Gets Auto-Generated:**
|
|
135
139
|
|
|
136
|
-
|
|
137
|
-
api_style = "REST" (standard)
|
|
138
|
-
architecture_pattern = "Clean Architecture" (modular, testable)
|
|
140
|
+
**Phase 1 (Business):**
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
password_policy = "8+ chars, bcrypt 12 rounds"
|
|
142
|
+
- ✅ Target users based on system type
|
|
143
|
+
- ✅ Core features typical for the system type
|
|
144
|
+
- ✅ Success metrics appropriate for the domain
|
|
144
145
|
|
|
145
|
-
|
|
146
|
-
formatter = MATCH framework:
|
|
147
|
-
NestJS/Node.js → "Prettier + ESLint"
|
|
148
|
-
Python → "Black + pylint"
|
|
149
|
-
Java → "Spotless + Checkstyle"
|
|
146
|
+
**Phase 2 (Data):**
|
|
150
147
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
ELSE:
|
|
156
|
-
coverage_target = "60-80%"
|
|
157
|
-
test_types = ["Unit (70%)", "Integration (20%)", "E2E (10%)"]
|
|
148
|
+
- ✅ Database: PostgreSQL (most common)
|
|
149
|
+
- ✅ ORM: Match framework idiomatically
|
|
150
|
+
- ✅ Caching: Redis for Production/Enterprise
|
|
151
|
+
- ✅ Search: Elasticsearch only for Enterprise
|
|
158
152
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
153
|
+
**Phase 3 (Architecture):**
|
|
154
|
+
|
|
155
|
+
- ✅ Pattern: Monolith (MVP) → Clean Architecture (Production) → Microservices (Enterprise)
|
|
156
|
+
- ✅ API: REST only (MVP) → REST + GraphQL (Production) → + gRPC (Enterprise)
|
|
157
|
+
- ✅ Scaling strategy based on scope
|
|
158
|
+
|
|
159
|
+
**Phase 4 (Security):**
|
|
160
|
+
|
|
161
|
+
- ✅ Auth: JWT for MVP/Production, OAuth2 + SSO for Enterprise
|
|
162
|
+
- ✅ Authorization: RBAC standard, ABAC for Enterprise
|
|
163
|
+
- ✅ Password policies per scope
|
|
164
|
+
- ✅ Rate limiting and CORS enabled
|
|
165
|
+
|
|
166
|
+
**Phase 5 (Code Standards):**
|
|
167
|
+
|
|
168
|
+
- ✅ Formatter/Linter matching framework (Prettier+ESLint, Black+pylint, etc.)
|
|
169
|
+
- ✅ Git workflow: GitHub Flow (MVP), Git Flow (Production)
|
|
170
|
+
- ✅ Conventional Commits
|
|
171
|
+
|
|
172
|
+
**Phase 6 (Testing):**
|
|
173
|
+
|
|
174
|
+
- ✅ Framework matching tech stack
|
|
175
|
+
- ✅ Coverage: 20% (MVP), 70% (Production), 85% (Enterprise)
|
|
176
|
+
- ✅ Test types distribution
|
|
177
|
+
|
|
178
|
+
**Phase 7 (Operations):**
|
|
179
|
+
|
|
180
|
+
- ✅ Deployment: PaaS (MVP), Cloud (Production), Multi-region (Enterprise)
|
|
181
|
+
- ✅ CI/CD: GitHub Actions
|
|
182
|
+
- ✅ Monitoring: Basic (MVP), APM (Production), Full observability (Enterprise)
|
|
167
183
|
|
|
168
184
|
### Step 3: Present Summary for Review
|
|
169
185
|
|
|
170
|
-
After auto-generating all suggestions, present a
|
|
186
|
+
After auto-generating all suggestions, present a clear summary:
|
|
171
187
|
|
|
172
|
-
#### **Quick Summary (1 paragraph
|
|
188
|
+
#### **Quick Summary (1 paragraph)**
|
|
173
189
|
|
|
174
190
|
```
|
|
175
191
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
176
192
|
✅ Configuration Complete - Quick Summary
|
|
177
193
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
178
194
|
|
|
179
|
-
Your [System Type] backend will use [Framework] with [Database], following
|
|
195
|
+
Your [System Type] backend will use [Framework] with [Database], following
|
|
196
|
+
[Architecture Pattern] with [X] entities ([entity names]). Security includes
|
|
197
|
+
[Auth Method] with [Authorization], [Password Policy]. Code follows
|
|
198
|
+
[Formatter] + [Linter], targeting [Coverage Target] test coverage. Deployment
|
|
199
|
+
to [Deployment Platform] with [Monitoring] for production readiness.
|
|
180
200
|
|
|
181
201
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
182
202
|
```
|
|
183
203
|
|
|
184
|
-
**Example:**
|
|
204
|
+
**Example (E-commerce + NestJS + Production):**
|
|
185
205
|
|
|
186
206
|
```
|
|
187
|
-
Your E-commerce backend will use NestJS
|
|
207
|
+
Your E-commerce backend will use NestJS with PostgreSQL, following Clean
|
|
208
|
+
Architecture with 8 entities (User, Product, Category, Cart, Order, Payment,
|
|
209
|
+
Address, Review). Security includes JWT + Refresh Tokens with RBAC,
|
|
210
|
+
12+ characters bcrypt 12 rounds. Code follows Prettier + ESLint +
|
|
211
|
+
@typescript-eslint, targeting 70% test coverage. Deployment to Cloud
|
|
212
|
+
(AWS/GCP/Azure) with APM (Datadog/New Relic) + Sentry for production
|
|
213
|
+
readiness.
|
|
188
214
|
```
|
|
189
215
|
|
|
190
216
|
#### **Extended Report (Organized by Phase)**
|
|
@@ -195,67 +221,43 @@ Your E-commerce backend will use NestJS (TypeScript) with PostgreSQL and Prisma,
|
|
|
195
221
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
196
222
|
|
|
197
223
|
**Phase 1: Business & Discovery**
|
|
198
|
-
• System Type: [
|
|
199
|
-
• Target Users:
|
|
200
|
-
• Core Features:
|
|
201
|
-
•
|
|
202
|
-
• Constraints: Time (MVP by Q2 2025)
|
|
203
|
-
• Success Metrics: 1k→10k users, <200ms response, 99% uptime
|
|
224
|
+
• System Type: [From user input]
|
|
225
|
+
• Target Users: [AI-suggested based on system type]
|
|
226
|
+
• Core Features: [AI-suggested based on system type]
|
|
227
|
+
• Success Metrics: [AI-suggested based on system type]
|
|
204
228
|
|
|
205
229
|
**Phase 2: Data Architecture**
|
|
206
|
-
• Database:
|
|
207
|
-
• ORM:
|
|
208
|
-
•
|
|
209
|
-
•
|
|
210
|
-
• Data Volume: Low (<10k records), Moderate growth, Low complexity (text-based)
|
|
211
|
-
• Retention: Keep forever (no auto-deletion)
|
|
230
|
+
• Database: [AI-suggested from scope]
|
|
231
|
+
• ORM: [AI-suggested from framework]
|
|
232
|
+
• Caching: [AI-suggested from scope]
|
|
233
|
+
• Core Entities: [From user input]
|
|
212
234
|
|
|
213
235
|
**Phase 3: System Architecture**
|
|
214
|
-
• Framework:
|
|
215
|
-
•
|
|
216
|
-
• API Style:
|
|
217
|
-
•
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
•
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
• Auth Method: JWT (stateless, scalable)
|
|
224
|
-
• Token Config: 15min access, 7d refresh, RS256 algorithm
|
|
225
|
-
• Authorization: RBAC with roles (admin, user, moderator)
|
|
226
|
-
• Password Policy: 8+ chars, uppercase + lowercase + number, bcrypt 12 rounds
|
|
227
|
-
• Rate Limiting: 5/15min (auth), 100/min (read), 30/min (write)
|
|
228
|
-
• CORS: Specific origins (https://myapp.com + localhost:3000 for dev)
|
|
229
|
-
• Encryption: TLS 1.2+ in transit, AES-256 for PII fields at rest
|
|
230
|
-
• Compliance: GDPR (if EU users) - data export, deletion rights
|
|
236
|
+
• Framework: [From user input]
|
|
237
|
+
• Pattern: [AI-suggested from scope]
|
|
238
|
+
• API Style: [AI-suggested from scope]
|
|
239
|
+
• Scaling: [AI-suggested from scope]
|
|
240
|
+
|
|
241
|
+
**Phase 4: Security**
|
|
242
|
+
• Authentication: [AI-suggested from scope]
|
|
243
|
+
• Authorization: [AI-suggested from scope]
|
|
244
|
+
• Password Policy: [AI-suggested from scope]
|
|
231
245
|
|
|
232
246
|
**Phase 5: Code Standards**
|
|
233
|
-
• Formatter:
|
|
234
|
-
•
|
|
235
|
-
•
|
|
236
|
-
• Documentation: JSDoc for public APIs and complex logic
|
|
237
|
-
• Error Handling: Centralized exception handler with custom error classes
|
|
238
|
-
• Logging: Winston with JSON structured logs
|
|
239
|
-
• Git Workflow: Feature branch + PR with 1 reviewer approval
|
|
240
|
-
• Commits: Conventional Commits (feat/fix/docs/chore)
|
|
241
|
-
|
|
242
|
-
**Phase 6: Testing Strategy**
|
|
243
|
-
• Framework: Jest (unit + integration + e2e)
|
|
244
|
-
• Coverage Target: 60-80% overall
|
|
245
|
-
• Test Distribution: 70% unit, 20% integration, 10% e2e
|
|
246
|
-
• Test Database: In-memory SQLite for fast tests
|
|
247
|
-
• Mocking: External APIs, payment gateways, email service
|
|
248
|
-
• CI Integration: GitHub Actions with automated test runs on PR
|
|
249
|
-
|
|
250
|
-
**Phase 7: Operations & Deployment**
|
|
251
|
-
• Platform: Heroku (PaaS for fast MVP deployment)
|
|
252
|
-
• Containerization: Docker + Docker Compose for local dev
|
|
253
|
-
• Environments: Development (local), Staging (Heroku pipeline), Production (Heroku)
|
|
254
|
-
• CI/CD: GitHub Actions (test → build → deploy to staging → manual approval → production)
|
|
255
|
-
• Monitoring: Sentry for error tracking, basic console logs
|
|
256
|
-
• Health Checks: /health endpoint with database connectivity check
|
|
257
|
-
• Backups: Daily automated PostgreSQL backups (Heroku addon)
|
|
247
|
+
• Formatter: [AI-suggested from framework]
|
|
248
|
+
• Linter: [AI-suggested from framework]
|
|
249
|
+
• Git Workflow: [AI-suggested from scope]
|
|
258
250
|
|
|
251
|
+
**Phase 6: Testing**
|
|
252
|
+
• Coverage Target: [AI-suggested from scope]
|
|
253
|
+
• Framework: [AI-suggested from framework]
|
|
254
|
+
|
|
255
|
+
**Phase 7: Operations**
|
|
256
|
+
• Deployment: [AI-suggested from scope]
|
|
257
|
+
• Monitoring: [AI-suggested from scope]
|
|
258
|
+
|
|
259
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
260
|
+
💡 These suggestions can be customized during document review.
|
|
259
261
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
260
262
|
```
|
|
261
263
|
|
|
@@ -289,7 +291,7 @@ Your choice (A/B/C): __
|
|
|
289
291
|
|
|
290
292
|
### Step 5: Generate Documentation
|
|
291
293
|
|
|
292
|
-
Generate all 17 documents using the confirmed values (either
|
|
294
|
+
Generate all 17 documents using the confirmed values (either AI-suggested or user-customized).
|
|
293
295
|
|
|
294
296
|
---
|
|
295
297
|
|
|
@@ -882,4 +884,3 @@ _Version: 4.0 (Phase 9 integrated - Implementation Roadmap with Story Points)_
|
|
|
882
884
|
_Last Updated: 2025-12-09_
|
|
883
885
|
_Version: 3.0 (Unified workflow: Phase 8 integrates project setup + final docs generation)_
|
|
884
886
|
_AI Flow - Transform your idea into production-ready code in minutes_
|
|
885
|
-
|