ai-flow-dev 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +25 -38
  2. package/dist/cli.js +68 -46
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +5 -5
  5. package/prompts/backend/flow-build-phase-0.md +31 -63
  6. package/prompts/backend/flow-build-phase-1.md +9 -17
  7. package/prompts/backend/flow-build-phase-10.md +199 -585
  8. package/prompts/backend/flow-build-phase-2.md +152 -86
  9. package/prompts/backend/flow-build-phase-3.md +108 -68
  10. package/prompts/backend/flow-build-phase-4.md +5 -8
  11. package/prompts/backend/flow-build-phase-5.md +39 -12
  12. package/prompts/backend/flow-build-phase-6.md +29 -8
  13. package/prompts/backend/flow-build-phase-7.md +120 -40
  14. package/prompts/backend/flow-build-phase-8.md +28 -65
  15. package/prompts/backend/flow-build-phase-9.md +267 -1298
  16. package/prompts/backend/flow-build.md +881 -957
  17. package/prompts/backend/flow-dev-commit.md +27 -50
  18. package/prompts/backend/flow-dev-feature.md +1929 -2017
  19. package/prompts/backend/flow-dev-fix.md +936 -964
  20. package/prompts/backend/flow-dev-refactor.md +672 -701
  21. package/prompts/backend/flow-dev-review.md +356 -389
  22. package/prompts/backend/flow-dev-work.md +1066 -1118
  23. package/prompts/backend/flow-docs-sync.md +20 -196
  24. package/prompts/frontend/flow-build-phase-0.md +503 -484
  25. package/prompts/frontend/flow-build-phase-1.md +445 -433
  26. package/prompts/frontend/flow-build-phase-2.md +910 -957
  27. package/prompts/frontend/flow-build-phase-3.md +692 -664
  28. package/prompts/frontend/flow-build-phase-4.md +478 -463
  29. package/prompts/frontend/flow-build-phase-5.md +488 -467
  30. package/prompts/frontend/flow-build-phase-6.md +571 -550
  31. package/prompts/frontend/flow-build-phase-7.md +560 -592
  32. package/prompts/frontend/flow-build-phase-8.md +17 -42
  33. package/prompts/frontend/flow-build.md +457 -503
  34. package/prompts/frontend/flow-docs-sync.md +14 -35
  35. package/prompts/mobile/flow-build-phase-0.md +104 -97
  36. package/prompts/mobile/flow-build-phase-1.md +137 -122
  37. package/prompts/mobile/flow-build-phase-2.md +123 -130
  38. package/prompts/mobile/flow-build-phase-3.md +144 -149
  39. package/prompts/mobile/flow-build-phase-4.md +140 -132
  40. package/prompts/mobile/flow-build-phase-5.md +70 -70
  41. package/prompts/mobile/flow-build-phase-6.md +136 -134
  42. package/prompts/mobile/flow-build-phase-7.md +24 -58
  43. package/prompts/mobile/flow-build-phase-8.md +17 -42
  44. package/prompts/mobile/flow-build.md +47 -97
  45. package/prompts/mobile/flow-docs-sync.md +13 -32
  46. package/prompts/shared/mermaid-guidelines.md +106 -0
  47. package/prompts/shared/scope-levels.md +126 -0
  48. package/prompts/shared/story-points.md +65 -0
  49. package/prompts/shared/task-format.md +86 -0
  50. package/templates/AGENT.template.md +194 -15
  51. package/templates/backend/README.template.md +2 -32
  52. package/templates/backend/ai-instructions.template.md +2 -32
  53. package/templates/backend/copilot-instructions.template.md +2 -22
  54. package/templates/backend/docs/api.template.md +89 -20
  55. package/templates/backend/docs/architecture.template.md +165 -53
  56. package/templates/backend/docs/business-flows.template.md +7 -14
  57. package/templates/backend/docs/code-standards.template.md +2 -38
  58. package/templates/backend/docs/contributing.template.md +2 -16
  59. package/templates/backend/docs/data-model.template.md +125 -21
  60. package/templates/backend/docs/operations.template.md +179 -50
  61. package/templates/backend/docs/testing.template.md +2 -42
  62. package/templates/backend/project-brief.template.md +2 -28
  63. package/templates/backend/specs/configuration.template.md +2 -14
  64. package/templates/backend/specs/security.template.md +2 -32
  65. package/templates/frontend/README.template.md +2 -18
  66. package/templates/frontend/ai-instructions.template.md +2 -20
  67. package/templates/frontend/docs/api-integration.template.md +12 -30
  68. package/templates/frontend/docs/components.template.md +2 -28
  69. package/templates/frontend/docs/error-handling.template.md +11 -27
  70. package/templates/frontend/docs/operations.template.md +8 -18
  71. package/templates/frontend/docs/performance.template.md +8 -18
  72. package/templates/frontend/docs/pwa.template.md +8 -18
  73. package/templates/frontend/docs/state-management.template.md +2 -28
  74. package/templates/frontend/docs/styling.template.md +2 -26
  75. package/templates/frontend/docs/testing.template.md +2 -28
  76. package/templates/frontend/project-brief.template.md +2 -16
  77. package/templates/frontend/specs/accessibility.template.md +8 -18
  78. package/templates/frontend/specs/configuration.template.md +2 -24
  79. package/templates/frontend/specs/security.template.md +10 -24
  80. package/templates/fullstack/README.template.md +17 -47
  81. package/templates/fullstack/ai-instructions.template.md +17 -45
  82. package/templates/fullstack/project-brief.template.md +16 -42
  83. package/templates/fullstack/specs/configuration.template.md +16 -42
  84. package/templates/mobile/README.template.md +11 -29
  85. package/templates/mobile/ai-instructions.template.md +11 -27
  86. package/templates/mobile/docs/app-store.template.md +11 -29
  87. package/templates/mobile/docs/architecture.template.md +14 -38
  88. package/templates/mobile/docs/native-features.template.md +16 -44
  89. package/templates/mobile/docs/navigation.template.md +9 -23
  90. package/templates/mobile/docs/offline-strategy.template.md +10 -26
  91. package/templates/mobile/docs/permissions.template.md +9 -23
  92. package/templates/mobile/docs/state-management.template.md +12 -32
  93. package/templates/mobile/docs/testing.template.md +14 -38
  94. package/templates/mobile/project-brief.template.md +12 -30
  95. package/templates/mobile/specs/build-configuration.template.md +10 -26
  96. package/templates/mobile/specs/deployment.template.md +9 -23
