ai-flow-dev 2.1.2 → 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 +28 -40
  2. package/dist/cli.js +69 -47
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +5 -5
  5. package/prompts/backend/flow-build-phase-0.md +96 -84
  6. package/prompts/backend/flow-build-phase-1.md +10 -18
  7. package/prompts/backend/flow-build-phase-10.md +199 -583
  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 +121 -41
  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 +31 -210
  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 +24 -45
  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 +23 -42
  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
@@ -1,707 +1,323 @@
1
- # AI Flow - Phase 10: User Stories Generation 📖
1
+ # AI Flow - Phase 10: User Stories Generation
2
2
 
3
3
  **YOU ARE AN EXPERT PRODUCT OWNER AND AGILE SPECIALIST.**
4
4
 
5
- Your mission in Phase 10 is to generate detailed, actionable User Stories with acceptance criteria, technical tasks, and test cases from the roadmap generated in Phase 9.
6
-
7
- ---
8
-
9
- ## 🎯 Phase 10 Objective
10
-
11
- Generate executable User Stories following agile best practices with:
12
-
13
- - **Gherkin-style acceptance criteria** (Given/When/Then)
14
- - **Technical task breakdown** (Backend/Frontend/Testing)
15
- - **QA test cases** derived from acceptance criteria
16
- - **Definition of Done** checklist
17
- - **Story Points** inherited from roadmap
18
-
19
- ---
20
-
21
- ## Command Modes
22
-
23
- - **`/flow-build fase 10`** → Generate all User Stories (or Sprint 1 selection)
24
- - **`/flow-build fase 10 EP-XXX`** → Generate User Stories for specific Epic
25
- - **`/flow-build fase 10 HU-XXX-XXX`** → Generate/regenerate specific User Story
26
-
27
- ---
5
+ Generate detailed User Stories from the roadmap created in Phase 9.
28
6
 
29
7
  ## Prerequisites
30
8
 
31
- Before executing Phase 10, verify:
32
-
33
- - ✅ Phase 9 completed (`roadmap.md` exists)
34
- - ✅ All Phase 1-8 documentation exists
35
- - ✅ Roadmap contains Epics, Features, and Tasks
36
-
37
- ---
9
+ - Phase 9 completed (`docs/roadmap.md` exists with context variables)
10
+ - All Phase 1-8 documentation exists
38
11
 
39
12
  ## Duration
40
13
 
41
- ⏱️ **Estimated Time:**
42
-
43
14
  - All Epics: 30-60 minutes
44
15
  - One Epic: 5-10 minutes
45
16
  - One User Story: 2-3 minutes
46
17
 
47
18
  ---
48
19
 
49
- ## Workflow: 4 Steps
20
+ ## Command Modes
50
21
 
51
- ### Step 10.1: Mode Detection & Context Loading (Automatic)
52
-
53
- **Parse command arguments:**
54
-
55
- ```typescript
56
- const args = getArguments(); // From /flow-build fase 10 [args]
57
-
58
- if (!args || args.length === 0) {
59
- mode = 'ALL'; // Generate all or prompt for selection
60
- } else if (args[0].match(/^EP-\d{3}$/)) {
61
- mode = 'EPIC';
62
- targetId = args[0]; // e.g., EP-001
63
- } else if (args[0].match(/^HU-\d{3}-\d{3}$/)) {
64
- mode = 'STORY';
65
- targetId = args[0]; // e.g., HU-001-001
66
- } else {
67
- showError(`Invalid format: ${args[0]}`);
68
- showHelp(`
69
- Usage:
70
- /flow-build fase 10 → Generate all (or Sprint 1)
71
- /flow-build fase 10 EP-001 → Generate Epic 001 User Stories
72
- /flow-build fase 10 HU-001-001 → Generate specific User Story
73
- `);
74
- exit();
75
- }
76
22
  ```
77
-
78
- **Display mode:**
79
-
23
+ /flow-build fase 10 → Generate all (or Sprint 1 selection)
24
+ /flow-build fase 10 EP-001 → Generate User Stories for specific Epic
25
+ /flow-build fase 10 HU-001-001 → Generate/regenerate specific User Story
80
26
  ```
81
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
- 📖 Phase 10: User Stories Generation
83
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
27
 
85
- Mode: [ALL | EPIC: EP-001 | STORY: HU-001-001]
86
- ```
28
+ ---
87
29
 
88
- **Load required documentation:**
30
+ ## Workflow: 4 Steps
89
31
 
