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,487 @@
1
+ # AI Instructions - Full Stack
2
+
3
+ > **CRITICAL:** Every AI assistant MUST read and follow this document before any work.
4
+
5
+ ---
6
+
7
+ ## 🎯 Project Overview
8
+
9
+ **Name:** {{PROJECT_NAME}}
10
+
11
+ **Description:** {{PROJECT_DESCRIPTION}}
12
+
13
+ **Purpose:** {{PROBLEM_STATEMENT}}
14
+
15
+ **Target Users:** {{TARGET_USERS}}
16
+
17
+ ---
18
+
19
+ ## 🏗️ Tech Stack
20
+
21
+ ### Backend
22
+
23
+ - **Framework:** {{FRAMEWORK}} {{FRAMEWORK_VERSION}}
24
+ - **Language:** {{LANGUAGE}} {{LANGUAGE_VERSION}}
25
+ - **Runtime:** {{RUNTIME_VERSION}}
26
+ - **Type System:** {{TYPE_SYSTEM}}
27
+
28
+ ### Database
29
+
30
+ - **Primary Database:** {{DATABASE}} {{DATABASE_VERSION}}
31
+ - **ORM:** {{ORM}}
32
+ - **Migrations:** {{MIGRATION_TOOL}}
33
+ {{#IF_CACHE}}- **Cache:** {{CACHE_TYPE}}{{/IF_CACHE}}
34
+
35
+ ### Authentication & Security
36
+
37
+ - **Auth Method:** {{AUTH_METHOD}}
38
+ - **Password Hashing:** {{PASSWORD_HASH_ALGORITHM}}
39
+ - **Token Strategy:** {{TOKEN_STRATEGY}}
40
+
41
+ ### Frontend
42
+
43
+ - **UI Framework:** {{UI_FRAMEWORK}} {{UI_FRAMEWORK_VERSION}}
44
+ - **Meta Framework:** {{META_FRAMEWORK}}
45
+ - **Build Tool:** {{BUILD_TOOL}}
46
+ - **Package Manager:** {{PACKAGE_MANAGER}}
47
+
48
+ ### UI & Components
49
+
50
+ - **Component Pattern:** {{COMPONENT_PATTERN}}
51
+ - **Component Library:** {{COMPONENT_LIBRARY}}
52
+ - **Form Management:** {{FORM_LIBRARY}}
53
+ - **Icon System:** {{ICON_SYSTEM}}
54
+
55
+ ### State Management
56
+
57
+ - **State Solution:** {{STATE_MANAGEMENT}}
58
+ - **Data Fetching:** {{DATA_FETCHING}}
59
+ - **Cache Strategy:** {{CACHE_STRATEGY}}
60
+
61
+ ### Styling
62
+
63
+ - **Styling Approach:** {{STYLING_APPROACH}}
64
+ - **CSS Preprocessor:** {{CSS_PREPROCESSOR}}
65
+ - **Design Tokens:** {{DESIGN_TOKENS}}
66
+ - **Theme Support:** {{THEME_SUPPORT}}
67
+
68
+ ### Routing
69
+
70
+ - **Router:** {{ROUTING_LIBRARY}}
71
+ - **Route Strategy:** {{ROUTE_STRATEGY}}
72
+
73
+ ### Testing
74
+
75
+ - **Backend Unit Testing:** {{UNIT_TEST_FRAMEWORK}}
76
+ - **Frontend Unit Testing:** {{UNIT_TEST_FRAMEWORK}}
77
+ - **Component Testing:** {{COMPONENT_TEST_LIBRARY}}
78
+ - **E2E Testing:** {{E2E_FRAMEWORK}}
79
+ - **Coverage Target:** {{TEST_COVERAGE_TARGET}}
80
+
81
+ ### Infrastructure
82
+
83
+ - **Backend Deployment:** {{DEPLOYMENT_PLATFORM}}
84
+ - **Frontend Deployment:** {{FRONTEND_DEPLOYMENT_PLATFORM}}
85
+ - **Containerization:** {{DOCKER_USAGE}}
86
+ - **CI/CD:** {{CICD_PLATFORM}}
87
+ - **CDN:** {{CDN_PROVIDER}}
88
+ - **Analytics:** {{ANALYTICS_TOOL}}
89
+
90
+ ### Key Libraries
91
+
92
+ {{KEY_LIBRARIES}}
93
+
94
+ ---
95
+
96
+ ## 🏛️ Architecture
97
+
98
+ **Backend Pattern:** {{ARCHITECTURE_PATTERN}}
99
+
100
+ {{ARCHITECTURE_DESCRIPTION}}
101
+
102
+ **Frontend Pattern:** {{COMPONENT_PATTERN}}
103
+
104
+ {{FRONTEND_ARCHITECTURE_DESCRIPTION}}
105
+
106
+ **File Organization:** {{FILE_ORGANIZATION}}
107
+
108
+ **Folder Structure:**
109
+ ```
110
+ {{FOLDER_STRUCTURE}}
111
+ ```
112
+
113
+ ---
114
+
115
+ ## ❌ NEVER Rules
116
+
117
+ **YOU MUST NEVER:**
118
+
119
+ ### Code Quality
120
+
121
+ - ❌ Use `any` type ({{#IF_TYPESCRIPT}}TypeScript{{/IF_TYPESCRIPT}}) - Always use proper types
122
+ - ❌ Leave console.log in production code - Use proper logging
123
+ - ❌ Commit commented-out code - Delete it or use git history
124
+ - ❌ Hardcode configuration - Use environment variables
125
+ - ❌ Skip error handling - Always handle errors appropriately
126
+
127
+ ### Security
128
+
129
+ - ❌ Store secrets in code - Use environment variables or secrets manager
130
+ - ❌ Expose sensitive data in logs - Sanitize all logs
131
+ - ❌ Skip input validation - Always validate user input (backend AND frontend)
132
+ - ❌ Trust user input - Sanitize and validate everything
133
+ - ❌ Use weak password hashing - Use {{PASSWORD_HASH_ALGORITHM}}
134
+ - ❌ Store sensitive data in localStorage - Use httpOnly cookies for tokens
135
+ - ❌ Expose API keys in frontend code - Use environment variables + backend proxy
136
+ - ❌ Use eval() or Function() constructor - Major security risk
137
+
138
+ ### Backend Architecture
139
+
140
+ - ❌ Put business logic in controllers/routes - Keep controllers thin
141
+ - ❌ Access database directly from controllers - Use services/repositories
142
+ - ❌ Mix concerns across layers - Respect layer boundaries
143
+ - ❌ Create circular dependencies - Design proper dependency flow
144
+
145
+ ### Backend Data
146
+
147
+ - ❌ Use SELECT \* in production - Specify columns explicitly
148
+ - ❌ Query databases in loops (N+1) - Use joins or batch queries
149
+ - ❌ Forget database transactions for multi-step operations
150
+ - ❌ Ignore database indexes - Index frequently queried columns
151
+
152
+ ### Frontend Performance
153
+
154
+ - ❌ Import entire libraries - Use tree-shaking friendly imports
155
+ - ❌ Render large lists without virtualization - Use react-window, vue-virtual-scroller
156
+ - ❌ Forget to memoize expensive computations - Use useMemo, computed
157
+ - ❌ Load all routes upfront - Use code splitting and lazy loading
158
+ - ❌ Skip image optimization - Use next/image, nuxt/image, or optimize manually
159
+ - ❌ Ignore bundle size - Monitor and optimize regularly
160
+
161
+ ### Frontend Accessibility (WCAG {{A11Y_COMPLIANCE}})
162
+
163
+ - ❌ Use divs for buttons - Use semantic HTML (`<button>`, `<a>`)
164
+ - ❌ Forget alt text on images - Every `<img>` needs descriptive alt
165
+ - ❌ Skip keyboard navigation support - All interactive elements must be keyboard accessible
166
+ - ❌ Ignore color contrast ratios - Minimum 4.5:1 for text (WCAG AA)
167
+ - ❌ Remove focus outlines without replacement - Provide visible focus indicators
168
+
169
+ ### Frontend State Management
170
+
171
+ - ❌ Prop drill more than 2-3 levels - Use context, provide/inject, or state management
172
+ - ❌ Store derived data in state - Compute on the fly
173
+ - ❌ Forget to clean up subscriptions - Unsubscribe in useEffect cleanup, onUnmounted
174
+ - ❌ Use global state for everything - Keep state as local as possible
175
+
176
+ ### Testing
177
+
178
+ - ❌ Skip tests for new features - Write tests first or alongside code
179
+ - ❌ Mock internal business logic - Only mock external dependencies
180
+ - ❌ Commit failing tests - All tests must pass before commit
181
+
182
+ {{CUSTOM_NEVER_RULES}}
183
+
184
+ ---
185
+
186
+ ## ✅ ALWAYS Rules
187
+
188
+ **YOU MUST ALWAYS:**
189
+
190
+ ### Code Quality
191
+
192
+ - ✅ Use TypeScript strict mode ({{#IF_TYPESCRIPT}}enabled{{/IF_TYPESCRIPT}})
193
+ - ✅ Follow naming conventions from `docs/code-standards.md`
194
+ - ✅ Write self-documenting code with clear names
195
+ - ✅ Add comments for complex business logic only
196
+ - ✅ Keep functions under {{MAX_FUNCTION_LENGTH}} lines
197
+ - ✅ Limit cyclomatic complexity to {{MAX_COMPLEXITY}}
198
+
199
+ ### Security
200
+
201
+ - ✅ Validate all inputs with {{VALIDATION_LIBRARY}} (backend AND frontend)
202
+ - ✅ Sanitize data before database queries
203
+ - ✅ Use parameterized queries (prevent SQL injection)
204
+ - ✅ Implement rate limiting on public endpoints
205
+ - ✅ Return generic error messages to users (no stack traces in prod)
206
+ - ✅ Log security events (failed logins, permission denials)
207
+ - ✅ Sanitize user input to prevent XSS (frontend)
208
+ - ✅ Use CSRF tokens for forms
209
+ - ✅ Configure Content Security Policy headers
210
+
211
+ ### Backend Architecture
212
+
213
+ - ✅ Follow {{ARCHITECTURE_PATTERN}} pattern strictly
214
+ - ✅ Use dependency injection
215
+ - ✅ Keep controllers thin (delegate to services)
216
+ - ✅ Use DTOs for request/response validation
217
+ - ✅ Implement proper error handling with custom error classes
218
+
219
+ ### Backend Data
220
+
221
+ - ✅ Use transactions for multi-table operations
222
+ - ✅ Implement soft deletes if configured ({{#IF_SOFT_DELETES}}enabled{{/IF_SOFT_DELETES}})
223
+ - ✅ Add created_at/updated_at timestamps
224
+ - ✅ Use database migrations (never manual schema changes)
225
+ - ✅ Add indexes for foreign keys and frequently queried fields
226
+
227
+ ### Frontend Component Design
228
+
229
+ - ✅ Keep components focused on one responsibility
230
+ - ✅ Use TypeScript for type safety
231
+ - ✅ Write PropTypes or TypeScript interfaces for props
232
+ - ✅ Use semantic HTML elements
233
+ - ✅ Add ARIA attributes when needed
234
+ - ✅ Ensure keyboard navigation works
235
+
236
+ ### Frontend Performance
237
+
238
+ - ✅ Implement code splitting for routes
239
+ - ✅ Optimize images (WebP format, lazy loading)
240
+ - ✅ Monitor Core Web Vitals: {{WEB_VITALS_TARGETS}}
241
+ - ✅ Use production builds for deployment
242
+ - ✅ Implement proper caching strategies
243
+ - ✅ Debounce search inputs and expensive operations
244
+
245
+ ### Frontend State Management
246
+
247
+ - ✅ Keep state as close as possible to where it's used
248
+ - ✅ Use {{STATE_MANAGEMENT}} for global state
249
+ - ✅ Use {{DATA_FETCHING}} for server state
250
+ - ✅ Implement optimistic updates for better UX
251
+
252
+ ### API Integration
253
+
254
+ - ✅ Version APIs ({{API_VERSIONING_STRATEGY}})
255
+ - ✅ Use proper HTTP status codes
256
+ - ✅ Return consistent error response format
257
+ - ✅ Document endpoints with {{API_DOCS_TOOL}}
258
+ - ✅ Implement pagination for list endpoints
259
+ - ✅ Handle loading, success, and error states (frontend)
260
+ - ✅ Cancel requests on component unmount
261
+
262
+ ### Testing
263
+
264
+ - ✅ Write unit tests for all services (target: {{UNIT_TEST_COVERAGE}}%+ coverage)
265
+ - ✅ Write integration tests for critical flows
266
+ - ✅ Mock external dependencies (APIs, email, payments)
267
+ - ✅ Use factories/fixtures for test data
268
+ - ✅ Run tests before every commit
269
+ - ✅ Test component behavior, not implementation (frontend)
270
+ - ✅ Test accessibility (screen reader compatibility)
271
+
272
+ {{CUSTOM_ALWAYS_RULES}}
273
+
274
+ ---
275
+
276
+ ## 🔄 Development Workflow
277
+
278
+ ### 1. Before Starting a Task
279
+
280
+ - Read relevant documentation (architecture, security, code standards)
281
+ - Understand business requirements
282
+ - Check for existing similar implementations
283
+ - Plan approach before coding
284
+ - Consider both backend and frontend implications
285
+
286
+ ### 2. While Coding
287
+
288
+ - Follow TDD if possible (test-first development)
289
+ - Commit frequently with conventional commits
290
+ - Write clear, descriptive commit messages
291
+ - Keep commits focused (one logical change per commit)
292
+ - Coordinate backend and frontend changes
293
+
294
+ ### 3. Before Committing
295
+
296
+ **Backend:**
297
+ - Run linter: `{{LINT_COMMAND}}`
298
+ - Run tests: `{{TEST_COMMAND}}`
299
+ - Check test coverage meets minimum ({{MIN_COVERAGE}}%)
300
+
301
+ **Frontend:**
302
+ - Run linter: `{{PACKAGE_MANAGER}} run lint`
303
+ - Run tests: `{{PACKAGE_MANAGER}} run test`
304
+ - Build succeeds: `{{PACKAGE_MANAGER}} run build`
305
+
306
+ ### 4. Code Review
307
+
308
+ - Self-review before requesting review
309
+ - Address all review comments
310
+ - Update tests if logic changes
311
+ - Update documentation if behavior changes
312
+ - Verify backend and frontend integration
313
+
314
+ ### 5. Deployment
315
+
316
+ - Follow deployment procedures in `docs/operations.md`
317
+ - Update CHANGELOG.md
318
+ - Test in staging before production
319
+ - Monitor logs after deployment
320
+ - Verify both backend and frontend deployments
321
+
322
+ ---
323
+
324
+ ## 🎯 Priorities
325
+
326
+ When there are trade-offs, prioritize in this order:
327
+
328
+ 1. **{{PRIORITY_1}}** - {{PRIORITY_1_DESCRIPTION}}
329
+ 2. **{{PRIORITY_2}}** - {{PRIORITY_2_DESCRIPTION}}
330
+ 3. **{{PRIORITY_3}}** - {{PRIORITY_3_DESCRIPTION}}
331
+ 4. **{{PRIORITY_4}}** - {{PRIORITY_4_DESCRIPTION}}
332
+ 5. **{{PRIORITY_5}}** - {{PRIORITY_5_DESCRIPTION}}
333
+
334
+ ---
335
+
336
+ ## 📁 Project Structure
337
+
338
+ ```
339
+ {{PROJECT_STRUCTURE}}
340
+ ```
341
+
342
+ ---
343
+
344
+ ## 🧪 Testing Commands
345
+
346
+ **Backend:**
347
+ ```bash
348
+ # Run all tests
349
+ {{TEST_ALL_COMMAND}}
350
+
351
+ # Run unit tests only
352
+ {{TEST_UNIT_COMMAND}}
353
+
354
+ # Run integration tests
355
+ {{TEST_INTEGRATION_COMMAND}}
356
+
357
+ # Run with coverage
358
+ {{TEST_COVERAGE_COMMAND}}
359
+ ```
360
+
361
+ **Frontend:**
362
+ ```bash
363
+ # Run all tests
364
+ {{PACKAGE_MANAGER}} run test
365
+
366
+ # Run with coverage
367
+ {{PACKAGE_MANAGER}} run test:coverage
368
+
369
+ # Run E2E tests
370
+ {{PACKAGE_MANAGER}} run test:e2e
371
+ ```
372
+
373
+ ---
374
+
375
+ ## 🚀 Common Commands
376
+
377
+ **Backend:**
378
+ ```bash
379
+ # Install dependencies
380
+ {{INSTALL_COMMAND}}
381
+
382
+ # Start development server
383
+ {{DEV_COMMAND}}
384
+
385
+ # Build for production
386
+ {{BUILD_COMMAND}}
387
+
388
+ # Run linter
389
+ {{LINT_COMMAND}}
390
+
391
+ # Run database migrations
392
+ {{MIGRATION_RUN_COMMAND}}
393
+
394
+ # Create new migration
395
+ {{MIGRATION_CREATE_COMMAND}}
396
+ ```
397
+
398
+ **Frontend:**
399
+ ```bash
400
+ # Install dependencies
401
+ {{PACKAGE_MANAGER}} install
402
+
403
+ # Start development server
404
+ {{PACKAGE_MANAGER}} run dev
405
+
406
+ # Build for production
407
+ {{PACKAGE_MANAGER}} run build
408
+
409
+ # Run linter
410
+ {{PACKAGE_MANAGER}} run lint
411
+
412
+ # Format code
413
+ {{PACKAGE_MANAGER}} run format
414
+ ```
415
+
416
+ ---
417
+
418
+ ## 📚 Key Documentation Files
419
+
420
+ - `project-brief.md` - Business context and objectives
421
+ - `README.md` - Developer setup, commands, repo structure
422
+ - `docs/architecture.md` - System architecture and patterns (backend)
423
+ - `docs/data-model.md` - Database schema and relationships
424
+ - `docs/components.md` - Component architecture (frontend)
425
+ - `docs/state-management.md` - State patterns (frontend)
426
+ - `docs/code-standards.md` - Detailed coding standards
427
+ - `docs/testing.md` - Testing strategy and requirements
428
+ - `docs/operations.md` - Deployment and operational procedures
429
+ - `docs/business-flows.md` - Business processes and diagrams
430
+ - `docs/api.md` - API conventions and endpoint catalogue
431
+ - `specs/security.md` - Security policies and compliance
432
+ - `specs/configuration.md` - Environment configuration
433
+ - `docs/contributing.md` - Development setup, workflow
434
+
435
+ ---
436
+
437
+ ## 🔐 Environment Variables
438
+
439
+ See `.env.example` files in both `backend/` and `frontend/` directories for all required environment variables.
440
+
441
+ **Backend Critical Variables:**
442
+ {{CRITICAL_ENV_VARS}}
443
+
444
+ **Frontend Critical Variables:**
445
+ {{FRONTEND_CRITICAL_VARS}}
446
+
447
+ ---
448
+
449
+ ## 🛡️ Security Checklist
450
+
451
+ Before every feature:
452
+
453
+ **Backend:**
454
+ - [ ] Input validation implemented with {{VALIDATION_LIBRARY}}
455
+ - [ ] Authentication required (if applicable)
456
+ - [ ] Authorization checked (role/permission)
457
+ - [ ] Rate limiting applied (if public endpoint)
458
+ - [ ] No sensitive data in logs
459
+ - [ ] No hardcoded secrets
460
+ - [ ] SQL injection prevented (parameterized queries)
461
+
462
+ **Frontend:**
463
+ - [ ] XSS prevented (output encoding)
464
+ - [ ] CSRF protection (if stateful)
465
+ - [ ] User input sanitized
466
+ - [ ] No API keys exposed
467
+ - [ ] Content Security Policy configured
468
+
469
+ ---
470
+
471
+ ## 📞 When in Doubt
472
+
473
+ 1. Check this document first
474
+ 2. Review `docs/code-standards.md` for specific patterns
475
+ 3. Look for similar existing implementations in the codebase
476
+ 4. Ask for clarification before making architectural decisions
477
+ 5. Prioritize security and maintainability over speed
478
+ 6. Consider both backend and frontend implications
479
+
480
+ ---
481
+
482
+ **Remember:** These rules exist to maintain quality, security, and consistency. Following them makes the codebase better for everyone.
483
+
484
+ **Last Updated:** {{GENERATION_DATE}}
485
+
486
+ **Generated by:** AI Flow v1.3.0
487
+
@@ -0,0 +1,197 @@
1
+ # Project Brief
2
+
3
+ > Business context and objectives for {{PROJECT_NAME}}
4
+
5
+ ---
6
+
7
+ ## 🎯 Project Overview
8
+
9
+ ### What Problem Are We Solving?
10
+
11
+ {{PROBLEM_STATEMENT}}
12
+
13
+ ### Description
14
+
15
+ {{PROJECT_DESCRIPTION}}
16
+
17
+ **Project Type:** Full Stack Application (Backend API + Frontend Application)
18
+
19
+ ---
20
+
21
+ ## 👥 Target Users
22
+
23
+ {{TARGET_USERS_DESCRIPTION}}
24
+
25
+ **User Types:**
26
+ {{#EACH TARGET_USER}}
27
+ - **{{USER_TYPE}}**: {{USER_DESCRIPTION}}
28
+ {{/EACH}}
29
+
30
+ ---
31
+
32
+ ## 🎯 Business Objectives
33
+
34
+ ### Primary Objectives
35
+
36
+ {{#EACH BUSINESS_OBJECTIVE}}
37
+ {{INDEX}}. **{{OBJECTIVE_TITLE}}**
38
+ - {{OBJECTIVE_DESCRIPTION}}
39
+ - Success metric: {{SUCCESS_METRIC}}
40
+ {{/EACH}}
41
+
42
+ ---
43
+
44
+ ## ✅ Scope
45
+
46
+ ### In Scope
47
+
48
+ **Backend Features and capabilities:**
49
+ {{#EACH BACKEND_IN_SCOPE_FEATURE}}
50
+ - **{{FEATURE_NAME}}**: {{FEATURE_DESCRIPTION}}
51
+ {{/EACH}}
52
+
53
+ **Frontend Features and capabilities:**
54
+ {{#EACH FRONTEND_IN_SCOPE_FEATURE}}
55
+ - **{{FEATURE_NAME}}**: {{FEATURE_DESCRIPTION}}
56
+ {{/EACH}}
57
+
58
+ ### Out of Scope
59
+
60
+ **Features explicitly NOT included:**
61
+ {{#EACH OUT_OF_SCOPE_FEATURE}}
62
+ - **{{FEATURE_NAME}}**: {{REASON_OUT_OF_SCOPE}}
63
+ {{/EACH}}
64
+
65
+ ---
66
+
67
+ ## 🚧 Constraints
68
+
69
+ {{#EACH CONSTRAINT}}
70
+ ### {{CONSTRAINT_TYPE}}
71
+
72
+ {{CONSTRAINT_DESCRIPTION}}
73
+
74
+ **Impact:** {{CONSTRAINT_IMPACT}}
75
+
76
+ {{/EACH}}
77
+
78
+ ---
79
+
80
+ ## 📊 Success Metrics (KPIs)
81
+
82
+ ### Technical Metrics
83
+
84
+ **Backend:**
85
+ {{#EACH BACKEND_TECHNICAL_METRIC}}
86
+ - **{{METRIC_NAME}}**: {{METRIC_TARGET}}
87
+ {{/EACH}}
88
+
89
+ **Frontend:**
90
+ {{#EACH FRONTEND_TECHNICAL_METRIC}}
91
+ - **{{METRIC_NAME}}**: {{METRIC_TARGET}}
92
+ {{/EACH}}
93
+
94
+ ### Business Metrics
95
+
96
+ {{#EACH BUSINESS_METRIC}}
97
+ - **{{METRIC_NAME}}**: {{METRIC_TARGET}}
98
+ {{/EACH}}
99
+
100
+ ---
101
+
102
+ ## 🗓️ Project Context
103
+
104
+ **Current Phase:** {{PROJECT_PHASE}}
105
+
106
+ {{#IF TIMELINE}}**Estimated Timeline:** {{TIMELINE}}{{/IF}}
107
+
108
+ {{#IF BUDGET}}**Budget Constraints:** {{BUDGET}}{{/IF}}
109
+
110
+ ---
111
+
112
+ ## 🏢 Stakeholders
113
+
114
+ {{#EACH STAKEHOLDER}}
115
+ - **{{STAKEHOLDER_ROLE}}**: {{STAKEHOLDER_INTEREST}}
116
+ {{/EACH}}
117
+
118
+ ---
119
+
120
+ ## 🔄 Integration Points
121
+
122
+ **Backend External Systems:**
123
+ {{#IF NO_BACKEND_INTEGRATIONS}}
124
+ None - This is a standalone backend system.
125
+ {{ELSE}}
126
+ {{#EACH BACKEND_INTEGRATION}}
127
+ - **{{INTEGRATION_NAME}}**: {{INTEGRATION_PURPOSE}}
128
+ - Type: {{INTEGRATION_TYPE}}
129
+ - Critical: {{IS_CRITICAL}}
130
+ {{/EACH}}
131
+ {{/IF}}
132
+
133
+ **Frontend External Services:**
134
+ {{#IF NO_FRONTEND_INTEGRATIONS}}
135
+ None - Frontend only consumes backend API.
136
+ {{ELSE}}
137
+ {{#EACH FRONTEND_INTEGRATION}}
138
+ - **{{INTEGRATION_NAME}}**: {{INTEGRATION_PURPOSE}}
139
+ - Type: {{INTEGRATION_TYPE}}
140
+ - Critical: {{IS_CRITICAL}}
141
+ {{/EACH}}
142
+ {{/IF}}
143
+
144
+ ---
145
+
146
+ ## 📋 Key Assumptions
147
+
148
+ {{#EACH ASSUMPTION}}
149
+ - {{ASSUMPTION_DESCRIPTION}}
150
+ {{/EACH}}
151
+
152
+ ---
153
+
154
+ ## ⚠️ Risks
155
+
156
+ {{#EACH RISK}}
157
+ ### {{RISK_TITLE}}
158
+
159
+ **Description:** {{RISK_DESCRIPTION}}
160
+
161
+ **Probability:** {{RISK_PROBABILITY}}
162
+
163
+ **Impact:** {{RISK_IMPACT}}
164
+
165
+ **Mitigation:** {{RISK_MITIGATION}}
166
+
167
+ {{/EACH}}
168
+
169
+ ---
170
+
171
+ ## 🎓 Domain Glossary
172
+
173
+ **Key terms and concepts:**
174
+ {{#EACH GLOSSARY_TERM}}
175
+ - **{{TERM}}**: {{DEFINITION}}
176
+ {{/EACH}}
177
+
178
+ ---
179
+
180
+ ## 📚 References
181
+
182
+ {{#IF REFERENCES}}
183
+ {{#EACH REFERENCE}}
184
+ - {{REFERENCE_TITLE}}: {{REFERENCE_URL}}
185
+ {{/EACH}}
186
+ {{ELSE}}
187
+ No external references.
188
+ {{/IF}}
189
+
190
+ ---
191
+
192
+ **Document Version:** 1.0
193
+
194
+ **Last Updated:** {{GENERATION_DATE}}
195
+
196
+ **Generated by:** AI Flow v1.3.0
197
+