ai-flow-dev 2.4.5 β 2.5.2
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/README.md +22 -12
- package/package.json +1 -1
- package/prompts/backend/flow-commit.md +69 -3
- package/prompts/backend/flow-work-feature.md +13 -0
- package/prompts/backend/flow-work-fix.md +10 -0
- package/prompts/backend/flow-work-refactor.md +10 -0
- package/prompts/backend/flow-work.md +686 -94
- package/prompts/frontend/flow-commit.md +69 -3
- package/prompts/frontend/flow-work-feature.md +13 -0
- package/prompts/frontend/flow-work-fix.md +2 -0
- package/prompts/frontend/flow-work-refactor.md +10 -0
- package/prompts/frontend/flow-work.md +692 -96
- package/prompts/mobile/flow-commit.md +69 -3
- package/prompts/mobile/flow-work-feature.md +13 -0
- package/prompts/mobile/flow-work-fix.md +10 -0
- package/prompts/mobile/flow-work-refactor.md +10 -0
- package/prompts/mobile/flow-work.md +688 -96
- package/prompts/shared/task-summary-template.md +277 -0
- package/templates/AGENT.template.md +41 -23
- package/templates/backend/.clauderules.template +112 -112
- package/templates/backend/.cursorrules.template +102 -102
|
@@ -11,35 +11,40 @@ Your mission is to orchestrate development tasks through an interactive workflow
|
|
|
11
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
12
|
|
|
13
13
|
---
|
|
14
|
+
|
|
14
15
|
## Command: `/flow-work`
|
|
15
16
|
|
|
16
17
|
### Objective
|
|
18
|
+
|
|
17
19
|
Provide a single, intelligent entry point for all development work (New Features, Refactorings, and Bug Fixes) with automatic context detection and interactive planning.
|
|
18
20
|
|
|
19
21
|
### Usage Modes
|
|
22
|
+
|
|
20
23
|
- **`/flow-work`** β Resume paused work (if exists) or Interactive mode.
|
|
21
24
|
- **`/flow-work [description]`** β Semantic detection (Feature, Refactor, or Fix).
|
|
22
25
|
- **`/flow-work HU-XXX-XXX`** β Implement specific User Story.
|
|
23
26
|
- **`/flow-work [Feature Name]`** β Implement feature from roadmap.md.
|
|
24
27
|
|
|
25
28
|
---
|
|
29
|
+
|
|
26
30
|
## Phase 0: Detection & Strategy (Automatic)
|
|
27
31
|
|
|
28
32
|
**1. Semantic Analysis of Input:**
|
|
29
33
|
|
|
30
|
-
| Input Pattern
|
|
31
|
-
|
|
32
|
-
| `HU-\d{3}-\d{3}`
|
|
33
|
-
| `EP-\d{3}`
|
|
34
|
-
| `T\d{3}(-T\d{3})?`
|
|
35
|
-
| `HU-XXX-XXX TXXX-TXXX
|
|
36
|
-
| Matches `planning/roadmap.md`
|
|
37
|
-
| "refactor", "move", "extract"
|
|
38
|
-
| "fix", "bug", "error", "falla" | `FIX`
|
|
39
|
-
| "implement", "create", "new"
|
|
40
|
-
| No arguments
|
|
34
|
+
| Input Pattern | Mode | Source / Action |
|
|
35
|
+
| ------------------------------ | ----------------- | -------------------------------------------------------------------- |
|
|
36
|
+
| `HU-\d{3}-\d{3}` | `USER_STORY` | Load from `planning/user-stories/**/HU-XXX-XXX.md` |
|
|
37
|
+
| `EP-\d{3}` | `EPIC` | Analyze/List User Stories for Epic `EP-XXX` |
|
|
38
|
+
| `T\d{3}(-T\d{3})?` | `TASKS` | Target specific task or range (e.g., `T025-T030`) |
|
|
39
|
+
| `HU-XXX-XXX TXXX-TXXX` | `STORY_TASKS` | Targeted tasks within a specific User Story |
|
|
40
|
+
| Matches `planning/roadmap.md` | `ROADMAP_FEATURE` | Extract section from `planning/roadmap.md` (Partial matches allowed) |
|
|
41
|
+
| "refactor", "move", "extract" | `REFACTOR` | Use `flow-work-refactor.md` |
|
|
42
|
+
| "fix", "bug", "error", "falla" | `FIX` | Detect complexity (Quick vs Complex) |
|
|
43
|
+
| "implement", "create", "new" | `FEATURE` | Use `flow-work-feature.md` |
|
|
44
|
+
| No arguments | `RESUME` | Search for paused work in `.ai-flow/work/` |
|
|
41
45
|
|
|
42
46
|
**2. Detection Logic Details:**
|
|
47
|
+
|
|
43
48
|
- **USER_STORY / EPIC**: Load metadata from `planning/user-stories/` or `planning/roadmap.md`.
|
|
44
49
|
- **ROADMAP_FEATURE**: Fuzzy search in `planning/roadmap.md` for titles like "User Management" or "Feature 2.2".
|
|
45
50
|
- **TASK RANGES**: If `T025-T030` is provided, find the parent Story or Feature in current context or roadmap.
|
|
@@ -47,13 +52,107 @@ Provide a single, intelligent entry point for all development work (New Features
|
|
|
47
52
|
- **COMPLEX FIX**: Multi-file, architectural, performance/security. β Use `flow-work-fix.md` (Deep).
|
|
48
53
|
|
|
49
54
|
---
|
|
55
|
+
|
|
56
|
+
## Phase 0.5: Complexity Classification (CRITICAL)
|
|
57
|
+
|
|
58
|
+
**Analyze task scope to determine workflow:**
|
|
59
|
+
|
|
60
|
+
| Metric | SIMPLE (β‘) | MEDIUM (π) | COMPLEX (ποΈ) |
|
|
61
|
+
| ------------- | ----------- | ----------- | ------------- |
|
|
62
|
+
| Files | 1 | 2-5 | >5 |
|
|
63
|
+
| Lines | <20 | 20-100 | >100 |
|
|
64
|
+
| Tests | No | Optional | Required |
|
|
65
|
+
| Docs | None | Minor | Significant |
|
|
66
|
+
| Architecture | None | Minimal | Major changes |
|
|
67
|
+
| Time estimate | <15 min | 15-60 min | >60 min |
|
|
68
|
+
|
|
69
|
+
**Classification Rules:**
|
|
70
|
+
|
|
71
|
+
**β‘ SIMPLE Task:**
|
|
72
|
+
|
|
73
|
+
- Examples: Fix typo, rename variable, update constant, add log, adjust CSS
|
|
74
|
+
- **Workflow**: In-chat plan β Execute β Done (NO files created)
|
|
75
|
+
- **Context**: Only `ai-instructions.md` if relevant
|
|
76
|
+
|
|
77
|
+
**π MEDIUM Task:**
|
|
78
|
+
|
|
79
|
+
- Examples: Add component, refactor hook, simple bug fix, update API call
|
|
80
|
+
- **Workflow**: Create `work.md` only (NO `status.json`) β Execute β Simple archive
|
|
81
|
+
- **Context**: Load 2-3 relevant docs
|
|
82
|
+
|
|
83
|
+
**ποΈ COMPLEX Task:**
|
|
84
|
+
|
|
85
|
+
- Examples: New feature, major refactor, security fix, multi-file changes
|
|
86
|
+
- **Workflow**: Full workflow (`work.md` + `status.json` + branch + archiving)
|
|
87
|
+
- **Context**: Load all relevant docs
|
|
88
|
+
|
|
89
|
+
**Detection Logic:**
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
if files_affected == 1 and lines_changed < 20 and no_tests_needed and no_architecture_impact:
|
|
93
|
+
complexity = "SIMPLE"
|
|
94
|
+
elif files_affected <= 5 and lines_changed <= 100 and architecture_impact == "minimal":
|
|
95
|
+
complexity = "MEDIUM"
|
|
96
|
+
else:
|
|
97
|
+
complexity = "COMPLEX"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Show classification:**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
π Task Complexity: [SIMPLE β‘ | MEDIUM π | COMPLEX ποΈ]
|
|
104
|
+
|
|
105
|
+
Detected:
|
|
106
|
+
- Files: [N]
|
|
107
|
+
- Estimated lines: [~X]
|
|
108
|
+
- Tests needed: [Yes/No]
|
|
109
|
+
- Architecture impact: [None/Minimal/Major]
|
|
110
|
+
|
|
111
|
+
Proceeding with [SIMPLE/MEDIUM/COMPLEX] workflow.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
50
116
|
## Phase 1: Analysis & Refinement
|
|
51
117
|
|
|
52
|
-
**1. Context Loading (
|
|
118
|
+
**1. Context Loading (Smart & Selective):**
|
|
119
|
+
|
|
120
|
+
**CRITICAL: Load context based on task complexity and type:**
|
|
121
|
+
|
|
122
|
+
**IF complexity == "SIMPLE":**
|
|
123
|
+
|
|
124
|
+
- Load ONLY `ai-instructions.md` if task involves code changes
|
|
125
|
+
- Skip all other documentation
|
|
126
|
+
- Use existing patterns in nearby code as reference
|
|
127
|
+
|
|
128
|
+
**IF complexity == "MEDIUM":**
|
|
53
129
|
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
130
|
+
- Load `ai-instructions.md` (core rules)
|
|
131
|
+
- Load 1-2 specific docs based on task type:
|
|
132
|
+
- Component changes β `docs/components.md`
|
|
133
|
+
- Routing changes β `docs/routing.md`
|
|
134
|
+
- State management β `docs/state-management.md`
|
|
135
|
+
- Styling β `docs/styling.md`
|
|
136
|
+
- Skip architecture.md unless creating new patterns
|
|
137
|
+
|
|
138
|
+
**IF complexity == "COMPLEX":**
|
|
139
|
+
|
|
140
|
+
- Load `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
141
|
+
- Load `docs/architecture.md` (patterns, structure)
|
|
142
|
+
- Load task-specific docs:
|
|
143
|
+
- Components β `docs/components.md`
|
|
144
|
+
- Routing/Navigation β `docs/routing.md`
|
|
145
|
+
- State β `docs/state-management.md`
|
|
146
|
+
- API Integration β `docs/api-integration.md`
|
|
147
|
+
- Testing β `docs/testing.md`
|
|
148
|
+
- Load `docs/code-standards.md` only if creating new files
|
|
149
|
+
|
|
150
|
+
**Source Documentation (User Stories/Roadmap):**
|
|
151
|
+
|
|
152
|
+
**IF** `HU-XXX-XXX` or roadmap feature provided:
|
|
153
|
+
|
|
154
|
+
- **`planning/roadmap.md`**: Load for high-level scope
|
|
155
|
+
- **`planning/user-stories/**/HU-XXX-XXX.md`\*\*: Load for detailed requirements
|
|
57
156
|
|
|
58
157
|
**2. Detail Level Detection (if Manual input):**
|
|
59
158
|
|
|
@@ -81,35 +180,40 @@ detail_level = analyze_description(input)
|
|
|
81
180
|
**3. Interactive Refinement (Conditional):**
|
|
82
181
|
|
|
83
182
|
**IF detail_level == "HIGH":**
|
|
183
|
+
|
|
84
184
|
- Skip refinement questions
|
|
85
185
|
- Proceed directly to Phase 2 (Planning)
|
|
86
186
|
- Show: "β
Sufficient detail detected. Proceeding with planning..."
|
|
87
187
|
|
|
88
188
|
**IF detail_level == "MEDIUM":**
|
|
189
|
+
|
|
89
190
|
- Ask 1-2 targeted questions (only missing items)
|
|
90
191
|
- Use Multiple Choice with defaults (β)
|
|
91
192
|
|
|
92
193
|
**IF detail_level == "LOW":**
|
|
194
|
+
|
|
93
195
|
- Full refinement flow (3-5 questions)
|
|
94
196
|
- Use Multiple Choice with defaults (β)
|
|
95
197
|
- Focus on: approach, scope, constraints, priorities
|
|
96
198
|
|
|
97
199
|
**Example Interaction (LOW detail):**
|
|
200
|
+
|
|
98
201
|
> π I need to clarify some details for this feature:
|
|
202
|
+
>
|
|
99
203
|
> 1. What authentication provider should we use? [default: A]
|
|
100
204
|
> A) JWT (Local) β
|
|
101
205
|
> B) OAuth2 (Google/GitHub)
|
|
102
206
|
> C) Firebase Auth
|
|
103
|
-
>
|
|
104
207
|
> 2. Should we implement audit logs for this? [default: B]
|
|
105
208
|
> A) Yes
|
|
106
209
|
> B) No β
|
|
107
210
|
>
|
|
108
|
-
> Your answers (or Enter for defaults): _
|
|
211
|
+
> Your answers (or Enter for defaults): \_
|
|
109
212
|
|
|
110
213
|
**4. Refined Objective Generation (if Manual):**
|
|
111
214
|
|
|
112
215
|
After refinement, generate clear objective statement:
|
|
216
|
+
|
|
113
217
|
```
|
|
114
218
|
β
Refined Objective:
|
|
115
219
|
|
|
@@ -127,6 +231,7 @@ Is this correct? (Yes/Edit/Cancel): _
|
|
|
127
231
|
**5. Documentation Compliance Check:**
|
|
128
232
|
|
|
129
233
|
Read relevant documentation:
|
|
234
|
+
|
|
130
235
|
- `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
131
236
|
- `docs/architecture.md` (patterns, structure)
|
|
132
237
|
- `docs/code-standards.md` (naming, quality)
|
|
@@ -137,6 +242,7 @@ Read relevant documentation:
|
|
|
137
242
|
Compare refined objective against documentation:
|
|
138
243
|
|
|
139
244
|
**IF deviation detected:**
|
|
245
|
+
|
|
140
246
|
```
|
|
141
247
|
π¨ POTENTIAL DEVIATION
|
|
142
248
|
|
|
@@ -155,6 +261,7 @@ Your choice: _
|
|
|
155
261
|
```
|
|
156
262
|
|
|
157
263
|
**IF user chooses B (Override):**
|
|
264
|
+
|
|
158
265
|
```
|
|
159
266
|
β οΈ OVERRIDE CONFIRMATION
|
|
160
267
|
|
|
@@ -167,67 +274,156 @@ Provide justification: _
|
|
|
167
274
|
```
|
|
168
275
|
|
|
169
276
|
---
|
|
277
|
+
|
|
278
|
+
## Phase 1.5: SIMPLE Task Fast-Track
|
|
279
|
+
|
|
280
|
+
**IF complexity == "SIMPLE": Execute immediately without creating files**
|
|
281
|
+
|
|
282
|
+
1. **Show in-chat plan:**
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
β‘ SIMPLE Task - Fast Execution
|
|
286
|
+
|
|
287
|
+
What: [1-line description]
|
|
288
|
+
File: [path]
|
|
289
|
+
Change: [specific modification]
|
|
290
|
+
Lines: ~[N] (estimated)
|
|
291
|
+
|
|
292
|
+
Execute now? (y/n): _
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
2. **IF user confirms ('y'):**
|
|
296
|
+
- Make the change immediately
|
|
297
|
+
- Show git diff preview
|
|
298
|
+
- Skip to Phase 3 (no branch creation if already on feature branch)
|
|
299
|
+
- Show: "β
Done. Run `/flow-commit` to commit."
|
|
300
|
+
- **END WORKFLOW** (no archiving needed)
|
|
301
|
+
|
|
302
|
+
3. **IF user declines ('n'):**
|
|
303
|
+
- Cancel task
|
|
304
|
+
- **END WORKFLOW**
|
|
305
|
+
|
|
306
|
+
**Note:** SIMPLE tasks don't create work.md, status.json, or archive records.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
170
310
|
## Phase 2: Planning & Documentation
|
|
171
311
|
|
|
172
|
-
|
|
312
|
+
**β οΈ SKIP THIS PHASE IF complexity == "SIMPLE"**
|
|
173
313
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
314
|
+
**1. Read Required Documentation (Based on Complexity)**
|
|
315
|
+
|
|
316
|
+
**IF complexity == "MEDIUM":**
|
|
317
|
+
|
|
318
|
+
- `ai-instructions.md` (core rules)
|
|
319
|
+
- Load ONLY task-specific docs:
|
|
320
|
+
- Components β `docs/components.md`
|
|
321
|
+
- Routing β `docs/routing.md`
|
|
322
|
+
- State β `docs/state-management.md`
|
|
323
|
+
- Styling β `docs/styling.md`
|
|
324
|
+
|
|
325
|
+
**IF complexity == "COMPLEX":**
|
|
326
|
+
|
|
327
|
+
- `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
328
|
+
- `docs/architecture.md` (layer, pattern, structure)
|
|
329
|
+
- Task-specific docs:
|
|
330
|
+
- Components β `docs/components.md`
|
|
331
|
+
- Routing/Navigation β `docs/routing.md`
|
|
332
|
+
- State β `docs/state-management.md`
|
|
333
|
+
- API Integration β `docs/api-integration.md`
|
|
334
|
+
- Testing β `docs/testing.md`
|
|
335
|
+
- `docs/code-standards.md` (only if creating new files)
|
|
182
336
|
|
|
183
337
|
**2. Analyze Existing Codebase (MANDATORY)**
|
|
184
338
|
|
|
185
339
|
Find similar features/patterns in codebase:
|
|
186
|
-
|
|
340
|
+
|
|
341
|
+
- Identify existing files to use as reference (e.g., UserProfile.tsx for ProductCard.tsx)
|
|
187
342
|
- Check naming conventions in actual code
|
|
188
343
|
- Verify architectural consistency
|
|
189
|
-
- Look for reusable components/
|
|
344
|
+
- Look for reusable components/hooks
|
|
345
|
+
|
|
346
|
+
**3. Generate work.md (Conditional)**
|
|
347
|
+
|
|
348
|
+
**IF complexity == "MEDIUM":**
|
|
190
349
|
|
|
191
|
-
|
|
350
|
+
- Create simplified `.ai-flow/work/[task-name]/work.md` (~15-20 lines)
|
|
351
|
+
- Skip status.json
|
|
192
352
|
|
|
193
|
-
|
|
353
|
+
**IF complexity == "COMPLEX":**
|
|
194
354
|
|
|
195
|
-
|
|
355
|
+
- Create full `.ai-flow/work/[task-name]/work.md` (~30-40 lines)
|
|
356
|
+
- Create `status.json` (see step 4)
|
|
357
|
+
|
|
358
|
+
**Structure for MEDIUM tasks** (~15-20 lines):
|
|
359
|
+
|
|
360
|
+
```markdown
|
|
361
|
+
# [Type]: [Feature Name]
|
|
362
|
+
|
|
363
|
+
**Source**: [HU-XXX | Roadmap X.X | Manual]
|
|
364
|
+
**Files**: [2-5 files listed]
|
|
365
|
+
**Estimated**: [20-60 min]
|
|
366
|
+
|
|
367
|
+
## Objective
|
|
368
|
+
|
|
369
|
+
[1 clear paragraph]
|
|
370
|
+
|
|
371
|
+
## Tasks
|
|
372
|
+
|
|
373
|
+
- [ ] Task 1 β path/Component.tsx
|
|
374
|
+
- [ ] Task 2 β path/hook.ts
|
|
375
|
+
- [ ] Task 3 (optional tests)
|
|
376
|
+
|
|
377
|
+
## Key Rules
|
|
378
|
+
|
|
379
|
+
- β
[1-2 relevant ALWAYS rules]
|
|
380
|
+
- β [1-2 relevant NEVER rules]
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Structure for COMPLEX tasks** (~30-40 lines):
|
|
196
384
|
|
|
197
385
|
```markdown
|
|
198
386
|
# [Type]: [Feature Name]
|
|
199
387
|
|
|
200
388
|
## Context
|
|
389
|
+
|
|
201
390
|
**Source**: HU-001-002 | Roadmap 2.3 | Manual [+ DEVIATION if override]
|
|
202
391
|
**SP**: 5 | **Branch**: feature/user-auth | **Deps**: None
|
|
203
392
|
|
|
204
393
|
## Objective
|
|
394
|
+
|
|
205
395
|
[1-2 clear paragraphs describing WHAT will be implemented]
|
|
206
396
|
|
|
207
397
|
## Documentation Constraints
|
|
398
|
+
|
|
208
399
|
**Read**: ai-instructions.md, architecture.md, code-standards.md, [security.md]
|
|
209
400
|
|
|
210
401
|
**Key Rules**:
|
|
402
|
+
|
|
211
403
|
- β
ALWAYS: [List specific rules that apply]
|
|
212
404
|
- β NEVER: [List specific prohibitions]
|
|
213
405
|
- π Pattern: [Architectural pattern from docs]
|
|
214
406
|
- π Location: [File structure from architecture.md]
|
|
215
407
|
|
|
216
408
|
## Approach
|
|
409
|
+
|
|
217
410
|
**Layer**: [Data | Business Logic | API | UI]
|
|
218
411
|
**Files**: [List files to create/modify]
|
|
219
412
|
**Reference**: [Existing file to follow as pattern]
|
|
220
413
|
|
|
221
414
|
**Phases**:
|
|
415
|
+
|
|
222
416
|
1. [Phase 1 description]
|
|
223
417
|
2. [Phase 2 description]
|
|
224
418
|
3. [Phase 3 description]
|
|
225
419
|
4. [Phase 4 description]
|
|
226
420
|
|
|
227
421
|
## Tasks
|
|
422
|
+
|
|
228
423
|
[SEE TASK GENERATION LOGIC BELOW]
|
|
229
424
|
|
|
230
425
|
## Validation
|
|
426
|
+
|
|
231
427
|
- [ ] All NEVER/ALWAYS rules followed
|
|
232
428
|
- [ ] Tests pass (coverage per docs/testing.md)
|
|
233
429
|
- [ ] No hardcoded secrets
|
|
@@ -238,6 +434,7 @@ Create single consolidated file: `.ai-flow/work/[task-name]/work.md`
|
|
|
238
434
|
**Task Generation Logic:**
|
|
239
435
|
|
|
240
436
|
**IF source is User Story:**
|
|
437
|
+
|
|
241
438
|
```python
|
|
242
439
|
tasks = read_user_story_tasks()
|
|
243
440
|
if tasks.are_detailed(): # Has: path, constraints, SP, deps
|
|
@@ -254,6 +451,7 @@ else:
|
|
|
254
451
|
```
|
|
255
452
|
|
|
256
453
|
**IF source is Roadmap:**
|
|
454
|
+
|
|
257
455
|
```python
|
|
258
456
|
feature = read_roadmap_feature()
|
|
259
457
|
if feature.has_detailed_tasks():
|
|
@@ -271,8 +469,10 @@ else:
|
|
|
271
469
|
**IF source is Manual OR tasks need expansion:**
|
|
272
470
|
|
|
273
471
|
Generate detailed tasks with this format:
|
|
472
|
+
|
|
274
473
|
```markdown
|
|
275
474
|
## Tasks
|
|
475
|
+
|
|
276
476
|
**Source**: Manual | Roadmap X.X (expanded) | HU-XXX-XXX (expanded)
|
|
277
477
|
|
|
278
478
|
- [ ] T001 [D] Create User entity β src/entities/User.ts β’ 1 SP
|
|
@@ -286,13 +486,16 @@ Generate detailed tasks with this format:
|
|
|
286
486
|
```
|
|
287
487
|
|
|
288
488
|
**Task Detail Requirements:**
|
|
489
|
+
|
|
289
490
|
- Specific file path
|
|
290
491
|
- Pattern/reference to follow
|
|
291
492
|
- Key constraints from docs
|
|
292
493
|
- Dependencies (if applicable)
|
|
293
494
|
- Story Points
|
|
294
495
|
|
|
295
|
-
**4. Generate status.json**
|
|
496
|
+
**4. Generate status.json (ONLY for COMPLEX tasks)**
|
|
497
|
+
|
|
498
|
+
**IF complexity == "COMPLEX":**
|
|
296
499
|
|
|
297
500
|
Create: `.ai-flow/work/[task-name]/status.json`
|
|
298
501
|
|
|
@@ -324,6 +527,7 @@ Create: `.ai-flow/work/[task-name]/status.json`
|
|
|
324
527
|
**5. User Approval**
|
|
325
528
|
|
|
326
529
|
Show work.md for review:
|
|
530
|
+
|
|
327
531
|
```
|
|
328
532
|
π Generated: .ai-flow/work/[task-name]/work.md
|
|
329
533
|
|
|
@@ -335,10 +539,105 @@ Review work.md? (Yes/Edit/No): _
|
|
|
335
539
|
- **No**: Cancel workflow
|
|
336
540
|
|
|
337
541
|
---
|
|
542
|
+
|
|
338
543
|
## Phase 3: Execution (Branch Creation)
|
|
339
544
|
|
|
340
545
|
**Upon confirmation to start implementation:**
|
|
341
546
|
|
|
547
|
+
**π‘οΈ CRITICAL: Protected Branch Check**
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
git branch --show-current
|
|
551
|
+
git status --porcelain
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
**If current branch is protected** (`main`, `master`, `develop`, `development`):
|
|
555
|
+
|
|
556
|
+
**A) If there are uncommitted changes:**
|
|
557
|
+
|
|
558
|
+
1. **Analyze changes to generate branch name:**
|
|
559
|
+
|
|
560
|
+
```bash
|
|
561
|
+
git status --porcelain
|
|
562
|
+
git diff --stat
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
**Detection rules:**
|
|
566
|
+
- **New components/features** β `feature/`
|
|
567
|
+
- **Bug fixes** (error handling, corrections) β `fix/`
|
|
568
|
+
- **Refactoring/Styling** (code improvements, CSS changes) β `refactor/`
|
|
569
|
+
- **Configuration/Dependencies** (package.json, webpack, vite, etc.) β `chore/`
|
|
570
|
+
- **Tests only** β `test/`
|
|
571
|
+
- **Documentation only** β `docs/`
|
|
572
|
+
|
|
573
|
+
**Naming strategy:**
|
|
574
|
+
- Extract component/page/feature name
|
|
575
|
+
- Remove extensions (.tsx, .jsx, .ts, .js)
|
|
576
|
+
- Convert to kebab-case
|
|
577
|
+
- Limit to 3-4 words max
|
|
578
|
+
|
|
579
|
+
**Examples:**
|
|
580
|
+
|
|
581
|
+
```
|
|
582
|
+
src/components/UserProfile.tsx (new) β feature/user-profile
|
|
583
|
+
src/pages/Dashboard.tsx (fix) β fix/dashboard-page
|
|
584
|
+
src/hooks/useAuth.ts (modified) β refactor/use-auth-hook
|
|
585
|
+
package.json + package-lock.json β chore/update-dependencies
|
|
586
|
+
src/components/Auth* + src/pages/Login* β feature/authentication
|
|
587
|
+
styles/ + components/ (multiple) β refactor/ui-components
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
2. **Warn user:**
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
β οΈ Working on protected branch '[branch-name]' with uncommitted changes.
|
|
594
|
+
|
|
595
|
+
Analyzed changes:
|
|
596
|
+
- [file1] (new)
|
|
597
|
+
- [file2] (modified)
|
|
598
|
+
- [file3] (modified)
|
|
599
|
+
... [N] more files
|
|
600
|
+
|
|
601
|
+
Detected type: [feature|fix|refactor|chore]
|
|
602
|
+
Suggested branch: [type]/[descriptive-slug]
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
3. **Offer options:**
|
|
606
|
+
- **A)** Create branch: `[type]/[suggested-name]` β
|
|
607
|
+
- **B)** Edit branch name (user provides custom slug)
|
|
608
|
+
- **C)** Stash changes and continue: `git stash`
|
|
609
|
+
- **D)** Cancel
|
|
610
|
+
|
|
611
|
+
4. If user chooses A:
|
|
612
|
+
|
|
613
|
+
```bash
|
|
614
|
+
git checkout -b [type]/[suggested-name]
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
Then show:
|
|
618
|
+
|
|
619
|
+
```
|
|
620
|
+
β
Created and switched to '[type]/[suggested-name]'
|
|
621
|
+
|
|
622
|
+
Next steps:
|
|
623
|
+
1. Run /flow-commit to commit these changes
|
|
624
|
+
2. Return to protected branch: git checkout [protected-branch]
|
|
625
|
+
3. Continue with /flow-work for new task
|
|
626
|
+
|
|
627
|
+
Or continue working on this branch if it's your intended work.
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
5. If user chooses B:
|
|
631
|
+
```
|
|
632
|
+
Enter branch name (without type prefix): _
|
|
633
|
+
```
|
|
634
|
+
Then create: `[detected-type]/[user-input]`
|
|
635
|
+
|
|
636
|
+
**B) If NO uncommitted changes:**
|
|
637
|
+
|
|
638
|
+
- β
Proceed normally - creating work branches FROM protected branches is correct workflow
|
|
639
|
+
- Protected branches serve as base for new work
|
|
640
|
+
|
|
342
641
|
1. **Generate Branch Name**:
|
|
343
642
|
- `feature/[slug]`
|
|
344
643
|
- `refactor/[slug]`
|
|
@@ -351,72 +650,368 @@ Review work.md? (Yes/Edit/No): _
|
|
|
351
650
|
- Update `status.json` progress
|
|
352
651
|
|
|
353
652
|
---
|
|
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
|
-
|
|
653
|
+
|
|
654
|
+
## Phase 4: Finalization (User-Controlled)
|
|
655
|
+
|
|
656
|
+
**β οΈ SKIP THIS PHASE IF complexity == "SIMPLE"** (already handled in Phase 1.5)
|
|
657
|
+
|
|
658
|
+
**Trigger Options:**
|
|
659
|
+
|
|
660
|
+
- User types: `/flow-work complete`
|
|
661
|
+
- All checkboxes in work.md marked complete
|
|
662
|
+
- User explicitly requests finalization
|
|
663
|
+
|
|
664
|
+
**CRITICAL: This phase requires EXPLICIT user confirmations at each step.**
|
|
665
|
+
|
|
666
|
+
---
|
|
667
|
+
|
|
668
|
+
### Step 1: Validation Check
|
|
669
|
+
|
|
670
|
+
```
|
|
671
|
+
π Running validation...
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
Execute:
|
|
675
|
+
|
|
676
|
+
```bash
|
|
677
|
+
npm test # or project-specific test command
|
|
678
|
+
npm run lint # or project-specific lint command
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
Show results:
|
|
682
|
+
|
|
683
|
+
```
|
|
684
|
+
π Validation Results
|
|
685
|
+
|
|
686
|
+
Tests: [β
Passed | β Failed (N tests)]
|
|
687
|
+
Lint: [β
Clean | β οΈ N warnings | β N errors]
|
|
688
|
+
Coverage: [X%]
|
|
689
|
+
|
|
690
|
+
Proceed with finalization?
|
|
691
|
+
|
|
692
|
+
a) Yes, continue β
|
|
693
|
+
b) No, let me fix issues
|
|
694
|
+
c) Skip validation (not recommended)
|
|
695
|
+
|
|
696
|
+
Your choice: _
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
- **'b'**: Return to Phase 3 for fixes, END finalization
|
|
700
|
+
- **'c'**: Show warning, ask confirmation again, then continue
|
|
701
|
+
- **'a'**: Continue to Step 2
|
|
702
|
+
|
|
703
|
+
---
|
|
704
|
+
|
|
705
|
+
### Step 2: Source Documentation Update (Interactive)
|
|
706
|
+
|
|
707
|
+
**Detect source references:**
|
|
708
|
+
|
|
709
|
+
```python
|
|
710
|
+
source = extract_from_work_md_or_status_json()
|
|
711
|
+
# Returns: "HU-001-002" | "roadmap-2.3" | "manual" | None
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
**IF source exists (HU or roadmap):**
|
|
715
|
+
|
|
716
|
+
```
|
|
717
|
+
π Update Source Documentation?
|
|
718
|
+
|
|
719
|
+
Found:
|
|
720
|
+
- planning/roadmap.md β Feature 2.3 "User Profile Component"
|
|
721
|
+
- planning/user-stories/EP-001/HU-001-002.md
|
|
722
|
+
|
|
723
|
+
What to update?
|
|
724
|
+
|
|
725
|
+
a) Update both β
|
|
726
|
+
b) Update roadmap only
|
|
727
|
+
c) Update user story only
|
|
728
|
+
d) Skip (I'll update manually later)
|
|
729
|
+
|
|
730
|
+
Your choice: _
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
**Execute selected updates:**
|
|
734
|
+
|
|
735
|
+
- Read files
|
|
736
|
+
- Mark checkboxes as complete: `- [ ]` β `- [x]`
|
|
737
|
+
- Add timestamp comment: `<!-- Completed: YYYY-MM-DD HH:MM -->`
|
|
738
|
+
- Save files
|
|
739
|
+
|
|
740
|
+
**Show confirmation:**
|
|
741
|
+
|
|
742
|
+
```
|
|
743
|
+
β
Updated:
|
|
744
|
+
- planning/roadmap.md (Feature 2.3)
|
|
745
|
+
- planning/user-stories/EP-001/HU-001-002.md (5/5 DoD items)
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
**IF update fails:**
|
|
749
|
+
|
|
750
|
+
```
|
|
751
|
+
β Failed to update [file]: [reason]
|
|
752
|
+
|
|
753
|
+
Options:
|
|
754
|
+
1) Retry update
|
|
755
|
+
2) Skip this file
|
|
756
|
+
3) Cancel finalization
|
|
757
|
+
|
|
758
|
+
Your choice: _
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
**IF source is "manual" or None:**
|
|
762
|
+
|
|
763
|
+
```
|
|
764
|
+
βοΈ No source documentation to update (manual task)
|
|
765
|
+
```
|
|
418
766
|
|
|
419
767
|
---
|
|
768
|
+
|
|
769
|
+
### Step 3: Archiving Decision (Explicit Confirmation)
|
|
770
|
+
|
|
771
|
+
**Show current state:**
|
|
772
|
+
|
|
773
|
+
```bash
|
|
774
|
+
git diff --stat
|
|
775
|
+
git log --oneline origin/[base-branch]..HEAD
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
**Present archiving options:**
|
|
779
|
+
|
|
780
|
+
```
|
|
781
|
+
πΎ Task Completion Options
|
|
782
|
+
|
|
783
|
+
Current work:
|
|
784
|
+
- Branch: [branch-name]
|
|
785
|
+
- Files changed: [N]
|
|
786
|
+
- Commits: [N]
|
|
787
|
+
- Duration: [X min]
|
|
788
|
+
|
|
789
|
+
What do you want to do?
|
|
790
|
+
|
|
791
|
+
a) Complete & Archive β
|
|
792
|
+
β Record analytics, delete work files, clean state
|
|
793
|
+
|
|
794
|
+
b) Complete & Keep
|
|
795
|
+
β Record analytics, rename folder to [task]-completed
|
|
796
|
+
|
|
797
|
+
c) Mark as Paused
|
|
798
|
+
β Keep work files for later resume
|
|
799
|
+
|
|
800
|
+
d) Cancel
|
|
801
|
+
β Go back to editing
|
|
802
|
+
|
|
803
|
+
Your choice: _
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
**IF 'a' (Complete & Archive):**
|
|
807
|
+
|
|
808
|
+
```
|
|
809
|
+
β
Archiving task...
|
|
810
|
+
```
|
|
811
|
+
|
|
812
|
+
1. **Extract metadata:**
|
|
813
|
+
|
|
814
|
+
```javascript
|
|
815
|
+
// IF complexity == "COMPLEX" (has status.json):
|
|
816
|
+
analytics = {
|
|
817
|
+
task: '[task-name]',
|
|
818
|
+
type: '[feature|refactor|fix]',
|
|
819
|
+
src: '[HU-001-002|roadmap-2.3|manual]',
|
|
820
|
+
dur: Math.round((completed - created) / 60000), // minutes
|
|
821
|
+
start: timestamps.created,
|
|
822
|
+
end: new Date().toISOString(),
|
|
823
|
+
tasks: progress.totalTasks,
|
|
824
|
+
sp: extract_story_points_from_work_md(),
|
|
825
|
+
commits: git.commits.length,
|
|
826
|
+
valid: validation.tests.passed && validation.lint.passed,
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
// IF complexity == "MEDIUM" (only work.md):
|
|
830
|
+
analytics = {
|
|
831
|
+
task: '[task-name]',
|
|
832
|
+
type: '[detected-from-folder-name]',
|
|
833
|
+
src: 'manual',
|
|
834
|
+
dur: estimate_duration_from_git_log(),
|
|
835
|
+
start: get_first_commit_timestamp(),
|
|
836
|
+
end: new Date().toISOString(),
|
|
837
|
+
tasks: count_checkboxes_in_work_md(),
|
|
838
|
+
sp: extract_story_points_from_work_md() || null,
|
|
839
|
+
commits: count_commits_in_branch(),
|
|
840
|
+
valid: validation_passed,
|
|
841
|
+
};
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
2. **Append to analytics:**
|
|
845
|
+
|
|
846
|
+
```bash
|
|
847
|
+
echo '{json}' >> .ai-flow/archive/analytics.jsonl
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
3. **Delete work folder:**
|
|
851
|
+
|
|
852
|
+
```bash
|
|
853
|
+
rm -rf .ai-flow/work/[task-name]/
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
4. **Show confirmation:**
|
|
857
|
+
|
|
858
|
+
```
|
|
859
|
+
β
Task archived successfully
|
|
860
|
+
|
|
861
|
+
π Analytics recorded:
|
|
862
|
+
- Duration: [X] min
|
|
863
|
+
- Story Points: [N]
|
|
864
|
+
- Commits: [N]
|
|
865
|
+
- Validation: [β
Passed | β Failed]
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
**IF 'b' (Complete & Keep):**
|
|
869
|
+
|
|
870
|
+
1. Record analytics (same as 'a')
|
|
871
|
+
2. Rename folder:
|
|
872
|
+
```bash
|
|
873
|
+
mv .ai-flow/work/[task] .ai-flow/work/[task]-completed/
|
|
874
|
+
```
|
|
875
|
+
3. Show: `β
Task marked complete. Files kept in: .ai-flow/work/[task]-completed/`
|
|
876
|
+
|
|
877
|
+
**IF 'c' (Mark as Paused):**
|
|
878
|
+
|
|
879
|
+
1. Add marker file:
|
|
880
|
+
```bash
|
|
881
|
+
echo "Paused: $(date)" > .ai-flow/work/[task]/PAUSED
|
|
882
|
+
```
|
|
883
|
+
2. Show: `βΈοΈ Task paused. Resume with: /flow-work`
|
|
884
|
+
3. **END finalization**
|
|
885
|
+
|
|
886
|
+
**IF 'd' (Cancel):**
|
|
887
|
+
|
|
888
|
+
1. Show: `β Finalization cancelled. Task remains active.`
|
|
889
|
+
2. **END finalization**
|
|
890
|
+
|
|
891
|
+
---
|
|
892
|
+
|
|
893
|
+
### Step 4: Ticket Summary (Optional)
|
|
894
|
+
|
|
895
|
+
**Only ask if task was archived (option 'a' or 'b'):**
|
|
896
|
+
|
|
897
|
+
```
|
|
898
|
+
π Generate ticket summary?
|
|
899
|
+
|
|
900
|
+
(For ClickUp, Jira, Linear, Asana, Trello, GitHub Projects, etc.)
|
|
901
|
+
|
|
902
|
+
y/n: _
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
**IF 'y':**
|
|
906
|
+
|
|
907
|
+
1. Check if template exists:
|
|
908
|
+
|
|
909
|
+
```bash
|
|
910
|
+
[ -f .ai-flow/prompts/shared/task-summary-template.md ]
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
2. **IF template exists:**
|
|
914
|
+
- Read template
|
|
915
|
+
- Extract data from:
|
|
916
|
+
- Last line of `analytics.jsonl`
|
|
917
|
+
- Git stats: `git diff --stat`, `git log --oneline`
|
|
918
|
+
- Branch info
|
|
919
|
+
- Populate template with real data
|
|
920
|
+
- Show formatted summary
|
|
921
|
+
|
|
922
|
+
3. **IF template doesn't exist:**
|
|
923
|
+
- Generate basic summary:
|
|
924
|
+
|
|
925
|
+
```
|
|
926
|
+
π Task Summary
|
|
927
|
+
|
|
928
|
+
**Task**: [task-name]
|
|
929
|
+
**Type**: [feature|refactor|fix]
|
|
930
|
+
**Duration**: [X min]
|
|
931
|
+
**Story Points**: [N]
|
|
932
|
+
**Commits**: [N]
|
|
933
|
+
**Branch**: [branch-name]
|
|
934
|
+
**Status**: β
Complete
|
|
935
|
+
|
|
936
|
+
**Changes**:
|
|
937
|
+
[git diff --stat output]
|
|
938
|
+
|
|
939
|
+
**Commits**:
|
|
940
|
+
[git log --oneline output]
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
4. Show: `π Copy the summary above to your ticket system`
|
|
944
|
+
|
|
945
|
+
**IF 'n':**
|
|
946
|
+
|
|
947
|
+
```
|
|
948
|
+
βοΈ Skipping ticket summary
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
---
|
|
952
|
+
|
|
953
|
+
### Step 5: Git Push (Final Step)
|
|
954
|
+
|
|
955
|
+
```
|
|
956
|
+
π Push changes to remote?
|
|
957
|
+
|
|
958
|
+
git push origin [branch-name]
|
|
959
|
+
|
|
960
|
+
y/n: _
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
**IF 'y':**
|
|
964
|
+
|
|
965
|
+
```bash
|
|
966
|
+
git push origin [branch-name]
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
Show result:
|
|
970
|
+
|
|
971
|
+
```
|
|
972
|
+
β
Pushed to origin/[branch-name]
|
|
973
|
+
|
|
974
|
+
Next steps:
|
|
975
|
+
- Create Pull Request/Merge Request
|
|
976
|
+
- Request code review
|
|
977
|
+
- Update project board
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
**IF 'n':**
|
|
981
|
+
|
|
982
|
+
```
|
|
983
|
+
βοΈ Skipping push
|
|
984
|
+
|
|
985
|
+
β οΈ Remember to push later:
|
|
986
|
+
git push origin [branch-name]
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
---
|
|
990
|
+
|
|
991
|
+
### Finalization Complete
|
|
992
|
+
|
|
993
|
+
```
|
|
994
|
+
β
Task Finalization Complete
|
|
995
|
+
|
|
996
|
+
π Summary:
|
|
997
|
+
- [β
|β οΈ] Validation passed
|
|
998
|
+
- [β
|βοΈ] Documentation updated
|
|
999
|
+
- [β
|βοΈ] Task archived
|
|
1000
|
+
- [β
|βοΈ] Ticket summary generated
|
|
1001
|
+
- [β
|βοΈ] Pushed to remote
|
|
1002
|
+
|
|
1003
|
+
Task: [task-name]
|
|
1004
|
+
Branch: [branch-name]
|
|
1005
|
+
Duration: [X min]
|
|
1006
|
+
Commits: [N]
|
|
1007
|
+
|
|
1008
|
+
π Great work!
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
**END WORKFLOW**
|
|
1012
|
+
|
|
1013
|
+
---
|
|
1014
|
+
|
|
420
1015
|
## Orchestration Rules
|
|
421
1016
|
|
|
422
1017
|
- **DRY Logic**: This file handles the high-level orchestration.
|
|
@@ -428,4 +1023,5 @@ Review work.md? (Yes/Edit/No): _
|
|
|
428
1023
|
- **State Persistence**: Always read/write to `.ai-flow/work/[name]/status.json` to maintain state across sessions.
|
|
429
1024
|
|
|
430
1025
|
---
|
|
1026
|
+
|
|
431
1027
|
**BEGIN EXECUTION when user runs `/flow-work [args]`**
|