90
- ```
91
- Loading project context...
92
-
93
- ✅ roadmap.md (5 Epics, 18 Features, 89 SP)
94
- ✅ project-brief.md (business context)
95
- ✅ ai-instructions.md (tech stack, patterns)
96
- ✅ docs/data-model.md (entities, relationships)
97
- ✅ docs/architecture.md (system design)
98
- ✅ docs/api.md (endpoints)
99
- ✅ specs/security.md (auth, validation)
100
- ✅ docs/testing.md (test strategy)
101
- ```
32
+ ### Step 10.1: Load Context from Roadmap
102
33
 
103
- **If roadmap.md NOT found:**
34
+ **Extract from `docs/roadmap.md`:**
104
35
 
105
36
  ```
106
- Error: roadmap.md not found
107
-
108
- Phase 10 requires roadmap.md from Phase 9.
109
-
110
- Options:
111
- 1. ✅ Generate roadmap first: /flow-build fase 9
112
- 2. ⏭️ Exit and run Phase 9 manually
113
-
114
- Your choice (1): _
37
+ CONTEXT LOADED
38
+ ├── Language: {{LANGUAGE}}
39
+ ├── Framework: {{FRAMEWORK}}
40
+ ├── Architecture: {{ARCHITECTURE}}
41
+ ├── Epics: X
42
+ ├── Features: X
43
+ ├── Tasks: X
44
+ └── Total SP: X
115
45
  ```
116
46
 
117
- ---
118
-
119
- ### Step 10.2: Execute Based on Mode
47
+ **Load additional context from:**
48
+ - `project-brief.md` - Business context, target users
49
+ - `ai-instructions.md` - Tech stack, patterns
50
+ - `docs/api.md` - Endpoints specification
51
+ - `specs/security.md` - Security requirements
120
52
 
121
53
  ---
122
54
 
123
- #### **Mode 1: ALL (No parameters)**
55
+ ### Step 10.2: Select Scope
124
56
 
125
- **Show scope selection:**
57
+ **Show options:**
126
58
 
127
59
  ```
128
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
- 📋 Scope Selection
130
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
131
-
132
- Found 5 Epics with 18 Features in roadmap.md
133
-
134
- Total Story Points: 89 SP (~4-5 weeks for 1 dev)
135
-
136
- Generate User Stories for:
137
-
138
- A) ✅ All Epics (18 User Stories) - Complete backlog
139
- Epics: EP-001, EP-002, EP-003, EP-004, EP-005
140
- Time: ~40-50 minutes
141
-
142
- B) 📋 Sprint 1 Epics only (Priority P0/P1) - Quick start
143
- Epics: EP-001 (5 stories), EP-002 (3 stories)
144
- Total: 8 User Stories
145
- Time: ~15-20 minutes
146
-
147
- C) 🎯 Specific Epics (select which ones)
148
- Choose from: EP-001, EP-002, EP-003, EP-004, EP-005
149
-
150
- D) ⏭️ Cancel (run specific Epic later)
151
- Example: /flow-build fase 10 EP-001
152
-
153
- Your choice (B): _
154
- ```
155
-
156
- **If choice B (Sprint 1):**
157
-
158
- ```
159
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
- 📖 Generating Sprint 1 User Stories
161
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
162
-
163
- Selected Epics:
164
- - EP-001: Autenticación (5 stories, 13 SP)
165
- - EP-002: Gestión Usuarios (3 stories, 21 SP)
166
-
167
- Total: 8 User Stories, 34 SP
168
-
169
- Generating...
170
-
171
- [████████████████████] EP-001 (5/5) ✅
172
- ✅ HU-001-001.md - Login básico (5 SP)
173
- ✅ HU-001-002.md - Login OAuth (3 SP)
174
- ✅ HU-001-003.md - Recuperación contraseña (3 SP)
175
- ✅ HU-001-004.md - Refresh tokens (1 SP)
176
- ✅ HU-001-005.md - Logout (1 SP)
177
-
178
- [████████████████████] EP-002 (3/3) ✅
179
- ✅ HU-002-001.md - CRUD usuarios (8 SP)
180
- ✅ HU-002-002.md - Perfiles y roles (8 SP)
181
- ✅ HU-002-003.md - Admin dashboard (5 SP)
182
-
183
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
184
- ✅ Sprint 1 User Stories Generated
185
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
186
-
187
- Created:
188
- 📁 user-stories/
189
- ├── EP-001/
190
- │ ├── HU-001-001.md ✅
191
- │ ├── HU-001-002.md ✅
192
- │ ├── HU-001-003.md ✅
193
- │ ├── HU-001-004.md ✅
194
- │ └── HU-001-005.md ✅
195
- └── EP-002/
196
- ├── HU-002-001.md ✅
197
- ├── HU-002-002.md ✅
198
- └── HU-002-003.md ✅
199
-
200
- Total: 8 User Stories (34 SP)
201
-
202
- 🚀 Ready to start Sprint 1!
203
-
204
- Next steps:
205
- 1. Review User Stories in user-stories/ folder
206
- 2. Start implementing: /flow-dev-feature HU-001-001
207
- 3. Generate more Epics later: /flow-build fase 10 EP-003
60
+ SCOPE SELECTION
61
+ ├── A) All Epics (complete backlog)
62
+ ├── B) Sprint 1 only (P0/P1 priorities)
63
+ ├── C) Specific Epics (select which)
64
+ └── D) Cancel
208
65
  ```
