agileflow 2.51.0 → 2.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +82 -460
  2. package/package.json +18 -3
  3. package/scripts/agileflow-configure.js +134 -63
  4. package/scripts/agileflow-welcome.js +161 -31
  5. package/scripts/generators/agent-registry.js +2 -2
  6. package/scripts/generators/command-registry.js +6 -6
  7. package/scripts/generators/index.js +2 -6
  8. package/scripts/generators/inject-babysit.js +9 -2
  9. package/scripts/generators/inject-help.js +3 -1
  10. package/scripts/generators/inject-readme.js +7 -3
  11. package/scripts/generators/skill-registry.js +5 -5
  12. package/scripts/get-env.js +13 -12
  13. package/scripts/obtain-context.js +79 -26
  14. package/scripts/session-coordinator.sh +232 -0
  15. package/scripts/session-manager.js +512 -0
  16. package/src/core/agents/orchestrator.md +275 -0
  17. package/src/core/commands/adr.md +38 -16
  18. package/src/core/commands/agent.md +39 -22
  19. package/src/core/commands/assign.md +17 -0
  20. package/src/core/commands/auto.md +60 -46
  21. package/src/core/commands/babysit.md +302 -637
  22. package/src/core/commands/baseline.md +20 -0
  23. package/src/core/commands/blockers.md +33 -48
  24. package/src/core/commands/board.md +19 -0
  25. package/src/core/commands/changelog.md +20 -0
  26. package/src/core/commands/ci.md +17 -0
  27. package/src/core/commands/context.md +43 -40
  28. package/src/core/commands/debt.md +76 -45
  29. package/src/core/commands/deploy.md +20 -0
  30. package/src/core/commands/deps.md +40 -46
  31. package/src/core/commands/diagnose.md +24 -18
  32. package/src/core/commands/docs.md +18 -0
  33. package/src/core/commands/epic.md +31 -0
  34. package/src/core/commands/feedback.md +33 -21
  35. package/src/core/commands/handoff.md +29 -0
  36. package/src/core/commands/help.md +16 -7
  37. package/src/core/commands/impact.md +31 -61
  38. package/src/core/commands/metrics.md +17 -35
  39. package/src/core/commands/packages.md +21 -0
  40. package/src/core/commands/pr.md +15 -0
  41. package/src/core/commands/readme-sync.md +42 -9
  42. package/src/core/commands/research.md +58 -11
  43. package/src/core/commands/retro.md +42 -50
  44. package/src/core/commands/review.md +22 -27
  45. package/src/core/commands/session/end.md +53 -297
  46. package/src/core/commands/session/history.md +38 -257
  47. package/src/core/commands/session/init.md +44 -446
  48. package/src/core/commands/session/new.md +152 -0
  49. package/src/core/commands/session/resume.md +51 -447
  50. package/src/core/commands/session/status.md +32 -244
  51. package/src/core/commands/sprint.md +33 -0
  52. package/src/core/commands/status.md +18 -0
  53. package/src/core/commands/story-validate.md +32 -0
  54. package/src/core/commands/story.md +21 -6
  55. package/src/core/commands/template.md +18 -0
  56. package/src/core/commands/tests.md +22 -0
  57. package/src/core/commands/update.md +72 -58
  58. package/src/core/commands/validate-expertise.md +25 -37
  59. package/src/core/commands/velocity.md +33 -74
  60. package/src/core/commands/verify.md +16 -0
  61. package/src/core/experts/documentation/expertise.yaml +16 -2
  62. package/src/core/skills/agileflow-retro-facilitator/SKILL.md +57 -219
  63. package/src/core/skills/agileflow-retro-facilitator/cookbook/4ls.md +86 -0
  64. package/src/core/skills/agileflow-retro-facilitator/cookbook/glad-sad-mad.md +79 -0
  65. package/src/core/skills/agileflow-retro-facilitator/cookbook/start-stop-continue.md +142 -0
  66. package/src/core/skills/agileflow-retro-facilitator/prompts/action-items.md +83 -0
  67. package/src/core/skills/writing-skills/SKILL.md +352 -0
  68. package/src/core/skills/writing-skills/testing-skills-with-subagents.md +232 -0
  69. package/tools/cli/agileflow-cli.js +4 -2
  70. package/tools/cli/commands/config.js +20 -13
  71. package/tools/cli/commands/doctor.js +25 -9
  72. package/tools/cli/commands/list.js +10 -6
  73. package/tools/cli/commands/setup.js +54 -3
  74. package/tools/cli/commands/status.js +6 -8
  75. package/tools/cli/commands/uninstall.js +5 -5
  76. package/tools/cli/commands/update.js +51 -7
  77. package/tools/cli/installers/core/installer.js +8 -4
  78. package/tools/cli/installers/ide/_base-ide.js +3 -1
  79. package/tools/cli/installers/ide/claude-code.js +3 -7
  80. package/tools/cli/installers/ide/codex.js +440 -0
  81. package/tools/cli/installers/ide/manager.js +2 -6
  82. package/tools/cli/lib/content-injector.js +3 -3
  83. package/tools/cli/lib/docs-setup.js +3 -2
  84. package/tools/cli/lib/npm-utils.js +3 -3
  85. package/tools/cli/lib/ui.js +7 -7
  86. package/tools/cli/lib/version-checker.js +3 -3
  87. package/tools/postinstall.js +2 -3