@@ -3,17 +3,13 @@
3
3
  **YOU ARE AN EXPERT TECHNICAL ARCHITECT AND DOCUMENTATION SPECIALIST.**
4
4
 
5
5
  Your mission is to detect changes in the codebase and update the project documentation automatically when the user executes `/flow-docs-sync`.
6
-
7
- ---
8
-
6
+ ---
9
7
  ## Command: `/flow-docs-sync`
10
8
 
11
9
  ### Objective
12
10
 
13
11
  Detect changes in the codebase compared to the last documented state (stored in `.ai-flow/cache/docs-analysis.json`) and update all affected documentation files automatically.
14
-
15
- ---
16
-
12
+ ---
17
13
  ## Execution Flow
18
14
 
19
15
  ### Step 1: Check for Analysis File
@@ -82,193 +78,28 @@ First, check if `.ai-flow/cache/docs-analysis.json` exists:
82
78
 
83
79
  No se requiere ninguna actualización.
84
80
  ```
85
-
86
- ---
87
-
81
+ ---
88
82
  ## 📊 MERMAID DIAGRAM REGENERATION GUIDELINES
89
83
 
90
- When regenerating or updating diagrams in documentation files, follow these **critical** formatting rules:
84
+ > 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for all Mermaid diagram formatting rules (ER, Architecture, Flow).
91
85
 
92
86
  ### ER Diagrams (data-model.md)
93
87
 
94
- **Diagram Type:** `erDiagram`
95
-
96
- **Requirements:**
97
-
98
- 1. Show ALL entities and their relationships
99
- 2. Include field types and constraints (PK, FK, UK)
100
- 3. Add descriptions for complex or business-critical fields
101
- 4. Verify relationship cardinality matches actual database schema
102
- 5. Keep entity order logical (core entities first, then related)
103
-
104
- **Quality Checklist:**
105
-
106
- - [ ] Code fence is exactly ` ```mermaid ` (lowercase, no spaces)
107
- - [ ] All entities from database are represented
108
- - [ ] All foreign key relationships are shown
109
- - [ ] Primary keys are marked with `PK`
110
- - [ ] Foreign keys are marked with `FK`
111
- - [ ] Many-to-many relationships use junction tables
112
- - [ ] Field types match database schema
113
- - [ ] Diagram renders without errors
114
-
115
- **Example:**
116
-
117
- ````markdown
118
- ```mermaid
119
- erDiagram
120
- USER ||--o{ ORDER : places
121
- PRODUCT ||--o{ ORDER_ITEM : contains
122
- ORDER ||--o{ ORDER_ITEM : includes
123
-
124
- USER {
125
- string id PK
126
- string email UK
127
- string name
128
- datetime createdAt
129
- }
130
-
131
- ORDER {
132
- string id PK
133
- string userId FK
134
- decimal total
135
- string status
136
- }
137
-
138
- PRODUCT {
139
- string id PK
140
- string name
141
- decimal price
142
- }
143
-
144
- ORDER_ITEM {
145
- string id PK
146
- string orderId FK
147
- string productId FK
148
- int quantity
149
- }
150
- ```
151
- ````
152
-
153
- ---
154
-
88
+ > 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for ER diagram syntax, relationship notation, and common mistakes.
89
+ ---
155
90
  ### Architecture Diagrams (architecture.md)
