ai-flow-dev 2.1.3 → 2.1.5
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 +25 -38
- package/dist/cli.js +68 -46
- package/dist/cli.js.map +1 -1
- package/package.json +5 -5
- package/prompts/backend/flow-build-phase-0.md +31 -63
- package/prompts/backend/flow-build-phase-1.md +9 -17
- package/prompts/backend/flow-build-phase-10.md +199 -585
- package/prompts/backend/flow-build-phase-2.md +152 -86
- package/prompts/backend/flow-build-phase-3.md +108 -68
- package/prompts/backend/flow-build-phase-4.md +5 -8
- package/prompts/backend/flow-build-phase-5.md +39 -12
- package/prompts/backend/flow-build-phase-6.md +29 -8
- package/prompts/backend/flow-build-phase-7.md +120 -40
- package/prompts/backend/flow-build-phase-8.md +28 -65
- package/prompts/backend/flow-build-phase-9.md +267 -1298
- package/prompts/backend/flow-build.md +881 -957
- package/prompts/backend/flow-dev-commit.md +27 -50
- package/prompts/backend/flow-dev-feature.md +1929 -2017
- package/prompts/backend/flow-dev-fix.md +936 -964
- package/prompts/backend/flow-dev-refactor.md +672 -701
- package/prompts/backend/flow-dev-review.md +356 -389
- package/prompts/backend/flow-dev-work.md +1066 -1118
- package/prompts/backend/flow-docs-sync.md +20 -196
- package/prompts/frontend/flow-build-phase-0.md +503 -484
- package/prompts/frontend/flow-build-phase-1.md +445 -433
- package/prompts/frontend/flow-build-phase-2.md +910 -957
- package/prompts/frontend/flow-build-phase-3.md +692 -664
- package/prompts/frontend/flow-build-phase-4.md +478 -463
- package/prompts/frontend/flow-build-phase-5.md +488 -467
- package/prompts/frontend/flow-build-phase-6.md +571 -550
- package/prompts/frontend/flow-build-phase-7.md +560 -592
- package/prompts/frontend/flow-build-phase-8.md +17 -42
- package/prompts/frontend/flow-build.md +457 -503
- package/prompts/frontend/flow-docs-sync.md +14 -35
- package/prompts/mobile/flow-build-phase-0.md +104 -97
- package/prompts/mobile/flow-build-phase-1.md +137 -122
- package/prompts/mobile/flow-build-phase-2.md +123 -130
- package/prompts/mobile/flow-build-phase-3.md +144 -149
- package/prompts/mobile/flow-build-phase-4.md +140 -132
- package/prompts/mobile/flow-build-phase-5.md +70 -70
- package/prompts/mobile/flow-build-phase-6.md +136 -134
- package/prompts/mobile/flow-build-phase-7.md +24 -58
- package/prompts/mobile/flow-build-phase-8.md +17 -42
- package/prompts/mobile/flow-build.md +47 -97
- package/prompts/mobile/flow-docs-sync.md +13 -32
- package/prompts/shared/mermaid-guidelines.md +106 -0
- package/prompts/shared/scope-levels.md +126 -0
- package/prompts/shared/story-points.md +65 -0
- package/prompts/shared/task-format.md +86 -0
- package/templates/AGENT.template.md +194 -15
- package/templates/backend/README.template.md +2 -32
- package/templates/backend/ai-instructions.template.md +2 -32
- package/templates/backend/copilot-instructions.template.md +2 -22
- package/templates/backend/docs/api.template.md +89 -20
- package/templates/backend/docs/architecture.template.md +165 -53
- package/templates/backend/docs/business-flows.template.md +7 -14
- package/templates/backend/docs/code-standards.template.md +2 -38
- package/templates/backend/docs/contributing.template.md +2 -16
- package/templates/backend/docs/data-model.template.md +125 -21
- package/templates/backend/docs/operations.template.md +179 -50
- package/templates/backend/docs/testing.template.md +2 -42
- package/templates/backend/project-brief.template.md +2 -28
- package/templates/backend/specs/configuration.template.md +2 -14
- package/templates/backend/specs/security.template.md +2 -32
- package/templates/frontend/README.template.md +2 -18
- package/templates/frontend/ai-instructions.template.md +2 -20
- package/templates/frontend/docs/api-integration.template.md +12 -30
- package/templates/frontend/docs/components.template.md +2 -28
- package/templates/frontend/docs/error-handling.template.md +11 -27
- package/templates/frontend/docs/operations.template.md +8 -18
- package/templates/frontend/docs/performance.template.md +8 -18
- package/templates/frontend/docs/pwa.template.md +8 -18
- package/templates/frontend/docs/state-management.template.md +2 -28
- package/templates/frontend/docs/styling.template.md +2 -26
- package/templates/frontend/docs/testing.template.md +2 -28
- package/templates/frontend/project-brief.template.md +2 -16
- package/templates/frontend/specs/accessibility.template.md +8 -18
- package/templates/frontend/specs/configuration.template.md +2 -24
- package/templates/frontend/specs/security.template.md +10 -24
- package/templates/fullstack/README.template.md +17 -47
- package/templates/fullstack/ai-instructions.template.md +17 -45
- package/templates/fullstack/project-brief.template.md +16 -42
- package/templates/fullstack/specs/configuration.template.md +16 -42
- package/templates/mobile/README.template.md +11 -29
- package/templates/mobile/ai-instructions.template.md +11 -27
- package/templates/mobile/docs/app-store.template.md +11 -29
- package/templates/mobile/docs/architecture.template.md +14 -38
- package/templates/mobile/docs/native-features.template.md +16 -44
- package/templates/mobile/docs/navigation.template.md +9 -23
- package/templates/mobile/docs/offline-strategy.template.md +10 -26
- package/templates/mobile/docs/permissions.template.md +9 -23
- package/templates/mobile/docs/state-management.template.md +12 -32
- package/templates/mobile/docs/testing.template.md +14 -38
- package/templates/mobile/project-brief.template.md +12 -30
- package/templates/mobile/specs/build-configuration.template.md +10 -26
- package/templates/mobile/specs/deployment.template.md +9 -23
|
@@ -1,1129 +1,1077 @@
|
|
|
1
|
-
# AI Flow - Work Management
|
|
2
|
-
|
|
3
|
-
**YOU ARE AN EXPERT PROJECT MANAGER AND WORKFLOW COORDINATOR.**
|
|
4
|
-
|
|
5
|
-
Your mission is to manage work in progress, resume interrupted work, and archive completed work when the user executes `/work`.
|
|
6
|
-
|
|
1
|
+
# AI Flow - Work Management
|
|
2
|
+
|
|
3
|
+
**YOU ARE AN EXPERT PROJECT MANAGER AND WORKFLOW COORDINATOR.**
|
|
4
|
+
|
|
5
|
+
Your mission is to manage work in progress, resume interrupted work, and archive completed work when the user executes `/work`.
|
|
6
|
+
---
|
|
7
|
+
## Command: `/work`
|
|
8
|
+
|
|
9
|
+
### Objective
|
|
10
|
+
|
|
11
|
+
Manage work in progress efficiently:
|
|
12
|
+
|
|
13
|
+
- List active tasks with progress
|
|
14
|
+
- Show details of specific tasks
|
|
15
|
+
- Resume interrupted work without context loss
|
|
16
|
+
- Archive completed work with documentation updates
|
|
17
|
+
|
|
18
|
+
### Subcommands
|
|
19
|
+
|
|
20
|
+
- **`/work`** → List active work + interactive menu
|
|
21
|
+
- **`/work show [name]`** → Show details of specific task
|
|
22
|
+
- **`/work resume [name]`** → Resume paused work
|
|
23
|
+
- **`/work archive [name]`** → Archive completed work
|
|
24
|
+
---
|
|
25
|
+
## Workflow: `/work` (List Active Work)
|
|
26
|
+
|
|
27
|
+
### Step 1: Scan Work Directory
|
|
28
|
+
|
|
29
|
+
List all items in `.ai-flow/work/` directory
|
|
30
|
+
|
|
31
|
+
### Step 2: Display Active Work
|
|
32
|
+
|
|
33
|
+
For each task, show:
|
|
34
|
+
|
|
35
|
+
- **Name** and **type** (feature/fix/refactor)
|
|
36
|
+
- **Status** (PLANNING/IN_PROGRESS/PAUSED/COMPLETED)
|
|
37
|
+
- **Progress** (completed tasks / total tasks = percentage)
|
|
38
|
+
- **Timestamps** (started, last updated)
|
|
39
|
+
- **Time estimate** (if available)
|
|
40
|
+
|
|
41
|
+
### Step 3: Interactive Menu
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
What would you like to do?
|
|
45
|
+
A) Show details of a task
|
|
46
|
+
B) Resume a task
|
|
47
|
+
C) Archive a task
|
|
48
|
+
D) Clean up (archive all completed)
|
|
49
|
+
E) Exit
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Example output:**
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
---
|
|
56
|
+
📋 Work Management
|
|
57
|
+
---
|
|
58
|
+
Active work in .ai-flow/work/:
|
|
59
|
+
|
|
60
|
+
1. 🚀 feature-notifications
|
|
61
|
+
Type: feature (new)
|
|
62
|
+
Status: ⏸️ PAUSED (implementation phase)
|
|
63
|
+
Progress: 12/18 tasks (67%)
|
|
64
|
+
Branch: feature/notifications-websocket ⭐ CURRENT
|
|
65
|
+
Started: 2025-01-19 14:30
|
|
66
|
+
Last updated: 2025-01-19 16:45
|
|
67
|
+
Estimated remaining: 15-20 minutes
|
|
68
|
+
|
|
69
|
+
2. 🔧 fix-pagination-bug
|
|
70
|
+
Type: fix (complex)
|
|
71
|
+
Status: ⏸️ PAUSED (testing phase)
|
|
72
|
+
Progress: 5/6 tasks (83%)
|
|
73
|
+
Branch: fix/pagination-offset
|
|
74
|
+
Started: 2025-01-20 09:15
|
|
75
|
+
Last updated: 2025-01-20 10:30
|
|
76
|
+
Estimated remaining: 5 minutes
|
|
77
|
+
|
|
78
|
+
3. 🔄 refactor-auth-service
|
|
79
|
+
Type: feature (refactor)
|
|
80
|
+
Status: 📝 PLANNING
|
|
81
|
+
Progress: 0/15 tasks (plan created)
|
|
82
|
+
Branch: refactor/auth-cleanup
|
|
83
|
+
Started: 2025-01-20 11:00
|
|
84
|
+
Last updated: 2025-01-20 11:05
|
|
85
|
+
---
|
|
86
|
+
What would you like to do?
|
|
87
|
+
A) Show details of a task
|
|
88
|
+
B) Resume a task
|
|
89
|
+
C) Archive a task
|
|
90
|
+
D) Clean up (archive all completed)
|
|
91
|
+
E) Exit
|
|
92
|
+
```
|
|
93
|
+
---
|
|
94
|
+
## Workflow: `/work show [name]`
|
|
95
|
+
|
|
96
|
+
### Step 1: Read Task Files
|
|
97
|
+
|
|
98
|
+
Load task information:
|
|
99
|
+
|
|
100
|
+
- Read `status.json` for metadata
|
|
101
|
+
- Read `spec.md` for requirements
|
|
102
|
+
- Read `plan.md` for technical approach
|
|
103
|
+
- Read `tasks.md` for task list
|
|
104
|
+
|
|
105
|
+
### Step 2: Display Detailed View
|
|
106
|
+
|
|
107
|
+
Show comprehensive task details:
|
|
108
|
+
|
|
109
|
+
- Overview and description
|
|
110
|
+
- Current status and phase
|
|
111
|
+
- Detailed progress (tasks ✅ vs ⏳)
|
|
112
|
+
- Files created/modified
|
|
113
|
+
- Affected documentation
|
|
114
|
+
- Next step to take
|
|
115
|
+
|
|
116
|
+
### Step 3: Action Options
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
What would you like to do?
|
|
120
|
+
A) Resume this task
|
|
121
|
+
B) Archive this task (if complete)
|
|
122
|
+
C) Back to list
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Example output:**
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
---
|
|
129
|
+
📄 Task Details: feature-notifications
|
|
130
|
+
---
|
|
131
|
+
**Overview:**
|
|
132
|
+
Real-time notification system using WebSockets
|
|
133
|
+
|
|
134
|
+
**Type:** New feature
|
|
135
|
+
**Status:** ⏸️ PAUSED at implementation phase
|
|
136
|
+
**Progress:** 12/18 tasks complete (67%)
|
|
137
|
+
**Time spent:** 45 minutes
|
|
138
|
+
**Estimated remaining:** 15-20 minutes
|
|
139
|
+
|
|
140
|
+
**Completed tasks:** ✅
|
|
141
|
+
1. ✅ Install dependencies
|
|
142
|
+
2. ✅ Create Notification entity
|
|
143
|
+
3. ✅ Generate migration
|
|
144
|
+
4. ✅ Create NotificationService
|
|
145
|
+
5. ✅ Create NotificationController
|
|
146
|
+
6. ✅ Create WebSocket handler
|
|
147
|
+
7. ✅ Create adminOnly middleware
|
|
148
|
+
8. ✅ Register routes
|
|
149
|
+
9. ✅ Set up WebSocket server
|
|
150
|
+
10. ✅ Unit tests for NotificationService
|
|
151
|
+
11. ✅ Integration tests for endpoints
|
|
152
|
+
12. ✅ WebSocket tests
|
|
153
|
+
|
|
154
|
+
**Remaining tasks:** ⏳
|
|
155
|
+
13. ⏳ Update API documentation
|
|
156
|
+
14. ⏳ Update data model documentation
|
|
157
|
+
15. ⏳ Add environment variables
|
|
158
|
+
16. ⏳ Test end-to-end flow
|
|
159
|
+
17. ⏳ Security review
|
|
160
|
+
18. ⏳ Performance check
|
|
161
|
+
|
|
162
|
+
**Files created:**
|
|
163
|
+
- src/entities/Notification.entity.ts
|
|
164
|
+
- src/controllers/NotificationController.ts
|
|
165
|
+
- src/services/NotificationService.ts
|
|
166
|
+
- src/websocket/notificationSocket.ts
|
|
167
|
+
- tests/notification.test.ts
|
|
168
|
+
|
|
169
|
+
**Files modified:**
|
|
170
|
+
- src/app.ts (registered WebSocket server)
|
|
171
|
+
- src/routes/index.ts (registered routes)
|
|
172
|
+
|
|
173
|
+
**Next step:** Update API documentation (task 13/18)
|
|
7
174
|
---
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Manage work in progress efficiently:
|
|
14
|
-
|
|
15
|
-
- List active tasks with progress
|
|
16
|
-
- Show details of specific tasks
|
|
17
|
-
- Resume interrupted work without context loss
|
|
18
|
-
- Archive completed work with documentation updates
|
|
19
|
-
|
|
20
|
-
### Subcommands
|
|
21
|
-
|
|
22
|
-
- **`/work`** → List active work + interactive menu
|
|
23
|
-
- **`/work show [name]`** → Show details of specific task
|
|
24
|
-
- **`/work resume [name]`** → Resume paused work
|
|
25
|
-
- **`/work archive [name]`** → Archive completed work
|
|
26
|
-
|
|
175
|
+
What would you like to do?
|
|
176
|
+
A) Resume this task
|
|
177
|
+
B) Archive this task
|
|
178
|
+
C) Back to list
|
|
179
|
+
```
|
|
27
180
|
---
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Status: 📝 PLANNING
|
|
86
|
-
Progress: 0/15 tasks (plan created)
|
|
87
|
-
Branch: refactor/auth-cleanup
|
|
88
|
-
Started: 2025-01-20 11:00
|
|
89
|
-
Last updated: 2025-01-20 11:05
|
|
90
|
-
|
|
91
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
92
|
-
|
|
93
|
-
What would you like to do?
|
|
94
|
-
A) Show details of a task
|
|
95
|
-
B) Resume a task
|
|
96
|
-
C) Archive a task
|
|
97
|
-
D) Clean up (archive all completed)
|
|
98
|
-
E) Exit
|
|
99
|
-
```
|
|
100
|
-
|
|
181
|
+
## Workflow: `/work resume [name]`
|
|
182
|
+
|
|
183
|
+
### Step 1: Load Complete Context
|
|
184
|
+
|
|
185
|
+
Read all work files:
|
|
186
|
+
|
|
187
|
+
- `spec.md` - Requirements
|
|
188
|
+
- `plan.md` - Technical approach
|
|
189
|
+
- `tasks.md` - Task list with progress
|
|
190
|
+
- `status.json` - Previous implementation mode, progress, and Git info
|
|
191
|
+
- All generated code files
|
|
192
|
+
- Existing tests
|
|
193
|
+
|
|
194
|
+
**Check Git branch mismatch:**
|
|
195
|
+
|
|
196
|
+
If `status.json` has Git information, verify current branch matches:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Read from status.json: git.branchName = "feature/notifications-websocket"
|
|
200
|
+
# Check current branch: git branch --show-current
|
|
201
|
+
|
|
202
|
+
# If mismatch:
|
|
203
|
+
⚠️ Branch Mismatch Detected
|
|
204
|
+
|
|
205
|
+
This work was started on: feature/notifications-websocket
|
|
206
|
+
You are currently on: main
|
|
207
|
+
|
|
208
|
+
Options:
|
|
209
|
+
1. Switch to work branch (recommended)
|
|
210
|
+
git checkout feature/notifications-websocket
|
|
211
|
+
2. Continue on current branch (not recommended)
|
|
212
|
+
3. Abort resume
|
|
213
|
+
|
|
214
|
+
What would you like to do? (1/2/3)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**User selects option 1 → Switch branch:**
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
git checkout feature/notifications-websocket
|
|
221
|
+
# Switched to branch 'feature/notifications-websocket'
|
|
222
|
+
|
|
223
|
+
✅ On correct branch. Continuing resume...
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Step 2: Identify Next Task
|
|
227
|
+
|
|
228
|
+
- Find first incomplete task (without ✅)
|
|
229
|
+
- Read previous `implementationMode` from `status.json`
|
|
230
|
+
- Understand context from completed tasks
|
|
231
|
+
- Calculate remaining work (tasks and phases if applicable)
|
|
232
|
+
|
|
233
|
+
### Step 3: Choose Implementation Mode
|
|
234
|
+
|
|
235
|
+
**Read previous mode from `status.json` and suggest as default:**
|
|
236
|
+
|
|
237
|
+
```
|
|
101
238
|
---
|
|
102
|
-
|
|
103
|
-
## Workflow: `/work show [name]`
|
|
104
|
-
|
|
105
|
-
### Step 1: Read Task Files
|
|
106
|
-
|
|
107
|
-
Load task information:
|
|
108
|
-
|
|
109
|
-
- Read `status.json` for metadata
|
|
110
|
-
- Read `spec.md` for requirements
|
|
111
|
-
- Read `plan.md` for technical approach
|
|
112
|
-
- Read `tasks.md` for task list
|
|
113
|
-
|
|
114
|
-
### Step 2: Display Detailed View
|
|
115
|
-
|
|
116
|
-
Show comprehensive task details:
|
|
117
|
-
|
|
118
|
-
- Overview and description
|
|
119
|
-
- Current status and phase
|
|
120
|
-
- Detailed progress (tasks ✅ vs ⏳)
|
|
121
|
-
- Files created/modified
|
|
122
|
-
- Affected documentation
|
|
123
|
-
- Next step to take
|
|
124
|
-
|
|
125
|
-
### Step 3: Action Options
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
What would you like to do?
|
|
129
|
-
A) Resume this task
|
|
130
|
-
B) Archive this task (if complete)
|
|
131
|
-
C) Back to list
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Example output:**
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
138
|
-
📄 Task Details: feature-notifications
|
|
139
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
140
|
-
|
|
141
|
-
**Overview:**
|
|
142
|
-
Real-time notification system using WebSockets
|
|
143
|
-
|
|
144
|
-
**Type:** New feature
|
|
145
|
-
**Status:** ⏸️ PAUSED at implementation phase
|
|
146
|
-
**Progress:** 12/18 tasks complete (67%)
|
|
147
|
-
**Time spent:** 45 minutes
|
|
148
|
-
**Estimated remaining:** 15-20 minutes
|
|
149
|
-
|
|
150
|
-
**Completed tasks:** ✅
|
|
151
|
-
1. ✅ Install dependencies
|
|
152
|
-
2. ✅ Create Notification entity
|
|
153
|
-
3. ✅ Generate migration
|
|
154
|
-
4. ✅ Create NotificationService
|
|
155
|
-
5. ✅ Create NotificationController
|
|
156
|
-
6. ✅ Create WebSocket handler
|
|
157
|
-
7. ✅ Create adminOnly middleware
|
|
158
|
-
8. ✅ Register routes
|
|
159
|
-
9. ✅ Set up WebSocket server
|
|
160
|
-
10. ✅ Unit tests for NotificationService
|
|
161
|
-
11. ✅ Integration tests for endpoints
|
|
162
|
-
12. ✅ WebSocket tests
|
|
163
|
-
|
|
164
|
-
**Remaining tasks:** ⏳
|
|
165
|
-
13. ⏳ Update API documentation
|
|
166
|
-
14. ⏳ Update data model documentation
|
|
167
|
-
15. ⏳ Add environment variables
|
|
168
|
-
16. ⏳ Test end-to-end flow
|
|
169
|
-
17. ⏳ Security review
|
|
170
|
-
18. ⏳ Performance check
|
|
171
|
-
|
|
172
|
-
**Files created:**
|
|
173
|
-
- src/entities/Notification.entity.ts
|
|
174
|
-
- src/controllers/NotificationController.ts
|
|
175
|
-
- src/services/NotificationService.ts
|
|
176
|
-
- src/websocket/notificationSocket.ts
|
|
177
|
-
- tests/notification.test.ts
|
|
178
|
-
|
|
179
|
-
**Files modified:**
|
|
180
|
-
- src/app.ts (registered WebSocket server)
|
|
181
|
-
- src/routes/index.ts (registered routes)
|
|
182
|
-
|
|
183
|
-
**Next step:** Update API documentation (task 13/18)
|
|
184
|
-
|
|
185
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
186
|
-
|
|
187
|
-
What would you like to do?
|
|
188
|
-
A) Resume this task
|
|
189
|
-
B) Archive this task
|
|
190
|
-
C) Back to list
|
|
191
|
-
```
|
|
192
|
-
|
|
239
|
+
⚙️ Resume Implementation Mode
|
|
193
240
|
---
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
**
|
|
209
|
-
|
|
210
|
-
If
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
1. Switch to work branch (recommended)
|
|
224
|
-
git checkout feature/notifications-websocket
|
|
225
|
-
2. Continue on current branch (not recommended)
|
|
226
|
-
3. Abort resume
|
|
227
|
-
|
|
228
|
-
What would you like to do? (1/2/3)
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**User selects option 1 → Switch branch:**
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
git checkout feature/notifications-websocket
|
|
235
|
-
# Switched to branch 'feature/notifications-websocket'
|
|
236
|
-
|
|
237
|
-
✅ On correct branch. Continuing resume...
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Step 2: Identify Next Task
|
|
241
|
-
|
|
242
|
-
- Find first incomplete task (without ✅)
|
|
243
|
-
- Read previous `implementationMode` from `status.json`
|
|
244
|
-
- Understand context from completed tasks
|
|
245
|
-
- Calculate remaining work (tasks and phases if applicable)
|
|
246
|
-
|
|
247
|
-
### Step 3: Choose Implementation Mode
|
|
248
|
-
|
|
249
|
-
**Read previous mode from `status.json` and suggest as default:**
|
|
250
|
-
|
|
251
|
-
```
|
|
252
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
253
|
-
⚙️ Resume Implementation Mode
|
|
254
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
255
|
-
|
|
256
|
-
Previous mode: Phase-by-phase
|
|
257
|
-
Progress: 12/18 tasks (67%)
|
|
258
|
-
Remaining: 6 tasks (Phase 2: 3 tasks left, Phase 3: 3 tasks)
|
|
259
|
-
|
|
260
|
-
How do you want to continue?
|
|
261
|
-
|
|
262
|
-
1. 🚀 Auto (complete remaining tasks automatically)
|
|
263
|
-
2. 📋 Phase-by-phase (pause after Phase 2 completes) ⭐ PREVIOUS MODE
|
|
264
|
-
3. 🔍 Task-by-task (manual approval for each task)
|
|
265
|
-
4. 💾 Save progress and exit again
|
|
266
|
-
|
|
267
|
-
Your choice (2): [1/2/3/4]
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
**Smart defaults based on remaining work:**
|
|
271
|
-
|
|
272
|
-
- **If <5 tasks remaining** → Suggest Mode 1 (Auto) - Quick finish
|
|
273
|
-
- **If phases remaining** → Suggest Mode 2 (Phase-by-phase) - Same as before
|
|
274
|
-
- **Otherwise** → Suggest previous mode from status.json
|
|
275
|
-
|
|
276
|
-
### Step 4: Continue Implementation
|
|
277
|
-
|
|
278
|
-
Execute based on selected mode:
|
|
279
|
-
|
|
280
|
-
#### Mode 1: Auto
|
|
281
|
-
|
|
282
|
-
Continue automatically until all tasks complete:
|
|
283
|
-
|
|
284
|
-
```
|
|
285
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
286
|
-
⚙️ Resuming: feature-notifications (Auto Mode)
|
|
287
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
288
|
-
|
|
289
|
-
Loading context...
|
|
290
|
-
✅ Read spec.md, plan.md, tasks.md
|
|
291
|
-
✅ Analyzed completed code (12/18 tasks done)
|
|
292
|
-
|
|
293
|
-
Continuing from task 13/18: Update API documentation
|
|
294
|
-
|
|
295
|
-
Task 13/18: Update API documentation ✅
|
|
296
|
-
Task 14/18: Update data model documentation ✅
|
|
297
|
-
Task 15/18: Add environment variables ✅
|
|
298
|
-
Task 16/18: Test end-to-end flow ✅
|
|
299
|
-
Task 17/18: Security review ✅
|
|
300
|
-
Task 18/18: Performance check ✅
|
|
301
|
-
|
|
302
|
-
All tasks completed! ✅
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
#### Mode 2: Phase-by-phase
|
|
306
|
-
|
|
307
|
-
Continue phase by phase with pauses:
|
|
308
|
-
|
|
309
|
-
```
|
|
310
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
311
|
-
⚙️ Resuming: feature-notifications (Phase-by-phase Mode)
|
|
312
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
-
|
|
314
|
-
Loading context...
|
|
315
|
-
✅ Read spec.md, plan.md, tasks.md
|
|
316
|
-
✅ Phase 1 already complete (10/10 tasks)
|
|
317
|
-
|
|
318
|
-
Continuing Phase 2: Business Logic (2/15 tasks complete)
|
|
319
|
-
|
|
320
|
-
Task 2.3: Create EmailService ✅
|
|
321
|
-
Task 2.4: Implement password hashing ✅
|
|
322
|
-
...
|
|
323
|
-
Task 2.15: Add error handling ✅
|
|
324
|
-
|
|
325
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
326
|
-
✅ Phase 2 Complete (15/15 tasks)
|
|
327
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
328
|
-
|
|
329
|
-
Continue to Phase 3? (Y/n/pause)
|
|
330
|
-
> Y
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
#### Mode 3: Task-by-task
|
|
334
|
-
|
|
335
|
-
Ask for confirmation before each task:
|
|
336
|
-
|
|
337
|
-
```
|
|
338
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
339
|
-
⚙️ Resuming: feature-notifications (Task-by-task Mode)
|
|
340
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
341
|
-
|
|
342
|
-
Loading context...
|
|
343
|
-
✅ Loaded context (12/18 tasks complete)
|
|
344
|
-
|
|
345
|
-
Next task: Update API documentation
|
|
346
|
-
Files to modify: docs/api.md
|
|
347
|
-
|
|
348
|
-
Proceed? (Y/n/skip/pause)
|
|
349
|
-
> Y
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
#### Mode 4: Save and exit
|
|
353
|
-
|
|
354
|
-
Save progress and exit without changes:
|
|
355
|
-
|
|
356
|
-
```
|
|
357
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
358
|
-
💾 Progress Saved
|
|
359
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
360
|
-
|
|
361
|
-
Current progress: 12/18 tasks (67%)
|
|
362
|
-
Status: Paused
|
|
363
|
-
|
|
364
|
-
No changes made. To resume: /work resume feature-notifications
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### Step 5: Update Status
|
|
368
|
-
|
|
369
|
-
- Update `status.json` with:
|
|
370
|
-
- New `implementationMode` if changed
|
|
371
|
-
- Updated timestamp
|
|
372
|
-
- Current progress
|
|
373
|
-
- Last task completed
|
|
374
|
-
- Reason for pause (if paused)
|
|
375
|
-
|
|
241
|
+
Previous mode: Phase-by-phase
|
|
242
|
+
Progress: 12/18 tasks (67%)
|
|
243
|
+
Remaining: 6 tasks (Phase 2: 3 tasks left, Phase 3: 3 tasks)
|
|
244
|
+
|
|
245
|
+
How do you want to continue?
|
|
246
|
+
|
|
247
|
+
1. 🚀 Auto (complete remaining tasks automatically)
|
|
248
|
+
2. 📋 Phase-by-phase (pause after Phase 2 completes) ⭐ PREVIOUS MODE
|
|
249
|
+
3. 🔍 Task-by-task (manual approval for each task)
|
|
250
|
+
4. 💾 Save progress and exit again
|
|
251
|
+
|
|
252
|
+
Your choice (2): [1/2/3/4]
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Smart defaults based on remaining work:**
|
|
256
|
+
|
|
257
|
+
- **If <5 tasks remaining** → Suggest Mode 1 (Auto) - Quick finish
|
|
258
|
+
- **If phases remaining** → Suggest Mode 2 (Phase-by-phase) - Same as before
|
|
259
|
+
- **Otherwise** → Suggest previous mode from status.json
|
|
260
|
+
|
|
261
|
+
### Step 4: Continue Implementation
|
|
262
|
+
|
|
263
|
+
Execute based on selected mode:
|
|
264
|
+
|
|
265
|
+
#### Mode 1: Auto
|
|
266
|
+
|
|
267
|
+
Continue automatically until all tasks complete:
|
|
268
|
+
|
|
269
|
+
```
|
|
376
270
|
---
|
|
377
|
-
|
|
378
|
-
## Workflow: `/work archive [name]`
|
|
379
|
-
|
|
380
|
-
### Step 1: Verify Completion
|
|
381
|
-
|
|
382
|
-
Check if task is ready to archive:
|
|
383
|
-
|
|
384
|
-
- All tasks marked complete (✅)
|
|
385
|
-
- Tests passing
|
|
386
|
-
- No pending work
|
|
387
|
-
- **No uncommitted Git changes** (if Git enabled)
|
|
388
|
-
|
|
389
|
-
**If uncommitted changes exist:**
|
|
390
|
-
|
|
391
|
-
```bash
|
|
392
|
-
⚠️ Uncommitted Changes Detected
|
|
393
|
-
|
|
394
|
-
You have uncommitted changes in this work:
|
|
395
|
-
M src/controllers/NotificationController.ts
|
|
396
|
-
M docs/api.md
|
|
397
|
-
|
|
398
|
-
Options:
|
|
399
|
-
1. Commit changes first (recommended)
|
|
400
|
-
2. Stash changes: git stash
|
|
401
|
-
3. Archive with uncommitted changes (⚠️ not recommended)
|
|
402
|
-
4. Abort archive
|
|
403
|
-
|
|
404
|
-
What would you like to do? (1/2/3/4)
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
**User selects option 1 → Commit first:**
|
|
408
|
-
|
|
409
|
-
```bash
|
|
410
|
-
🔧 Commit remaining changes before archive
|
|
411
|
-
|
|
412
|
-
Commit message:
|
|
413
|
-
feat(notifications): finalize API documentation
|
|
414
|
-
|
|
415
|
-
Completed final documentation updates for notification endpoints.
|
|
416
|
-
|
|
417
|
-
Commit these changes? (Y/n)
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
**If not complete:** Ask user if they want to archive anyway
|
|
421
|
-
|
|
422
|
-
### Step 2: Move to Archive
|
|
423
|
-
|
|
424
|
-
Move work directory:
|
|
425
|
-
|
|
426
|
-
- From: `.ai-flow/work/[name]/`
|
|
427
|
-
- To: `.ai-flow/archive/YYYY-MM/[name]/`
|
|
428
|
-
|
|
429
|
-
Use current year-month for organization
|
|
430
|
-
|
|
431
|
-
### Step 3: Update Documentation
|
|
432
|
-
|
|
433
|
-
**First, read existing documentation structure:**
|
|
434
|
-
|
|
435
|
-
1. **Read affected docs listed in `status.json`** to understand:
|
|
436
|
-
- Current format and structure
|
|
437
|
-
- Section organization
|
|
438
|
-
- Markdown conventions
|
|
439
|
-
- Example patterns used
|
|
440
|
-
|
|
441
|
-
2. **Common affected docs:**
|
|
442
|
-
- **`docs/api.md`** - Endpoint format, request/response examples
|
|
443
|
-
- **`docs/data-model.md`** - Entity format, relationship notation
|
|
444
|
-
- **`specs/security.md`** - Security documentation patterns
|
|
445
|
-
|
|
446
|
-
**Then update maintaining consistency:**
|
|
447
|
-
|
|
448
|
-
Based on `affectedDocs` in `status.json`, update:
|
|
449
|
-
|
|
450
|
-
- **`docs/api.md`** - If new endpoints added (match existing endpoint format)
|
|
451
|
-
- **`docs/data-model.md`** - If entities added/modified (match existing entity format)
|
|
452
|
-
- **`specs/security.md`** - If auth/security changed (match existing security doc style)
|
|
453
|
-
- **Other docs** as specified (maintain their established format)
|
|
454
|
-
|
|
455
|
-
### Step 4: Generate Summary
|
|
456
|
-
|
|
457
|
-
Create final summary with:
|
|
458
|
-
|
|
459
|
-
- What was built
|
|
460
|
-
- Files created/modified
|
|
461
|
-
- Tests added
|
|
462
|
-
- Documentation updated
|
|
463
|
-
- Total time spent
|
|
464
|
-
|
|
465
|
-
**Example output:**
|
|
466
|
-
|
|
467
|
-
```
|
|
468
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
469
|
-
🗄️ Archiving: feature-notifications
|
|
470
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
471
|
-
|
|
472
|
-
✅ All 18 tasks completed
|
|
473
|
-
✅ All tests passed
|
|
474
|
-
✅ All changes committed
|
|
475
|
-
|
|
476
|
-
Moving to archive...
|
|
477
|
-
✅ Moved to .ai-flow/archive/2025-01/feature-notifications/
|
|
478
|
-
|
|
479
|
-
Updating documentation...
|
|
480
|
-
✅ Updated docs/api.md (added 3 endpoints)
|
|
481
|
-
✅ Updated docs/data-model.md (added Notification entity)
|
|
482
|
-
✅ Updated .env.example (added REDIS_URL)
|
|
483
|
-
|
|
484
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
485
|
-
📦 Git Summary
|
|
486
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
487
|
-
|
|
488
|
-
Branch: feature/notifications-websocket (from main)
|
|
489
|
-
Commits: 4
|
|
490
|
-
|
|
491
|
-
a1b2c3d feat(entities): add Notification entity
|
|
492
|
-
e4f5g6h feat(websocket): implement notification socket handler
|
|
493
|
-
i7j8k9l test(notifications): add comprehensive test suite
|
|
494
|
-
m0n1o2p docs(api): document notification endpoints
|
|
495
|
-
|
|
496
|
-
Files changed: 10
|
|
497
|
-
Tests added: 24
|
|
498
|
-
All validations passed ✅
|
|
499
|
-
|
|
500
|
-
🚀 Ready to create Pull Request
|
|
501
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
502
|
-
|
|
503
|
-
Suggested PR command:
|
|
504
|
-
|
|
505
|
-
gh pr create \
|
|
506
|
-
--title "feat(notifications): Real-time notification system" \
|
|
507
|
-
--body "## Feature\n\nImplements real-time notifications using WebSockets.\n\n## Changes\n\n- New Notification entity with Redis storage\n- WebSocket server for real-time updates\n- RESTful API for notification CRUD\n- Admin-only notification creation\n- Comprehensive test coverage (24 tests)\n\n## Documentation\n\n- API endpoints documented\n- Data model updated\n- Environment variables added\n\n## Testing\n\nAll tests passing (24 new tests added)" \
|
|
508
|
-
--base main
|
|
509
|
-
|
|
510
|
-
Or open in browser:
|
|
511
|
-
https://github.com/yourorg/yourrepo/compare/main...feature/notifications-websocket
|
|
512
|
-
|
|
513
|
-
⚠️ Note: PR creation is manual. Review commits before creating PR.
|
|
514
|
-
|
|
515
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
516
|
-
✅ Archive Complete!
|
|
517
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
518
|
-
|
|
519
|
-
Summary:
|
|
520
|
-
- Feature: Real-time notifications with WebSockets
|
|
521
|
-
- 8 files created, 2 modified
|
|
522
|
-
- 24 tests added (all passing)
|
|
523
|
-
- 4 Git commits
|
|
524
|
-
- Documentation updated
|
|
525
|
-
- Total time: 18 minutes
|
|
526
|
-
|
|
527
|
-
Archived: .ai-flow/archive/2025-01/feature-notifications/
|
|
528
|
-
```
|
|
529
|
-
|
|
271
|
+
⚙️ Resuming: feature-notifications (Auto Mode)
|
|
530
272
|
---
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
Archive these tasks? (Y/n)
|
|
554
|
-
> Y
|
|
555
|
-
|
|
556
|
-
Archiving feature-user-profile...
|
|
557
|
-
✅ Moved to archive
|
|
558
|
-
✅ Updated docs/api.md (4 endpoints)
|
|
559
|
-
✅ Updated docs/data-model.md (Profile entity)
|
|
560
|
-
|
|
561
|
-
Archiving fix-validation-error...
|
|
562
|
-
✅ Moved to archive
|
|
563
|
-
✅ No docs to update (bug fix)
|
|
564
|
-
|
|
565
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
566
|
-
✅ Cleanup Complete!
|
|
567
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
568
|
-
|
|
569
|
-
Archived 2 tasks
|
|
570
|
-
.ai-flow/work/ is now clean
|
|
571
|
-
```
|
|
572
|
-
|
|
273
|
+
Loading context...
|
|
274
|
+
✅ Read spec.md, plan.md, tasks.md
|
|
275
|
+
✅ Analyzed completed code (12/18 tasks done)
|
|
276
|
+
|
|
277
|
+
Continuing from task 13/18: Update API documentation
|
|
278
|
+
|
|
279
|
+
Task 13/18: Update API documentation ✅
|
|
280
|
+
Task 14/18: Update data model documentation ✅
|
|
281
|
+
Task 15/18: Add environment variables ✅
|
|
282
|
+
Task 16/18: Test end-to-end flow ✅
|
|
283
|
+
Task 17/18: Security review ✅
|
|
284
|
+
Task 18/18: Performance check ✅
|
|
285
|
+
|
|
286
|
+
All tasks completed! ✅
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
#### Mode 2: Phase-by-phase
|
|
290
|
+
|
|
291
|
+
Continue phase by phase with pauses:
|
|
292
|
+
|
|
293
|
+
```
|
|
573
294
|
---
|
|
574
|
-
|
|
575
|
-
## Git Integration
|
|
576
|
-
|
|
577
|
-
### Overview
|
|
578
|
-
|
|
579
|
-
The `/work` command integrates with Git across all subcommands:
|
|
580
|
-
|
|
581
|
-
**`/work` (list):**
|
|
582
|
-
|
|
583
|
-
- Shows Git branch for each work item
|
|
584
|
-
- Indicates CURRENT branch with ⭐ marker
|
|
585
|
-
- Helps identify which work is on which branch
|
|
586
|
-
|
|
587
|
-
**`/work show [name]`:**
|
|
588
|
-
|
|
589
|
-
- Displays Git branch information
|
|
590
|
-
- Shows commit count if available
|
|
591
|
-
- Lists uncommitted changes (if any)
|
|
592
|
-
|
|
593
|
-
**`/work resume [name]`:**
|
|
594
|
-
|
|
595
|
-
- Detects branch mismatch (work branch vs current branch)
|
|
596
|
-
- Prompts to switch branches automatically
|
|
597
|
-
- Inherits Git commit strategy from original command
|
|
598
|
-
- Continues making commits as originally configured
|
|
599
|
-
|
|
600
|
-
**`/work archive [name]`:**
|
|
601
|
-
|
|
602
|
-
- Validates no uncommitted changes before archive
|
|
603
|
-
- Shows Git summary (branch, commits, files changed)
|
|
604
|
-
- Suggests Pull Request creation
|
|
605
|
-
- **Never pushes automatically** (always manual review)
|
|
606
|
-
|
|
607
|
-
### Branch Tracking in List View
|
|
608
|
-
|
|
609
|
-
When listing active work, show Git branch for each item:
|
|
610
|
-
|
|
611
|
-
```bash
|
|
612
|
-
📊 Active Work:
|
|
613
|
-
|
|
614
|
-
1. 🚀 feature-notifications
|
|
615
|
-
Type: feature (new)
|
|
616
|
-
Progress: 12/18 tasks (67%)
|
|
617
|
-
Branch: feature/notifications-websocket ⭐ CURRENT
|
|
618
|
-
|
|
619
|
-
2. 🔧 fix-pagination-bug
|
|
620
|
-
Type: fix (complex)
|
|
621
|
-
Progress: 5/6 tasks (83%)
|
|
622
|
-
Branch: fix/pagination-offset
|
|
623
|
-
|
|
624
|
-
3. 🔄 refactor-auth-service
|
|
625
|
-
Type: feature (refactor)
|
|
626
|
-
Progress: 0/15 tasks (plan only)
|
|
627
|
-
Branch: refactor/auth-cleanup
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
**⭐ CURRENT** indicates:
|
|
631
|
-
|
|
632
|
-
- This is your active Git branch
|
|
633
|
-
- Resuming this work won't require branch switch
|
|
634
|
-
- New commits will go to this branch
|
|
635
|
-
|
|
636
|
-
### Branch Mismatch Detection (Resume)
|
|
637
|
-
|
|
638
|
-
When resuming work, check if current branch matches work branch:
|
|
639
|
-
|
|
640
|
-
**Scenario: Work was on different branch**
|
|
641
|
-
|
|
642
|
-
```bash
|
|
643
|
-
# User runs: /work resume feature-notifications
|
|
644
|
-
# Work was started on: feature/notifications-websocket
|
|
645
|
-
# Current branch: main
|
|
646
|
-
|
|
647
|
-
⚠️ Branch Mismatch Detected
|
|
648
|
-
|
|
649
|
-
This work was started on: feature/notifications-websocket
|
|
650
|
-
You are currently on: main
|
|
651
|
-
|
|
652
|
-
Switching branches will:
|
|
653
|
-
✓ Restore correct code context
|
|
654
|
-
✓ Continue work where you left off
|
|
655
|
-
✓ Commits go to correct branch
|
|
656
|
-
|
|
657
|
-
Options:
|
|
658
|
-
1. Switch to work branch (recommended)
|
|
659
|
-
git checkout feature/notifications-websocket
|
|
660
|
-
2. Continue on current branch (⚠️ not recommended - will diverge)
|
|
661
|
-
3. Abort resume
|
|
662
|
-
|
|
663
|
-
What would you like to do? (1/2/3)
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
**User selects 1:**
|
|
667
|
-
|
|
668
|
-
```bash
|
|
669
|
-
git checkout feature/notifications-websocket
|
|
670
|
-
# Switched to branch 'feature/notifications-websocket'
|
|
671
|
-
|
|
672
|
-
✅ On correct branch. Loading context...
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
**If branch doesn't exist locally (was deleted):**
|
|
676
|
-
|
|
677
|
-
```bash
|
|
678
|
-
⚠️ Branch Not Found
|
|
679
|
-
|
|
680
|
-
Branch 'feature/notifications-websocket' does not exist locally.
|
|
681
|
-
|
|
682
|
-
This work cannot be resumed without the branch.
|
|
683
|
-
The code changes may have been lost.
|
|
684
|
-
|
|
685
|
-
Options:
|
|
686
|
-
1. Check if branch exists remotely: git fetch origin
|
|
687
|
-
2. Recreate branch from main (start over)
|
|
688
|
-
3. Abort resume
|
|
689
|
-
|
|
690
|
-
What would you like to do? (1/2/3)
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
### Uncommitted Changes Validation (Archive)
|
|
694
|
-
|
|
695
|
-
Before archiving, check for uncommitted changes:
|
|
696
|
-
|
|
697
|
-
**Scenario: Uncommitted changes exist**
|
|
698
|
-
|
|
699
|
-
```bash
|
|
700
|
-
# User runs: /work archive feature-notifications
|
|
701
|
-
# All tasks complete, but files uncommitted
|
|
702
|
-
|
|
703
|
-
⚠️ Uncommitted Changes Detected
|
|
704
|
-
|
|
705
|
-
You have uncommitted changes in this work:
|
|
706
|
-
M src/controllers/NotificationController.ts
|
|
707
|
-
M docs/api.md
|
|
708
|
-
?? src/services/NotificationCache.ts
|
|
709
|
-
|
|
710
|
-
Archiving with uncommitted changes is risky because:
|
|
711
|
-
✗ Changes won't be in Git history
|
|
712
|
-
✗ Could lose work if branch is deleted
|
|
713
|
-
✗ PR won't include these changes
|
|
714
|
-
|
|
715
|
-
Options:
|
|
716
|
-
1. Commit changes first (recommended)
|
|
717
|
-
2. Stash changes: git stash
|
|
718
|
-
3. Archive anyway (⚠️ changes will be lost)
|
|
719
|
-
4. Abort archive
|
|
720
|
-
|
|
721
|
-
What would you like to do? (1/2/3/4)
|
|
722
|
-
```
|
|
723
|
-
|
|
724
|
-
**User selects 1 (commit first):**
|
|
725
|
-
|
|
726
|
-
```bash
|
|
727
|
-
🔧 Commit remaining changes
|
|
728
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
729
|
-
|
|
730
|
-
Pre-commit validation:
|
|
731
|
-
✓ Lint passed
|
|
732
|
-
✓ Type check passed
|
|
733
|
-
✓ Tests passed
|
|
734
|
-
|
|
735
|
-
Commit message:
|
|
736
|
-
feat(notifications): add Redis caching layer
|
|
737
|
-
|
|
738
|
-
Added NotificationCache service for improved performance.
|
|
739
|
-
Caches recent notifications in Redis with 5-minute TTL.
|
|
740
|
-
|
|
741
|
-
Changes:
|
|
742
|
-
- New NotificationCache.ts service
|
|
743
|
-
- Updated NotificationController to use cache
|
|
744
|
-
- Updated API docs with caching behavior
|
|
745
|
-
|
|
746
|
-
Files: 3 changed
|
|
747
|
-
|
|
748
|
-
Commit these changes? (Y/n)
|
|
749
|
-
```
|
|
750
|
-
|
|
751
|
-
**User confirms → Commit, then continue archive:**
|
|
752
|
-
|
|
753
|
-
```bash
|
|
754
|
-
git add .
|
|
755
|
-
git commit -m "feat(notifications): add Redis caching layer ..."
|
|
756
|
-
# ✅ Committed as: p3q4r5s
|
|
757
|
-
|
|
758
|
-
Proceeding with archive...
|
|
759
|
-
```
|
|
760
|
-
|
|
761
|
-
### Git Summary in Archive Output
|
|
762
|
-
|
|
763
|
-
When archiving, show comprehensive Git summary:
|
|
764
|
-
|
|
765
|
-
```bash
|
|
766
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
767
|
-
📦 Git Summary
|
|
768
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
769
|
-
|
|
770
|
-
Branch: feature/notifications-websocket
|
|
771
|
-
Source: main
|
|
772
|
-
Commits: 5 (all committed ✅)
|
|
773
|
-
|
|
774
|
-
Commit history:
|
|
775
|
-
a1b2c3d feat(entities): add Notification entity
|
|
776
|
-
e4f5g6h feat(websocket): implement notification socket handler
|
|
777
|
-
i7j8k9l feat(api): add notification CRUD endpoints
|
|
778
|
-
m0n1o2p test(notifications): comprehensive test suite
|
|
779
|
-
p3q4r5s feat(notifications): add Redis caching layer
|
|
780
|
-
|
|
781
|
-
Files changed: 12 (8 created, 4 modified)
|
|
782
|
-
Tests added: 24
|
|
783
|
-
Lines added: 847
|
|
784
|
-
Lines removed: 23
|
|
785
|
-
|
|
786
|
-
All validations passed ✅
|
|
787
|
-
No uncommitted changes ✅
|
|
788
|
-
|
|
789
|
-
🚀 Ready to create Pull Request
|
|
790
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
791
|
-
|
|
792
|
-
Suggested PR command:
|
|
793
|
-
|
|
794
|
-
gh pr create \
|
|
795
|
-
--title "feat(notifications): Real-time notification system" \
|
|
796
|
-
--body "## Feature\n\nReal-time notifications using WebSockets + Redis.\n\n## Highlights\n\n- WebSocket server for push notifications\n- RESTful API for notification CRUD\n- Redis caching for performance\n- Admin-only notification creation\n- Comprehensive test coverage\n\n## Changes\n\n- 8 new files created\n- 4 files modified\n- 24 tests added (all passing)\n\n## Documentation\n\n- API endpoints documented\n- Data model updated\n- Environment variables added\n\n## Performance\n\n- Caching reduces DB load by 70%\n- WebSocket handles 1000+ concurrent connections" \
|
|
797
|
-
--base main
|
|
798
|
-
|
|
799
|
-
Or open in browser:
|
|
800
|
-
https://github.com/yourorg/yourrepo/compare/main...feature/notifications-websocket
|
|
801
|
-
|
|
802
|
-
⚠️ Note: PR creation is manual. Review all commits before creating PR.
|
|
803
|
-
```
|
|
804
|
-
|
|
805
|
-
### Inherited Git Strategy (Resume)
|
|
806
|
-
|
|
807
|
-
When resuming work, inherit the original Git commit strategy:
|
|
808
|
-
|
|
809
|
-
**If work was started with `/feature`:**
|
|
810
|
-
|
|
811
|
-
- Resume uses same commit strategy (phase-by-phase, auto, etc.)
|
|
812
|
-
- Commits continue following Conventional Commits
|
|
813
|
-
- Pre-commit validation still applies
|
|
814
|
-
- status.json tracks all commits
|
|
815
|
-
|
|
816
|
-
**If work was started with `/fix`:**
|
|
817
|
-
|
|
818
|
-
- Resume continues bug fix workflow
|
|
819
|
-
- Single commit or docs commit (depending on complexity)
|
|
820
|
-
- Root cause analysis still required in commit messages
|
|
821
|
-
|
|
822
|
-
**If work was started with `/refactor-quick`:**
|
|
823
|
-
|
|
824
|
-
- Resume likely means extending refactor (rare)
|
|
825
|
-
- Single commit at end
|
|
826
|
-
- Maintains "no behavior change" principle
|
|
827
|
-
|
|
828
|
-
### Edge Cases
|
|
829
|
-
|
|
830
|
-
#### 1. No Git Repository
|
|
831
|
-
|
|
832
|
-
```
|
|
833
|
-
ℹ️ Not a Git repository.
|
|
834
|
-
|
|
835
|
-
Work management will continue without Git integration.
|
|
836
|
-
Branch tracking and PR suggestions unavailable.
|
|
837
|
-
|
|
838
|
-
Continue? (Y/n)
|
|
839
|
-
```
|
|
840
|
-
|
|
841
|
-
#### 2. Detached HEAD on Resume
|
|
842
|
-
|
|
843
|
-
```
|
|
844
|
-
⚠️ Detached HEAD Detected
|
|
845
|
-
|
|
846
|
-
You are in detached HEAD state.
|
|
847
|
-
Work branch: feature/notifications-websocket
|
|
848
|
-
|
|
849
|
-
Options:
|
|
850
|
-
1. Checkout work branch
|
|
851
|
-
2. Create new branch from current commit
|
|
852
|
-
3. Abort resume
|
|
853
|
-
|
|
854
|
-
What would you like to do? (1/2/3)
|
|
855
|
-
```
|
|
856
|
-
|
|
857
|
-
#### 3. Conflicting Work on Same Branch
|
|
858
|
-
|
|
859
|
-
```
|
|
860
|
-
⚠️ Multiple Work Items on Same Branch
|
|
861
|
-
|
|
862
|
-
Found 2 work items on branch 'feature/notifications-websocket':
|
|
863
|
-
- feature-notifications (current resume)
|
|
864
|
-
- feature-notifications-v2 (older work)
|
|
865
|
-
|
|
866
|
-
This suggests duplicate or conflicting work.
|
|
867
|
-
|
|
868
|
-
Options:
|
|
869
|
-
1. Continue with current work
|
|
870
|
-
2. Show both work items
|
|
871
|
-
3. Archive older work first
|
|
872
|
-
4. Abort resume
|
|
873
|
-
|
|
874
|
-
What would you like to do? (1/2/3/4)
|
|
875
|
-
```
|
|
876
|
-
|
|
877
|
-
#### 4. Remote Branch Changed (Archive)
|
|
878
|
-
|
|
879
|
-
```
|
|
880
|
-
⚠️ Remote Branch Has New Commits
|
|
881
|
-
|
|
882
|
-
Your branch is behind 'origin/feature/notifications-websocket' by 2 commits.
|
|
883
|
-
|
|
884
|
-
This suggests someone else pushed to this branch.
|
|
885
|
-
|
|
886
|
-
Options:
|
|
887
|
-
1. Pull latest changes: git pull origin feature/notifications-websocket
|
|
888
|
-
2. Continue archive (may cause conflicts on merge)
|
|
889
|
-
3. Abort archive
|
|
890
|
-
|
|
891
|
-
What would you like to do? (1/2/3)
|
|
892
|
-
```
|
|
893
|
-
|
|
894
|
-
#### 5. Branch Already Merged
|
|
895
|
-
|
|
896
|
-
```
|
|
897
|
-
ℹ️ Branch Already Merged
|
|
898
|
-
|
|
899
|
-
Branch 'feature/notifications-websocket' appears to be already merged into main.
|
|
900
|
-
|
|
901
|
-
Options:
|
|
902
|
-
1. Archive anyway (recommended)
|
|
903
|
-
2. Delete branch: git branch -d feature/notifications-websocket
|
|
904
|
-
3. Keep branch and abort archive
|
|
905
|
-
|
|
906
|
-
What would you like to do? (1/2/3)
|
|
907
|
-
```
|
|
908
|
-
|
|
909
|
-
### Workflow Example (Resume with Branch Switch)
|
|
910
|
-
|
|
911
|
-
```bash
|
|
912
|
-
# User is on main branch
|
|
913
|
-
$ git branch --show-current
|
|
914
|
-
main
|
|
915
|
-
|
|
916
|
-
# User wants to resume work that was on different branch
|
|
917
|
-
$ /work resume feature-notifications
|
|
918
|
-
|
|
919
|
-
⚠️ Branch Mismatch Detected
|
|
920
|
-
|
|
921
|
-
This work was started on: feature/notifications-websocket
|
|
922
|
-
You are currently on: main
|
|
923
|
-
|
|
924
|
-
Options:
|
|
925
|
-
1. Switch to work branch (recommended)
|
|
926
|
-
2. Continue on current branch (not recommended)
|
|
927
|
-
3. Abort resume
|
|
928
|
-
|
|
929
|
-
What would you like to do? (1/2/3): 1
|
|
930
|
-
|
|
931
|
-
# Agent switches branch
|
|
932
|
-
git checkout feature/notifications-websocket
|
|
933
|
-
# Switched to branch 'feature/notifications-websocket'
|
|
934
|
-
|
|
935
|
-
✅ On correct branch. Loading context...
|
|
936
|
-
|
|
937
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
938
|
-
⚙️ Resume Implementation Mode
|
|
939
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
940
|
-
|
|
941
|
-
Feature: Real-time notifications
|
|
942
|
-
Progress: 12/18 tasks (67%)
|
|
943
|
-
Previous mode: Phase-by-phase
|
|
944
|
-
Git branch: feature/notifications-websocket ✅
|
|
945
|
-
Git commits: 3 (all committed)
|
|
946
|
-
|
|
947
|
-
How do you want to continue?
|
|
948
|
-
1. Auto (complete remaining 6 tasks)
|
|
949
|
-
2. Phase-by-phase ⭐ PREVIOUS MODE
|
|
950
|
-
3. Task-by-task
|
|
951
|
-
4. Save and exit
|
|
952
|
-
|
|
953
|
-
Your choice (2):
|
|
954
|
-
```
|
|
955
|
-
|
|
956
|
-
### Configuration
|
|
957
|
-
|
|
958
|
-
Git integration for work management in `.ai-flow/core/config.json`:
|
|
959
|
-
|
|
960
|
-
```json
|
|
961
|
-
{
|
|
962
|
-
"git": {
|
|
963
|
-
"enabled": true,
|
|
964
|
-
"showBranchInList": true,
|
|
965
|
-
"warnOnBranchMismatch": true,
|
|
966
|
-
"requireCleanStateForArchive": true,
|
|
967
|
-
"suggestPROnArchive": true
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
```
|
|
971
|
-
|
|
972
|
-
**Options:**
|
|
973
|
-
|
|
974
|
-
- `enabled` - Enable Git integration (default: true)
|
|
975
|
-
- `showBranchInList` - Show branch in list view (default: true)
|
|
976
|
-
- `warnOnBranchMismatch` - Warn on resume if branches don't match (default: true)
|
|
977
|
-
- `requireCleanStateForArchive` - Require no uncommitted changes for archive (default: true)
|
|
978
|
-
- `suggestPROnArchive` - Suggest PR command on archive (default: true)
|
|
979
|
-
|
|
980
|
-
### Cross-Command Integration
|
|
981
|
-
|
|
982
|
-
Work management inherits Git strategy from original command:
|
|
983
|
-
|
|
984
|
-
| Original Command | Git Strategy Inherited |
|
|
985
|
-
| ----------------- | ------------------------------------------------------------ |
|
|
986
|
-
| `/feature` | Phase-based commits, branch isolation, PR suggestion |
|
|
987
|
-
| `/fix` (complex) | Single commit after fix, optional docs commit, PR suggestion |
|
|
988
|
-
| `/fix` (simple) | Single commit, no branch, no PR |
|
|
989
|
-
| `/refactor-quick` | Single commit at end, current branch, no PR |
|
|
990
|
-
|
|
991
|
-
**Key principle:** Resume doesn't change strategy, only continues it.
|
|
992
|
-
|
|
295
|
+
⚙️ Resuming: feature-notifications (Phase-by-phase Mode)
|
|
993
296
|
---
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
- Suggest same mode as default (with smart override)
|
|
1005
|
-
- Continue seamlessly from last task
|
|
1006
|
-
- No context loss
|
|
1007
|
-
|
|
1008
|
-
### 2. Implementation Mode Consistency
|
|
1009
|
-
|
|
1010
|
-
When resuming:
|
|
1011
|
-
|
|
1012
|
-
- Always offer mode selection (don't assume)
|
|
1013
|
-
- Suggest previous mode as default
|
|
1014
|
-
- Smart defaults based on remaining work:
|
|
1015
|
-
- <5 tasks remaining → Suggest Auto
|
|
1016
|
-
- Phases remaining → Suggest Phase-by-phase
|
|
1017
|
-
- Otherwise → Previous mode
|
|
1018
|
-
- Respect user's choice if they override
|
|
1019
|
-
|
|
1020
|
-
### 3. Documentation Updates
|
|
1021
|
-
|
|
1022
|
-
When archiving:
|
|
1023
|
-
|
|
1024
|
-
- Always update affected documentation
|
|
1025
|
-
- Maintain consistency with existing docs
|
|
1026
|
-
- Use proper formatting
|
|
1027
|
-
- Include examples
|
|
1028
|
-
|
|
1029
|
-
### 4. Progress Tracking
|
|
1030
|
-
|
|
1031
|
-
- Update `status.json` timestamps on any change
|
|
1032
|
-
- Update `implementationMode` if user changes it
|
|
1033
|
-
- Keep progress percentage accurate
|
|
1034
|
-
- Track time spent
|
|
1035
|
-
- Save pause reason when user pauses
|
|
1036
|
-
|
|
1037
|
-
### 5. Clean State
|
|
1038
|
-
|
|
1039
|
-
- After archiving, work/ should only have active work
|
|
1040
|
-
- Archive/ organizes by year-month
|
|
1041
|
-
- Easy to find historical work
|
|
1042
|
-
|
|
297
|
+
Loading context...
|
|
298
|
+
✅ Read spec.md, plan.md, tasks.md
|
|
299
|
+
✅ Phase 1 already complete (10/10 tasks)
|
|
300
|
+
|
|
301
|
+
Continuing Phase 2: Business Logic (2/15 tasks complete)
|
|
302
|
+
|
|
303
|
+
Task 2.3: Create EmailService ✅
|
|
304
|
+
Task 2.4: Implement password hashing ✅
|
|
305
|
+
...
|
|
306
|
+
Task 2.15: Add error handling ✅
|
|
1043
307
|
---
|
|
1044
|
-
|
|
1045
|
-
## Example: Complete Resume Flow
|
|
1046
|
-
|
|
1047
|
-
### User paused a complex feature after Phase 1:
|
|
1048
|
-
|
|
1049
|
-
```
|
|
1050
|
-
User runs: /work resume feature-auth-system
|
|
1051
|
-
|
|
1052
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1053
|
-
⚙️ Resume Implementation Mode
|
|
1054
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1055
|
-
|
|
1056
|
-
Loading context...
|
|
1057
|
-
✅ Read spec.md, plan.md, tasks.md, status.json
|
|
1058
|
-
✅ Analyzed completed code
|
|
1059
|
-
|
|
1060
|
-
Feature: JWT authentication system
|
|
1061
|
-
Complexity: COMPLEX (52 tasks across 5 phases)
|
|
1062
|
-
Previous mode: Phase-by-phase
|
|
1063
|
-
Progress: 10/52 tasks (19%)
|
|
1064
|
-
Completed: Phase 1 - Data Layer (10/10 tasks ✅)
|
|
1065
|
-
Remaining: 4 phases (42 tasks)
|
|
1066
|
-
|
|
1067
|
-
How do you want to continue?
|
|
1068
|
-
|
|
1069
|
-
1. 🚀 Auto (complete remaining tasks automatically)
|
|
1070
|
-
2. 📋 Phase-by-phase (pause after each phase) ⭐ PREVIOUS MODE
|
|
1071
|
-
3. 🔍 Task-by-task (manual approval for each task)
|
|
1072
|
-
4. 💾 Save progress and exit again
|
|
1073
|
-
|
|
1074
|
-
Your choice (2): 2
|
|
1075
|
-
|
|
1076
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1077
|
-
⚙️ Resuming: feature-auth-system (Phase-by-phase Mode)
|
|
1078
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1079
|
-
|
|
1080
|
-
PHASE 2/5: Business Logic
|
|
1081
|
-
|
|
1082
|
-
Task 2.1: Create AuthService ✅
|
|
1083
|
-
Task 2.2: Create TokenService ✅
|
|
1084
|
-
Task 2.3: Create EmailService ✅
|
|
1085
|
-
Task 2.4: Implement password hashing ✅
|
|
1086
|
-
Task 2.5: Implement JWT generation ✅
|
|
1087
|
-
Task 2.6: Implement token validation ✅
|
|
1088
|
-
Task 2.7: Implement refresh token logic ✅
|
|
1089
|
-
Task 2.8: Create password reset flow ✅
|
|
1090
|
-
Task 2.9: Create email verification flow ✅
|
|
1091
|
-
Task 2.10: Add rate limiting logic ✅
|
|
1092
|
-
Task 2.11: Add audit logging ✅
|
|
1093
|
-
Task 2.12: Error handling for auth ✅
|
|
1094
|
-
Task 2.13: Input validation schemas ✅
|
|
1095
|
-
Task 2.14: Business rule enforcement ✅
|
|
1096
|
-
Task 2.15: Service integration tests ✅
|
|
1097
|
-
|
|
1098
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1099
|
-
✅ Phase 2 Complete (15/15 tasks)
|
|
1100
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1101
|
-
|
|
1102
|
-
📁 Files created:
|
|
1103
|
-
- src/services/AuthService.ts
|
|
1104
|
-
- src/services/TokenService.ts
|
|
1105
|
-
- src/services/EmailService.ts
|
|
1106
|
-
- src/utils/passwordHash.ts
|
|
1107
|
-
- src/utils/jwtUtils.ts
|
|
1108
|
-
|
|
1109
|
-
Overall progress: 25/52 tasks (48%)
|
|
1110
|
-
|
|
1111
|
-
Continue to Phase 3? (Y/n/pause)
|
|
1112
|
-
> pause
|
|
1113
|
-
|
|
1114
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1115
|
-
💾 Progress Saved
|
|
1116
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1117
|
-
|
|
1118
|
-
Current progress: 25/52 tasks (48%)
|
|
1119
|
-
Completed: Phases 1-2
|
|
1120
|
-
Next: Phase 3 - API Layer
|
|
1121
|
-
Status: Paused after Phase 2 completion
|
|
1122
|
-
|
|
1123
|
-
To resume: /work resume feature-auth-system
|
|
1124
|
-
```
|
|
1125
|
-
|
|
308
|
+
✅ Phase 2 Complete (15/15 tasks)
|
|
1126
309
|
---
|
|
1127
|
-
|
|
1128
|
-
|
|
310
|
+
Continue to Phase 3? (Y/n/pause)
|
|
311
|
+
> Y
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
#### Mode 3: Task-by-task
|
|
315
|
+
|
|
316
|
+
Ask for confirmation before each task:
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
---
|
|
320
|
+
⚙️ Resuming: feature-notifications (Task-by-task Mode)
|
|
321
|
+
---
|
|
322
|
+
Loading context...
|
|
323
|
+
✅ Loaded context (12/18 tasks complete)
|
|
324
|
+
|
|
325
|
+
Next task: Update API documentation
|
|
326
|
+
Files to modify: docs/api.md
|
|
327
|
+
|
|
328
|
+
Proceed? (Y/n/skip/pause)
|
|
329
|
+
> Y
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### Mode 4: Save and exit
|
|
333
|
+
|
|
334
|
+
Save progress and exit without changes:
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
---
|
|
338
|
+
💾 Progress Saved
|
|
339
|
+
---
|
|
340
|
+
Current progress: 12/18 tasks (67%)
|
|
341
|
+
Status: Paused
|
|
342
|
+
|
|
343
|
+
No changes made. To resume: /work resume feature-notifications
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Step 5: Update Status
|
|
347
|
+
|
|
348
|
+
- Update `status.json` with:
|
|
349
|
+
- New `implementationMode` if changed
|
|
350
|
+
- Updated timestamp
|
|
351
|
+
- Current progress
|
|
352
|
+
- Last task completed
|
|
353
|
+
- Reason for pause (if paused)
|
|
354
|
+
---
|
|
355
|
+
## Workflow: `/work archive [name]`
|
|
356
|
+
|
|
357
|
+
### Step 1: Verify Completion
|
|
358
|
+
|
|
359
|
+
Check if task is ready to archive:
|
|
360
|
+
|
|
361
|
+
- All tasks marked complete (✅)
|
|
362
|
+
- Tests passing
|
|
363
|
+
- No pending work
|
|
364
|
+
- **No uncommitted Git changes** (if Git enabled)
|
|
365
|
+
|
|
366
|
+
**If uncommitted changes exist:**
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
⚠️ Uncommitted Changes Detected
|
|
370
|
+
|
|
371
|
+
You have uncommitted changes in this work:
|
|
372
|
+
M src/controllers/NotificationController.ts
|
|
373
|
+
M docs/api.md
|
|
374
|
+
|
|
375
|
+
Options:
|
|
376
|
+
1. Commit changes first (recommended)
|
|
377
|
+
2. Stash changes: git stash
|
|
378
|
+
3. Archive with uncommitted changes (⚠️ not recommended)
|
|
379
|
+
4. Abort archive
|
|
380
|
+
|
|
381
|
+
What would you like to do? (1/2/3/4)
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**User selects option 1 → Commit first:**
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
🔧 Commit remaining changes before archive
|
|
388
|
+
|
|
389
|
+
Commit message:
|
|
390
|
+
feat(notifications): finalize API documentation
|
|
391
|
+
|
|
392
|
+
Completed final documentation updates for notification endpoints.
|
|
393
|
+
|
|
394
|
+
Commit these changes? (Y/n)
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**If not complete:** Ask user if they want to archive anyway
|
|
398
|
+
|
|
399
|
+
### Step 2: Move to Archive
|
|
400
|
+
|
|
401
|
+
Move work directory:
|
|
402
|
+
|
|
403
|
+
- From: `.ai-flow/work/[name]/`
|
|
404
|
+
- To: `.ai-flow/archive/YYYY-MM/[name]/`
|
|
405
|
+
|
|
406
|
+
Use current year-month for organization
|
|
407
|
+
|
|
408
|
+
### Step 3: Update Documentation
|
|
409
|
+
|
|
410
|
+
**First, read existing documentation structure:**
|
|
411
|
+
|
|
412
|
+
1. **Read affected docs listed in `status.json`** to understand:
|
|
413
|
+
- Current format and structure
|
|
414
|
+
- Section organization
|
|
415
|
+
- Markdown conventions
|
|
416
|
+
- Example patterns used
|
|
417
|
+
|
|
418
|
+
2. **Common affected docs:**
|
|
419
|
+
- **`docs/api.md`** - Endpoint format, request/response examples
|
|
420
|
+
- **`docs/data-model.md`** - Entity format, relationship notation
|
|
421
|
+
- **`specs/security.md`** - Security documentation patterns
|
|
422
|
+
|
|
423
|
+
**Then update maintaining consistency:**
|
|
424
|
+
|
|
425
|
+
Based on `affectedDocs` in `status.json`, update:
|
|
426
|
+
|
|
427
|
+
- **`docs/api.md`** - If new endpoints added (match existing endpoint format)
|
|
428
|
+
- **`docs/data-model.md`** - If entities added/modified (match existing entity format)
|
|
429
|
+
- **`specs/security.md`** - If auth/security changed (match existing security doc style)
|
|
430
|
+
- **Other docs** as specified (maintain their established format)
|
|
431
|
+
|
|
432
|
+
### Step 4: Generate Summary
|
|
433
|
+
|
|
434
|
+
Create final summary with:
|
|
435
|
+
|
|
436
|
+
- What was built
|
|
437
|
+
- Files created/modified
|
|
438
|
+
- Tests added
|
|
439
|
+
- Documentation updated
|
|
440
|
+
- Total time spent
|
|
441
|
+
|
|
442
|
+
**Example output:**
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
---
|
|
446
|
+
🗄️ Archiving: feature-notifications
|
|
447
|
+
---
|
|
448
|
+
✅ All 18 tasks completed
|
|
449
|
+
✅ All tests passed
|
|
450
|
+
✅ All changes committed
|
|
451
|
+
|
|
452
|
+
Moving to archive...
|
|
453
|
+
✅ Moved to .ai-flow/archive/2025-01/feature-notifications/
|
|
454
|
+
|
|
455
|
+
Updating documentation...
|
|
456
|
+
✅ Updated docs/api.md (added 3 endpoints)
|
|
457
|
+
✅ Updated docs/data-model.md (added Notification entity)
|
|
458
|
+
✅ Updated .env.example (added REDIS_URL)
|
|
459
|
+
---
|
|
460
|
+
📦 Git Summary
|
|
461
|
+
---
|
|
462
|
+
Branch: feature/notifications-websocket (from main)
|
|
463
|
+
Commits: 4
|
|
464
|
+
|
|
465
|
+
a1b2c3d feat(entities): add Notification entity
|
|
466
|
+
e4f5g6h feat(websocket): implement notification socket handler
|
|
467
|
+
i7j8k9l test(notifications): add comprehensive test suite
|
|
468
|
+
m0n1o2p docs(api): document notification endpoints
|
|
469
|
+
|
|
470
|
+
Files changed: 10
|
|
471
|
+
Tests added: 24
|
|
472
|
+
All validations passed ✅
|
|
473
|
+
|
|
474
|
+
🚀 Ready to create Pull Request
|
|
475
|
+
---
|
|
476
|
+
Suggested PR command:
|
|
477
|
+
|
|
478
|
+
gh pr create \
|
|
479
|
+
--title "feat(notifications): Real-time notification system" \
|
|
480
|
+
--body "## Feature\n\nImplements real-time notifications using WebSockets.\n\n## Changes\n\n- New Notification entity with Redis storage\n- WebSocket server for real-time updates\n- RESTful API for notification CRUD\n- Admin-only notification creation\n- Comprehensive test coverage (24 tests)\n\n## Documentation\n\n- API endpoints documented\n- Data model updated\n- Environment variables added\n\n## Testing\n\nAll tests passing (24 new tests added)" \
|
|
481
|
+
--base main
|
|
482
|
+
|
|
483
|
+
Or open in browser:
|
|
484
|
+
https://github.com/yourorg/yourrepo/compare/main...feature/notifications-websocket
|
|
485
|
+
|
|
486
|
+
⚠️ Note: PR creation is manual. Review commits before creating PR.
|
|
487
|
+
---
|
|
488
|
+
✅ Archive Complete!
|
|
489
|
+
---
|
|
490
|
+
Summary:
|
|
491
|
+
- Feature: Real-time notifications with WebSockets
|
|
492
|
+
- 8 files created, 2 modified
|
|
493
|
+
- 24 tests added (all passing)
|
|
494
|
+
- 4 Git commits
|
|
495
|
+
- Documentation updated
|
|
496
|
+
- Total time: 18 minutes
|
|
497
|
+
|
|
498
|
+
Archived: .ai-flow/archive/2025-01/feature-notifications/
|
|
499
|
+
```
|
|
500
|
+
---
|
|
501
|
+
## Clean Up (Archive All Completed)
|
|
502
|
+
|
|
503
|
+
When user selects "D) Clean up":
|
|
504
|
+
|
|
505
|
+
1. Scan all work items
|
|
506
|
+
2. Identify completed ones (all tasks ✅)
|
|
507
|
+
3. Ask for confirmation
|
|
508
|
+
4. Archive each completed item
|
|
509
|
+
5. Show summary
|
|
510
|
+
|
|
511
|
+
**Example output:**
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
---
|
|
515
|
+
🗄️ Cleanup: Archive All Completed
|
|
516
|
+
---
|
|
517
|
+
Found 2 completed tasks:
|
|
518
|
+
- feature-user-profile (18/18 tasks)
|
|
519
|
+
- fix-validation-error (6/6 tasks)
|
|
520
|
+
|
|
521
|
+
Archive these tasks? (Y/n)
|
|
522
|
+
> Y
|
|
523
|
+
|
|
524
|
+
Archiving feature-user-profile...
|
|
525
|
+
✅ Moved to archive
|
|
526
|
+
✅ Updated docs/api.md (4 endpoints)
|
|
527
|
+
✅ Updated docs/data-model.md (Profile entity)
|
|
528
|
+
|
|
529
|
+
Archiving fix-validation-error...
|
|
530
|
+
✅ Moved to archive
|
|
531
|
+
✅ No docs to update (bug fix)
|
|
532
|
+
---
|
|
533
|
+
✅ Cleanup Complete!
|
|
534
|
+
---
|
|
535
|
+
Archived 2 tasks
|
|
536
|
+
.ai-flow/work/ is now clean
|
|
537
|
+
```
|
|
538
|
+
---
|
|
539
|
+
## Git Integration
|
|
540
|
+
|
|
541
|
+
### Overview
|
|
542
|
+
|
|
543
|
+
The `/work` command integrates with Git across all subcommands:
|
|
544
|
+
|
|
545
|
+
**`/work` (list):**
|
|
546
|
+
|
|
547
|
+
- Shows Git branch for each work item
|
|
548
|
+
- Indicates CURRENT branch with ⭐ marker
|
|
549
|
+
- Helps identify which work is on which branch
|
|
550
|
+
|
|
551
|
+
**`/work show [name]`:**
|
|
552
|
+
|
|
553
|
+
- Displays Git branch information
|
|
554
|
+
- Shows commit count if available
|
|
555
|
+
- Lists uncommitted changes (if any)
|
|
556
|
+
|
|
557
|
+
**`/work resume [name]`:**
|
|
558
|
+
|
|
559
|
+
- Detects branch mismatch (work branch vs current branch)
|
|
560
|
+
- Prompts to switch branches automatically
|
|
561
|
+
- Inherits Git commit strategy from original command
|
|
562
|
+
- Continues making commits as originally configured
|
|
563
|
+
|
|
564
|
+
**`/work archive [name]`:**
|
|
565
|
+
|
|
566
|
+
- Validates no uncommitted changes before archive
|
|
567
|
+
- Shows Git summary (branch, commits, files changed)
|
|
568
|
+
- Suggests Pull Request creation
|
|
569
|
+
- **Never pushes automatically** (always manual review)
|
|
570
|
+
|
|
571
|
+
### Branch Tracking in List View
|
|
572
|
+
|
|
573
|
+
When listing active work, show Git branch for each item:
|
|
574
|
+
|
|
575
|
+
```bash
|
|
576
|
+
📊 Active Work:
|
|
577
|
+
|
|
578
|
+
1. 🚀 feature-notifications
|
|
579
|
+
Type: feature (new)
|
|
580
|
+
Progress: 12/18 tasks (67%)
|
|
581
|
+
Branch: feature/notifications-websocket ⭐ CURRENT
|
|
582
|
+
|
|
583
|
+
2. 🔧 fix-pagination-bug
|
|
584
|
+
Type: fix (complex)
|
|
585
|
+
Progress: 5/6 tasks (83%)
|
|
586
|
+
Branch: fix/pagination-offset
|
|
587
|
+
|
|
588
|
+
3. 🔄 refactor-auth-service
|
|
589
|
+
Type: feature (refactor)
|
|
590
|
+
Progress: 0/15 tasks (plan only)
|
|
591
|
+
Branch: refactor/auth-cleanup
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
**⭐ CURRENT** indicates:
|
|
595
|
+
|
|
596
|
+
- This is your active Git branch
|
|
597
|
+
- Resuming this work won't require branch switch
|
|
598
|
+
- New commits will go to this branch
|
|
599
|
+
|
|
600
|
+
### Branch Mismatch Detection (Resume)
|
|
601
|
+
|
|
602
|
+
When resuming work, check if current branch matches work branch:
|
|
603
|
+
|
|
604
|
+
**Scenario: Work was on different branch**
|
|
605
|
+
|
|
606
|
+
```bash
|
|
607
|
+
# User runs: /work resume feature-notifications
|
|
608
|
+
# Work was started on: feature/notifications-websocket
|
|
609
|
+
# Current branch: main
|
|
610
|
+
|
|
611
|
+
⚠️ Branch Mismatch Detected
|
|
612
|
+
|
|
613
|
+
This work was started on: feature/notifications-websocket
|
|
614
|
+
You are currently on: main
|
|
615
|
+
|
|
616
|
+
Switching branches will:
|
|
617
|
+
✓ Restore correct code context
|
|
618
|
+
✓ Continue work where you left off
|
|
619
|
+
✓ Commits go to correct branch
|
|
620
|
+
|
|
621
|
+
Options:
|
|
622
|
+
1. Switch to work branch (recommended)
|
|
623
|
+
git checkout feature/notifications-websocket
|
|
624
|
+
2. Continue on current branch (⚠️ not recommended - will diverge)
|
|
625
|
+
3. Abort resume
|
|
626
|
+
|
|
627
|
+
What would you like to do? (1/2/3)
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
**User selects 1:**
|
|
631
|
+
|
|
632
|
+
```bash
|
|
633
|
+
git checkout feature/notifications-websocket
|
|
634
|
+
# Switched to branch 'feature/notifications-websocket'
|
|
635
|
+
|
|
636
|
+
✅ On correct branch. Loading context...
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
**If branch doesn't exist locally (was deleted):**
|
|
640
|
+
|
|
641
|
+
```bash
|
|
642
|
+
⚠️ Branch Not Found
|
|
643
|
+
|
|
644
|
+
Branch 'feature/notifications-websocket' does not exist locally.
|
|
645
|
+
|
|
646
|
+
This work cannot be resumed without the branch.
|
|
647
|
+
The code changes may have been lost.
|
|
648
|
+
|
|
649
|
+
Options:
|
|
650
|
+
1. Check if branch exists remotely: git fetch origin
|
|
651
|
+
2. Recreate branch from main (start over)
|
|
652
|
+
3. Abort resume
|
|
653
|
+
|
|
654
|
+
What would you like to do? (1/2/3)
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
### Uncommitted Changes Validation (Archive)
|
|
658
|
+
|
|
659
|
+
Before archiving, check for uncommitted changes:
|
|
660
|
+
|
|
661
|
+
**Scenario: Uncommitted changes exist**
|
|
662
|
+
|
|
663
|
+
```bash
|
|
664
|
+
# User runs: /work archive feature-notifications
|
|
665
|
+
# All tasks complete, but files uncommitted
|
|
666
|
+
|
|
667
|
+
⚠️ Uncommitted Changes Detected
|
|
668
|
+
|
|
669
|
+
You have uncommitted changes in this work:
|
|
670
|
+
M src/controllers/NotificationController.ts
|
|
671
|
+
M docs/api.md
|
|
672
|
+
?? src/services/NotificationCache.ts
|
|
673
|
+
|
|
674
|
+
Archiving with uncommitted changes is risky because:
|
|
675
|
+
✗ Changes won't be in Git history
|
|
676
|
+
✗ Could lose work if branch is deleted
|
|
677
|
+
✗ PR won't include these changes
|
|
678
|
+
|
|
679
|
+
Options:
|
|
680
|
+
1. Commit changes first (recommended)
|
|
681
|
+
2. Stash changes: git stash
|
|
682
|
+
3. Archive anyway (⚠️ changes will be lost)
|
|
683
|
+
4. Abort archive
|
|
684
|
+
|
|
685
|
+
What would you like to do? (1/2/3/4)
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
**User selects 1 (commit first):**
|
|
689
|
+
|
|
690
|
+
```bash
|
|
691
|
+
🔧 Commit remaining changes
|
|
692
|
+
---
|
|
693
|
+
Pre-commit validation:
|
|
694
|
+
✓ Lint passed
|
|
695
|
+
✓ Type check passed
|
|
696
|
+
✓ Tests passed
|
|
697
|
+
|
|
698
|
+
Commit message:
|
|
699
|
+
feat(notifications): add Redis caching layer
|
|
700
|
+
|
|
701
|
+
Added NotificationCache service for improved performance.
|
|
702
|
+
Caches recent notifications in Redis with 5-minute TTL.
|
|
703
|
+
|
|
704
|
+
Changes:
|
|
705
|
+
- New NotificationCache.ts service
|
|
706
|
+
- Updated NotificationController to use cache
|
|
707
|
+
- Updated API docs with caching behavior
|
|
708
|
+
|
|
709
|
+
Files: 3 changed
|
|
710
|
+
|
|
711
|
+
Commit these changes? (Y/n)
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
**User confirms → Commit, then continue archive:**
|
|
715
|
+
|
|
716
|
+
```bash
|
|
717
|
+
git add .
|
|
718
|
+
git commit -m "feat(notifications): add Redis caching layer ..."
|
|
719
|
+
# ✅ Committed as: p3q4r5s
|
|
720
|
+
|
|
721
|
+
Proceeding with archive...
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
### Git Summary in Archive Output
|
|
725
|
+
|
|
726
|
+
When archiving, show comprehensive Git summary:
|
|
727
|
+
|
|
728
|
+
```bash
|
|
729
|
+
---
|
|
730
|
+
📦 Git Summary
|
|
731
|
+
---
|
|
732
|
+
Branch: feature/notifications-websocket
|
|
733
|
+
Source: main
|
|
734
|
+
Commits: 5 (all committed ✅)
|
|
735
|
+
|
|
736
|
+
Commit history:
|
|
737
|
+
a1b2c3d feat(entities): add Notification entity
|
|
738
|
+
e4f5g6h feat(websocket): implement notification socket handler
|
|
739
|
+
i7j8k9l feat(api): add notification CRUD endpoints
|
|
740
|
+
m0n1o2p test(notifications): comprehensive test suite
|
|
741
|
+
p3q4r5s feat(notifications): add Redis caching layer
|
|
742
|
+
|
|
743
|
+
Files changed: 12 (8 created, 4 modified)
|
|
744
|
+
Tests added: 24
|
|
745
|
+
Lines added: 847
|
|
746
|
+
Lines removed: 23
|
|
747
|
+
|
|
748
|
+
All validations passed ✅
|
|
749
|
+
No uncommitted changes ✅
|
|
750
|
+
|
|
751
|
+
🚀 Ready to create Pull Request
|
|
752
|
+
---
|
|
753
|
+
Suggested PR command:
|
|
754
|
+
|
|
755
|
+
gh pr create \
|
|
756
|
+
--title "feat(notifications): Real-time notification system" \
|
|
757
|
+
--body "## Feature\n\nReal-time notifications using WebSockets + Redis.\n\n## Highlights\n\n- WebSocket server for push notifications\n- RESTful API for notification CRUD\n- Redis caching for performance\n- Admin-only notification creation\n- Comprehensive test coverage\n\n## Changes\n\n- 8 new files created\n- 4 files modified\n- 24 tests added (all passing)\n\n## Documentation\n\n- API endpoints documented\n- Data model updated\n- Environment variables added\n\n## Performance\n\n- Caching reduces DB load by 70%\n- WebSocket handles 1000+ concurrent connections" \
|
|
758
|
+
--base main
|
|
759
|
+
|
|
760
|
+
Or open in browser:
|
|
761
|
+
https://github.com/yourorg/yourrepo/compare/main...feature/notifications-websocket
|
|
762
|
+
|
|
763
|
+
⚠️ Note: PR creation is manual. Review all commits before creating PR.
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
### Inherited Git Strategy (Resume)
|
|
767
|
+
|
|
768
|
+
When resuming work, inherit the original Git commit strategy:
|
|
769
|
+
|
|
770
|
+
**If work was started with `/feature`:**
|
|
771
|
+
|
|
772
|
+
- Resume uses same commit strategy (phase-by-phase, auto, etc.)
|
|
773
|
+
- Commits continue following Conventional Commits
|
|
774
|
+
- Pre-commit validation still applies
|
|
775
|
+
- status.json tracks all commits
|
|
776
|
+
|
|
777
|
+
**If work was started with `/fix`:**
|
|
778
|
+
|
|
779
|
+
- Resume continues bug fix workflow
|
|
780
|
+
- Single commit or docs commit (depending on complexity)
|
|
781
|
+
- Root cause analysis still required in commit messages
|
|
782
|
+
|
|
783
|
+
**If work was started with `/refactor-quick`:**
|
|
784
|
+
|
|
785
|
+
- Resume likely means extending refactor (rare)
|
|
786
|
+
- Single commit at end
|
|
787
|
+
- Maintains "no behavior change" principle
|
|
788
|
+
|
|
789
|
+
### Edge Cases
|
|
790
|
+
|
|
791
|
+
#### 1. No Git Repository
|
|
792
|
+
|
|
793
|
+
```
|
|
794
|
+
ℹ️ Not a Git repository.
|
|
795
|
+
|
|
796
|
+
Work management will continue without Git integration.
|
|
797
|
+
Branch tracking and PR suggestions unavailable.
|
|
798
|
+
|
|
799
|
+
Continue? (Y/n)
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
#### 2. Detached HEAD on Resume
|
|
803
|
+
|
|
804
|
+
```
|
|
805
|
+
⚠️ Detached HEAD Detected
|
|
806
|
+
|
|
807
|
+
You are in detached HEAD state.
|
|
808
|
+
Work branch: feature/notifications-websocket
|
|
809
|
+
|
|
810
|
+
Options:
|
|
811
|
+
1. Checkout work branch
|
|
812
|
+
2. Create new branch from current commit
|
|
813
|
+
3. Abort resume
|
|
814
|
+
|
|
815
|
+
What would you like to do? (1/2/3)
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
#### 3. Conflicting Work on Same Branch
|
|
819
|
+
|
|
820
|
+
```
|
|
821
|
+
⚠️ Multiple Work Items on Same Branch
|
|
822
|
+
|
|
823
|
+
Found 2 work items on branch 'feature/notifications-websocket':
|
|
824
|
+
- feature-notifications (current resume)
|
|
825
|
+
- feature-notifications-v2 (older work)
|
|
826
|
+
|
|
827
|
+
This suggests duplicate or conflicting work.
|
|
828
|
+
|
|
829
|
+
Options:
|
|
830
|
+
1. Continue with current work
|
|
831
|
+
2. Show both work items
|
|
832
|
+
3. Archive older work first
|
|
833
|
+
4. Abort resume
|
|
834
|
+
|
|
835
|
+
What would you like to do? (1/2/3/4)
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
#### 4. Remote Branch Changed (Archive)
|
|
839
|
+
|
|
840
|
+
```
|
|
841
|
+
⚠️ Remote Branch Has New Commits
|
|
842
|
+
|
|
843
|
+
Your branch is behind 'origin/feature/notifications-websocket' by 2 commits.
|
|
844
|
+
|
|
845
|
+
This suggests someone else pushed to this branch.
|
|
846
|
+
|
|
847
|
+
Options:
|
|
848
|
+
1. Pull latest changes: git pull origin feature/notifications-websocket
|
|
849
|
+
2. Continue archive (may cause conflicts on merge)
|
|
850
|
+
3. Abort archive
|
|
851
|
+
|
|
852
|
+
What would you like to do? (1/2/3)
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### 5. Branch Already Merged
|
|
856
|
+
|
|
857
|
+
```
|
|
858
|
+
ℹ️ Branch Already Merged
|
|
859
|
+
|
|
860
|
+
Branch 'feature/notifications-websocket' appears to be already merged into main.
|
|
861
|
+
|
|
862
|
+
Options:
|
|
863
|
+
1. Archive anyway (recommended)
|
|
864
|
+
2. Delete branch: git branch -d feature/notifications-websocket
|
|
865
|
+
3. Keep branch and abort archive
|
|
866
|
+
|
|
867
|
+
What would you like to do? (1/2/3)
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
### Workflow Example (Resume with Branch Switch)
|
|
871
|
+
|
|
872
|
+
```bash
|
|
873
|
+
# User is on main branch
|
|
874
|
+
$ git branch --show-current
|
|
875
|
+
main
|
|
876
|
+
|
|
877
|
+
# User wants to resume work that was on different branch
|
|
878
|
+
$ /work resume feature-notifications
|
|
879
|
+
|
|
880
|
+
⚠️ Branch Mismatch Detected
|
|
881
|
+
|
|
882
|
+
This work was started on: feature/notifications-websocket
|
|
883
|
+
You are currently on: main
|
|
884
|
+
|
|
885
|
+
Options:
|
|
886
|
+
1. Switch to work branch (recommended)
|
|
887
|
+
2. Continue on current branch (not recommended)
|
|
888
|
+
3. Abort resume
|
|
889
|
+
|
|
890
|
+
What would you like to do? (1/2/3): 1
|
|
891
|
+
|
|
892
|
+
# Agent switches branch
|
|
893
|
+
git checkout feature/notifications-websocket
|
|
894
|
+
# Switched to branch 'feature/notifications-websocket'
|
|
895
|
+
|
|
896
|
+
✅ On correct branch. Loading context...
|
|
897
|
+
---
|
|
898
|
+
⚙️ Resume Implementation Mode
|
|
899
|
+
---
|
|
900
|
+
Feature: Real-time notifications
|
|
901
|
+
Progress: 12/18 tasks (67%)
|
|
902
|
+
Previous mode: Phase-by-phase
|
|
903
|
+
Git branch: feature/notifications-websocket ✅
|
|
904
|
+
Git commits: 3 (all committed)
|
|
905
|
+
|
|
906
|
+
How do you want to continue?
|
|
907
|
+
1. Auto (complete remaining 6 tasks)
|
|
908
|
+
2. Phase-by-phase ⭐ PREVIOUS MODE
|
|
909
|
+
3. Task-by-task
|
|
910
|
+
4. Save and exit
|
|
911
|
+
|
|
912
|
+
Your choice (2):
|
|
913
|
+
```
|
|
914
|
+
|
|
915
|
+
### Configuration
|
|
916
|
+
|
|
917
|
+
Git integration for work management in `.ai-flow/core/config.json`:
|
|
918
|
+
|
|
919
|
+
```json
|
|
920
|
+
{
|
|
921
|
+
"git": {
|
|
922
|
+
"enabled": true,
|
|
923
|
+
"showBranchInList": true,
|
|
924
|
+
"warnOnBranchMismatch": true,
|
|
925
|
+
"requireCleanStateForArchive": true,
|
|
926
|
+
"suggestPROnArchive": true
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
**Options:**
|
|
932
|
+
|
|
933
|
+
- `enabled` - Enable Git integration (default: true)
|
|
934
|
+
- `showBranchInList` - Show branch in list view (default: true)
|
|
935
|
+
- `warnOnBranchMismatch` - Warn on resume if branches don't match (default: true)
|
|
936
|
+
- `requireCleanStateForArchive` - Require no uncommitted changes for archive (default: true)
|
|
937
|
+
- `suggestPROnArchive` - Suggest PR command on archive (default: true)
|
|
938
|
+
|
|
939
|
+
### Cross-Command Integration
|
|
940
|
+
|
|
941
|
+
Work management inherits Git strategy from original command:
|
|
942
|
+
|
|
943
|
+
| Original Command | Git Strategy Inherited |
|
|
944
|
+
| ----------------- | ------------------------------------------------------------ |
|
|
945
|
+
| `/feature` | Phase-based commits, branch isolation, PR suggestion |
|
|
946
|
+
| `/fix` (complex) | Single commit after fix, optional docs commit, PR suggestion |
|
|
947
|
+
| `/fix` (simple) | Single commit, no branch, no PR |
|
|
948
|
+
| `/refactor-quick` | Single commit at end, current branch, no PR |
|
|
949
|
+
|
|
950
|
+
**Key principle:** Resume doesn't change strategy, only continues it.
|
|
951
|
+
---
|
|
952
|
+
## Important Rules
|
|
953
|
+
|
|
954
|
+
### 1. Context Preservation
|
|
955
|
+
|
|
956
|
+
When resuming work:
|
|
957
|
+
|
|
958
|
+
- Load ALL context files
|
|
959
|
+
- Understand completed work
|
|
960
|
+
- Read previous `implementationMode` from status.json
|
|
961
|
+
- Suggest same mode as default (with smart override)
|
|
962
|
+
- Continue seamlessly from last task
|
|
963
|
+
- No context loss
|
|
964
|
+
|
|
965
|
+
### 2. Implementation Mode Consistency
|
|
966
|
+
|
|
967
|
+
When resuming:
|
|
968
|
+
|
|
969
|
+
- Always offer mode selection (don't assume)
|
|
970
|
+
- Suggest previous mode as default
|
|
971
|
+
- Smart defaults based on remaining work:
|
|
972
|
+
- <5 tasks remaining → Suggest Auto
|
|
973
|
+
- Phases remaining → Suggest Phase-by-phase
|
|
974
|
+
- Otherwise → Previous mode
|
|
975
|
+
- Respect user's choice if they override
|
|
976
|
+
|
|
977
|
+
### 3. Documentation Updates
|
|
978
|
+
|
|
979
|
+
When archiving:
|
|
980
|
+
|
|
981
|
+
- Always update affected documentation
|
|
982
|
+
- Maintain consistency with existing docs
|
|
983
|
+
- Use proper formatting
|
|
984
|
+
- Include examples
|
|
985
|
+
|
|
986
|
+
### 4. Progress Tracking
|
|
987
|
+
|
|
988
|
+
- Update `status.json` timestamps on any change
|
|
989
|
+
- Update `implementationMode` if user changes it
|
|
990
|
+
- Keep progress percentage accurate
|
|
991
|
+
- Track time spent
|
|
992
|
+
- Save pause reason when user pauses
|
|
993
|
+
|
|
994
|
+
### 5. Clean State
|
|
995
|
+
|
|
996
|
+
- After archiving, work/ should only have active work
|
|
997
|
+
- Archive/ organizes by year-month
|
|
998
|
+
- Easy to find historical work
|
|
999
|
+
---
|
|
1000
|
+
## Example: Complete Resume Flow
|
|
1001
|
+
|
|
1002
|
+
### User paused a complex feature after Phase 1:
|
|
1003
|
+
|
|
1004
|
+
```
|
|
1005
|
+
User runs: /work resume feature-auth-system
|
|
1006
|
+
---
|
|
1007
|
+
⚙️ Resume Implementation Mode
|
|
1008
|
+
---
|
|
1009
|
+
Loading context...
|
|
1010
|
+
✅ Read spec.md, plan.md, tasks.md, status.json
|
|
1011
|
+
✅ Analyzed completed code
|
|
1012
|
+
|
|
1013
|
+
Feature: JWT authentication system
|
|
1014
|
+
Complexity: COMPLEX (52 tasks across 5 phases)
|
|
1015
|
+
Previous mode: Phase-by-phase
|
|
1016
|
+
Progress: 10/52 tasks (19%)
|
|
1017
|
+
Completed: Phase 1 - Data Layer (10/10 tasks ✅)
|
|
1018
|
+
Remaining: 4 phases (42 tasks)
|
|
1019
|
+
|
|
1020
|
+
How do you want to continue?
|
|
1021
|
+
|
|
1022
|
+
1. 🚀 Auto (complete remaining tasks automatically)
|
|
1023
|
+
2. 📋 Phase-by-phase (pause after each phase) ⭐ PREVIOUS MODE
|
|
1024
|
+
3. 🔍 Task-by-task (manual approval for each task)
|
|
1025
|
+
4. 💾 Save progress and exit again
|
|
1026
|
+
|
|
1027
|
+
Your choice (2): 2
|
|
1028
|
+
---
|
|
1029
|
+
⚙️ Resuming: feature-auth-system (Phase-by-phase Mode)
|
|
1030
|
+
---
|
|
1031
|
+
PHASE 2/5: Business Logic
|
|
1032
|
+
|
|
1033
|
+
Task 2.1: Create AuthService ✅
|
|
1034
|
+
Task 2.2: Create TokenService ✅
|
|
1035
|
+
Task 2.3: Create EmailService ✅
|
|
1036
|
+
Task 2.4: Implement password hashing ✅
|
|
1037
|
+
Task 2.5: Implement JWT generation ✅
|
|
1038
|
+
Task 2.6: Implement token validation ✅
|
|
1039
|
+
Task 2.7: Implement refresh token logic ✅
|
|
1040
|
+
Task 2.8: Create password reset flow ✅
|
|
1041
|
+
Task 2.9: Create email verification flow ✅
|
|
1042
|
+
Task 2.10: Add rate limiting logic ✅
|
|
1043
|
+
Task 2.11: Add audit logging ✅
|
|
1044
|
+
Task 2.12: Error handling for auth ✅
|
|
1045
|
+
Task 2.13: Input validation schemas ✅
|
|
1046
|
+
Task 2.14: Business rule enforcement ✅
|
|
1047
|
+
Task 2.15: Service integration tests ✅
|
|
1048
|
+
---
|
|
1049
|
+
✅ Phase 2 Complete (15/15 tasks)
|
|
1050
|
+
---
|
|
1051
|
+
📁 Files created:
|
|
1052
|
+
- src/services/AuthService.ts
|
|
1053
|
+
- src/services/TokenService.ts
|
|
1054
|
+
- src/services/EmailService.ts
|
|
1055
|
+
- src/utils/passwordHash.ts
|
|
1056
|
+
- src/utils/jwtUtils.ts
|
|
1057
|
+
|
|
1058
|
+
Overall progress: 25/52 tasks (48%)
|
|
1059
|
+
|
|
1060
|
+
Continue to Phase 3? (Y/n/pause)
|
|
1061
|
+
> pause
|
|
1062
|
+
---
|
|
1063
|
+
💾 Progress Saved
|
|
1064
|
+
---
|
|
1065
|
+
Current progress: 25/52 tasks (48%)
|
|
1066
|
+
Completed: Phases 1-2
|
|
1067
|
+
Next: Phase 3 - API Layer
|
|
1068
|
+
Status: Paused after Phase 2 completion
|
|
1069
|
+
|
|
1070
|
+
To resume: /work resume feature-auth-system
|
|
1071
|
+
```
|
|
1072
|
+
---
|
|
1073
|
+
**BEGIN EXECUTION when user runs `/work`, `/work show [name]`, `/work resume [name]`, or `/work archive [name]`**
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1129
1077
|
|