@@ -1,487 +1,91 @@
1
1
  ---
2
- description: Resume work with verification and context loading
2
+ description: Pick a session to switch to or resume
3
3
  argument-hint: (no arguments)
4
4
  ---
5
5
 
6
- # Resume AgileFlow Session
6
+ # /agileflow:session:resume
7
7
 
8
- You are running the `/agileflow:session:resume` command to start an AgileFlow session with environment verification, test checking, and context loading.
8
+ View all sessions and get the command to switch to one.
9
9
 
10
- ## IMMEDIATE ACTIONS
11
-
12
- **Execute these steps NOW in order:**
13
-
14
- ### Step 1: Read session-state.json
15
- ```bash
16
- cat docs/09-agents/session-state.json
17
- ```
18
-
19
- ### Step 2: Read status.json for current stories
20
- ```bash
21
- cat docs/09-agents/status.json
22
- ```
23
-
24
- ### Step 3: Get git context
25
- ```bash
26
- git branch --show-current && git log --oneline -5 && git status --short
27
- ```
28
-
29
- ### Step 4: Update session-state.json with new session
30
- Use the Write tool to update `docs/09-agents/session-state.json`:
31
- - Set `current_session.id` to `sess-YYYYMMDD-HHMMSS` (current timestamp)
32
- - Set `current_session.started_at` to current ISO timestamp
33
- - Set `current_session.branch` to current git branch
34
- - Set `current_session.head_sha_start` to current HEAD
35
- - Keep `last_session` as-is (from previous read)
36
-
37
- ### Step 5: Display session summary
38
- Output a formatted summary showing:
39
- - Last session info (if exists)
40
- - Current work (in-progress stories from status.json)
41
- - Ready queue (ready stories from status.json)
42
- - Git status (branch, recent commits)
43
- - Next steps
44
-
45
- ## TODO LIST TRACKING
46
-
47
- **CRITICAL**: Immediately create a todo list using TodoWrite tool to track session resumption:
48
- ```
49
- 1. Read session-state.json
50
- 2. Read status.json
51
- 3. Get git context (branch, commits, status)
52
- 4. Update session-state.json with new session
53
- 5. Display session summary
54
- ```
55
-
56
- Mark each step complete as you finish it. This ensures comprehensive session startup.
10
+ ---
57
11
 
58
- **When to use:**
59
- - Manually: Start of each coding session
60
- - Automatically: Via SessionStart hook (configured in `/agileflow:session:init`)
12
+ ## Purpose
61
13
 
62
- ## Prerequisites
14
+ When you have multiple sessions and want to switch between them, this command:
15
+ - Lists all registered sessions (active and inactive)
16
+ - Shows which are currently active (have a running Claude process)
17
+ - Provides the `cd` command to switch to your chosen session
63
18
 
64
- - Session harness must be initialized (`/agileflow:session:init`)
65
- - Must be in project root directory
19
+ ## IMMEDIATE ACTIONS
66
20
 
67
- ## Execution Flow
21
+ Upon invocation, execute these steps:
68
22
 
69
- ### 1. Check Initialization
23
+ ### Step 1: Get All Sessions
70
24
 
71
25
  ```bash
72
- if [ ! -f "docs/00-meta/environment.json" ]; then
73
- echo "⚠️ Session harness not initialized"
74
- echo ""
75
- echo "Run /agileflow:session:init to set up test verification"
76
- echo ""
77
- echo "Or continue without session harness? [y/N]: "
78
-
79
- # If user says no, exit
80
- # If yes, skip to step 4 (load context only)
81
- fi
26
+ node .agileflow/scripts/session-manager.js list --json
82
27
  ```
83
28
 