156
91
 
157
- **Diagram Type:** `graph TD` (or `graph LR`)
158
-
159
- **Requirements:**
160
-
161
- 1. Show ALL major system components (services, databases, caches, queues)
162
- 2. Label connections with protocols/methods (HTTPS, gRPC, REST, etc.)
163
- 3. Use consistent styling (databases as cylinders, services as boxes)
164
- 4. Include external integrations (Email, Payment, SMS services)
165
- 5. Show monitoring and logging components if present
166
- 6. Include deployment context (load balancers, CDN) if relevant
167
-
168
- **Quality Checklist:**
169
-
170
- - [ ] Code fence is exactly ` ```mermaid ` (lowercase, no spaces)
171
- - [ ] All services/components from codebase are shown
172
- - [ ] Database connections are labeled
173
- - [ ] External APIs are included
174
- - [ ] Authentication/authorization flow is visible
175
- - [ ] Caching layer is shown (if exists)
176
- - [ ] Message queues are included (if exists)
177
- - [ ] Styling is applied for clarity
178
- - [ ] Diagram renders without errors
179
-
180
- **Example:**
181
-
182
- ````markdown
183
- ```mermaid
184
- graph TD
185
- Client[Client Application]
186
- API[API Gateway<br/>Express/NestJS]
187
- Auth[Auth Service<br/>JWT]
188
- DB[(PostgreSQL)]
189
- Cache[(Redis)]
190
- Queue[Message Queue<br/>RabbitMQ]
191
-
192
- Client -->|HTTPS| API
193
- API -->|Verify| Auth
194
- API -->|Query| DB
195
- API -->|Cache| Cache
196
- API -->|Enqueue| Queue
197
-
198
- style DB fill:#e1ffe1
199
- style Cache fill:#f0e1ff
200
- ```
201
- ````
202
-
203
- ---
204
-
92
+ > 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for architecture diagram syntax, node shapes, and styling.
93
+ ---
94
+ ---
205
95
  ### Business Flow Diagrams (project-brief.md)
206
96
 
207
- **Diagram Type:** `flowchart TD` (or `flowchart LR`)
208
-
209
- **Requirements:**
210
-
211
- 1. Start with `([Start Terminal])`
212
- 2. End with `([End Terminal])`
213
- 3. Use `{Diamond}` for ALL decision points
214
- 4. Label ALL decision branches clearly (`-->|Yes|`, `-->|No|`)
215
- 5. Show complete paths (including error/failure scenarios)
216
- 6. Keep flows readable (avoid crossing arrows when possible)
217
- 7. Use consistent styling for node types
218
-
219
- **Quality Checklist:**
220
-
221
- - [ ] Code fence is exactly ` ```mermaid ` (lowercase, no spaces)
222
- - [ ] Flow starts with a terminal node
223
- - [ ] Flow ends with terminal node(s)
224
- - [ ] All decision points have labeled branches
225
- - [ ] All paths lead to an end state
226
- - [ ] Error/failure paths are included
227
- - [ ] Node labels are clear and concise
228
- - [ ] Line breaks (`<br/>`) used for readability
229
- - [ ] Styling applied for visual clarity
230
- - [ ] Diagram renders without errors
231
-
232
- **Example:**
233
-
234
- ````markdown
235
- ```mermaid
236
- flowchart TD
237
- Start([User Starts Process]) --> Action1[Perform Action]
238
- Action1 --> Decision{Success?}
239
-
240
- Decision -->|Yes| Success[Process Complete]
241
- Decision -->|No| Retry{Retry?}
242
-
243
- Retry -->|Yes| Action1
244
- Retry -->|No| Failed[Process Failed]
245
-
246
- Success --> End1([End: Success])
247
- Failed --> End2([End: Failed])
248
-
249
- style Start fill:#e1f5ff
250
- style End1 fill:#e1ffe1
251
- style End2 fill:#ffe1e1
252
- ```
253
- ````
254
-
255
- ---
256
-
97
+ > 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for business flow syntax, decision points, and styling.
98
+ ---
257
99
  ### Common Formatting Rules (ALL Diagrams)
