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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +408 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +791 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/fs-utils.d.ts +2 -0
  8. package/dist/fs-utils.d.ts.map +1 -0
  9. package/dist/fs-utils.js +46 -0
  10. package/dist/fs-utils.js.map +1 -0
  11. package/package.json +71 -0
  12. package/prompts/backend/flow-dev-feature.md +1318 -0
  13. package/prompts/backend/flow-dev-fix.md +903 -0
  14. package/prompts/backend/flow-dev-refactor.md +715 -0
  15. package/prompts/backend/flow-dev-review.md +401 -0
  16. package/prompts/backend/flow-dev-work.md +1129 -0
  17. package/prompts/backend/flow-docs-gen-phase-0.md +1840 -0
  18. package/prompts/backend/flow-docs-gen-phase-1.md +435 -0
  19. package/prompts/backend/flow-docs-gen-phase-2.md +460 -0
  20. package/prompts/backend/flow-docs-gen-phase-3.md +684 -0
  21. package/prompts/backend/flow-docs-gen-phase-4.md +516 -0
  22. package/prompts/backend/flow-docs-gen-phase-5.md +637 -0
  23. package/prompts/backend/flow-docs-gen-phase-6.md +465 -0
  24. package/prompts/backend/flow-docs-gen-phase-7.md +1207 -0
  25. package/prompts/backend/flow-docs-gen.md +820 -0
  26. package/prompts/backend/flow-docs-sync.md +526 -0
  27. package/prompts/backend/flow-project-init.md +248 -0
  28. package/prompts/backend/flow-project-roadmap.md +1159 -0
  29. package/prompts/frontend/flow-docs-gen-phase-0.md +494 -0
  30. package/prompts/frontend/flow-docs-gen-phase-1.md +449 -0
  31. package/prompts/frontend/flow-docs-gen-phase-2.md +983 -0
  32. package/prompts/frontend/flow-docs-gen-phase-3.md +685 -0
  33. package/prompts/frontend/flow-docs-gen-phase-4.md +480 -0
  34. package/prompts/frontend/flow-docs-gen-phase-5.md +483 -0
  35. package/prompts/frontend/flow-docs-gen-phase-6.md +570 -0
  36. package/prompts/frontend/flow-docs-gen-phase-7.md +582 -0
  37. package/prompts/frontend/flow-docs-gen.md +413 -0
  38. package/prompts/frontend/flow-docs-sync.md +561 -0
  39. package/prompts/mobile/flow-docs-gen-phase-0.md +387 -0
  40. package/prompts/mobile/flow-docs-gen-phase-1.md +530 -0
  41. package/prompts/mobile/flow-docs-gen-phase-2.md +584 -0
  42. package/prompts/mobile/flow-docs-gen-phase-3.md +659 -0
  43. package/prompts/mobile/flow-docs-gen-phase-4.md +363 -0
  44. package/prompts/mobile/flow-docs-gen-phase-5.md +369 -0
  45. package/prompts/mobile/flow-docs-gen-phase-6.md +490 -0
  46. package/prompts/mobile/flow-docs-gen-phase-7.md +407 -0
  47. package/prompts/mobile/flow-docs-gen.md +430 -0
  48. package/prompts/mobile/flow-docs-sync.md +634 -0
  49. package/templates/backend/.clauderules.template +111 -0
  50. package/templates/backend/.cursorrules.template +102 -0
  51. package/templates/backend/.env.example.template +122 -0
  52. package/templates/backend/README.template.md +200 -0
  53. package/templates/backend/ai-instructions.template.md +354 -0
  54. package/templates/backend/copilot-instructions.template.md +160 -0
  55. package/templates/backend/docs/api.template.md +251 -0
  56. package/templates/backend/docs/architecture.template.md +612 -0
  57. package/templates/backend/docs/business-flows.template.md +109 -0
  58. package/templates/backend/docs/code-standards.template.md +828 -0
  59. package/templates/backend/docs/contributing.template.md +163 -0
  60. package/templates/backend/docs/data-model.template.md +416 -0
  61. package/templates/backend/docs/operations.template.md +591 -0
  62. package/templates/backend/docs/testing.template.md +762 -0
  63. package/templates/backend/project-brief.template.md +176 -0
  64. package/templates/backend/specs/configuration.template.md +133 -0
  65. package/templates/backend/specs/security.template.md +422 -0
  66. package/templates/frontend/README.template.md +121 -0
  67. package/templates/frontend/ai-instructions.template.md +368 -0
  68. package/templates/frontend/docs/api-integration.template.md +390 -0
  69. package/templates/frontend/docs/components.template.md +567 -0
  70. package/templates/frontend/docs/error-handling.template.md +385 -0
  71. package/templates/frontend/docs/operations.template.md +123 -0
  72. package/templates/frontend/docs/performance.template.md +140 -0
  73. package/templates/frontend/docs/pwa.template.md +135 -0
  74. package/templates/frontend/docs/state-management.template.md +394 -0
  75. package/templates/frontend/docs/styling.template.md +779 -0
  76. package/templates/frontend/docs/testing.template.md +736 -0
  77. package/templates/frontend/project-brief.template.md +55 -0
  78. package/templates/frontend/specs/accessibility.template.md +111 -0
  79. package/templates/frontend/specs/configuration.template.md +520 -0
  80. package/templates/frontend/specs/security.template.md +197 -0
  81. package/templates/fullstack/README.template.md +282 -0
  82. package/templates/fullstack/ai-instructions.template.md +487 -0
  83. package/templates/fullstack/project-brief.template.md +197 -0
  84. package/templates/fullstack/specs/configuration.template.md +380 -0
  85. package/templates/mobile/AGENT.template.md +251 -0
  86. package/templates/mobile/README.template.md +195 -0
  87. package/templates/mobile/ai-instructions.template.md +221 -0
  88. package/templates/mobile/docs/app-store.template.md +163 -0
  89. package/templates/mobile/docs/architecture.template.md +100 -0
  90. package/templates/mobile/docs/native-features.template.md +137 -0
  91. package/templates/mobile/docs/navigation.template.md +81 -0
  92. package/templates/mobile/docs/offline-strategy.template.md +90 -0
  93. package/templates/mobile/docs/permissions.template.md +70 -0
  94. package/templates/mobile/docs/state-management.template.md +116 -0
  95. package/templates/mobile/docs/testing.template.md +146 -0
  96. package/templates/mobile/project-brief.template.md +97 -0
  97. package/templates/mobile/specs/build-configuration.template.md +116 -0
  98. package/templates/mobile/specs/deployment.template.md +114 -0
  99. package/templates/shared/AGENT.template.md +252 -0