84
- ### 2. Run Init Script (Optional)
85
-
86
- If `init_script` is configured in environment.json:
87
-
88
- ```bash
89
- INIT_SCRIPT=$(jq -r '.init_script' docs/00-meta/environment.json)
29
+ Parse the JSON output to get session data.
90
30
 
91
- if [ -f "$INIT_SCRIPT" ]; then
92
- echo "🚀 Running environment initialization..."
93
- echo ""
31
+ ### Step 2: Build AskUserQuestion Options
94
32
 
95
- bash "$INIT_SCRIPT"
33
+ For each session, create an option:
96
34
 
97
- if [ $? -eq 0 ]; then
98
- echo ""
99
- echo "✅ Environment ready"
100
- else
101
- echo ""
102
- echo "⚠️ Init script encountered issues"
103
- echo "Continue anyway? [Y/n]: "
104
- fi
105
- fi
106
35
  ```
107
-
108
- **Output example:**
36
+ AskUserQuestion:
37
+ question: "Which session would you like to resume?"
38
+ header: "Sessions"
39
+ multiSelect: false
40
+ options:
41
+ - label: "Session 1: main (current)"
42
+ description: "US-0042: User Auth API │ Active now │ /home/user/project"
43
+ - label: "Session 2: \"auth\""
44
+ description: "US-0038: Fix Login │ Active now │ ../project-auth"
45
+ - label: "Create new session"
46
+ description: "Start a fresh parallel workspace"
109
47
  ```
110
- 🚀 Running environment initialization...
111
48
 
112
- 📦 Installing dependencies (npm ci)...
113
- Dependencies installed
49
+ **Formatting rules:**
50
+ - Show nickname in quotes if present, otherwise show branch
51
+ - Mark active sessions with "Active now"
52
+ - Mark inactive sessions with time since last active
53
+ - Mark current session with "(current)"
54
+ - Include story ID if available
55
+ - Show relative path for non-main sessions
114
56
 
115
- Environment ready
116
- ```
57
+ ### Step 3: Handle User Selection
117
58
 
118
- ### 3. Verify Tests
59
+ **If user selects a different session:**
119
60
 
120
- Run `/agileflow:verify` to check current test status:
61
+ Display the command to switch:
121
62
 
122
63
  ```
123
- 🧪 Running tests...
124
- Command: npm test
125
- ```
64
+ To resume Session 2 "auth":
126
65
 
127
- **Track changes from last session:**
128
- - Read `last_session.final_test_status` from session-state.json
129
- - Compare to current test results
130
- - Detect regressions
66
+ ┌─────────────────────────────────────────────────────────┐
67
+ │ cd ../project-auth && claude --resume │
68
+ └─────────────────────────────────────────────────────────┘
131
69
 
132
- **If tests were passing, now failing:**
70
+ Session info:
71
+ Branch: session-2
72
+ Story: US-0038 (in-progress)
133
73
  ```
134
- ⚠️ REGRESSION DETECTED
135
-
136
- Tests were: passing (last session)
137
- Tests are now: FAILING
138
-
139
- Failed: 2/42 tests
140
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
141
-
142
- ❌ auth.test.ts:42
143
- Expected redirect to /dashboard
144
- Got redirect to /login
145
-
146
- ❌ auth.test.ts:67
147
- Session token not persisting
148
-
149
- Recent commits:
150
- abc123 - feat: update auth flow (2 hours ago)
151
- def456 - fix: session cookie domain (3 hours ago)
152
74
 
153
- Likely culprit: abc123 (auth flow changes)
154
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
- ```
75
+ **If user selects current session:**
156
76
 
157
- **If tests passing:**
158
- ```
159
- ✅ All tests passing (42/42)
160
- Duration: 12.3s
161
77
  ```
162
-
163
- ### 4. Load Git Context
164
-
165
- Get recent activity:
166
-
167
- ```bash
168
- # Last 5 commits
169
- git log --oneline -5
170
-
171
- # Current branch
172
- git branch --show-current
173
-
174
- # Working tree status
175
- git status --short
78
+ You're already in Session 1!
176
79
  ```
177
80
 
178
- ### 5. Load AgileFlow Context
81
+ **If user selects "Create new session":**
179
82
 