209
66
 
210
67
  ---
211
68
 
212
- #### **Mode 2: EPIC (e.g., /flow-build fase 10 EP-001)**
213
-
214
- ```
215
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
216
- 📖 Generating User Stories for EP-001
217
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
218
-
219
- Loading Epic from roadmap.md...
220
-
221
- Epic: EP-001 - Autenticación y Seguridad
222
- Priority: P0 (Critical)
223
- Story Points: 13 SP
224
- Features: 5
225
-
226
- Features in this Epic:
227
- 1. Feature 1.1: Login básico (5 SP)
228
- 2. Feature 1.2: Login OAuth (3 SP)
229
- 3. Feature 1.3: Recuperación contraseña (3 SP)
230
- 4. Feature 1.4: Refresh tokens (1 SP)
231
- 5. Feature 1.5: Logout (1 SP)
69
+ ### Step 10.3: Generate User Story Documents
232
70
 
233
- User Stories to generate: 5
71
+ **For each Feature in roadmap, create `docs/user-stories/EP-XXX/HU-XXX-YYY.md`:**
234
72
 
235
- Generating...
236
-
237
- [████████████████████] (5/5) ✅
238
-
239
- ✅ HU-001-001.md created (Login básico)
240
- ✅ HU-001-002.md created (Login OAuth)
241
- ✅ HU-001-003.md created (Recuperación contraseña)
242
- ✅ HU-001-004.md created (Refresh tokens)
243
- ✅ HU-001-005.md created (Logout)
244
-
245
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
246
- ✅ EP-001 User Stories Generated
247
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
248
-
249
- Location: user-stories/EP-001/
73
+ ```markdown
74
+ # User Story: HU-{{EPIC}}-{{FEATURE}}
250
75
 
251
- Files created:
252
- - HU-001-001.md (5 SP, 6 tasks, 8 test cases)
253
- - HU-001-002.md (3 SP, 4 tasks, 5 test cases)
254
- - HU-001-003.md (3 SP, 5 tasks, 6 test cases)
255
- - HU-001-004.md (1 SP, 2 tasks, 3 test cases)
256
- - HU-001-005.md (1 SP, 2 tasks, 2 test cases)
76
+ **Title:** {{FEATURE_NAME}}
77
+ **Priority:** {{PRIORITY}} (Must Have | Should Have | Could Have)
78
+ **Story Points:** {{SP}} SP
79
+ **Sprint:** {{SPRINT}} or "Backlog"
257
80
 
258
- Total: 5 User Stories, 13 SP, 19 tasks, 24 test cases
81
+ ## Description
259
82
 
260
- Next: Start implementing with /flow-dev-feature HU-001-001
261
- ```
83
+ **As a** {{USER_TYPE}}
84
+ **I want** {{DESIRED_FUNCTIONALITY}}
85
+ **So that** {{USER_BENEFIT}}
262
86
 
263
87
  ---
264
88
 
265
- #### **Mode 3: STORY (e.g., /flow-build fase 10 HU-001-001)**
266
-
267
- ```
268
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
269
- 📖 Generating User Story: HU-001-001
270
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
271
-
272
- Checking if file exists...
273
-
274
- ⚠️ user-stories/EP-001/HU-001-001.md already exists
89
+ ## Acceptance Criteria
275
90
 
276
- File size: 4.2 KB
277
- Last modified: 2025-12-10 15:30
91
+ > Minimum 5-6 scenarios: Happy path (2-3) + Error cases (2) + Edge/Security (1-2)
278
92
 
279
- Options:
280
- 1. 🔄 Regenerate (overwrite completely)
281
- 2. 📝 Update (merge new content, preserve manual edits)
282
- 3. 👀 View current (show existing content)
283
- 4. ❌ Cancel
93
+ 1. **Given** {{PRECONDITION}}
94
+ **When** {{ACTION}}
95
+ **Then** {{EXPECTED_RESULT}}
284
96
 
285
- Your choice (2): _
97
+ 2. **Given** {{PRECONDITION}}
98
+ **When** {{ACTION}}
99
+ **Then** {{EXPECTED_RESULT}}
286
100
 
287
- [If user chooses 1: Regenerate]
101
+ 3. **Given** {{ERROR_PRECONDITION}}
102
+ **When** {{ERROR_ACTION}}
103
+ **Then** {{ERROR_RESULT}}
288
104
 