@@ -0,0 +1,465 @@
1
+ ## PHASE 6: Testing Strategy (15-25 min)
2
+
3
+ > **Order for this phase:**
4
+ >
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
8
+
9
+ > **📌 Scope-based behavior:**
10
+ >
11
+ > - **MVP:** Ask 6.1 (framework), 6.2 (smoke tests only), 6.7 (CI basics) - **Target: 15-25% coverage**
12
+ > - **Production-Ready:** Ask all questions 6.1-6.7 - **Target: 60-80% coverage**
13
+ > - **Enterprise:** Ask all questions 6.1-6.9 - **Target: 80-95% coverage + contract/load tests**
14
+
15
+ ### Objective
16
+
17
+ Define testing approach, tools, and quality gates.
18
+
19
+ **🚨 Important: All projects require basic testing. Scope determines depth, not whether to test.**
20
+
21
+ **6.1 Testing Framework**
22
+
23
+ ```
24
+
25
+ Which testing tools will you use?
26
+
27
+ JavaScript/TypeScript:
28
+ A) ⭐ Jest - Most popular, great ecosystem
29
+ B) Vitest - Modern, fast, Vite-compatible
30
+ C) Mocha + Chai
31
+ D) AVA
32
+
33
+ Python:
34
+ E) ⭐ pytest - Modern, feature-rich
35
+ F) unittest - Built-in
36
+ G) nose2
37
+
38
+ Java:
39
+ H) ⭐ JUnit 5 + Mockito
40
+ I) TestNG
41
+
42
+ Your choice: \_\_
43
+
44
+ Assertion library: **
45
+ Mocking library: **
46
+
47
+ ```
48
+
49
+ **6.2 Test Types**
50
+
51
+ ```
52
+ [If MVP scope selected, ask simplified version:]
53
+
54
+ For MVP, we'll focus on smoke tests (critical path verification).
55
+ Which critical flows should be tested?
56
+
57
+ Select 3-5 most important endpoints/features:
58
+ A) Authentication (login/register)
59
+ B) Main business operation (e.g., create order, post article)
60
+ C) User profile/account management
61
+ D) Payment processing (if applicable)
62
+ E) Data retrieval (main GET endpoints)
63
+
64
+ Selected: __
65
+
66
+ Test approach: Integration tests covering happy path of selected flows
67
+ Coverage target: 15-25%
68
+ Test type: Integration/E2E only (no unit tests required for MVP)
69
+
70
+ [If Production-Ready or Enterprise scope selected, ask full version:]
71
+
72
+ Which test types will you implement?
73
+
74
+ A) ✅ Unit Tests
75
+ - Test individual functions/methods in isolation
76
+ - Fast, numerous
77
+ - Mock all dependencies
78
+
79
+ B) ✅ Integration Tests
80
+ - Test multiple components together
81
+ - Database, external APIs
82
+ - Slower but more realistic
83
+
84
+ C) ✅ E2E (End-to-End) Tests
85
+ - Test full user flows
86
+ - API endpoints from request to response
87
+ - Tool: Supertest (Node.js), pytest with TestClient (Python)
88
+
89
+ D) 🏆 Contract Tests (Advanced - Enterprise recommended)
90
+ - Verify API contracts between services
91
+ - Tool: Pact, Spring Cloud Contract
92
+
93
+ E) ⚡ Load/Performance Tests (Enterprise recommended)
94
+ - Tool: Artillery, K6, JMeter
95
+
96
+ F) 🔬 Chaos Engineering (Enterprise only)
97
+ - Test system resilience to failures
98
+ - Tool: Chaos Monkey, Litmus, Gremlin
99
+
100
+ Selected: __
101
+
102
+ Pyramid distribution:
103
+ - 70% Unit tests
104
+ - 20% Integration tests
105
+ - 10% E2E tests
106
+ (Adjust as needed)
107
+
108
+ ```
109
+
110
+ **6.3 Test Database** [Skip if MVP scope]
111
+
112
+ ```
113
+ [Production-Ready/Enterprise only]
114
+
115
+ How will you handle database in tests?
116
+
117
+ A) ⭐ In-memory database
118
+ - SQLite for testing, PostgreSQL for prod
119
+ - Fast, isolated
120
+
121
+ B) 🏆 Docker test database
122
+ - Same DB as production
123
+ - More realistic
124
+ - Tool: Testcontainers
125
+
126
+ C) 🔄 Shared test database
127
+ - One DB for all tests
128
+ - Reset between test suites
129
+
130
+ D) 🎭 Mock database
131
+ - Mock all DB calls
132
+ - Fastest, but less realistic
133
+
134
+ Your choice: __
135
+
136
+ Test data strategy:
137
+ A) ⭐ Factories/Fixtures - Generate test data programmatically
138
+ B) Seed files - Load from JSON/SQL files
139
+ C) Inline - Create data in each test
140
+
141
+ ```
142
+
143
+ **6.4 Test Data Management** [Skip if MVP scope]
144
+
145
+ ```
146
+ [Production-Ready/Enterprise only]
147
+
148
+ How will you create test data?
149
+
150
+ A) ⭐ Factory pattern
151
+ - Libraries: factory_boy (Python), Fishery (TypeScript)
152
+ - Generate realistic data on demand
153
+
154
+ B) Fixtures
155
+ - Predefined test data
156
+ - Loaded before tests
157
+
158
+ C) Faker
159
+ - Random realistic data
160
+ - Library: @faker-js/faker, Faker (Python)
161
+
162
+ Your approach: __
163
+
164
+ Example test data needs:
165
+ - Users with various roles
166
+ - Products with different states
167
+ - Orders in different stages
168
+ - Payment records
169
+ - [Add your specific needs]
170
+
171
+ ```
172
+
173
+ **6.5 Mocking Strategy** [Skip if MVP scope]
174
+
175
+ ```
176
+ [Production-Ready/Enterprise only]
177
+
178
+ What will you mock?
179
+
180
+ A) ✅ External APIs - Third-party services
181
+ B) ✅ Database - In unit tests
182
+ C) ✅ File system - S3, local storage
183
+ D) ✅ Time/Date - For deterministic tests
184
+ E) ✅ Email/SMS - Sending services
185
+ F) ✅ Payment gateways
186
+
187
+ Mocking approach:
188
+ A) ⭐ Manual mocks - jest.fn(), unittest.mock
189
+ B) Library - MSW (Mock Service Worker), nock
190
+ C) Test doubles - Stubs, spies, mocks
191
+
192
+ When NOT to mock:
193
+ - Internal business logic
194
+ - Simple utilities
195
+ - Value objects
196
+
197
+ ```
198
+
199
+ **6.6 Test Organization** [Skip if MVP scope]
200
+
201
+ ```
202
+ [Production-Ready/Enterprise only]
203
+
204
+ Test file structure:
205
+
206
+ A) ⭐ Co-located with source
207
+ ```
208
+
209
+ src/
210
+ users/
211
+ user.service.ts
212
+ user.service.spec.ts
213
+
214
+ ```
215
+
216
+ B) Separate test directory
217
+ ```
218
+
219
+ src/users/user.service.ts
220
+ tests/users/user.service.test.ts
221
+
222
+ ````
223
+
224
+ Test naming:
225
+
226
+ ```typescript
227
+ describe('UserService', () => {
228
+ describe('createUser', () => {
229
+ it('should create a new user with valid data', async () => {
230
+ // Arrange
231
+ const userData = { email: 'test@example.com', name: 'Test' };
232
+
233
+ // Act
234
+ const result = await userService.createUser(userData);
235
+
236
+ // Assert
237
+ expect(result).toBeDefined();
238
+ expect(result.email).toBe(userData.email);
239
+ });
240
+
241
+ it('should throw error when email is duplicated', async () => {
242
+ // ...
243
+ });
244
+ });
245
+ });
246
+ ````
247
+
248
+ Naming pattern:
249
+ A) ⭐ "should [expected behavior] when [condition]"
250
+ B) "it [expected behavior]"
251
+ C) Free-form
252
+
253
+ ````
254
+
255
+ **6.6.1 Contract Testing** [If selected in 6.2]
256
+
257
+ ```
258
+ [Production-Ready/Enterprise only]
259
+
260
+ Contract testing tool:
261
+ A) ⭐ Pact - Consumer-driven contracts
262
+ B) Spring Cloud Contract - Provider contracts
263
+ C) Other: __
264
+
265
+ Contract strategy:
266
+ A) ⭐ Consumer-driven - Frontend/consumers define contracts
267
+ B) Provider-driven - Backend defines contracts
268
+ C) Both - Hybrid approach
269
+
270
+ Contract storage:
271
+ A) ⭐ Pact Broker - Centralized contract storage
272
+ B) Git repository - Version contracts in code
273
+ C) Other: __
274
+
275
+ Contract versioning:
276
+ - Strategy: __
277
+ - Breaking changes: __
278
+ ```
279
+
280
+ **6.6.2 Load/Performance Testing** [If selected in 6.2]
281
+
282
+ ```
283
+ [Production-Ready/Enterprise only]
284
+
285
+ Load testing tool:
286
+ A) ⭐ Artillery - Node.js, YAML-based
287
+ B) K6 - Modern, JavaScript-based
288
+ C) JMeter - Java-based, GUI available
289
+ D) Locust - Python-based
290
+ E) Other: __
291
+
292
+ Test scenarios:
293
+ - Normal load: __ requests/second
294
+ - Peak load: __ requests/second
295
+ - Stress test: __ requests/second (beyond capacity)
296
+ - Duration: __ minutes
297
+
298
+ Performance thresholds:
299
+ - Response time p50: < __ ms
300
+ - Response time p95: < __ ms
301
+ - Response time p99: < __ ms
302
+ - Error rate: < __%
303
+ - Throughput: > __ requests/second
304
+
305
+ When to run:
306
+ A) ⭐ Before major releases
307
+ B) Weekly automated runs
308
+ C) On-demand only
309
+ ```
310
+
311
+ **6.6.3 Chaos Engineering** [If selected in 6.2 - Enterprise only]
312
+
313
+ ```
314
+ [Enterprise only]
315
+
316
+ Chaos engineering tool:
317
+ A) ⭐ Chaos Monkey (Netflix)
318
+ B) Litmus (Kubernetes)
319
+ C) Gremlin - Managed chaos platform
320
+ D) Custom scripts
321
+ E) Other: __
322
+
323
+ Chaos experiments to run:
324
+ □ Network latency injection
325
+ □ Service failures
326
+ □ Database connection failures
327
+ □ CPU/memory exhaustion
328
+ □ Disk space issues
329
+ □ Network partition
330
+
331
+ Safety rules:
332
+ - Run only in: [Staging, Production with approval]
333
+ - Blast radius: __% of traffic/instances
334
+ - Auto-rollback: [Yes/No]
335
+ - Approval required: [Yes/No]
336
+ ```
337
+
338
+ **6.7 CI/CD Testing** [All scopes - simplified for MVP]
339
+
340
+ ```
341
+ [If MVP scope:]
342
+ For MVP, we'll set up basic CI to run smoke tests.
343
+
344
+ When will smoke tests run?
345
+ A) ⭐ On pull request (GitHub Actions, GitLab CI) - Recommended
346
+ B) Before deploy only
347
+
348
+ Selected: __
349
+
350
+ Quality gate for MVP:
351
+ - ✅ All smoke tests must pass
352
+ - ⚠️ Coverage tracking (no minimum required)
353
+
354
+ [If Production-Ready or Enterprise scope:]
355
+
356
+ When will tests run?
357
+
358
+ A) ⭐ On every commit (pre-commit hook) - Catch issues early
359
+ B) 🔥 On pull request (GitHub Actions, GitLab CI) - Most popular, prevents broken merges
360
+ C) ⭐ Before deploy (staging pipeline) - Recommended safety check
361
+ D) Nightly (comprehensive test suite) - For slow/extensive tests
362
+
363
+ Selected: __
364
+
365
+ Quality gates:
366
+
367
+ - ✅ All tests must pass
368
+ - ✅ Coverage must be >= __% (15-25% MVP, 60-80% Production, 80-95% Enterprise)
369
+ - ✅ No linting errors
370
+ - ⚡ Performance benchmarks met (optional, Enterprise recommended)
371
+
372
+ Failing a quality gate:
373
+ A) ⭐ Block merge/deploy - Force fix
374
+ B) ⚠️ Warning only - Allow with justification
375
+
376
+ ```
377
+
378
+ ### Phase 6 Output
379
+
380
+ ```
381
+ 📋 PHASE 6 SUMMARY:
382
+
383
+ **If MVP scope (A):**
384
+ Testing Framework: [Jest/pytest/JUnit] (6.1)
385
+ Test Types: Smoke tests on critical paths [selected 3-5 critical flows] (6.2)
386
+ Test Approach: Integration/E2E tests covering happy path only (6.2)
387
+ Coverage Target: 15-25% (6.2)
388
+ CI/CD Testing: [on PR/before deploy] + quality gate: all tests must pass (6.7)
389
+ Status: Basic testing implemented for MVP
390
+
391
+ **If Production-Ready (B):**
392
+ Testing Framework: [Jest/pytest/JUnit + assertion library + mocking library] (6.1)
393
+ Test Types: [unit/integration/e2e - selected types] (6.2)
394
+ Test Distribution: [pyramid percentages: 70/20/10 or custom] (6.2)
395
+ Test Database: [in-memory/Docker/shared/mock + initial data strategy] (6.3)
396
+ Test Data Management: [factories/fixtures/faker approach + specific test data needs] (6.4)
397
+ Mocking Strategy: [what to mock (APIs/DB/files/time/email/payments) + approach] (6.5)
398
+ Test Organization: [co-located/separate folder + naming pattern] (6.6)
399
+ CI/CD Testing: [when tests run (commit/PR/deploy/nightly) + quality gates (pass/60-80% coverage/lint) + gate behavior (block/warn)] (6.7)
400
+ Status: Comprehensive testing strategy implemented
401
+
402
+ **If Enterprise (C):**
403
+ Testing Framework: [Jest/pytest/JUnit + assertion library + mocking library] (6.1)
404
+ Test Types: [unit/integration/e2e/contract/load/chaos - all types] (6.2)
405
+ Test Distribution: [pyramid percentages: 70/20/10 or custom] (6.2)
406
+ Test Database: [in-memory/Docker/shared/mock + initial data strategy] (6.3)
407
+ Test Data Management: [factories/fixtures/faker approach + specific test data needs] (6.4)
408
+ Mocking Strategy: [what to mock (APIs/DB/files/time/email/payments) + approach] (6.5)
409
+ Test Organization: [co-located/separate folder + naming pattern] (6.6)
410
+ Contract Testing: [tool (Pact/Spring Cloud Contract) + strategy + storage + versioning] (6.6.1)
411
+ Load Testing: [tool (Artillery/K6/JMeter) + scenarios + thresholds + schedule] (6.6.2)
412
+ Chaos Engineering: [tool (Chaos Monkey/Litmus/Gremlin) + experiments + safety rules] (6.6.3)
413
+ CI/CD Testing: [when tests run (commit/PR/deploy/nightly) + quality gates (pass/80-95% coverage/lint/performance) + gate behavior (block/warn)] (6.7)
414
+ Status: Exhaustive testing strategy with advanced scenarios
415
+
416
+ Is this correct? (Yes/No)
417
+ ```
418
+
419
+ ---
420
+
421
+ ### 📄 Generate Phase 6 Documents
422
+
423
+ **Before starting generation:**
424
+
425
+ ```
426
+ 📖 Loading context from previous phases...
427
+ ✅ Re-reading docs/code-standards.md
428
+ ✅ Re-reading ai-instructions.md
429
+ ```
430
+
431
+ Once confirmed, generate:
432
+
433
+ **1. `docs/testing.md`**
434
+
435
+ - Use template: `.ai-flow/templates/docs/testing.template.md`
436
+ - **If MVP scope:** Fill with basic testing strategy: framework selection, smoke tests on critical paths, coverage 15-25%, basic CI setup. Mark advanced sections as "Not implemented yet - expand when moving to Production-Ready"
437
+ - **If Production-Ready:** Fill with comprehensive testing strategy: framework, unit/integration/e2e tests, 60-80% coverage, test data management, mocking, full CI/CD
438
+ - **If Enterprise:** Fill with exhaustive testing strategy: all Production-Ready items + contract tests, load tests, security tests, 80-95% coverage, performance benchmarks
439
+
440
+ ```
441
+ ✅ Generated: docs/testing.md
442
+
443
+ 📝 Please review this document. Do you need to make any corrections?
444
+
445
+ A) ✅ Looks perfect, continue to Phase 7
446
+ B) 📝 I'll edit it now (I'll wait)
447
+ C) 🔄 Regenerate with changes (tell me what to modify)
448
+ ```
449
+
450
+ **If user selects B:**
451
+
452
+ ```
453
+ Perfect. Please edit the document and type "ready" when you're done.
454
+ I'll re-read all files to update my context before continuing.
455
+ ```
456
+
457
+ ---
458
+
459
+ **Proceed to Phase 7 only after document is validated.**
460
+
461
+ ---
462
+
463
+ ## PHASE 7: Operations & Deployment (10 min)
464
+ ````
465
+