180
- Read from status.json and session-state.json:
181
-
182
- **Current Work:**
183
- - Stories with status `in_progress`
184
- - Stories with status `ready` (prioritized)
185
- - Stories with status `blocked` (with blocker info)
186
-
187
- **Recent Activity:**
188
- - Stories completed since last session
189
- - Commits made since last session
190
- - Test status changes
191
-
192
- **Previous Story Insights:**
193
- - If current story has Previous Story Insights, load them
194
- - If current story has Dev Agent Record from previous stories in epic, highlight key lessons
195
-
196
- ### 6. Update Session State
197
-
198
- Update `docs/09-agents/session-state.json`:
199
-
200
- ```json
201
- {
202
- "current_session": {
203
- "id": "sess-20251206-140000",
204
- "started_at": "2025-12-06T14:00:00Z",
205
- "baseline_verified": true,
206
- "initial_test_status": "passing",
207
- "current_story": "US-0043",
208
- "active_agent": null
209
- },
210
- "last_session": {
211
- "id": "sess-20251205-140000",
212
- "ended_at": "2025-12-05T18:00:00Z",
213
- "stories_completed": ["US-0041", "US-0042"],
214
- "final_test_status": "passing",
215
- "commits": ["abc123", "def456"]
216
- },
217
- "session_history": [
218
- {
219
- "date": "2025-12-05",
220
- "sessions": 2,
221
- "stories_completed": 3,
222
- "test_regressions": 0
223
- }
224
- ]
225
- }
226
83
  ```
227
-
228
- ### 7. Generate Session Summary
229
-
230
- Compile and display comprehensive summary:
231
-
232
- ```
233
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
234
- 🚀 AgileFlow Session Resumed
235
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
236
-
237
- 📅 Last Session: 1 day ago (sess-20251205-140000)
238
- Duration: 4 hours
239
- Stories Completed: US-0041, US-0042
240
-
241
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
242
- 📊 Current State
243
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
244
-
245
- → In Progress (1):
246
- US-0043: Add user profile settings page
247
- Owner: ui
248
- Started: 2 hours ago
249
- Tests: ✅ passing
250
-
251
- Ready Queue (5):
252
- US-0044: Implement password reset flow
253
- US-0045: Add email verification
254
- US-0046: Create admin dashboard
255
- US-0047: Add user roles and permissions
256
- US-0048: Implement audit logging
257
-
258
- Blocked (1):
259
- US-0049: Deploy to production
260
- Blocker: Waiting on US-0043 completion
261
- Owner: devops
262
-
263
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
264
- 🧪 Test Status
265
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
266
-
267
- ✅ All Passing (42/42)
268
- Last Run: Just now
269
- Command: npm test
270
- Duration: 12.3s
271
-
272
- No regressions detected since last session ✅
273
-
274
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
275
- 📁 Git Status
276
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
277
-
278
- Branch: feature/user-profile
279
- Status: Clean working tree ✅
280
-
281
- Recent commits:
282
- abc123 - feat: add profile form component (2 hours ago)
283
- def456 - test: add profile validation tests (3 hours ago)
284
- ghi789 - docs: update API documentation (1 day ago)
285
-
286
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
287
- 💡 Context from Previous Stories
288
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
289
-
290
- From US-0042 (completed 1 day ago):
291
- • Use shadcn/ui form components for consistency
292
- • zod validation reduces runtime errors significantly
293
- • Watch for Next.js hydration mismatches with dynamic content
294
- • Form state management works well with react-hook-form
295
-
296
- From US-0041 (completed 2 days ago):
297
- • API rate limiting needs Redis configuration
298
- • Test coverage requirement: 85% for new features
299
- • Always run migration before testing DB changes
300
-
301
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
302
-
303
- Ready to work on US-0043: "Add user profile settings page" 🚀
304
-
305
- Next steps:
306
- 1. Review story details: docs/06-stories/EP-0001/US-0043.md
307
- 2. Check Architecture Context for implementation guidance
308
- 3. Review Previous Story Insights above
309
- 4. Implement to acceptance criteria
310
- 5. Run /agileflow:verify before marking complete
311
-
312
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
313
- ```
314
-
315
- ### 8. Minimal Mode (If No Session Harness)
316
-
317
- If session harness not initialized, provide basic context:
318
-
319
- ```
320
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
321
- 🚀 AgileFlow Session (Basic Mode)
322
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
323
-
324
- ⚠️ Session harness not initialized
325
- Run /agileflow:session:init for:
326
- • Automatic test verification
327
- • Session state tracking
328
- • Baseline management
329
- • Regression detection
330
-
331
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
332
- 📊 Current State (from status.json)
333
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
334
-
335
- In Progress (1):
336
- US-0043: Add user profile settings page
337
- Owner: ui
338
-
339
- Ready Queue (5):
340
- US-0044, US-0045, US-0046, US-0047, US-0048
341
-
342
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
343
- ```
344
-
345
- ## Output Variations
346
-
347
- ### First Session Ever
348
- ```
349
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
350
- 🚀 Welcome to AgileFlow!
351
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
352
-
353
- This is your first session with session harness enabled.
354
-
355
- ✅ Environment ready
356
- ✅ Tests passing (42/42)
357
- ✅ Baseline established
358
-
359
- No stories in progress yet. Ready to start work!
360
-
361
- Next steps:
362
- 1. Review available stories: docs/06-stories/
363
- 2. Assign yourself a story: /agileflow:assign
364
- 3. Start implementation following AC
365
- 4. Run /agileflow:verify before completion
366
-
367
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
368
- ```
369
-
370
- ### After Long Break (7+ days)
371
- ```
372
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
373
- 🚀 Welcome Back!
374
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
375
-
376
- Last session: 8 days ago
377
-
378
- Since then:
379
- • 12 stories completed
380
- • 45 commits
381
- • 3 new epics added
382
-
383
- Consider running /agileflow:session:status for full overview
384
-
385
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+ Run /agileflow:session:new to create a new parallel workspace.
386
85
  ```