258
100
 
259
- **CRITICAL - Code Fence Syntax:**
260
-
261
- ````
262
- ✅ CORRECT: ```mermaid
263
- ❌ WRONG: ```Mermaid (capital M)
264
- ❌ WRONG: ``` mermaid (extra space)
265
- ❌ WRONG: ``mermaid (missing backtick)
266
- ````
267
-
268
- **Indentation:**
269
-
270
- - Start Mermaid syntax at column 0 (no leading spaces/tabs)
271
- - Only indent within Mermaid syntax according to Mermaid rules
101
+ > 📎 **Reference:** See [prompts/shared/mermaid-guidelines.md](../shared/mermaid-guidelines.md) for critical code fence syntax and indentation rules.
102
+ ---
272
103
  - Do NOT indent the entire code block
273
104
 
274
105
  **Validation Steps:**
@@ -287,9 +118,7 @@ flowchart TD
287
118
  4. Add new elements in logical positions
288
119
  5. Preserve comments or notes if present
289
120
  6. Verify the entire diagram still renders after changes
290
-
291
- ---
292
-
121
+ ---
293
122
  ### Step 4: Update Documents (If User Confirms)
294
123
 
295
124
  **If user responds "Y", "Yes", "y", "yes", or similar:**
@@ -372,9 +201,7 @@ flowchart TD
372
201
  ```
373
202
  Actualización cancelada. Ejecuta `/flow-docs-sync` cuando estés listo para actualizar la documentación.
374
203
  ```
375
-
376
- ---
377
-
204
+ ---
378
205
  ## Change Detection Rules
379
206
 
380
207
  ### Endpoints Detection
@@ -453,9 +280,7 @@ Actualización cancelada. Ejecuta `/flow-docs-sync` cuando estés listo para act
453
280
  - Add new variables to configuration spec
454
281
  - Add examples to `.env.example`
455
282
  - Maintain existing variables
456
-
457
- ---
458
-
283
+ ---
459
284
  ## Important Rules
460
285
 
461
286
  1. **Incremental Updates Only:**
@@ -482,9 +307,7 @@ Actualización cancelada. Ejecuta `/flow-docs-sync` cuando estés listo para act
482
307
  - If document doesn't exist, create it following template
483
308
  - If docs-analysis.json is corrupted, regenerate it
484
309
  - If comparison fails, show error and suggest full Phase 0 re-run
485
-
486
- ---
487
-
310
+ ---
488
311
  ## Example Execution
489
312
 
490
313
  ```
@@ -518,7 +341,8 @@ AI:
518
341
 
519
342
  Documentación sincronizada exitosamente.
520
343
  ```
344
+ ---
345
+ **BEGIN EXECUTION when user runs `/flow-docs-sync`**
346
+
521
347
 
522
- ---
523
348
 
524
- **BEGIN EXECUTION when user runs `/flow-docs-sync`**