ai-flow-dev 2.7.0 → 2.8.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.
- package/LICENSE +21 -21
- package/README.md +573 -570
- package/package.json +74 -74
- package/prompts/backend/flow-build-phase-0.md +535 -535
- package/prompts/backend/flow-build-phase-1.md +626 -626
- package/prompts/backend/flow-build-phase-10.md +340 -340
- package/prompts/backend/flow-build-phase-2.md +573 -573
- package/prompts/backend/flow-build-phase-3.md +834 -834
- package/prompts/backend/flow-build-phase-4.md +554 -554
- package/prompts/backend/flow-build-phase-5.md +703 -703
- package/prompts/backend/flow-build-phase-6.md +524 -524
- package/prompts/backend/flow-build-phase-7.md +1001 -1001
- package/prompts/backend/flow-build-phase-8.md +1407 -1407
- package/prompts/backend/flow-build-phase-9.md +477 -477
- package/prompts/backend/flow-build.md +137 -137
- package/prompts/backend/flow-check-review.md +656 -20
- package/prompts/backend/flow-check-test.md +526 -14
- package/prompts/backend/flow-check.md +717 -67
- package/prompts/backend/flow-commit.md +88 -119
- package/prompts/backend/flow-docs-sync.md +354 -354
- package/prompts/backend/flow-finish.md +919 -0
- package/prompts/backend/flow-release.md +949 -0
- package/prompts/backend/flow-work-feature.md +61 -61
- package/prompts/backend/flow-work-fix.md +46 -46
- package/prompts/backend/flow-work-refactor.md +48 -48
- package/prompts/backend/flow-work-resume.md +34 -34
- package/prompts/backend/flow-work.md +1098 -1286
- package/prompts/desktop/flow-build-phase-0.md +359 -359
- package/prompts/desktop/flow-build-phase-1.md +295 -295
- package/prompts/desktop/flow-build-phase-10.md +357 -357
- package/prompts/desktop/flow-build-phase-2.md +282 -282
- package/prompts/desktop/flow-build-phase-3.md +291 -291
- package/prompts/desktop/flow-build-phase-4.md +308 -308
- package/prompts/desktop/flow-build-phase-5.md +269 -269
- package/prompts/desktop/flow-build-phase-6.md +350 -350
- package/prompts/desktop/flow-build-phase-7.md +297 -297
- package/prompts/desktop/flow-build-phase-8.md +541 -541
- package/prompts/desktop/flow-build-phase-9.md +439 -439
- package/prompts/desktop/flow-build.md +156 -156
- package/prompts/desktop/flow-check-review.md +656 -20
- package/prompts/desktop/flow-check-test.md +526 -14
- package/prompts/desktop/flow-check.md +717 -67
- package/prompts/desktop/flow-commit.md +88 -119
- package/prompts/desktop/flow-docs-sync.md +354 -354
- package/prompts/desktop/flow-finish.md +919 -0
- package/prompts/desktop/flow-release.md +662 -0
- package/prompts/desktop/flow-work-feature.md +61 -61
- package/prompts/desktop/flow-work-fix.md +46 -46
- package/prompts/desktop/flow-work-refactor.md +48 -48
- package/prompts/desktop/flow-work-resume.md +34 -34
- package/prompts/desktop/flow-work.md +1202 -1390
- package/prompts/frontend/flow-build-phase-0.md +425 -425
- package/prompts/frontend/flow-build-phase-1.md +626 -626
- package/prompts/frontend/flow-build-phase-10.md +33 -33
- package/prompts/frontend/flow-build-phase-2.md +573 -573
- package/prompts/frontend/flow-build-phase-3.md +782 -782
- package/prompts/frontend/flow-build-phase-4.md +554 -554
- package/prompts/frontend/flow-build-phase-5.md +703 -703
- package/prompts/frontend/flow-build-phase-6.md +524 -524
- package/prompts/frontend/flow-build-phase-7.md +1001 -1001
- package/prompts/frontend/flow-build-phase-8.md +872 -872
- package/prompts/frontend/flow-build-phase-9.md +94 -94
- package/prompts/frontend/flow-build.md +137 -137
- package/prompts/frontend/flow-check-review.md +656 -20
- package/prompts/frontend/flow-check-test.md +526 -14
- package/prompts/frontend/flow-check.md +717 -67
- package/prompts/frontend/flow-commit.md +88 -119
- package/prompts/frontend/flow-docs-sync.md +550 -550
- package/prompts/frontend/flow-finish.md +919 -0
- package/prompts/frontend/flow-release.md +519 -0
- package/prompts/frontend/flow-work-api.md +1547 -0
- package/prompts/frontend/flow-work-feature.md +61 -61
- package/prompts/frontend/flow-work-fix.md +38 -38
- package/prompts/frontend/flow-work-refactor.md +48 -48
- package/prompts/frontend/flow-work-resume.md +34 -34
- package/prompts/frontend/flow-work.md +1595 -1320
- package/prompts/mobile/flow-build-phase-0.md +425 -425
- package/prompts/mobile/flow-build-phase-1.md +626 -626
- package/prompts/mobile/flow-build-phase-10.md +32 -32
- package/prompts/mobile/flow-build-phase-2.md +573 -573
- package/prompts/mobile/flow-build-phase-3.md +782 -782
- package/prompts/mobile/flow-build-phase-4.md +554 -554
- package/prompts/mobile/flow-build-phase-5.md +703 -703
- package/prompts/mobile/flow-build-phase-6.md +524 -524
- package/prompts/mobile/flow-build-phase-7.md +1001 -1001
- package/prompts/mobile/flow-build-phase-8.md +888 -888
- package/prompts/mobile/flow-build-phase-9.md +90 -90
- package/prompts/mobile/flow-build.md +135 -135
- package/prompts/mobile/flow-check-review.md +656 -20
- package/prompts/mobile/flow-check-test.md +526 -14
- package/prompts/mobile/flow-check.md +717 -67
- package/prompts/mobile/flow-commit.md +88 -119
- package/prompts/mobile/flow-docs-sync.md +620 -620
- package/prompts/mobile/flow-finish.md +919 -0
- package/prompts/mobile/flow-release.md +751 -0
- package/prompts/mobile/flow-work-api.md +1500 -0
- package/prompts/mobile/flow-work-feature.md +61 -61
- package/prompts/mobile/flow-work-fix.md +46 -46
- package/prompts/mobile/flow-work-refactor.md +48 -48
- package/prompts/mobile/flow-work-resume.md +34 -34
- package/prompts/mobile/flow-work.md +1605 -1329
- package/prompts/shared/mermaid-guidelines.md +102 -102
- package/prompts/shared/scope-levels.md +114 -114
- package/prompts/shared/smart-skip-preflight.md +214 -214
- package/prompts/shared/story-points.md +55 -55
- package/prompts/shared/task-format.md +74 -74
- package/prompts/shared/task-summary-template.md +277 -277
- package/templates/AGENT.template.md +443 -443
- package/templates/backend/.clauderules.template +112 -112
- package/templates/backend/.cursorrules.template +102 -102
- package/templates/backend/README.template.md +2 -2
- package/templates/backend/ai-instructions.template.md +2 -2
- package/templates/backend/copilot-instructions.template.md +2 -2
- package/templates/backend/docs/api.template.md +320 -320
- package/templates/backend/docs/business-flows.template.md +97 -97
- package/templates/backend/docs/code-standards.template.md +2 -2
- package/templates/backend/docs/contributing.template.md +3 -3
- package/templates/backend/docs/data-model.template.md +520 -520
- package/templates/backend/docs/testing.template.md +2 -2
- package/templates/backend/project-brief.template.md +2 -2
- package/templates/backend/specs/configuration.template.md +2 -2
- package/templates/backend/specs/security.template.md +2 -2
- package/templates/desktop/.clauderules.template +112 -112
- package/templates/desktop/.cursorrules.template +102 -102
- package/templates/desktop/README.template.md +170 -170
- package/templates/desktop/ai-instructions.template.md +366 -366
- package/templates/desktop/copilot-instructions.template.md +140 -140
- package/templates/desktop/docs/docs/api.template.md +320 -320
- package/templates/desktop/docs/docs/architecture.template.md +724 -724
- package/templates/desktop/docs/docs/business-flows.template.md +102 -102
- package/templates/desktop/docs/docs/code-standards.template.md +792 -792
- package/templates/desktop/docs/docs/contributing.template.md +149 -149
- package/templates/desktop/docs/docs/data-model.template.md +520 -520
- package/templates/desktop/docs/docs/operations.template.md +720 -720
- package/templates/desktop/docs/docs/testing.template.md +722 -722
- package/templates/desktop/project-brief.template.md +150 -150
- package/templates/desktop/specs/specs/configuration.template.md +121 -121
- package/templates/desktop/specs/specs/security.template.md +392 -392
- package/templates/frontend/README.template.md +2 -2
- package/templates/frontend/ai-instructions.template.md +2 -2
- package/templates/frontend/docs/api-integration.template.md +362 -362
- package/templates/frontend/docs/components.template.md +2 -2
- package/templates/frontend/docs/error-handling.template.md +360 -360
- package/templates/frontend/docs/operations.template.md +107 -107
- package/templates/frontend/docs/performance.template.md +124 -124
- package/templates/frontend/docs/pwa.template.md +119 -119
- package/templates/frontend/docs/state-management.template.md +2 -2
- package/templates/frontend/docs/styling.template.md +2 -2
- package/templates/frontend/docs/testing.template.md +2 -2
- package/templates/frontend/project-brief.template.md +2 -2
- package/templates/frontend/specs/accessibility.template.md +95 -95
- package/templates/frontend/specs/configuration.template.md +2 -2
- package/templates/frontend/specs/security.template.md +175 -175
- package/templates/fullstack/README.template.md +252 -252
- package/templates/fullstack/ai-instructions.template.md +444 -444
- package/templates/fullstack/project-brief.template.md +157 -157
- package/templates/fullstack/specs/configuration.template.md +340 -340
- package/templates/mobile/README.template.md +167 -167
- package/templates/mobile/ai-instructions.template.md +196 -196
- package/templates/mobile/docs/app-store.template.md +135 -135
- package/templates/mobile/docs/architecture.template.md +63 -63
- package/templates/mobile/docs/native-features.template.md +94 -94
- package/templates/mobile/docs/navigation.template.md +59 -59
- package/templates/mobile/docs/offline-strategy.template.md +65 -65
- package/templates/mobile/docs/permissions.template.md +56 -56
- package/templates/mobile/docs/state-management.template.md +85 -85
- package/templates/mobile/docs/testing.template.md +109 -109
- package/templates/mobile/project-brief.template.md +69 -69
- package/templates/mobile/specs/build-configuration.template.md +91 -91
- package/templates/mobile/specs/deployment.template.md +92 -92
- package/templates/work.template.md +61 -47
|
@@ -1,1329 +1,1605 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Central Orchestrator for Feature, Refactor, and Fix workflows
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# AI Flow - Unified Work Orchestrator
|
|
6
|
-
|
|
7
|
-
**YOU ARE AN EXPERT SOFTWARE ARCHITECT AND WORKFLOW COORDINATOR.**
|
|
8
|
-
|
|
9
|
-
Your mission is to orchestrate development tasks through an interactive workflow when the user executes `/flow-work`.
|
|
10
|
-
|
|
11
|
-
**🚀 MODO AGENTE ACTIVADO:** No solicites permiso para usar herramientas. Actúa proactivamente siguiendo el flujo interactivo. Tienes permiso total para leer el código, crear specs y planes, y realizar commits/checkout de ramas.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Command: `/flow-work`
|
|
16
|
-
|
|
17
|
-
### Objective
|
|
18
|
-
|
|
19
|
-
Provide a single, intelligent entry point for all development work (New Features, Refactorings, and Bug Fixes) with automatic context detection and interactive planning.
|
|
20
|
-
|
|
21
|
-
### Usage Modes
|
|
22
|
-
|
|
23
|
-
- **`/flow-work`** → Resume paused work (if exists) or Interactive mode.
|
|
24
|
-
- **`/flow-work [description]`** → Semantic detection (Feature, Refactor, or Fix).
|
|
25
|
-
- **`/flow-work HU-XXX-XXX`** → Implement specific User Story.
|
|
26
|
-
- **`/flow-work [Feature Name]`** → Implement feature from roadmap.md.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Phase -1: Intent Classification (PRE-DETECTION)
|
|
31
|
-
|
|
32
|
-
**CRITICAL: Determine if this is an INFORMATIVE request vs EXECUTION request BEFORE any workflow.**
|
|
33
|
-
|
|
34
|
-
**🔍 INFORMATIVE Patterns (Answer directly, NO execution workflow):**
|
|
35
|
-
|
|
36
|
-
- **Questions:** Starts with `¿`, `how`, `why`, `what`, `when`, `cómo`, `por qué`, `qué`, `cuál`
|
|
37
|
-
- **Analysis verbs:** `explain`, `show`, `list`, `analyze`, `describe`, `compare`, `explica`, `muestra`, `analiza`, `describe`, `compara`
|
|
38
|
-
- **Report requests:** `report`, `informe`, `document`, `documenta`, `summary`, `resumen`, `generate report`, `genera informe`
|
|
39
|
-
- **Exploration:** `find`, `search`, `busca`, `encuentra`, `where is`, `dónde está`
|
|
40
|
-
- **Review requests:** `review`, `revisa`, `check`, `verifica`, `audit`, `audita`
|
|
41
|
-
|
|
42
|
-
**🛠️ EXECUTION Patterns (Enter workflow):**
|
|
43
|
-
|
|
44
|
-
- **Action verbs:** `implement`, `create`, `refactor`, `fix`, `add`, `remove`, `update`, `delete`, `build`, `develop`
|
|
45
|
-
- **Task codes:** `HU-\d{3}-\d{3}`, `EP-\d{3}`, `T\d{3}`
|
|
46
|
-
- **Imperative:** `new feature`, `nueva feature`, `crear`, `implementar`
|
|
47
|
-
|
|
48
|
-
**Detection Logic:**
|
|
49
|
-
|
|
50
|
-
```python
|
|
51
|
-
import re
|
|
52
|
-
|
|
53
|
-
# Normalize input
|
|
54
|
-
input_lower = input.strip().lower()
|
|
55
|
-
|
|
56
|
-
# INFORMATIVE patterns (high priority)
|
|
57
|
-
informative_patterns = [
|
|
58
|
-
r'^(¿|how|why|what|when|where|cómo|por qué|qué|cuál|dónde)',
|
|
59
|
-
r'^(explain|show|list|analyze|describe|compare|explica|muestra|analiza|describe|compara)',
|
|
60
|
-
r'(report|informe|document|documenta|summary|resumen)',
|
|
61
|
-
r'(find|search|busca|encuentra)',
|
|
62
|
-
r'(review|revisa|check|verifica|audit|audita)',
|
|
63
|
-
]
|
|
64
|
-
|
|
65
|
-
for pattern in informative_patterns:
|
|
66
|
-
if re.search(pattern, input_lower):
|
|
67
|
-
return "INFORMATIVE" # → Jump to Phase 99
|
|
68
|
-
|
|
69
|
-
# EXECUTION patterns
|
|
70
|
-
execution_patterns = [
|
|
71
|
-
r'(HU-\d{3}-\d{3}|EP-\d{3}|T\d{3})', # Task codes
|
|
72
|
-
r'^(implement|create|refactor|fix|add|remove|update|delete|build|develop)',
|
|
73
|
-
r'(implementar|crear|nueva feature|new feature)',
|
|
74
|
-
]
|
|
75
|
-
|
|
76
|
-
for pattern in execution_patterns:
|
|
77
|
-
if re.search(pattern, input_lower):
|
|
78
|
-
return "EXECUTION" # → Continue to Phase 0
|
|
79
|
-
|
|
80
|
-
# Ambiguous case - ask user
|
|
81
|
-
return "AMBIGUOUS"
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Action based on detection:**
|
|
85
|
-
|
|
86
|
-
**IF mode == "INFORMATIVE":**
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
🔍 Detected: Informative request (question/report/analysis)
|
|
90
|
-
|
|
91
|
-
I'll provide a detailed answer without creating work files or branches.
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
→ **Jump to Phase 99: Informative Response**
|
|
95
|
-
|
|
96
|
-
**IF mode == "EXECUTION":**
|
|
97
|
-
|
|
98
|
-
→ **Continue to Phase 0** (current workflow)
|
|
99
|
-
|
|
100
|
-
**IF mode == "AMBIGUOUS":**
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
❓ I'm not sure if this is:
|
|
104
|
-
A) A question/report request (I'll answer directly)
|
|
105
|
-
B) A task to implement (I'll create work plan and execute)
|
|
106
|
-
|
|
107
|
-
Please clarify (A/B): _
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Phase 0: Detection & Strategy (Automatic)
|
|
113
|
-
|
|
114
|
-
**1. Semantic Analysis of Input:**
|
|
115
|
-
|
|
116
|
-
| Input Pattern | Mode | Source / Action |
|
|
117
|
-
| ------------------------------ | ----------------- | -------------------------------------------------------------------- |
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
| "
|
|
125
|
-
| "
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- **
|
|
132
|
-
- **
|
|
133
|
-
- **
|
|
134
|
-
- **
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
-
|
|
458
|
-
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
**
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
-
|
|
616
|
-
- **
|
|
617
|
-
- **
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
**
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
**
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
**IF
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
---
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
-
|
|
864
|
-
-
|
|
865
|
-
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
2
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
**
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
**
|
|
1112
|
-
|
|
1113
|
-
- **
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
-
|
|
1117
|
-
-
|
|
1118
|
-
-
|
|
1119
|
-
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
-
|
|
1140
|
-
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
**
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
```
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
###
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Central Orchestrator for Feature, Refactor, and Fix workflows
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# AI Flow - Unified Work Orchestrator
|
|
6
|
+
|
|
7
|
+
**YOU ARE AN EXPERT SOFTWARE ARCHITECT AND WORKFLOW COORDINATOR.**
|
|
8
|
+
|
|
9
|
+
Your mission is to orchestrate development tasks through an interactive workflow when the user executes `/flow-work`.
|
|
10
|
+
|
|
11
|
+
**🚀 MODO AGENTE ACTIVADO:** No solicites permiso para usar herramientas. Actúa proactivamente siguiendo el flujo interactivo. Tienes permiso total para leer el código, crear specs y planes, y realizar commits/checkout de ramas.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Command: `/flow-work`
|
|
16
|
+
|
|
17
|
+
### Objective
|
|
18
|
+
|
|
19
|
+
Provide a single, intelligent entry point for all development work (New Features, Refactorings, and Bug Fixes) with automatic context detection and interactive planning.
|
|
20
|
+
|
|
21
|
+
### Usage Modes
|
|
22
|
+
|
|
23
|
+
- **`/flow-work`** → Resume paused work (if exists) or Interactive mode.
|
|
24
|
+
- **`/flow-work [description]`** → Semantic detection (Feature, Refactor, or Fix).
|
|
25
|
+
- **`/flow-work HU-XXX-XXX`** → Implement specific User Story.
|
|
26
|
+
- **`/flow-work [Feature Name]`** → Implement feature from roadmap.md.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Phase -1: Intent Classification (PRE-DETECTION)
|
|
31
|
+
|
|
32
|
+
**CRITICAL: Determine if this is an INFORMATIVE request vs EXECUTION request BEFORE any workflow.**
|
|
33
|
+
|
|
34
|
+
**🔍 INFORMATIVE Patterns (Answer directly, NO execution workflow):**
|
|
35
|
+
|
|
36
|
+
- **Questions:** Starts with `¿`, `how`, `why`, `what`, `when`, `cómo`, `por qué`, `qué`, `cuál`
|
|
37
|
+
- **Analysis verbs:** `explain`, `show`, `list`, `analyze`, `describe`, `compare`, `explica`, `muestra`, `analiza`, `describe`, `compara`
|
|
38
|
+
- **Report requests:** `report`, `informe`, `document`, `documenta`, `summary`, `resumen`, `generate report`, `genera informe`
|
|
39
|
+
- **Exploration:** `find`, `search`, `busca`, `encuentra`, `where is`, `dónde está`
|
|
40
|
+
- **Review requests:** `review`, `revisa`, `check`, `verifica`, `audit`, `audita`
|
|
41
|
+
|
|
42
|
+
**🛠️ EXECUTION Patterns (Enter workflow):**
|
|
43
|
+
|
|
44
|
+
- **Action verbs:** `implement`, `create`, `refactor`, `fix`, `add`, `remove`, `update`, `delete`, `build`, `develop`
|
|
45
|
+
- **Task codes:** `HU-\d{3}-\d{3}`, `EP-\d{3}`, `T\d{3}`
|
|
46
|
+
- **Imperative:** `new feature`, `nueva feature`, `crear`, `implementar`
|
|
47
|
+
|
|
48
|
+
**Detection Logic:**
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import re
|
|
52
|
+
|
|
53
|
+
# Normalize input
|
|
54
|
+
input_lower = input.strip().lower()
|
|
55
|
+
|
|
56
|
+
# INFORMATIVE patterns (high priority)
|
|
57
|
+
informative_patterns = [
|
|
58
|
+
r'^(¿|how|why|what|when|where|cómo|por qué|qué|cuál|dónde)',
|
|
59
|
+
r'^(explain|show|list|analyze|describe|compare|explica|muestra|analiza|describe|compara)',
|
|
60
|
+
r'(report|informe|document|documenta|summary|resumen)',
|
|
61
|
+
r'(find|search|busca|encuentra)',
|
|
62
|
+
r'(review|revisa|check|verifica|audit|audita)',
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
for pattern in informative_patterns:
|
|
66
|
+
if re.search(pattern, input_lower):
|
|
67
|
+
return "INFORMATIVE" # → Jump to Phase 99
|
|
68
|
+
|
|
69
|
+
# EXECUTION patterns
|
|
70
|
+
execution_patterns = [
|
|
71
|
+
r'(HU-\d{3}-\d{3}|EP-\d{3}|T\d{3})', # Task codes
|
|
72
|
+
r'^(implement|create|refactor|fix|add|remove|update|delete|build|develop)',
|
|
73
|
+
r'(implementar|crear|nueva feature|new feature)',
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
for pattern in execution_patterns:
|
|
77
|
+
if re.search(pattern, input_lower):
|
|
78
|
+
return "EXECUTION" # → Continue to Phase 0
|
|
79
|
+
|
|
80
|
+
# Ambiguous case - ask user
|
|
81
|
+
return "AMBIGUOUS"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Action based on detection:**
|
|
85
|
+
|
|
86
|
+
**IF mode == "INFORMATIVE":**
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
🔍 Detected: Informative request (question/report/analysis)
|
|
90
|
+
|
|
91
|
+
I'll provide a detailed answer without creating work files or branches.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
→ **Jump to Phase 99: Informative Response**
|
|
95
|
+
|
|
96
|
+
**IF mode == "EXECUTION":**
|
|
97
|
+
|
|
98
|
+
→ **Continue to Phase 0** (current workflow)
|
|
99
|
+
|
|
100
|
+
**IF mode == "AMBIGUOUS":**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
❓ I'm not sure if this is:
|
|
104
|
+
A) A question/report request (I'll answer directly)
|
|
105
|
+
B) A task to implement (I'll create work plan and execute)
|
|
106
|
+
|
|
107
|
+
Please clarify (A/B): _
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Phase 0: Detection & Strategy (Automatic)
|
|
113
|
+
|
|
114
|
+
**1. Semantic Analysis of Input:**
|
|
115
|
+
|
|
116
|
+
| Input Pattern | Mode | Source / Action |
|
|
117
|
+
| ------------------------------ | ----------------- | -------------------------------------------------------------------- |
|
|
118
|
+
| `api\s+([a-z0-9\-_]+)` | `API_MODULE` | Invoke `.ai-flow/prompts/mobile/flow-work-api.md` analyzer |
|
|
119
|
+
| `HU-\d{3}-\d{3}` | `USER_STORY` | Load from `planning/user-stories/**/HU-XXX-XXX.md` |
|
|
120
|
+
| `EP-\d{3}` | `EPIC` | Analyze/List User Stories for Epic `EP-XXX` |
|
|
121
|
+
| `T\d{3}(-T\d{3})?` | `TASKS` | Target specific task or range (e.g., `T025-T030`) |
|
|
122
|
+
| `HU-XXX-XXX TXXX-TXXX` | `STORY_TASKS` | Targeted tasks within a specific User Story |
|
|
123
|
+
| Matches `planning/roadmap.md` | `ROADMAP_FEATURE` | Extract section from `planning/roadmap.md` (Partial matches allowed) |
|
|
124
|
+
| "refactor", "move", "extract" | `REFACTOR` | Use `flow-work-refactor.md` |
|
|
125
|
+
| "fix", "bug", "error", "falla" | `FIX` | Detect complexity (Quick vs Complex) |
|
|
126
|
+
| "implement", "create", "new" | `FEATURE` | Use `flow-work-feature.md` |
|
|
127
|
+
| No arguments | `RESUME` | Search for paused work in `.ai-flow/work/` |
|
|
128
|
+
|
|
129
|
+
**2. Detection Logic Details:**
|
|
130
|
+
|
|
131
|
+
- **USER_STORY / EPIC**: Load metadata from `planning/user-stories/` or `planning/roadmap.md`.
|
|
132
|
+
- **ROADMAP_FEATURE**: Fuzzy search in `planning/roadmap.md` for titles like "User Management" or "Feature 2.2".
|
|
133
|
+
- **TASK RANGES**: If `T025-T030` is provided, find the parent Story or Feature in current context or roadmap.
|
|
134
|
+
- **SIMPLE FIX**: Affects 1 file, obvious cause, <10 lines fix. → Use `flow-work-fix.md` (Quick).
|
|
135
|
+
- **COMPLEX FIX**: Multi-file, architectural, performance/security. → Use `flow-work-fix.md` (Deep).
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Phase 0.1: API Module Analysis (Conditional)
|
|
140
|
+
|
|
141
|
+
**ONLY execute if `mode == "API_MODULE"`**
|
|
142
|
+
|
|
143
|
+
This phase manages API URL configuration, invokes the specialized API analyzer, and enriches workflow context with OpenAPI metadata.
|
|
144
|
+
|
|
145
|
+
**🏗️ Architecture Design:**
|
|
146
|
+
|
|
147
|
+
- **This prompt (flow-work)**: Orchestrator with state management (cache, validation, retry logic)
|
|
148
|
+
- **Sub-prompt (flow-work-api)**: Pure analyzer (stateless, receives validated URL)
|
|
149
|
+
- **Cache location**: `.ai-flow/cache/api-config.json`
|
|
150
|
+
- **Why this separation?**:
|
|
151
|
+
- Reusability: analyzer can be used from different orchestrators
|
|
152
|
+
- Testability: pure analyzers are easier to test
|
|
153
|
+
- Maintainability: state management centralized in one place
|
|
154
|
+
|
|
155
|
+
### Step 1: Load or Detect API URL (Cache Management)
|
|
156
|
+
|
|
157
|
+
**1.1. Parse User Input**
|
|
158
|
+
|
|
159
|
+
Extract module name and optional API URL override:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
// Input examples:
|
|
163
|
+
// - "/flow-work api users"
|
|
164
|
+
// - "api organizations --api-url=http://localhost:3000/api/docs-json"
|
|
165
|
+
|
|
166
|
+
const pattern = /api\s+([a-z0-9\-_]+)(\s+--api-url=(.+))?/;
|
|
167
|
+
const match = userInput.match(pattern);
|
|
168
|
+
|
|
169
|
+
const moduleName = match[1]; // 'users', 'organizations', etc.
|
|
170
|
+
const customApiUrl = match[3]; // Optional override from user
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**1.2. Check Cache**
|
|
174
|
+
|
|
175
|
+
```javascript
|
|
176
|
+
const cacheFile = '.ai-flow/cache/api-config.json';
|
|
177
|
+
let apiUrl = null;
|
|
178
|
+
let cacheStatus = 'none';
|
|
179
|
+
|
|
180
|
+
if (await fileExists(cacheFile)) {
|
|
181
|
+
const cache = JSON.parse(await readFile(cacheFile));
|
|
182
|
+
|
|
183
|
+
// Check if cache is recent (< 24 hours)
|
|
184
|
+
const lastVerified = new Date(cache.lastVerified);
|
|
185
|
+
const hoursSinceVerified = (Date.now() - lastVerified) / 3600000;
|
|
186
|
+
|
|
187
|
+
if (hoursSinceVerified < 24) {
|
|
188
|
+
apiUrl = cache.apiUrl;
|
|
189
|
+
cacheStatus = 'valid';
|
|
190
|
+
console.log(`✅ Using cached API URL (verified ${Math.round(hoursSinceVerified)}h ago)`);
|
|
191
|
+
console.log(` ${apiUrl}`);
|
|
192
|
+
} else {
|
|
193
|
+
apiUrl = cache.apiUrl; // Still use it, but will re-validate
|
|
194
|
+
cacheStatus = 'expired';
|
|
195
|
+
console.log(`⚠️ Cache expired (${Math.round(hoursSinceVerified)}h old), will re-validate`);
|
|
196
|
+
console.log(` ${apiUrl}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// User override via --api-url flag takes precedence
|
|
201
|
+
if (customApiUrl) {
|
|
202
|
+
apiUrl = customApiUrl;
|
|
203
|
+
cacheStatus = 'override';
|
|
204
|
+
console.log(`🔧 Using URL override from command: ${apiUrl}`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Default fallback
|
|
208
|
+
if (!apiUrl) {
|
|
209
|
+
apiUrl = 'http://localhost:3001/api/docs-json';
|
|
210
|
+
cacheStatus = 'default';
|
|
211
|
+
console.log(`🔗 Using default API URL: ${apiUrl}`);
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**1.3. Validate URL (Quick Test)**
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
if (cacheStatus === 'valid') {
|
|
219
|
+
// Skip validation for recent cache (trust it)
|
|
220
|
+
console.log(`⏭️ Skipping validation (cache is recent)`);
|
|
221
|
+
} else {
|
|
222
|
+
// Validate URL before invoking analyzer
|
|
223
|
+
console.log(`\n🔗 Validating API URL: ${apiUrl}`);
|
|
224
|
+
|
|
225
|
+
try {
|
|
226
|
+
const controller = new AbortController();
|
|
227
|
+
const timeoutId = setTimeout(() => controller.abort(), 5000); // 5s quick test
|
|
228
|
+
|
|
229
|
+
const response = await fetch(apiUrl, {
|
|
230
|
+
method: 'HEAD', // Just check if endpoint exists
|
|
231
|
+
signal: controller.signal,
|
|
232
|
+
headers: { Accept: 'application/json' },
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
clearTimeout(timeoutId);
|
|
236
|
+
|
|
237
|
+
if (response.ok) {
|
|
238
|
+
console.log(`✅ Connection successful`);
|
|
239
|
+
} else {
|
|
240
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
241
|
+
}
|
|
242
|
+
} catch (error) {
|
|
243
|
+
// Connection failed - prompt user
|
|
244
|
+
return await handleConnectionError(error, apiUrl, cacheFile);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**1.4. Handle Connection Errors (Interactive)**
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
async function handleConnectionError(error: Error, attemptedUrl: string, cacheFile: string) {
|
|
253
|
+
const errorMessage =
|
|
254
|
+
error.name === 'AbortError'
|
|
255
|
+
? 'Connection timeout (backend might not be running)'
|
|
256
|
+
: error.message;
|
|
257
|
+
|
|
258
|
+
console.log(`
|
|
259
|
+
❌ Failed to connect to OpenAPI documentation
|
|
260
|
+
|
|
261
|
+
Attempted URL: ${attemptedUrl}
|
|
262
|
+
Error: ${errorMessage}
|
|
263
|
+
|
|
264
|
+
Common causes:
|
|
265
|
+
1. Backend server is not running (npm run dev / npm start)
|
|
266
|
+
2. Wrong port (check backend .env or package.json)
|
|
267
|
+
3. Different path (/api/docs vs /api/docs-json)
|
|
268
|
+
4. CORS not configured for your frontend origin
|
|
269
|
+
|
|
270
|
+
Options:
|
|
271
|
+
a) Provide correct URL ⭐
|
|
272
|
+
b) Retry current URL (if backend is starting up)
|
|
273
|
+
c) Skip API analysis (manual mode - no OpenAPI specs)
|
|
274
|
+
d) Cancel
|
|
275
|
+
|
|
276
|
+
Your choice: _
|
|
277
|
+
`);
|
|
278
|
+
|
|
279
|
+
const choice = await readUserInput();
|
|
280
|
+
|
|
281
|
+
if (choice === 'a') {
|
|
282
|
+
const newUrl = await promptForUrl(cacheFile);
|
|
283
|
+
return { apiUrl: newUrl, validated: true };
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (choice === 'b') {
|
|
287
|
+
console.log('\n⏳ Waiting 3 seconds for backend to start...');
|
|
288
|
+
await sleep(3000);
|
|
289
|
+
|
|
290
|
+
// Retry validation
|
|
291
|
+
try {
|
|
292
|
+
await fetch(attemptedUrl, { method: 'HEAD', signal: AbortSignal.timeout(5000) });
|
|
293
|
+
console.log('✅ Connection successful after retry');
|
|
294
|
+
return { apiUrl: attemptedUrl, validated: true };
|
|
295
|
+
} catch (retryError) {
|
|
296
|
+
console.log('❌ Still failing. Please check backend status.');
|
|
297
|
+
return await handleConnectionError(retryError, attemptedUrl, cacheFile);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (choice === 'c') {
|
|
302
|
+
console.log('\n⏭️ Skipping API analysis. Switching to manual FEATURE mode...');
|
|
303
|
+
return { mode: 'FEATURE', apiUrl: null, validated: false };
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (choice === 'd') {
|
|
307
|
+
throw new Error('User cancelled operation');
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Invalid choice - ask again
|
|
311
|
+
console.log('\n❌ Invalid option. Please enter a, b, c, or d.');
|
|
312
|
+
return await handleConnectionError(error, attemptedUrl, cacheFile);
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**1.5. Prompt for URL (with Validation)**
|
|
317
|
+
|
|
318
|
+
```typescript
|
|
319
|
+
async function promptForUrl(cacheFile: string): Promise<string> {
|
|
320
|
+
console.log(`\n📝 Enter OpenAPI Documentation URL\n
|
|
321
|
+
Common patterns:
|
|
322
|
+
NestJS: http://localhost:3000/api/docs-json
|
|
323
|
+
Express: http://localhost:3001/api-docs
|
|
324
|
+
FastAPI: http://localhost:8000/openapi.json
|
|
325
|
+
Spring: http://localhost:8080/v3/api-docs
|
|
326
|
+
|
|
327
|
+
URL: _
|
|
328
|
+
`);
|
|
329
|
+
|
|
330
|
+
const url = await readUserInput();
|
|
331
|
+
|
|
332
|
+
// Validate format
|
|
333
|
+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
|
334
|
+
console.log('\n❌ URL must start with http:// or https://');
|
|
335
|
+
return await promptForUrl(cacheFile);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Test URL
|
|
339
|
+
console.log(`\n🔗 Testing connection to: ${url}`);
|
|
340
|
+
|
|
341
|
+
try {
|
|
342
|
+
const response = await fetch(url, {
|
|
343
|
+
method: 'HEAD',
|
|
344
|
+
signal: AbortSignal.timeout(5000),
|
|
345
|
+
headers: { Accept: 'application/json' },
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
if (!response.ok) {
|
|
349
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
console.log(`
|
|
353
|
+
✅ Connection successful!
|
|
354
|
+
|
|
355
|
+
💾 Saving URL to cache for future commands...
|
|
356
|
+
`);
|
|
357
|
+
|
|
358
|
+
// Save to cache
|
|
359
|
+
await saveToCache(cacheFile, {
|
|
360
|
+
apiUrl: url,
|
|
361
|
+
lastVerified: new Date().toISOString(),
|
|
362
|
+
projectType: 'mobile',
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
return url;
|
|
366
|
+
} catch (error) {
|
|
367
|
+
const errorMsg = error.name === 'AbortError' ? 'Connection timeout' : error.message;
|
|
368
|
+
|
|
369
|
+
console.log(`\n❌ Failed to connect to ${url}\n Error: ${errorMsg}\n
|
|
370
|
+
Try again? (y/n): _
|
|
371
|
+
`);
|
|
372
|
+
|
|
373
|
+
const retry = await readUserInput();
|
|
374
|
+
if (retry.toLowerCase() === 'y') {
|
|
375
|
+
return await promptForUrl(cacheFile);
|
|
376
|
+
} else {
|
|
377
|
+
throw new Error('User cancelled after failed URL validation');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**1.6. Cache Management Functions**
|
|
384
|
+
|
|
385
|
+
```typescript
|
|
386
|
+
async function saveToCache(
|
|
387
|
+
cacheFile: string,
|
|
388
|
+
data: { apiUrl: string; lastVerified: string; projectType: string }
|
|
389
|
+
) {
|
|
390
|
+
const cacheDir = '.ai-flow/cache';
|
|
391
|
+
|
|
392
|
+
// Ensure directory exists
|
|
393
|
+
if (!(await fileExists(cacheDir))) {
|
|
394
|
+
await createDirectory(cacheDir);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Load existing cache or create new
|
|
398
|
+
let cache: any = { history: [] };
|
|
399
|
+
if (await fileExists(cacheFile)) {
|
|
400
|
+
try {
|
|
401
|
+
cache = JSON.parse(await readFile(cacheFile));
|
|
402
|
+
} catch {
|
|
403
|
+
// Corrupted cache, start fresh
|
|
404
|
+
cache = { history: [] };
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// Update cache
|
|
409
|
+
cache.apiUrl = data.apiUrl;
|
|
410
|
+
cache.lastVerified = data.lastVerified;
|
|
411
|
+
cache.projectType = data.projectType;
|
|
412
|
+
|
|
413
|
+
// Add to history
|
|
414
|
+
cache.history = cache.history || [];
|
|
415
|
+
cache.history.unshift({
|
|
416
|
+
url: data.apiUrl,
|
|
417
|
+
timestamp: data.lastVerified,
|
|
418
|
+
status: 'success',
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
// Keep only last 10 entries
|
|
422
|
+
cache.history = cache.history.slice(0, 10);
|
|
423
|
+
|
|
424
|
+
// Save
|
|
425
|
+
await writeFile(cacheFile, JSON.stringify(cache, null, 2));
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async function clearCache(cacheFile: string) {
|
|
429
|
+
if (await fileExists(cacheFile)) {
|
|
430
|
+
await deleteFile(cacheFile);
|
|
431
|
+
console.log('✅ API cache cleared');
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Step 2: Invoke API Module Analyzer
|
|
437
|
+
|
|
438
|
+
**Call sub-prompt with validated URL:**
|
|
439
|
+
|
|
440
|
+
```typescript
|
|
441
|
+
console.log(`\n🔍 Analyzing API module: ${moduleName}`);
|
|
442
|
+
console.log(`📡 Fetching OpenAPI spec from: ${apiUrl}\n`);
|
|
443
|
+
|
|
444
|
+
const analysisResult: OpenAPIAnalysisResult = await invoke_subprompt(
|
|
445
|
+
'.ai-flow/prompts/mobile/flow-work-api.md',
|
|
446
|
+
{
|
|
447
|
+
module: moduleName,
|
|
448
|
+
apiUrl: apiUrl, // Validated URL
|
|
449
|
+
}
|
|
450
|
+
);
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
**Sub-prompt responsibilities:**
|
|
454
|
+
|
|
455
|
+
- Fetch OpenAPI spec from backend
|
|
456
|
+
- Detect project stack (React Native Paper, React Navigation, React Hook Form, Zod, TanStack Query, etc.)
|
|
457
|
+
- Extract all endpoints for the module
|
|
458
|
+
- Parse DTOs (Response, Create, Update)
|
|
459
|
+
- Detect field specifications with validation rules
|
|
460
|
+
- Identify relationships (foreign keys, populated entities)
|
|
461
|
+
- Detect features (pagination, search, sorting, filters)
|
|
462
|
+
- Calculate complexity (SIMPLE/MEDIUM/COMPLEX)
|
|
463
|
+
- Return structured `OpenAPIAnalysisResult` JSON
|
|
464
|
+
|
|
465
|
+
### Step 3: Handle Sub-Prompt Result
|
|
466
|
+
|
|
467
|
+
**IF `analysisResult.success === true`:**
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
✅ API Analysis Complete
|
|
471
|
+
|
|
472
|
+
Module: ${analysisResult.module}
|
|
473
|
+
Endpoints: ${analysisResult.endpoints.length}
|
|
474
|
+
Complexity: ${analysisResult.complexity.level}
|
|
475
|
+
|
|
476
|
+
💾 Updating cache with successful connection...
|
|
477
|
+
|
|
478
|
+
Proceeding with enriched context...
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
Store in workflow context:
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
workflow_context.analysis = analysisResult;
|
|
485
|
+
workflow_context.mode = 'API_MODULE';
|
|
486
|
+
workflow_context.module = analysisResult.module;
|
|
487
|
+
|
|
488
|
+
// Update cache with successful analysis
|
|
489
|
+
await saveToCache(cacheFile, {
|
|
490
|
+
apiUrl: apiUrl,
|
|
491
|
+
lastVerified: new Date().toISOString(),
|
|
492
|
+
projectType: 'mobile',
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
// ⚠️ IMPORTANT: Do NOT create separate analysis files
|
|
496
|
+
// The analysis result is stored in memory (workflow_context.analysis)
|
|
497
|
+
// and will be used to generate the comprehensive work.md file.
|
|
498
|
+
// NO files like .ai-flow/analysis/*.md or .ai-flow/work/[task]/analysis.md
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
**IF `analysisResult.success === false`:**
|
|
502
|
+
|
|
503
|
+
```
|
|
504
|
+
❌ API Analysis Failed
|
|
505
|
+
|
|
506
|
+
Error: ${analysisResult.error}
|
|
507
|
+
Details: ${analysisResult.details}
|
|
508
|
+
|
|
509
|
+
Suggestions:
|
|
510
|
+
${analysisResult.suggestions.map((s, i) => ` ${i+1}. ${s}`).join('\n')}
|
|
511
|
+
|
|
512
|
+
The API URL might have changed or the backend spec is invalid.
|
|
513
|
+
|
|
514
|
+
Options:
|
|
515
|
+
A) Update URL and retry
|
|
516
|
+
B) Clear cache and try default URL
|
|
517
|
+
C) Proceed with manual mode (no OpenAPI analysis)
|
|
518
|
+
D) Cancel
|
|
519
|
+
|
|
520
|
+
Your choice: _
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
**User selects:**
|
|
524
|
+
|
|
525
|
+
- **A**: Prompt for new URL, save to cache, retry Phase 0.1
|
|
526
|
+
- **B**: Clear cache, use default, retry Phase 0.1
|
|
527
|
+
- **C**: Switch to `FEATURE` mode, continue without OpenAPI
|
|
528
|
+
- **D**: Abort workflow
|
|
529
|
+
|
|
530
|
+
### Step 4: Enrich Workflow Context
|
|
531
|
+
|
|
532
|
+
Merge analysis into workflow context for use in subsequent phases:
|
|
533
|
+
|
|
534
|
+
```typescript
|
|
535
|
+
workflow_context = {
|
|
536
|
+
...workflow_context,
|
|
537
|
+
|
|
538
|
+
// From API analysis
|
|
539
|
+
projectStandards: analysisResult.projectStandards,
|
|
540
|
+
openapi: analysisResult.openapi,
|
|
541
|
+
endpoints: analysisResult.endpoints,
|
|
542
|
+
schemas: analysisResult.schemas,
|
|
543
|
+
fields: analysisResult.fields,
|
|
544
|
+
features: analysisResult.features,
|
|
545
|
+
relationships: analysisResult.relationships,
|
|
546
|
+
|
|
547
|
+
// For Phase 2 (work.md generation)
|
|
548
|
+
template: 'api-module', // Use specialized template
|
|
549
|
+
|
|
550
|
+
// For Phase 0.5 (complexity override)
|
|
551
|
+
complexity_override: analysisResult.complexity.level,
|
|
552
|
+
estimatedSP: analysisResult.complexity.estimatedSP,
|
|
553
|
+
estimatedHours: analysisResult.complexity.estimatedHours,
|
|
554
|
+
};
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
### Step 5: Show Analysis Summary
|
|
558
|
+
|
|
559
|
+
Present structured summary to user (condensed version):
|
|
560
|
+
|
|
561
|
+
```
|
|
562
|
+
📋 API Module Analysis Summary
|
|
563
|
+
|
|
564
|
+
📊 Module: ${moduleName}
|
|
565
|
+
🔗 API: ${apiUrl}
|
|
566
|
+
|
|
567
|
+
📐 Detected Project Stack:
|
|
568
|
+
UI: ${projectStandards.stack.ui}
|
|
569
|
+
List: ${projectStandards.stack.list} ✅
|
|
570
|
+
Forms: ${projectStandards.stack.forms} + ${projectStandards.stack.validation} ✅
|
|
571
|
+
Data: ${projectStandards.stack.query} ✅
|
|
572
|
+
Navigation: ${projectStandards.stack.navigation} ✅
|
|
573
|
+
|
|
574
|
+
🔧 Endpoints: ${endpoints.length} detected
|
|
575
|
+
📦 Entity: ${schemas.response.fields.length} fields
|
|
576
|
+
🔗 Relationships: ${relationships.length}
|
|
577
|
+
🏗️ Complexity: ${complexity.level} (${complexity.estimatedHours}h estimated)
|
|
578
|
+
|
|
579
|
+
✅ All standards locked. Module will match existing patterns.
|
|
580
|
+
|
|
581
|
+
Proceeding to Phase 0.5...
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
### Step 6: Continue to Phase 0.5
|
|
585
|
+
|
|
586
|
+
With enriched context, proceed to complexity classification.
|
|
587
|
+
|
|
588
|
+
**Note**: In API_MODULE mode, complexity is already determined by the analyzer, so Phase 0.5 will use `workflow_context.complexity_override` instead of calculating it.
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
## Phase 0.5: Complexity Classification (CRITICAL)
|
|
593
|
+
|
|
594
|
+
**Analyze task scope to determine workflow:**
|
|
595
|
+
|
|
596
|
+
| Metric | SIMPLE (⚡) | MEDIUM (📝) | COMPLEX (🏗️) |
|
|
597
|
+
| ------------- | ----------- | ----------- | ------------- |
|
|
598
|
+
| Files | 1 | 2-5 | >5 |
|
|
599
|
+
| Lines | <20 | 20-100 | >100 |
|
|
600
|
+
| Tests | No | Optional | Required |
|
|
601
|
+
| Docs | None | Minor | Significant |
|
|
602
|
+
| Architecture | None | Minimal | Major changes |
|
|
603
|
+
| Time estimate | <15 min | 15-60 min | >60 min |
|
|
604
|
+
|
|
605
|
+
**Classification Rules:**
|
|
606
|
+
|
|
607
|
+
**⚡ SIMPLE Task:**
|
|
608
|
+
|
|
609
|
+
- Examples: Fix typo, rename variable, update constant, add log, adjust styling
|
|
610
|
+
- **Workflow**: In-chat plan → Execute → Done (NO files created)
|
|
611
|
+
- **Context**: Only `ai-instructions.md` if relevant
|
|
612
|
+
|
|
613
|
+
**📝 MEDIUM Task:**
|
|
614
|
+
|
|
615
|
+
- Examples: Add component, refactor hook, simple bug fix, update screen
|
|
616
|
+
- **Workflow**: Create `work.md` only (NO `status.json`) → Execute → Simple archive
|
|
617
|
+
- **Context**: Load 2-3 relevant docs
|
|
618
|
+
|
|
619
|
+
**🏗️ COMPLEX Task:**
|
|
620
|
+
|
|
621
|
+
- Examples: New feature, major refactor, security fix, multi-screen changes
|
|
622
|
+
- **Workflow**: Full workflow (`work.md` + `status.json` + branch + archiving)
|
|
623
|
+
- **Context**: Load all relevant docs
|
|
624
|
+
|
|
625
|
+
**Detection Logic:**
|
|
626
|
+
|
|
627
|
+
```python
|
|
628
|
+
# Special case: API_MODULE mode (complexity already determined)
|
|
629
|
+
if mode == "API_MODULE":
|
|
630
|
+
complexity = workflow_context.complexity_override # From API analyzer
|
|
631
|
+
elif files_affected == 1 and lines_changed < 20 and no_tests_needed and no_architecture_impact:
|
|
632
|
+
complexity = "SIMPLE"
|
|
633
|
+
elif files_affected <= 5 and lines_changed <= 100 and architecture_impact == "minimal":
|
|
634
|
+
complexity = "MEDIUM"
|
|
635
|
+
else:
|
|
636
|
+
complexity = "COMPLEX"
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
**Show classification:**
|
|
640
|
+
|
|
641
|
+
```
|
|
642
|
+
🔍 Task Complexity: [SIMPLE ⚡ | MEDIUM 📝 | COMPLEX 🏗️]
|
|
643
|
+
|
|
644
|
+
Detected:
|
|
645
|
+
- Files: [N]
|
|
646
|
+
- Estimated lines: [~X]
|
|
647
|
+
- Tests needed: [Yes/No]
|
|
648
|
+
- Architecture impact: [None/Minimal/Major]
|
|
649
|
+
|
|
650
|
+
Proceeding with [SIMPLE/MEDIUM/COMPLEX] workflow.
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
---
|
|
654
|
+
|
|
655
|
+
## Phase 1: Analysis & Refinement
|
|
656
|
+
|
|
657
|
+
**1. Context Loading (Smart & Selective):**
|
|
658
|
+
|
|
659
|
+
**CRITICAL: Load context based on task complexity and type:**
|
|
660
|
+
|
|
661
|
+
**IF complexity == "SIMPLE":**
|
|
662
|
+
|
|
663
|
+
- Load ONLY `ai-instructions.md` if task involves code changes
|
|
664
|
+
- Skip all other documentation
|
|
665
|
+
- Use existing patterns in nearby code as reference
|
|
666
|
+
|
|
667
|
+
**IF complexity == "MEDIUM":**
|
|
668
|
+
|
|
669
|
+
- Load `ai-instructions.md` (core rules)
|
|
670
|
+
- Load 1-2 specific docs based on task type:
|
|
671
|
+
- UI changes → `docs/components.md`
|
|
672
|
+
- Navigation → `docs/navigation.md`
|
|
673
|
+
- Security → `specs/security.md`
|
|
674
|
+
- Skip architecture.md unless creating new patterns
|
|
675
|
+
|
|
676
|
+
**IF complexity == "COMPLEX":**
|
|
677
|
+
|
|
678
|
+
- Load `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
679
|
+
- Load `docs/architecture.md` (patterns, structure)
|
|
680
|
+
- Load task-specific docs:
|
|
681
|
+
- UI → `docs/components.md`
|
|
682
|
+
- Security/Auth → `specs/security.md`
|
|
683
|
+
- Navigation → `docs/navigation.md`
|
|
684
|
+
- Tests → `docs/testing.md`
|
|
685
|
+
- Load `docs/code-standards.md` only if creating new files
|
|
686
|
+
|
|
687
|
+
**Source Documentation (User Stories/Roadmap):**
|
|
688
|
+
|
|
689
|
+
**IF** `HU-XXX-XXX` or roadmap feature provided:
|
|
690
|
+
|
|
691
|
+
- **`planning/roadmap.md`**: Load for high-level scope
|
|
692
|
+
- **`planning/user-stories/**/HU-XXX-XXX.md`\*\*: Load for detailed requirements
|
|
693
|
+
|
|
694
|
+
**2. Detail Level Detection (if Manual input):**
|
|
695
|
+
|
|
696
|
+
IF input is manual description (not HU/Roadmap):
|
|
697
|
+
|
|
698
|
+
```python
|
|
699
|
+
detail_level = analyze_description(input)
|
|
700
|
+
|
|
701
|
+
# Criteria for HIGH detail (Feature):
|
|
702
|
+
# - Mentions technology/method (JWT, OAuth, bcrypt, etc.)
|
|
703
|
+
# - Describes flow (registration, login, CRUD, etc.)
|
|
704
|
+
# - Includes technical constraints (hashing, tokens, validation, etc.)
|
|
705
|
+
|
|
706
|
+
# Criteria for HIGH detail (Refactor):
|
|
707
|
+
# - Describes what to extract/move
|
|
708
|
+
# - Mentions destination (file/class)
|
|
709
|
+
# - References pattern to follow
|
|
710
|
+
|
|
711
|
+
# Criteria for HIGH detail (Fix):
|
|
712
|
+
# - Describes symptom (error 500, crash, null pointer, etc.)
|
|
713
|
+
# - Mentions probable cause
|
|
714
|
+
# - Suggests fix approach
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
**3. Interactive Refinement (Conditional):**
|
|
718
|
+
|
|
719
|
+
**IF detail_level == "HIGH":**
|
|
720
|
+
|
|
721
|
+
- Skip refinement questions
|
|
722
|
+
- Proceed directly to Phase 2 (Planning)
|
|
723
|
+
- Show: "✅ Sufficient detail detected. Proceeding with planning..."
|
|
724
|
+
|
|
725
|
+
**IF detail_level == "MEDIUM":**
|
|
726
|
+
|
|
727
|
+
- Ask 1-2 targeted questions (only missing items)
|
|
728
|
+
- Use Multiple Choice with defaults (⭐)
|
|
729
|
+
|
|
730
|
+
**IF detail_level == "LOW":**
|
|
731
|
+
|
|
732
|
+
- Full refinement flow (3-5 questions)
|
|
733
|
+
- Use Multiple Choice with defaults (⭐)
|
|
734
|
+
- Focus on: approach, scope, constraints, priorities
|
|
735
|
+
|
|
736
|
+
**Example Interaction (LOW detail):**
|
|
737
|
+
|
|
738
|
+
> 📝 I need to clarify some details for this feature:
|
|
739
|
+
>
|
|
740
|
+
> 1. What authentication provider should we use? [default: A]
|
|
741
|
+
> A) JWT (Local) ⭐
|
|
742
|
+
> B) OAuth2 (Google/GitHub)
|
|
743
|
+
> C) Firebase Auth
|
|
744
|
+
> 2. Should we implement audit logs for this? [default: B]
|
|
745
|
+
> A) Yes
|
|
746
|
+
> B) No ⭐
|
|
747
|
+
>
|
|
748
|
+
> Your answers (or Enter for defaults): \_
|
|
749
|
+
|
|
750
|
+
**4. Refined Objective Generation (if Manual):**
|
|
751
|
+
|
|
752
|
+
After refinement, generate clear objective statement:
|
|
753
|
+
|
|
754
|
+
```
|
|
755
|
+
✅ Refined Objective:
|
|
756
|
+
|
|
757
|
+
[Clear 1-2 paragraph description of WHAT will be implemented]
|
|
758
|
+
|
|
759
|
+
**Scope**:
|
|
760
|
+
- [List in-scope items]
|
|
761
|
+
|
|
762
|
+
**Out of Scope**:
|
|
763
|
+
- [List out-of-scope items]
|
|
764
|
+
|
|
765
|
+
Is this correct? (Yes/Edit/Cancel): _
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
**5. Documentation Compliance Check:**
|
|
769
|
+
|
|
770
|
+
Read relevant documentation:
|
|
771
|
+
|
|
772
|
+
- `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
773
|
+
- `docs/architecture.md` (patterns, structure)
|
|
774
|
+
- `docs/code-standards.md` (naming, quality)
|
|
775
|
+
- IF auth/security: `specs/security.md`
|
|
776
|
+
- IF database: `docs/data-model.md`
|
|
777
|
+
- IF API: `docs/api.md`
|
|
778
|
+
|
|
779
|
+
Compare refined objective against documentation:
|
|
780
|
+
|
|
781
|
+
**IF deviation detected:**
|
|
782
|
+
|
|
783
|
+
```
|
|
784
|
+
🚨 POTENTIAL DEVIATION
|
|
785
|
+
|
|
786
|
+
From [document]:
|
|
787
|
+
❌ NEVER: [rule being violated]
|
|
788
|
+
✅ ALWAYS: [rule being ignored]
|
|
789
|
+
|
|
790
|
+
Your request: [conflicting part]
|
|
791
|
+
|
|
792
|
+
Options:
|
|
793
|
+
A) Modify request to align with documentation
|
|
794
|
+
B) Proceed with deviation (requires justification)
|
|
795
|
+
C) Cancel
|
|
796
|
+
|
|
797
|
+
Your choice: _
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
**IF user chooses B (Override):**
|
|
801
|
+
|
|
802
|
+
```
|
|
803
|
+
⚠️ OVERRIDE CONFIRMATION
|
|
804
|
+
|
|
805
|
+
You are implementing something that deviates from:
|
|
806
|
+
- [list violated documents/rules]
|
|
807
|
+
|
|
808
|
+
Type "I UNDERSTAND THE RISKS" to proceed: _
|
|
809
|
+
|
|
810
|
+
Provide justification: _
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
---
|
|
814
|
+
|
|
815
|
+
## Phase 1.5: SIMPLE Task Fast-Track
|
|
816
|
+
|
|
817
|
+
**IF complexity == "SIMPLE": Execute immediately without creating files**
|
|
818
|
+
|
|
819
|
+
1. **Show in-chat plan:**
|
|
820
|
+
|
|
821
|
+
```
|
|
822
|
+
⚡ SIMPLE Task - Fast Execution
|
|
823
|
+
|
|
824
|
+
What: [1-line description]
|
|
825
|
+
File: [path]
|
|
826
|
+
Change: [specific modification]
|
|
827
|
+
Lines: ~[N] (estimated)
|
|
828
|
+
|
|
829
|
+
Execute now? (y/n): _
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
2. **IF user confirms ('y'):**
|
|
833
|
+
- Make the change immediately
|
|
834
|
+
- Show git diff preview
|
|
835
|
+
- Skip to Phase 3 (no branch creation if already on feature branch)
|
|
836
|
+
- Show: "✅ Done. Run `/flow-commit` to commit."
|
|
837
|
+
- **END WORKFLOW** (no archiving needed)
|
|
838
|
+
|
|
839
|
+
3. **IF user declines ('n'):**
|
|
840
|
+
- Cancel task
|
|
841
|
+
- **END WORKFLOW**
|
|
842
|
+
|
|
843
|
+
**Note:** SIMPLE tasks don't create work.md, status.json, or archive records.
|
|
844
|
+
|
|
845
|
+
---
|
|
846
|
+
|
|
847
|
+
## Phase 2: Planning & Documentation
|
|
848
|
+
|
|
849
|
+
**⚠️ SKIP THIS PHASE IF complexity == "SIMPLE"**
|
|
850
|
+
|
|
851
|
+
**1. Read Required Documentation (Based on Complexity)**
|
|
852
|
+
|
|
853
|
+
**IF complexity == "MEDIUM":**
|
|
854
|
+
|
|
855
|
+
- `ai-instructions.md` (core rules)
|
|
856
|
+
- Load ONLY task-specific docs:
|
|
857
|
+
- UI → `docs/components.md`
|
|
858
|
+
- Navigation → `docs/navigation.md`
|
|
859
|
+
- Security → `specs/security.md`
|
|
860
|
+
|
|
861
|
+
**IF complexity == "COMPLEX":**
|
|
862
|
+
|
|
863
|
+
- `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
864
|
+
- `docs/architecture.md` (layer, pattern, structure)
|
|
865
|
+
- Task-specific docs:
|
|
866
|
+
- UI → `docs/components.md`
|
|
867
|
+
- Security/Auth → `specs/security.md`
|
|
868
|
+
- Navigation → `docs/navigation.md`
|
|
869
|
+
- Tests → `docs/testing.md`
|
|
870
|
+
- `docs/code-standards.md` (only if creating new files)
|
|
871
|
+
|
|
872
|
+
**2. Analyze Existing Codebase (MANDATORY)**
|
|
873
|
+
|
|
874
|
+
Find similar features/patterns in codebase:
|
|
875
|
+
|
|
876
|
+
- Identify existing files to use as reference (e.g., ProfileScreen.tsx for SettingsScreen.tsx)
|
|
877
|
+
- Check naming conventions in actual code
|
|
878
|
+
- Verify architectural consistency
|
|
879
|
+
- Look for reusable components/hooks
|
|
880
|
+
|
|
881
|
+
**3. Generate work.md (Conditional)**
|
|
882
|
+
|
|
883
|
+
**⚠️ IMPORTANT: work.md is the ONLY planning file**
|
|
884
|
+
|
|
885
|
+
- All analysis results, API specs, field specifications, and implementation plan go into `work.md`
|
|
886
|
+
- Do NOT create separate files like `analysis.md`, `api-analysis.md`, or `spec.md`
|
|
887
|
+
- The `work.md` file should be comprehensive and self-contained
|
|
888
|
+
- For COMPLEX tasks with API analysis, include all OpenAPI metadata directly in `work.md`
|
|
889
|
+
|
|
890
|
+
**IF complexity == "MEDIUM":\*\***
|
|
891
|
+
|
|
892
|
+
- Create simplified `.ai-flow/work/[task-name]/work.md` (~15-20 lines)
|
|
893
|
+
- Skip status.json
|
|
894
|
+
|
|
895
|
+
**IF complexity == "COMPLEX":**
|
|
896
|
+
|
|
897
|
+
- Create full `.ai-flow/work/[task-name]/work.md` (~30-40 lines)
|
|
898
|
+
- Create `status.json` (see step 4)
|
|
899
|
+
|
|
900
|
+
**Structure for MEDIUM tasks** (~15-20 lines):
|
|
901
|
+
|
|
902
|
+
```markdown
|
|
903
|
+
# [Type]: [Feature Name]
|
|
904
|
+
|
|
905
|
+
**Source**: [HU-XXX | Roadmap X.X | Manual]
|
|
906
|
+
**Files**: [2-5 files listed]
|
|
907
|
+
**Estimated**: [20-60 min]
|
|
908
|
+
|
|
909
|
+
## Objective
|
|
910
|
+
|
|
911
|
+
[1 clear paragraph]
|
|
912
|
+
|
|
913
|
+
## Tasks
|
|
914
|
+
|
|
915
|
+
- [ ] Task 1 → path/file.tsx
|
|
916
|
+
- [ ] Task 2 → path/file.ts
|
|
917
|
+
- [ ] Task 3 (optional tests)
|
|
918
|
+
|
|
919
|
+
## Key Rules
|
|
920
|
+
|
|
921
|
+
- ✅ [1-2 relevant ALWAYS rules]
|
|
922
|
+
- ❌ [1-2 relevant NEVER rules]
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
**Structure for COMPLEX tasks** (~30-40 lines):
|
|
926
|
+
|
|
927
|
+
```markdown
|
|
928
|
+
# [Type]: [Feature Name]
|
|
929
|
+
|
|
930
|
+
## Context
|
|
931
|
+
|
|
932
|
+
**Source**: HU-001-002 | Roadmap 2.3 | Manual [+ DEVIATION if override]
|
|
933
|
+
**SP**: 5 | **Branch**: feature/user-auth | **Deps**: None
|
|
934
|
+
|
|
935
|
+
## Objective
|
|
936
|
+
|
|
937
|
+
[1-2 clear paragraphs describing WHAT will be implemented]
|
|
938
|
+
|
|
939
|
+
## Documentation Constraints
|
|
940
|
+
|
|
941
|
+
**Read**: ai-instructions.md, architecture.md, code-standards.md, [security.md]
|
|
942
|
+
|
|
943
|
+
**Key Rules**:
|
|
944
|
+
|
|
945
|
+
- ✅ ALWAYS: [List specific rules that apply]
|
|
946
|
+
- ❌ NEVER: [List specific prohibitions]
|
|
947
|
+
- 📐 Pattern: [Architectural pattern from docs]
|
|
948
|
+
- 📁 Location: [File structure from architecture.md]
|
|
949
|
+
|
|
950
|
+
## Approach
|
|
951
|
+
|
|
952
|
+
**Layer**: [Data | Business Logic | API | UI]
|
|
953
|
+
**Files**: [List files to create/modify]
|
|
954
|
+
**Reference**: [Existing file to follow as pattern]
|
|
955
|
+
|
|
956
|
+
**Phases**:
|
|
957
|
+
|
|
958
|
+
1. [Phase 1 description]
|
|
959
|
+
2. [Phase 2 description]
|
|
960
|
+
3. [Phase 3 description]
|
|
961
|
+
4. [Phase 4 description]
|
|
962
|
+
|
|
963
|
+
## Tasks
|
|
964
|
+
|
|
965
|
+
[SEE TASK GENERATION LOGIC BELOW]
|
|
966
|
+
|
|
967
|
+
## Validation
|
|
968
|
+
|
|
969
|
+
- [ ] All NEVER/ALWAYS rules followed
|
|
970
|
+
- [ ] Tests pass (coverage per docs/testing.md)
|
|
971
|
+
- [ ] No hardcoded secrets
|
|
972
|
+
- [ ] Follows existing patterns
|
|
973
|
+
- [ ] [Add specific validations based on type]
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
**Task Generation Logic:**
|
|
977
|
+
|
|
978
|
+
**IF source is User Story:**
|
|
979
|
+
|
|
980
|
+
```python
|
|
981
|
+
tasks = read_user_story_tasks()
|
|
982
|
+
if tasks.are_detailed(): # Has: path, constraints, SP, deps
|
|
983
|
+
work_md.tasks = """
|
|
984
|
+
**Source**: planning/user-stories/EP-XXX/HU-XXX-XXX.md
|
|
985
|
+
|
|
986
|
+
Tasks already detailed in User Story (see linked file).
|
|
987
|
+
|
|
988
|
+
**Summary**: [N] tasks, [X] SP total
|
|
989
|
+
- [Brief phase breakdown]
|
|
990
|
+
"""
|
|
991
|
+
else:
|
|
992
|
+
work_md.tasks = generate_detailed_tasks()
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
**IF source is Roadmap:**
|
|
996
|
+
|
|
997
|
+
```python
|
|
998
|
+
feature = read_roadmap_feature()
|
|
999
|
+
if feature.has_detailed_tasks():
|
|
1000
|
+
work_md.tasks = """
|
|
1001
|
+
**Source**: planning/roadmap.md Feature X.X
|
|
1002
|
+
|
|
1003
|
+
Tasks already detailed in Roadmap (see linked file).
|
|
1004
|
+
|
|
1005
|
+
**Summary**: [N] tasks, [X] SP total
|
|
1006
|
+
"""
|
|
1007
|
+
else:
|
|
1008
|
+
work_md.tasks = generate_detailed_tasks()
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
**IF source is Manual OR tasks need expansion:**
|
|
1012
|
+
|
|
1013
|
+
Generate detailed tasks with this format:
|
|
1014
|
+
|
|
1015
|
+
```markdown
|
|
1016
|
+
## Tasks
|
|
1017
|
+
|
|
1018
|
+
**Source**: Manual | Roadmap X.X (expanded) | HU-XXX-XXX (expanded)
|
|
1019
|
+
|
|
1020
|
+
- [ ] T001 [D] Create User entity → src/entities/User.ts • 1 SP
|
|
1021
|
+
- Follow Product.ts pattern, hash passwords (bcrypt)
|
|
1022
|
+
- [ ] T002 [L] UserService.register() → src/services/ • 2 SP
|
|
1023
|
+
- Validate email, hash password, return JWT (deps: T001)
|
|
1024
|
+
- [ ] T003 [A] POST /users/register → src/controllers/ • 1 SP
|
|
1025
|
+
- Return 201, rate limit, follow api.md (deps: T002)
|
|
1026
|
+
- [ ] T004 [T] Unit tests → tests/services/ • 2 SP
|
|
1027
|
+
- 80% coverage, edge cases (deps: T002)
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
**Task Detail Requirements:**
|
|
1031
|
+
|
|
1032
|
+
- Specific file path
|
|
1033
|
+
- Pattern/reference to follow
|
|
1034
|
+
- Key constraints from docs
|
|
1035
|
+
- Dependencies (if applicable)
|
|
1036
|
+
- Story Points
|
|
1037
|
+
|
|
1038
|
+
**4. Generate status.json (ONLY for COMPLEX tasks)**
|
|
1039
|
+
|
|
1040
|
+
**IF complexity == "COMPLEX":**
|
|
1041
|
+
|
|
1042
|
+
Create: `.ai-flow/work/[task-name]/status.json`
|
|
1043
|
+
|
|
1044
|
+
```json
|
|
1045
|
+
{
|
|
1046
|
+
"type": "feature|refactor|fix",
|
|
1047
|
+
"source": "HU-001-002|roadmap-2.3|manual",
|
|
1048
|
+
"deviation": false,
|
|
1049
|
+
"progress": {
|
|
1050
|
+
"totalTasks": 4,
|
|
1051
|
+
"completedTasks": 0,
|
|
1052
|
+
"percentage": 0
|
|
1053
|
+
},
|
|
1054
|
+
"git": {
|
|
1055
|
+
"branchName": "feature/user-auth",
|
|
1056
|
+
"commits": []
|
|
1057
|
+
},
|
|
1058
|
+
"timestamps": {
|
|
1059
|
+
"created": "2025-12-22T23:00:00-03:00",
|
|
1060
|
+
"lastUpdated": "2025-12-22T23:00:00-03:00"
|
|
1061
|
+
},
|
|
1062
|
+
"validation": {
|
|
1063
|
+
"tests": { "executed": false },
|
|
1064
|
+
"lint": { "executed": false }
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
**5. User Approval**
|
|
1070
|
+
|
|
1071
|
+
Show work.md for review:
|
|
1072
|
+
|
|
1073
|
+
```
|
|
1074
|
+
📄 Generated: .ai-flow/work/[task-name]/work.md
|
|
1075
|
+
|
|
1076
|
+
Review work.md? (Yes/Edit/No): _
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
- **Yes**: Proceed to Phase 3
|
|
1080
|
+
- **Edit**: Allow user to modify work.md, then re-read
|
|
1081
|
+
- **No**: Cancel workflow
|
|
1082
|
+
|
|
1083
|
+
---
|
|
1084
|
+
|
|
1085
|
+
## Phase 3: Execution (Branch Creation)
|
|
1086
|
+
|
|
1087
|
+
**Upon confirmation to start implementation:**
|
|
1088
|
+
|
|
1089
|
+
**🛡️ CRITICAL: Protected Branch Check**
|
|
1090
|
+
|
|
1091
|
+
```bash
|
|
1092
|
+
git branch --show-current
|
|
1093
|
+
git status --porcelain
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
**If current branch is protected** (`main`, `master`, `develop`, `development`):
|
|
1097
|
+
|
|
1098
|
+
**A) If there are uncommitted changes:**
|
|
1099
|
+
|
|
1100
|
+
1. **Analyze changes to generate branch name:**
|
|
1101
|
+
|
|
1102
|
+
```bash
|
|
1103
|
+
git status --porcelain
|
|
1104
|
+
git diff --stat
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
**Detection rules:**
|
|
1108
|
+
- **New screens/features** → `feature/`
|
|
1109
|
+
- **Bug fixes** (crash fixes, error handling) → `fix/`
|
|
1110
|
+
- **Refactoring/Optimization** (code improvements, performance) → `refactor/`
|
|
1111
|
+
- **Native configs** (android/, ios/, dependencies) → `chore/`
|
|
1112
|
+
- **Tests only** → `test/`
|
|
1113
|
+
- **Documentation only** → `docs/`
|
|
1114
|
+
|
|
1115
|
+
**Naming strategy:**
|
|
1116
|
+
- Extract screen/module/feature name
|
|
1117
|
+
- Remove extensions (.tsx, .ts, .js)
|
|
1118
|
+
- Convert to kebab-case
|
|
1119
|
+
- Limit to 3-4 words max
|
|
1120
|
+
|
|
1121
|
+
**Examples:**
|
|
1122
|
+
|
|
1123
|
+
```
|
|
1124
|
+
src/screens/ProfileScreen.tsx (new) → feature/profile-screen
|
|
1125
|
+
src/navigation/AppNavigator.tsx (fix) → fix/app-navigation
|
|
1126
|
+
src/hooks/useAuth.ts (modified) → refactor/auth-hook
|
|
1127
|
+
android/ + ios/ (configs) → chore/native-config
|
|
1128
|
+
src/screens/Auth* + src/services/auth* → feature/authentication
|
|
1129
|
+
src/components/ (multiple) → refactor/ui-components
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1132
|
+
2. **Warn user:**
|
|
1133
|
+
|
|
1134
|
+
```
|
|
1135
|
+
⚠️ Working on protected branch '[branch-name]' with uncommitted changes.
|
|
1136
|
+
|
|
1137
|
+
Analyzed changes:
|
|
1138
|
+
- [file1] (new)
|
|
1139
|
+
- [file2] (modified)
|
|
1140
|
+
- [file3] (modified)
|
|
1141
|
+
... [N] more files
|
|
1142
|
+
|
|
1143
|
+
Detected type: [feature|fix|refactor|chore]
|
|
1144
|
+
Suggested branch: [type]/[descriptive-slug]
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
3. **Offer options:**
|
|
1148
|
+
- **A)** Create branch: `[type]/[suggested-name]` ⭐
|
|
1149
|
+
- **B)** Edit branch name (user provides custom slug)
|
|
1150
|
+
- **C)** Stash changes and continue: `git stash`
|
|
1151
|
+
- **D)** Cancel
|
|
1152
|
+
|
|
1153
|
+
4. If user chooses A:
|
|
1154
|
+
|
|
1155
|
+
```bash
|
|
1156
|
+
git checkout -b [type]/[suggested-name]
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
Then show:
|
|
1160
|
+
|
|
1161
|
+
```
|
|
1162
|
+
✅ Created and switched to '[type]/[suggested-name]'
|
|
1163
|
+
|
|
1164
|
+
Next steps:
|
|
1165
|
+
1. Run /flow-commit to commit these changes
|
|
1166
|
+
2. Return to protected branch: git checkout [protected-branch]
|
|
1167
|
+
3. Continue with /flow-work for new task
|
|
1168
|
+
|
|
1169
|
+
Or continue working on this branch if it's your intended work.
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
5. If user chooses B:
|
|
1173
|
+
```
|
|
1174
|
+
Enter branch name (without type prefix): _
|
|
1175
|
+
```
|
|
1176
|
+
Then create: `[detected-type]/[user-input]`
|
|
1177
|
+
|
|
1178
|
+
**B) If NO uncommitted changes:**
|
|
1179
|
+
|
|
1180
|
+
- ✅ Proceed normally - creating work branches FROM protected branches is correct workflow
|
|
1181
|
+
- Protected branches serve as base for new work
|
|
1182
|
+
|
|
1183
|
+
1. **Generate Branch Name**:
|
|
1184
|
+
- `feature/[slug]`
|
|
1185
|
+
- `refactor/[slug]`
|
|
1186
|
+
- `fix/[slug]`
|
|
1187
|
+
2. **Execute**: `git checkout -b [branch-name]`.
|
|
1188
|
+
3. **Update `status.json`**: Record branch name and start timestamp.
|
|
1189
|
+
4. **Implementation**: Proceed according to the selected mode (Auto, Phase-by-phase, Task-by-task).
|
|
1190
|
+
- Follow tasks in `work.md`
|
|
1191
|
+
- Update task checkboxes as completed
|
|
1192
|
+
- Update `status.json` progress
|
|
1193
|
+
|
|
1194
|
+
---
|
|
1195
|
+
|
|
1196
|
+
## Phase 4: Finalization (User-Controlled)
|
|
1197
|
+
|
|
1198
|
+
**⚠️ SKIP THIS PHASE IF complexity == "SIMPLE"** (already handled in Phase 1.5)
|
|
1199
|
+
|
|
1200
|
+
**Trigger Options:**
|
|
1201
|
+
|
|
1202
|
+
- User types: `/flow-work complete`
|
|
1203
|
+
- All checkboxes in work.md marked complete
|
|
1204
|
+
- User explicitly requests finalization
|
|
1205
|
+
|
|
1206
|
+
---
|
|
1207
|
+
|
|
1208
|
+
### Source Documentation Update (Interactive)
|
|
1209
|
+
|
|
1210
|
+
**Detect source references:**
|
|
1211
|
+
|
|
1212
|
+
```python
|
|
1213
|
+
source = extract_from_work_md_or_status_json()
|
|
1214
|
+
# Returns: "HU-001-002" | "roadmap-2.3" | "manual" | None
|
|
1215
|
+
```
|
|
1216
|
+
|
|
1217
|
+
**IF source exists (HU or roadmap):**
|
|
1218
|
+
|
|
1219
|
+
```
|
|
1220
|
+
📚 Update Source Documentation?
|
|
1221
|
+
|
|
1222
|
+
Found:
|
|
1223
|
+
- planning/roadmap.md → Feature 2.3 "User Authentication"
|
|
1224
|
+
- planning/user-stories/EP-001/HU-001-002.md
|
|
1225
|
+
|
|
1226
|
+
What to update?
|
|
1227
|
+
|
|
1228
|
+
a) Update both ⭐
|
|
1229
|
+
b) Update roadmap only
|
|
1230
|
+
c) Update user story only
|
|
1231
|
+
d) Skip (I'll update manually later)
|
|
1232
|
+
|
|
1233
|
+
Your choice: _
|
|
1234
|
+
```
|
|
1235
|
+
|
|
1236
|
+
**Execute selected updates:**
|
|
1237
|
+
|
|
1238
|
+
- Read files
|
|
1239
|
+
- Mark checkboxes as complete: `- [ ]` → `- [x]`
|
|
1240
|
+
- Add timestamp comment: `<!-- Completed: YYYY-MM-DD HH:MM -->`
|
|
1241
|
+
- Save files
|
|
1242
|
+
|
|
1243
|
+
**Show confirmation:**
|
|
1244
|
+
|
|
1245
|
+
```
|
|
1246
|
+
✅ Updated:
|
|
1247
|
+
- planning/roadmap.md (Feature 2.3)
|
|
1248
|
+
- planning/user-stories/EP-001/HU-001-002.md (5/5 DoD items)
|
|
1249
|
+
```
|
|
1250
|
+
|
|
1251
|
+
**IF update fails:**
|
|
1252
|
+
|
|
1253
|
+
```
|
|
1254
|
+
❌ Failed to update [file]: [reason]
|
|
1255
|
+
|
|
1256
|
+
Options:
|
|
1257
|
+
1) Retry update
|
|
1258
|
+
2) Skip this file
|
|
1259
|
+
3) Cancel finalization
|
|
1260
|
+
|
|
1261
|
+
Your choice: _
|
|
1262
|
+
```
|
|
1263
|
+
|
|
1264
|
+
**IF source is "manual" or None:**
|
|
1265
|
+
|
|
1266
|
+
```
|
|
1267
|
+
⏭️ No source documentation to update (manual task)
|
|
1268
|
+
```
|
|
1269
|
+
|
|
1270
|
+
---
|
|
1271
|
+
|
|
1272
|
+
## ✅ Development Work Complete
|
|
1273
|
+
|
|
1274
|
+
Your code is ready for finalization. You have two options:
|
|
1275
|
+
|
|
1276
|
+
### Option A: Run Full Finalization Now (Recommended) ⭐
|
|
1277
|
+
|
|
1278
|
+
Execute `/flow-finish` to complete all finalization steps automatically:
|
|
1279
|
+
|
|
1280
|
+
- ✅ **Smart Validation** - Runs tests + lint only if needed (or revalidates if requested)
|
|
1281
|
+
- 📦 **Work Archiving** - Records analytics to `.ai-flow/archive/analytics.jsonl`, cleans workspace
|
|
1282
|
+
- 🤖 **AI-Powered Summaries** - Generates professional PR/Jira descriptions (~1,200 tokens)
|
|
1283
|
+
- 🚀 **Optional Push** - Pushes to remote with explicit confirmation
|
|
1284
|
+
|
|
1285
|
+
**To proceed:** Type `/flow-finish` in the chat
|
|
1286
|
+
|
|
1287
|
+
---
|
|
1288
|
+
|
|
1289
|
+
### Option B: Manual Finalization
|
|
1290
|
+
|
|
1291
|
+
If you prefer granular control over each step:
|
|
1292
|
+
|
|
1293
|
+
1. **Validation:** `/flow-check` - Run comprehensive validation (tests + code review)
|
|
1294
|
+
2. **Commit:** `/flow-commit` - Create conventional commit with auto-generated message
|
|
1295
|
+
3. **Archive:** Manually record analytics and clean `.ai-flow/work/[task-name]/`
|
|
1296
|
+
4. **Push:** `git push origin [branch-name]` when ready
|
|
1297
|
+
|
|
1298
|
+
---
|
|
1299
|
+
|
|
1300
|
+
**What would you like to do?**
|
|
1301
|
+
|
|
1302
|
+
```
|
|
1303
|
+
a) Run /flow-finish now ⭐ (Recommended - comprehensive automation)
|
|
1304
|
+
b) I'll handle finalization manually (granular control)
|
|
1305
|
+
c) Tell me more about what /flow-finish does
|
|
1306
|
+
|
|
1307
|
+
Your choice: _
|
|
1308
|
+
```
|
|
1309
|
+
|
|
1310
|
+
**If 'a':** Execute `/flow-finish` immediately
|
|
1311
|
+
|
|
1312
|
+
**If 'b':** Show confirmation and end workflow:
|
|
1313
|
+
|
|
1314
|
+
```
|
|
1315
|
+
✅ Understood. Development complete.
|
|
1316
|
+
|
|
1317
|
+
📋 Manual finalization checklist:
|
|
1318
|
+
- [ ] Run validation: /flow-check
|
|
1319
|
+
- [ ] Commit changes: /flow-commit
|
|
1320
|
+
- [ ] Archive work folder
|
|
1321
|
+
- [ ] Push to remote
|
|
1322
|
+
- [ ] Create PR/MR
|
|
1323
|
+
|
|
1324
|
+
💡 Tip: You can run /flow-finish anytime to automate these steps.
|
|
1325
|
+
|
|
1326
|
+
🎉 Great work!
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1329
|
+
**If 'c':** Show detailed explanation:
|
|
1330
|
+
|
|
1331
|
+
```
|
|
1332
|
+
📖 About /flow-finish
|
|
1333
|
+
|
|
1334
|
+
/flow-finish is an intelligent finalization workflow that:
|
|
1335
|
+
|
|
1336
|
+
1️⃣ **Smart Validation (Step 1)**
|
|
1337
|
+
- Detects if /flow-check was already run successfully
|
|
1338
|
+
- Only re-runs if explicitly requested or validation failed
|
|
1339
|
+
- Shows comprehensive test + lint results
|
|
1340
|
+
|
|
1341
|
+
2️⃣ **Smart Commit (Step 2)**
|
|
1342
|
+
- Detects uncommitted changes automatically
|
|
1343
|
+
- Runs /flow-commit only if needed
|
|
1344
|
+
- Generates conventional commit messages
|
|
1345
|
+
|
|
1346
|
+
3️⃣ **Work Archiving (Step 3)**
|
|
1347
|
+
- Extracts analytics: duration, story points, commits
|
|
1348
|
+
- Appends to .ai-flow/archive/analytics.jsonl
|
|
1349
|
+
- Deletes .ai-flow/work/[task-name]/ folder
|
|
1350
|
+
|
|
1351
|
+
4️⃣ **AI Summaries (Step 4)**
|
|
1352
|
+
- Reads git diff + commit history
|
|
1353
|
+
- Generates professional PR description
|
|
1354
|
+
- Generates ticket update (Jira/ClickUp/Linear)
|
|
1355
|
+
- ~1,200 tokens, markdown-formatted
|
|
1356
|
+
|
|
1357
|
+
5️⃣ **Optional Push (Step 5)**
|
|
1358
|
+
- Always asks for confirmation
|
|
1359
|
+
- Shows branch name and remote
|
|
1360
|
+
- Never pushes without explicit approval
|
|
1361
|
+
|
|
1362
|
+
**Would you like to run it now?** (y/n): _
|
|
1363
|
+
```
|
|
1364
|
+
|
|
1365
|
+
**END WORKFLOW**
|
|
1366
|
+
|
|
1367
|
+
---
|
|
1368
|
+
|
|
1369
|
+
## Orchestration Rules
|
|
1370
|
+
|
|
1371
|
+
- **DRY Logic**: This file handles the high-level orchestration.
|
|
1372
|
+
- **Delegation**:
|
|
1373
|
+
- Detailed Feature logic → `@flow-work-feature.md`
|
|
1374
|
+
- Detailed Refactor logic → `@flow-work-refactor.md`
|
|
1375
|
+
- Detailed Fix logic → `@flow-work-fix.md`
|
|
1376
|
+
- Resume logic → `@flow-work-resume.md`
|
|
1377
|
+
- **State Persistence**: Always read/write to `.ai-flow/work/[name]/status.json` to maintain state across sessions.
|
|
1378
|
+
|
|
1379
|
+
---
|
|
1380
|
+
|
|
1381
|
+
## Phase 99: Informative Response
|
|
1382
|
+
|
|
1383
|
+
**This phase handles questions, reports, and analysis requests WITHOUT creating work files or branches.**
|
|
1384
|
+
|
|
1385
|
+
### 1. Analyze Request Type
|
|
1386
|
+
|
|
1387
|
+
**Classify the informative request:**
|
|
1388
|
+
|
|
1389
|
+
- **Technical Question:** How does X work? Why do we use Y?
|
|
1390
|
+
- **Screen/Component Explanation:** Explain this screen/component/hook
|
|
1391
|
+
- **Architecture Review:** Show me the navigation structure/state management
|
|
1392
|
+
- **Project Report:** Generate report on dependencies/performance/bundle size
|
|
1393
|
+
- **File Location:** Where is X screen? Find Y component
|
|
1394
|
+
- **Comparison:** Compare X vs Y approach (React Native vs Flutter)
|
|
1395
|
+
- **Best Practices:** What's the best way to handle X in mobile?
|
|
1396
|
+
|
|
1397
|
+
### 2. Load Relevant Context
|
|
1398
|
+
|
|
1399
|
+
**Based on request type, load specific documentation:**
|
|
1400
|
+
|
|
1401
|
+
**IF question about architecture/patterns:**
|
|
1402
|
+
|
|
1403
|
+
- Read `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
1404
|
+
- Read `docs/architecture.md` (navigation, state, native modules)
|
|
1405
|
+
- Search codebase for examples
|
|
1406
|
+
|
|
1407
|
+
**IF question about specific screen/component:**
|
|
1408
|
+
|
|
1409
|
+
- Search codebase for screen/component files
|
|
1410
|
+
- Read relevant specs from `specs/`
|
|
1411
|
+
- Check navigation flow
|
|
1412
|
+
|
|
1413
|
+
**IF report request:**
|
|
1414
|
+
|
|
1415
|
+
- Run appropriate analysis (performance, dependencies, native modules)
|
|
1416
|
+
- Read relevant docs for context
|
|
1417
|
+
- Generate structured report
|
|
1418
|
+
|
|
1419
|
+
**IF file location request:**
|
|
1420
|
+
|
|
1421
|
+
- Search codebase with grep/semantic search
|
|
1422
|
+
- List relevant screens/components with descriptions
|
|
1423
|
+
|
|
1424
|
+
### 3. Provide Comprehensive Answer
|
|
1425
|
+
|
|
1426
|
+
**Structure your response:**
|
|
1427
|
+
|
|
1428
|
+
```markdown
|
|
1429
|
+
## [Question/Request]
|
|
1430
|
+
|
|
1431
|
+
### Answer
|
|
1432
|
+
|
|
1433
|
+
[Detailed explanation with code examples if relevant]
|
|
1434
|
+
|
|
1435
|
+
### Related Documentation
|
|
1436
|
+
|
|
1437
|
+
- [Link to relevant docs]
|
|
1438
|
+
- [Link to screen/component examples]
|
|
1439
|
+
|
|
1440
|
+
### Additional Context
|
|
1441
|
+
|
|
1442
|
+
[Architecture decisions, mobile-specific considerations, performance implications]
|
|
1443
|
+
|
|
1444
|
+
### Related User Stories/Features
|
|
1445
|
+
|
|
1446
|
+
[If applicable, link to planning docs]
|
|
1447
|
+
```
|
|
1448
|
+
|
|
1449
|
+
**Guidelines:**
|
|
1450
|
+
|
|
1451
|
+
- **Be comprehensive:** Load all relevant context, don't guess
|
|
1452
|
+
- **Show examples:** Include actual code from the project
|
|
1453
|
+
- **Reference docs:** Link to `docs/`, `specs/`, `planning/`
|
|
1454
|
+
- **Explain trade-offs:** Why was X chosen over Y?
|
|
1455
|
+
- **Mobile-specific:** Consider iOS vs Android differences
|
|
1456
|
+
- **Provide sources:** Always cite where information comes from
|
|
1457
|
+
|
|
1458
|
+
### 4. Offer Follow-up Actions
|
|
1459
|
+
|
|
1460
|
+
**After answering, offer next steps:**
|
|
1461
|
+
|
|
1462
|
+
```
|
|
1463
|
+
✅ Answer provided.
|
|
1464
|
+
|
|
1465
|
+
Would you like me to:
|
|
1466
|
+
A) Implement changes based on this analysis
|
|
1467
|
+
B) Create a work plan for improvements
|
|
1468
|
+
C) Generate a spec/doc for this
|
|
1469
|
+
D) Nothing, just the answer
|
|
1470
|
+
|
|
1471
|
+
Your choice (or just ask another question): _
|
|
1472
|
+
```
|
|
1473
|
+
|
|
1474
|
+
**IF user chooses A or B:**
|
|
1475
|
+
|
|
1476
|
+
- Return to Phase 0 with refined objective
|
|
1477
|
+
- Create appropriate work.md and proceed with execution
|
|
1478
|
+
|
|
1479
|
+
**IF user chooses C:**
|
|
1480
|
+
|
|
1481
|
+
- Create spec/doc file in appropriate location
|
|
1482
|
+
- Commit with descriptive message
|
|
1483
|
+
|
|
1484
|
+
**IF user chooses D or asks another question:**
|
|
1485
|
+
|
|
1486
|
+
- **END WORKFLOW** (no files created, no branches)
|
|
1487
|
+
|
|
1488
|
+
### 5. Example Interactions
|
|
1489
|
+
|
|
1490
|
+
**Example 1: Technical Question**
|
|
1491
|
+
|
|
1492
|
+
````
|
|
1493
|
+
User: /flow-work ¿cómo funciona la navegación entre screens?
|
|
1494
|
+
|
|
1495
|
+
Agent:
|
|
1496
|
+
🔍 Detected: Informative request (question)
|
|
1497
|
+
|
|
1498
|
+
## How Navigation Works in This Project
|
|
1499
|
+
|
|
1500
|
+
### Implementation
|
|
1501
|
+
|
|
1502
|
+
We use React Navigation v6 with stack and tab navigators:
|
|
1503
|
+
- Main structure in `src/navigation/AppNavigator.tsx`
|
|
1504
|
+
- Tab navigator: `TabNavigator.tsx` (Home, Search, Profile)
|
|
1505
|
+
- Auth stack: `AuthNavigator.tsx` (Login, Register)
|
|
1506
|
+
|
|
1507
|
+
[Shows actual code from project]
|
|
1508
|
+
|
|
1509
|
+
### Navigation Flow
|
|
1510
|
+
```typescript
|
|
1511
|
+
// AppNavigator.tsx
|
|
1512
|
+
const AppNavigator = () => {
|
|
1513
|
+
const { isAuthenticated } = useAuth();
|
|
1514
|
+
|
|
1515
|
+
return (
|
|
1516
|
+
<NavigationContainer>
|
|
1517
|
+
{isAuthenticated ? <TabNavigator /> : <AuthNavigator />}
|
|
1518
|
+
</NavigationContainer>
|
|
1519
|
+
);
|
|
1520
|
+
};
|
|
1521
|
+
````
|
|
1522
|
+
|
|
1523
|
+
### Screen Transitions
|
|
1524
|
+
|
|
1525
|
+
- Stack: `navigation.navigate('ScreenName', { params })`
|
|
1526
|
+
- Modal: `navigation.push('Modal')`
|
|
1527
|
+
- Go back: `navigation.goBack()`
|
|
1528
|
+
|
|
1529
|
+
### Deep Linking
|
|
1530
|
+
|
|
1531
|
+
Configured in `linking.ts` for:
|
|
1532
|
+
|
|
1533
|
+
- `/home` → HomeScreen
|
|
1534
|
+
- `/profile/:id` → ProfileScreen
|
|
1535
|
+
- `/post/:id` → PostDetailScreen
|
|
1536
|
+
|
|
1537
|
+
### Platform Differences
|
|
1538
|
+
|
|
1539
|
+
- iOS: Native stack with gestures
|
|
1540
|
+
- Android: Material transitions
|
|
1541
|
+
- Handled automatically by React Navigation
|
|
1542
|
+
|
|
1543
|
+
### Related Documentation
|
|
1544
|
+
|
|
1545
|
+
- `docs/architecture.md` - Navigation structure
|
|
1546
|
+
- `docs/components.md` - Screen components
|
|
1547
|
+
|
|
1548
|
+
Would you like me to implement any changes to navigation? (Y/N): \_
|
|
1549
|
+
|
|
1550
|
+
```
|
|
1551
|
+
|
|
1552
|
+
**Example 2: Report Request**
|
|
1553
|
+
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
User: /flow-work genera un informe de dependencias nativas
|
|
1557
|
+
|
|
1558
|
+
Agent:
|
|
1559
|
+
🔍 Detected: Informative request (report)
|
|
1560
|
+
|
|
1561
|
+
## Native Dependencies Report
|
|
1562
|
+
|
|
1563
|
+
[Analyzes package.json and native modules]
|
|
1564
|
+
|
|
1565
|
+
### Total Native Modules: 8
|
|
1566
|
+
|
|
1567
|
+
| Module | Version | Platform | Purpose |
|
|
1568
|
+
| ------------------------------ | ------- | -------- | ------------------ |
|
|
1569
|
+
| react-native-permissions | 3.8.0 | Both | Runtime perms |
|
|
1570
|
+
| react-native-camera | 4.2.1 | Both | Camera access |
|
|
1571
|
+
| @react-native-async-storage | 1.19.0 | Both | Local storage |
|
|
1572
|
+
| react-native-push-notification | 8.1.1 | Both | Push notifications |
|
|
1573
|
+
| react-native-geolocation | 2.1.0 | Both | GPS location |
|
|
1574
|
+
| react-native-biometrics | 3.0.1 | Both | Face/Touch ID |
|
|
1575
|
+
| react-native-keychain | 8.1.2 | Both | Secure storage |
|
|
1576
|
+
| react-native-vector-icons | 9.2.0 | Both | Icon library |
|
|
1577
|
+
|
|
1578
|
+
### Pod Dependencies (iOS): 15 pods
|
|
1579
|
+
|
|
1580
|
+
### Gradle Dependencies (Android): 12 libraries
|
|
1581
|
+
|
|
1582
|
+
### Potential Issues
|
|
1583
|
+
|
|
1584
|
+
1. ⚠️ `react-native-camera` - Consider migrating to `react-native-vision-camera` (better performance)
|
|
1585
|
+
2. ✅ All modules support New Architecture
|
|
1586
|
+
3. ✅ No deprecated packages
|
|
1587
|
+
|
|
1588
|
+
### Bundle Impact
|
|
1589
|
+
|
|
1590
|
+
- iOS: +2.5 MB (native modules)
|
|
1591
|
+
- Android: +3.1 MB (native modules)
|
|
1592
|
+
|
|
1593
|
+
### Recommendations
|
|
1594
|
+
|
|
1595
|
+
1. Migrate camera module for better performance
|
|
1596
|
+
2. All modules are up to date ✅
|
|
1597
|
+
|
|
1598
|
+
Would you like me to create a migration plan for the camera module? (Y/N): \_
|
|
1599
|
+
|
|
1600
|
+
```
|
|
1601
|
+
|
|
1602
|
+
---
|
|
1603
|
+
|
|
1604
|
+
**BEGIN EXECUTION when user runs `/flow-work [args]`**
|
|
1605
|
+
```
|