387
86
 
388
87
  ## Related Commands
389
88
 
390
- | Command | Purpose |
391
- |---------|---------|
392
- | `/agileflow:session:init` | One-time setup of session harness |
393
- | `/agileflow:session:status` | View current session state and activity |
394
- | `/agileflow:session:end` | Cleanly end session and record summary |
395
- | `/agileflow:session:history` | View past session history and metrics |
396
-
397
- ## Error Handling
398
-
399
- ### Init Script Fails
400
- ```
401
- ⚠️ Environment initialization failed
402
-
403
- Error: npm ci exited with code 1
404
-
405
- Output:
406
- npm ERR! ENOLOCK: no package-lock.json found
407
-
408
- Options:
409
- 1. Fix issue and retry
410
- 2. Continue without running init
411
- 3. Exit and investigate
412
-
413
- Choice [1/2/3]: _
414
- ```
415
-
416
- ### Tests Fail
417
- ```
418
- ❌ Tests Failed
419
-
420
- Command: npm test
421
- Exit Code: 1
422
- Failed: 2/42 tests
423
-
424
- Options:
425
- 1. View failed test output
426
- 2. Continue with failing tests (mark in session state)
427
- 3. Exit to fix tests first
428
-
429
- Choice [1/2/3]: _
430
- ```
431
-
432
- ### Git Issues
433
- ```
434
- ⚠️ Git status check failed
435
-
436
- This might indicate:
437
- • Not in a git repository
438
- • Git not installed
439
- • Repository corruption
440
-
441
- Continuing without git context...
442
- ```
443
-
444
- ### Status.json Corrupted
445
- ```
446
- ❌ Cannot read status.json
447
-
448
- File appears corrupted or invalid JSON.
449
-
450
- Backup exists at: docs/09-agents/status.json.backup
451
-
452
- Options:
453
- 1. Restore from backup
454
- 2. Continue with empty status
455
- 3. Exit and fix manually
456
-
457
- Choice [1/2/3]: _
458
- ```
459
-
460
- ## Integration Points
461
-
462
- ### Called By
463
- - SessionStart hook (if configured)
464
- - User manually via `/agileflow:session:resume`
465
-
466
- ### Calls
467
- - `/agileflow:verify` - Test verification
468
- - Init script (`docs/00-meta/init.sh`)
469
-
470
- ### Reads
471
- - `docs/00-meta/environment.json` - Configuration
472
- - `docs/09-agents/session-state.json` - Session history
473
- - `docs/09-agents/status.json` - Current story status
474
- - Git log and status - Recent activity
475
-
476
- ### Updates
477
- - `docs/09-agents/session-state.json` - Current session metadata
478
-
479
- ## Implementation Notes
480
-
481
- 1. **Fast Execution**: Optimize for quick startup (<5 seconds typical)
482
- 2. **Graceful Degradation**: Works even if parts fail
483
- 3. **Clear Output**: Visual hierarchy with clear sections
484
- 4. **Actionable**: Always end with clear next steps
485
- 5. **Context-Rich**: Provide all info needed to resume work
486
- 6. **Non-Blocking**: Don't wait for user input unless critical
487
- 7. **Silent Option**: Support quiet mode for hook usage
89
+ - `/agileflow:session:new` - Create new session
90
+ - `/agileflow:session:status` - Quick status view
91
+ - `/agileflow:session:end` - End current session