289
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
290
- 🔄 Regenerating HU-001-001
291
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
+ 4. **Given** {{EDGE_PRECONDITION}}
106
+ **When** {{EDGE_ACTION}}
107
+ **Then** {{EDGE_RESULT}}
292
108
 
293
- ⚠️ WARNING: This will overwrite all manual changes!
294
-
295
- Backup current file? (Y/n): Y
296
-
297
- ✅ Backup created: user-stories/EP-001/.backup/HU-001-001.2025-12-12.md
298
-
299
- Loading context from roadmap.md...
300
- - Epic: EP-001 Autenticación
301
- - Feature: 1.1 Login básico (5 SP)
302
- - Priority: P0
303
-
304
- Generating User Story...
305
-
306
- ✅ HU-001-001.md regenerated successfully!
307
-
308
- Changes:
309
- + Added 2 new acceptance criteria (password strength, rate limiting)
310
- + Updated 3 test cases (added edge cases)
311
- + Refreshed Definition of Done
312
- ~ No changes to technical tasks
313
-
314
- Location: user-stories/EP-001/HU-001-001.md
315
- Backup: user-stories/EP-001/.backup/HU-001-001.2025-12-12.md
316
-
317
- [If file doesn't exist - New User Story]
318
-
319
- ✅ File doesn't exist, creating new User Story...
320
-
321
- Context from roadmap:
322
- - Epic: EP-001 Autenticación
323
- - Feature: 1.1 Login básico (5 SP)
324
- - Priority: P0 (Critical)
325
- - Tasks: 6 (from roadmap.md)
326
-
327
- Generating User Story with:
328
- ✅ User Story format (Como/Quiero/Para)
329
- ✅ Acceptance Criteria (Gherkin Given/When/Then)
330
- ✅ Technical Tasks (Backend/Frontend/Testing)
331
- ✅ QA Test Cases (derived from criteria)
332
- ✅ Estimation (Story Points + Time)
333
- ✅ Dependencies
334
- ✅ Definition of Done
335
-
336
- ✅ HU-001-001.md created successfully!
337
-
338
- Location: user-stories/EP-001/HU-001-001.md
339
- Size: 4.2 KB
340
- Tasks: 6
341
- Test Cases: 8
342
- Story Points: 5 SP (~6-8h)
343
-
344
- Next: Implement with /flow-dev-feature HU-001-001
345
- ```
109
+ 5. **Given** {{SECURITY_PRECONDITION}}
110
+ **When** {{SECURITY_ACTION}}
111
+ **Then** {{SECURITY_RESULT}}
346
112
 
347
113
  ---
348
114
 
349
- ### Step 10.3: Generate User Story Document
350
-
351
- **For each User Story, generate complete `.md` file with this structure:**
352
-
353
- ```markdown
354
- # 📖 Historia de Usuario: HU-{{XXX}}-{{YYY}} - {{TÍTULO}}
355
-
356
- ## Epic
115
+ ## Technical Notes
357
116
 
358
- EP-{{XXX}}: {{EPIC_NAME}}
117
+ > From ai-instructions.md, architecture.md, security.md
359
118
 
360
- ## Historia de Usuario
361
-
362
- **ID:** HU-{{XXX}}-{{YYY}}
363
- **Título:** {{FEATURE_NAME}}
364
- **Prioridad:** {{PRIORITY}} (Alta | Media | Baja)
365
- **Sprint:** {{SPRINT_NUMBER}} o "Backlog"
366
- **Story Points:** {{SP}} SP
367
- **Estimación:** {{TIME_ESTIMATE}}
368
-
369
- **Como:** {{USER_TYPE}}
370
- **Quiero:** {{DESIRED_FUNCTIONALITY}}
371
- **Para:** {{USER_BENEFIT}}
119
+ - {{IMPLEMENTATION_DETAIL_1}}
120
+ - {{IMPLEMENTATION_DETAIL_2}}
121
+ - {{SECURITY_REQUIREMENT}}
122
+ - {{INTEGRATION_DETAIL}}
372
123
 
373
124
  ---
374
125
 
375
- ## Criterios de Aceptación
376
-
377
- ### Escenario 1: {{SCENARIO_NAME}}
126
+ ## Tasks
378
127
 
379
- **Dado que** {{PRECONDITION}}
380
- **Cuando** {{ACTION}}
381
- **Entonces** {{EXPECTED_RESULT}}
128
+ > Inherited from docs/roadmap.md Feature {{FEATURE_NUMBER}}
382
129
 
383
- ### Escenario 2: {{SCENARIO_NAME}}
130
+ {{TASKS_FROM_ROADMAP}}
384
131
 
385
- **Dado que** {{PRECONDITION}}
386
- **Cuando** {{ACTION}}
387
- **Entonces** {{EXPECTED_RESULT}}
388
-
389
- ### Escenario 3: {{SCENARIO_NAME}}
132
+ ---
390
133
 
391
- **Dado que** {{PRECONDITION}}
392
- **Cuando** {{ACTION}}
393
- **Entonces** {{EXPECTED_RESULT}}
134
+ ## Dependencies
394
135
 
395
- **[Generate 3-5 scenarios covering: happy path, error cases, edge cases]**
136
+ - **Requires:** {{REQUIRED_STORIES}}
137
+ - **Blocks:** {{BLOCKED_STORIES}}
138
+ - **Related:** {{RELATED_STORIES}}
396
139
 
397
140
  ---
398
141
 
399
- ## Tareas Técnicas
142
+ ## Definition of Done
400
143
 
401
- > **Source:** Inherited from roadmap.md Feature {{FEATURE_NUMBER}}
144
+ - [ ] Code implemented and peer reviewed
145
+ - [ ] Unit tests passing (coverage >= 80%)
146
+ - [ ] Integration tests implemented
147
+ - [ ] Security requirements verified
148
+ - [ ] API documentation updated
149
+ - [ ] QA validation completed
150
+ - [ ] No lint/format errors
402
151
 
403
- ### Backend
152
+ ---
404
153
 
405
- - [ ] **T-{{XXX}}-001:** {{TASK_DESCRIPTION}} • {{SP}} SP (~{{TIME}})
406
- File: {{FILE_PATH}}
407
- Dependencies: {{DEPENDENCIES}}
154
+ ## Estimation
408
155
 
409
- - [ ] **T-{{XXX}}-002:** {{TASK_DESCRIPTION}} • {{SP}} SP (~{{TIME}})
410
- File: {{FILE_PATH}}
411
- Dependencies: {{DEPENDENCIES}}
156
+ - **Story Points:** {{SP}} SP
157
+ - **Time Estimate:** {{TIME_RANGE}}
158
+ - **Complexity:** {{COMPLEXITY}} (Low | Medium | High)
412
159
 
413
- ### Frontend (if applicable)
160
+ ---
414
161
 
415
- - [ ] **T-{{XXX}}-003:** {{TASK_DESCRIPTION}} • {{SP}} SP (~{{TIME}})
416
- File: {{FILE_PATH}}
417
- Dependencies: {{DEPENDENCIES}}
162
+ ## Assignment
418
163
 
419
- ### Testing
164
+ - **Assigned to:** (Unassigned)
165
+ - **Start date:** (TBD)
166
+ - **Due date:** (TBD)
167
+ - **Status:** Draft | Ready | In Progress | Done
168
+ ```
420
169
 
421
- - [ ] **T-{{XXX}}-004:** {{TASK_DESCRIPTION}} • {{SP}} SP (~{{TIME}})
422
- File: {{FILE_PATH}}
423
- Dependencies: {{DEPENDENCIES}}
170
+ ---
424
171
 
425
- **Total Tasks:** {{N}}
426
- **Total SP:** {{TOTAL_SP}} Story Points
172
+ ### Step 10.4: Generate Test Cases (Separate Files)
427
173
 
428
- ---
174
+ **For each User Story, create `docs/user-stories/EP-XXX/tests/TC-XXX-YYY.md`:**
429
175
 
430
- ## Casos de Prueba (QA)
176
+ ```markdown
177
+ # Test Cases: HU-{{EPIC}}-{{FEATURE}}
431
178
 
432
- > **Derived from:** Acceptance Criteria (1 scenario = 1-2 test cases)
179
+ > Derived from Acceptance Criteria (1-2 test cases per scenario)
433
180
 
434
- ### TC-{{XXX}}-001: {{TEST_NAME}} (Happy Path)
181
+ ## TC-001: {{TEST_NAME}} (Happy Path)
435
182
 
436
- - **Precondición:** {{INITIAL_STATE}}
437
- - **Pasos:**
183
+ - **Precondition:** {{INITIAL_STATE}}
184
+ - **Test Data:**
185
+ - Field1: `value1`
186
+ - Field2: `value2`
187
+ - **Steps:**
438
188
  1. {{STEP_1}}
439
189
  2. {{STEP_2}}
440
190
  3. {{STEP_3}}
441
- - **Resultado Esperado:** {{EXPECTED_OUTCOME}}
442
- - **Prioridad:** Alta
443
- - **Tipo:** Funcional | Integración | E2E
191
+ - **Expected Result:** {{EXPECTED_OUTCOME}}
192
+ - **Priority:** High
193
+ - **Type:** Functional
194
+ - **Automatable:** Yes/No
444
195
 
445
- ### TC-{{XXX}}-002: {{TEST_NAME}} (Error Case)
196
+ ## TC-002: {{TEST_NAME}} (Error Case)
446
197
 
447
- - **Precondición:** {{INITIAL_STATE}}
448
- - **Pasos:**
198
+ - **Precondition:** {{INITIAL_STATE}}
199
+ - **Test Data:**
200
+ - Field1: `invalid_value`
201
+ - **Steps:**
449
202
  1. {{STEP_1}}
450
203
  2. {{STEP_2}}
451
- - **Resultado Esperado:** {{ERROR_MESSAGE}}
452
- - **Prioridad:** Alta
453
- - **Tipo:** Funcional
204
+ - **Expected Result:** {{ERROR_MESSAGE}}
205
+ - **Priority:** High
206
+ - **Type:** Functional
454
207
 
455
- ### TC-{{XXX}}-003: {{TEST_NAME}} (Edge Case)
208
+ ## TC-003: {{TEST_NAME}} (Edge Case)
456
209
 
457
- - **Precondición:** {{INITIAL_STATE}}
458
- - **Pasos:**
210
+ - **Precondition:** {{INITIAL_STATE}}
211
+ - **Test Data:**
212
+ - Field1: `boundary_value`
213
+ - **Steps:**
459
214
  1. {{STEP_1}}
460
- 2. {{STEP_2}}
461
- - **Resultado Esperado:** {{EXPECTED_BEHAVIOR}}
462
- - **Prioridad:** Media
463
- - **Tipo:** Límites | Validación
464
-
465
- **[Generate 1-2 test cases per acceptance scenario = 3-10 total]**
466
-
467
- ---
215
+ - **Expected Result:** {{EXPECTED_BEHAVIOR}}
216
+ - **Priority:** Medium
217
+ - **Type:** Boundary
468
218
 
469
- ## Estimación
219
+ ## TC-004: {{TEST_NAME}} (Security)
470
220
 
471
- - **Story Points:** {{SP}} SP (from roadmap)
472
- - **Tiempo Estimado:** {{TIME_RANGE}} (e.g., 6-8h, 1-2d)
473
- - **Complejidad:** Baja | Media | Alta
221
+ - **Precondition:** {{SECURITY_STATE}}
222
+ - **Test Data:**
223
+ - Attempts: 5
224
+ - **Steps:**
225
+ 1. {{SECURITY_STEP}}
226
+ - **Expected Result:** {{SECURITY_OUTCOME}}
227
+ - **Priority:** High
228
+ - **Type:** Security
474
229
 
475
230
  ---
476
231
 
477
- ## Dependencias
478
-
479
- - **Requiere:** {{REQUIRED_STORIES}} (e.g., HU-001-001 completed)
480
- - **Bloquea:** {{BLOCKED_STORIES}} (e.g., HU-002-003 cannot start)
481
- - **Relacionado con:** {{RELATED_STORIES}}
482
-
483
- ---
484
-
485
- ## Definición de Done (DoD)
486
-
487
- - [ ] Código implementado siguiendo ai-instructions.md
488
- - [ ] Code review aprobado (mín 1 revisor)
489
- - [ ] Tests unitarios escritos (cobertura > 80%)
490
- - [ ] Tests de integración pasando
491
- - [ ] Casos de prueba QA ejecutados y aprobados ({{N}}/{{N}})
492
- - [ ] Documentación técnica actualizada (docs/api.md, etc.)
493
- - [ ] Sin errores de lint ni formateo
494
- - [ ] Deploy a staging exitoso
495
- - [ ] Product Owner aprobó la funcionalidad
496
-
497
- ---
498
-
499
- ## Notas Técnicas
500
-
501
- > **Context from:**
502
- >
503
- > - ai-instructions.md ({{FRAMEWORK}} patterns)
504
- > - docs/architecture.md ({{ARCHITECTURE_PATTERN}})
505
- > - specs/security.md (authentication, validation)
506
-
507
- ### Consideraciones de Implementación:
508
-
509
- - {{TECHNICAL_NOTE_1}}
510
- - {{TECHNICAL_NOTE_2}}
511
- - {{ARCHITECTURE_DECISION}}
512
-
513
- ### APIs/Servicios Involucrados:
514
-
515
- - **Endpoint:** `{{HTTP_METHOD}} {{ENDPOINT_PATH}}`
516
- - **Servicio externo:** {{EXTERNAL_SERVICE}} (if any)
517
-
518
- ### Seguridad/Performance:
519
-
520
- - {{SECURITY_CONSIDERATION}}
521
- - {{PERFORMANCE_OPTIMIZATION}}
522
-
523
- ---
524
-
525
- ## Diseño/Prototipo
526
-
527
- 🎨 **Diseño:** {{DESIGN_LINK}} (if provided by user)
528
-
529
- ---
530
-
531
- ## Historial
532
-
533
- - **Creada:** {{DATE}} (Phase 10)
534
- - **Actualizada:** {{DATE}} (if regenerated)
535
- - **Estado:** Draft | Ready | In Progress | Done
232
+ **Total Test Cases:** {{N}}
233
+ **Coverage:** {{N}}/{{TOTAL_CRITERIA}} (100%)
536
234
  ```
537
235
 
538
236
  ---
539
237
 
540
- ### Step 10.4: Update Roadmap with Links
541
-
542
- **After generating User Stories, update roadmap.md to add links:**
238
+ ### Step 10.5: Update Roadmap with Links
543
239
 
544
- ```
545
- Updating roadmap.md with User Story links...
546
-
547
- ✅ Updated Feature 1.1 with link to HU-001-001
548
- ✅ Updated Feature 1.2 with link to HU-001-002
549
- ✅ Updated Feature 1.3 with link to HU-001-003
550
-
551
- roadmap.md updated successfully!
552
- ```
553
-
554
- **Updated roadmap.md format:**
240
+ **After generating, update `docs/roadmap.md`:**
555
241
 
556
242
  ```markdown
557
- ### Feature 1.1: Login básico 5 SP (~6-8h)
243
+ ### Feature 1.1: {{FEATURE_NAME}}{{SP}} SP
558
244
 
559
- **User Story:** 📖 [HU-001-001](./user-stories/EP-001/HU-001-001.md)
560
-
561
- **Status:** ⚪ Not Started
245
+ **User Story:** [HU-001-001](docs/user-stories/EP-001/HU-001-001.md)
246
+ **Status:** Not Started
562
247
 
563
248
  **Tasks:**
564
-
565
- - [ ] T001 Write User entity tests • 1 SP
566
- - [ ] T002 Create User entity • 1 SP
567
- ...
249
+ {{TASKS}}
568
250
  ```
569
251
 
570
252
  ---
571
253
 
572
- ## 🎯 Generation Rules
573
-
574
- ### **1. User Story Format**
575
-
576
- - **Como:** Extract from project-brief.md (target users)
577
- - **Quiero:** From Feature name in roadmap
578
- - **Para:** From Feature scope/benefits
579
-
580
- ### **2. Acceptance Criteria**
581
-
582
- - **Minimum 3 scenarios:** Happy path + Error case + Edge case
583
- - **Gherkin format:** Dado/Cuando/Entonces (Given/When/Then)
584
- - **Testable:** Each scenario = executable test
585
- - **Based on:** API docs, business flows, security specs
586
-
587
- ### **3. Technical Tasks**
588
-
589
- - **Inherit from roadmap:** Use Tasks from roadmap.md Feature
590
- - **Add file paths:** Exact location where code goes
591
- - **Add dependencies:** Which tasks block others
592
- - **Keep Story Points:** From roadmap estimation
593
-
594
- ### **4. Test Cases**
595
-
596
- - **Derive from criteria:** 1-2 test cases per acceptance scenario
597
- - **Types:** Funcional, Integración, E2E, Límites
598
- - **Priority:** Alta for happy/error paths, Media for edge cases
599
- - **Format:** Precondición Pasos Resultado esperado
600
-
601
- ### **5. Definition of Done**
602
-
603
- **Standard checklist (same for all stories):**
604
-
605
- - Code implemented
606
- - Code review passed
607
- - Tests written (unit + integration)
608
- - Tests passing
609
- - QA test cases executed
610
- - Documentation updated
611
- - Lint/format clean
612
- - Staging deploy successful
613
- - PO approval
614
-
615
- ### **6. Technical Notes**
616
-
617
- **Pull from documentation:**
618
-
619
- - `ai-instructions.md` → Framework patterns, code conventions
620
- - `docs/architecture.md` → Architecture pattern (Hexagonal, Clean, etc.)
621
- - `docs/data-model.md` → Entity schemas, relationships
622
- - `specs/security.md` → Auth requirements, validations
623
- - `docs/api.md` → Endpoint details
254
+ ## Generation Rules
255
+
256
+ ### User Story Format
257
+ - **Title:** From Feature name in roadmap
258
+ - **Priority:** MoSCoW (Must/Should/Could/Won't Have)
259
+ - **As a:** From project-brief.md (target users)
260
+ - **I want:** From Feature description
261
+ - **So that:** User value/benefit
262
+
263
+ ### Acceptance Criteria
264
+ - **Minimum 5-6 scenarios**
265
+ - **Gherkin format:** Given/When/Then
266
+ - **Include:** Happy path, Error cases, Edge cases, Security
267
+ - **Each scenario = executable test**
268
+
269
+ ### Technical Notes
270
+ - Pull from ai-instructions.md, architecture.md, security.md
271
+ - Be specific (e.g., "bcrypt 12 rounds", not "hash passwords")
272
+ - Include rate limiting, logging, integrations
273
+
274
+ ### Tasks
275
+ - **Inherit from roadmap** (don't duplicate)
276
+ - Keep same format: `TXXX [CAT] Desc • N SP → {{path}} | deps: X`
277
+ - Keep Story Points from roadmap
278
+
279
+ ### Test Cases
280
+ - **Separate file** per User Story
281
+ - 1-2 test cases per acceptance scenario
282
+ - Include specific test data
283
+ - Mark priority and type
624
284
 
625
285
  ---
626
286
 
627
- ## ⚠️ Rules & Constraints
628
-
629
- ### **NEVER:**
287
+ ## DO NOT
630
288
 
631
289
  - ❌ Create User Story without roadmap context
632
- - ❌ Duplicate tasks from roadmap (reference, don't copy)
633
- - ❌ Skip acceptance criteria
634
- - ❌ Generate test cases without criteria
635
- - ❌ Use generic DoD (personalize per story if needed)
636
- - ❌ Forget to update roadmap.md with links
637
-
638
- ### **ALWAYS:**
639
-
640
- - ✅ Inherit Story Points from roadmap
641
- - ✅ Generate 3-5 acceptance scenarios (Gherkin)
642
- - ✅ Derive 1-2 test cases per scenario
643
- - ✅ Link back to Epic and Feature
644
- - ✅ Include technical context from docs
645
- - ✅ Update roadmap.md with User Story links
290
+ - ❌ Skip acceptance criteria (minimum 5-6 required)
291
+ - ❌ Generate generic test cases without test data
292
+ - ❌ Duplicate tasks from roadmap
293
+ - ❌ Omit security scenarios
294
+ - ❌ Hardcode language-specific details
295
+ - ❌ Forget to update roadmap with links
296
+
297
+ ## ALWAYS
298
+
299
+ - ✅ Inherit context variables from roadmap
300
+ - ✅ Generate 5-6 Gherkin acceptance scenarios
301
+ - ✅ Include security scenarios
302
+ - ✅ Derive test cases from criteria
303
+ - ✅ Separate test cases into tests/ folder
304
+ - ✅ Update roadmap with User Story links
646
305
  - ✅ Create backup before regenerating
647
306
 
648
307
  ---
649
308
 
650
- ## 📊 Summary Format
651
-
652
- **After generation, show:**
309
+ ## Summary
653
310
 
654
311
  ```
655
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
656
- PHASE 10 COMPLETE: USER STORIES GENERATED
657
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
658
-
659
- Generated: {{N}} User Stories
660
- Total Story Points: {{SP}} SP
661
- Total Tasks: {{TASKS}}
662
- Total Test Cases: {{TC}}
663
-
664
- Files created:
665
- 📁 user-stories/
666
- ├── EP-001/ (5 stories, 13 SP)
667
- ├── EP-002/ (3 stories, 21 SP)
668
- └── EP-003/ (4 stories, 18 SP)
669
-
670
- Updated:
671
- ✅ roadmap.md (added User Story links)
672
-
673
- 🚀 Ready to start development!
312
+ PHASE 10 COMPLETE
313
+ ├── Generated: X User Stories
314
+ ├── Total SP: X SP
315
+ ├── Test Cases: X
316
+ ├── Files: docs/user-stories/EP-XXX/
317
+ └── Updated: docs/roadmap.md (added links)
674
318
 
675
319
  Next steps:
676
- 1. Review User Stories in user-stories/ folder
320
+ 1. Review User Stories in docs/user-stories/
677
321
  2. Start implementing: /flow-dev-feature HU-001-001
678
- 3. Track progress: /flow-dev-work
679
- 4. Generate more stories: /flow-build fase 10 EP-004
680
-
681
- Happy coding! 🎉
322
+ 3. Generate more: /flow-build fase 10 EP-XXX
682
323
  ```
683
-
684
- ---
685
-
686
- ## 🔗 Integration with Phase 9
687
-
688
- **Phase 9 provides:**
689
-
690
- - Epics structure
691
- - Features with Story Points
692
- - Technical tasks breakdown
693
- - Dependencies
694
-
695
- **Phase 10 adds:**
696
-
697
- - User Story format (Como/Quiero/Para)
698
- - Acceptance criteria (Gherkin)
699
- - Test cases (derived from criteria)
700
- - Definition of Done
701
- - Technical context from all docs
702
-
703
- **Together they form:** Complete backlog ready for execution
704
-
705
- ---
706
-
707
- **EXECUTION:** Execute workflow based on detected mode (ALL | EPIC | STORY)