agileflow 2.91.0 → 2.92.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -6
  3. package/lib/README.md +178 -0
  4. package/lib/codebase-indexer.js +32 -23
  5. package/lib/colors.js +190 -12
  6. package/lib/consent.js +232 -0
  7. package/lib/correlation.js +277 -0
  8. package/lib/error-codes.js +46 -0
  9. package/lib/errors.js +48 -6
  10. package/lib/file-cache.js +182 -0
  11. package/lib/format-error.js +156 -0
  12. package/lib/path-resolver.js +155 -7
  13. package/lib/paths.js +212 -20
  14. package/lib/placeholder-registry.js +205 -0
  15. package/lib/registry-di.js +358 -0
  16. package/lib/result-schema.js +363 -0
  17. package/lib/result.js +210 -0
  18. package/lib/session-registry.js +13 -0
  19. package/lib/session-state-machine.js +465 -0
  20. package/lib/validate-commands.js +308 -0
  21. package/lib/validate.js +116 -52
  22. package/package.json +1 -1
  23. package/scripts/af +34 -0
  24. package/scripts/agent-loop.js +63 -9
  25. package/scripts/agileflow-configure.js +2 -2
  26. package/scripts/agileflow-welcome.js +491 -23
  27. package/scripts/archive-completed-stories.sh +57 -11
  28. package/scripts/claude-tmux.sh +102 -0
  29. package/scripts/damage-control-bash.js +3 -70
  30. package/scripts/damage-control-edit.js +3 -20
  31. package/scripts/damage-control-write.js +3 -20
  32. package/scripts/dependency-check.js +310 -0
  33. package/scripts/get-env.js +11 -4
  34. package/scripts/lib/configure-detect.js +23 -1
  35. package/scripts/lib/configure-features.js +50 -2
  36. package/scripts/lib/context-formatter.js +771 -0
  37. package/scripts/lib/context-loader.js +699 -0
  38. package/scripts/lib/damage-control-utils.js +107 -0
  39. package/scripts/lib/json-utils.sh +162 -0
  40. package/scripts/lib/state-migrator.js +353 -0
  41. package/scripts/lib/story-state-machine.js +437 -0
  42. package/scripts/obtain-context.js +80 -1248
  43. package/scripts/pre-push-check.sh +46 -0
  44. package/scripts/precompact-context.sh +23 -10
  45. package/scripts/query-codebase.js +127 -14
  46. package/scripts/ralph-loop.js +5 -5
  47. package/scripts/session-manager.js +408 -55
  48. package/scripts/spawn-parallel.js +666 -0
  49. package/scripts/tui/blessed/data/watcher.js +20 -15
  50. package/scripts/tui/blessed/index.js +2 -2
  51. package/scripts/tui/blessed/panels/output.js +14 -8
  52. package/scripts/tui/blessed/panels/sessions.js +22 -15
  53. package/scripts/tui/blessed/panels/trace.js +14 -8
  54. package/scripts/tui/blessed/ui/help.js +3 -3
  55. package/scripts/tui/blessed/ui/screen.js +4 -4
  56. package/scripts/tui/blessed/ui/statusbar.js +5 -9
  57. package/scripts/tui/blessed/ui/tabbar.js +11 -11
  58. package/scripts/validators/component-validator.js +41 -14
  59. package/scripts/validators/json-schema-validator.js +11 -4
  60. package/scripts/validators/markdown-validator.js +1 -2
  61. package/scripts/validators/migration-validator.js +17 -5
  62. package/scripts/validators/security-validator.js +137 -33
  63. package/scripts/validators/story-format-validator.js +31 -10
  64. package/scripts/validators/test-result-validator.js +19 -4
  65. package/scripts/validators/workflow-validator.js +12 -5
  66. package/src/core/agents/codebase-query.md +24 -0
  67. package/src/core/commands/adr.md +114 -0
  68. package/src/core/commands/agent.md +120 -0
  69. package/src/core/commands/assign.md +145 -0
  70. package/src/core/commands/babysit.md +32 -5
  71. package/src/core/commands/changelog.md +118 -0
  72. package/src/core/commands/configure.md +42 -6
  73. package/src/core/commands/diagnose.md +114 -0
  74. package/src/core/commands/epic.md +113 -0
  75. package/src/core/commands/handoff.md +128 -0
  76. package/src/core/commands/help.md +75 -0
  77. package/src/core/commands/pr.md +96 -0
  78. package/src/core/commands/roadmap/analyze.md +400 -0
  79. package/src/core/commands/session/new.md +132 -6
  80. package/src/core/commands/session/spawn.md +197 -0
  81. package/src/core/commands/sprint.md +22 -0
  82. package/src/core/commands/status.md +74 -0
  83. package/src/core/commands/story.md +143 -4
  84. package/src/core/templates/agileflow-metadata.json +55 -2
  85. package/src/core/templates/plan-template.md +125 -0
  86. package/src/core/templates/story-lifecycle.md +213 -0
  87. package/src/core/templates/story-template.md +4 -0
  88. package/src/core/templates/tdd-test-template.js +241 -0
  89. package/tools/cli/commands/setup.js +95 -0
  90. package/tools/cli/installers/core/installer.js +94 -0
  91. package/tools/cli/installers/ide/_base-ide.js +20 -11
  92. package/tools/cli/installers/ide/codex.js +29 -47
  93. package/tools/cli/installers/ide/windsurf.js +1 -1
  94. package/tools/cli/lib/config-manager.js +17 -2
  95. package/tools/cli/lib/content-transformer.js +271 -0
  96. package/tools/cli/lib/error-handler.js +14 -22
  97. package/tools/cli/lib/ide-error-factory.js +421 -0
  98. package/tools/cli/lib/ide-health-monitor.js +364 -0
  99. package/tools/cli/lib/ide-registry.js +113 -2
  100. package/tools/cli/lib/ui.js +15 -25
@@ -124,3 +124,123 @@ ACTIONS
124
124
  3) Print a persona snippet to paste as that terminal's system prompt.
125
125
 
126
126
  Diff-first; YES/NO.
127
+
128
+ ---
129
+
130
+ ## Expected Output
131
+
132
+ ### Successful Agent Onboarding
133
+
134
+ ```
135
+ 📋 Onboarding New Agent: AG-UI
136
+
137
+ AGENT_ID: AG-UI
138
+ ROLE: Frontend Developer
139
+ TOOLS: Read, Write, Edit, Bash, Glob
140
+ SCOPE:
141
+ - Directories: src/components/, src/pages/
142
+ - Story Tags: frontend, ui, ux
143
+
144
+ Files to create:
145
+ ───────────────────────────────────────────────
146
+ 1. docs/02-practices/prompts/agents/agent-AG-UI.md
147
+
148
+ Preview:
149
+ ─────────────────────────────────────────────
150
+ ---
151
+ agent_id: AG-UI
152
+ role: Frontend Developer
153
+ tools: [Read, Write, Edit, Bash, Glob]
154
+ scope:
155
+ directories: [src/components/, src/pages/]
156
+ story_tags: [frontend, ui, ux]
157
+ ---
158
+
159
+ # AG-UI: Frontend Developer Agent
160
+
161
+ ## Responsibilities
162
+ Build and maintain user interface components, pages, and styling.
163
+
164
+ ## System Prompt (Contract)
165
+ **Scope**: Only modify files in src/components/ and src/pages/
166
+ **Testing**: Run `npm test` before committing
167
+ **Commits**: Prefix with "feat(ui):" or "fix(ui):"
168
+ **Status**: Update status.json after completing stories
169
+ ─────────────────────────────────────────────
170
+
171
+ 2. docs/09-agents/roster.yaml (update)
172
+
173
+ + agents:
174
+ + - id: AG-UI
175
+ + role: Frontend Developer
176
+ + tools: [Read, Write, Edit, Bash, Glob]
177
+ + scope:
178
+ + directories: [src/components/, src/pages/]
179
+ + story_tags: [frontend, ui, ux]
180
+
181
+ [AskUserQuestion: "Create this agent profile?"]
182
+
183
+ ✅ Agent onboarded successfully!
184
+ Profile: docs/02-practices/prompts/agents/agent-AG-UI.md
185
+ Roster: docs/09-agents/roster.yaml updated
186
+
187
+ 📝 System Prompt Snippet (paste into terminal):
188
+
189
+ You are AG-UI, a Frontend Developer agent.
190
+ Your scope is limited to: src/components/, src/pages/
191
+ You work on stories tagged: frontend, ui, ux
192
+ Always run tests before committing.
193
+ Always update status.json after completing work.
194
+ ```
195
+
196
+ ### Missing Required Inputs
197
+
198
+ ```
199
+ ❌ Missing required inputs
200
+
201
+ Please provide:
202
+ â€ĸ AGENT_ID - Agent identifier (e.g., AG-UI, AG-API)
203
+ â€ĸ ROLE - Agent role description (e.g., "Frontend Developer")
204
+
205
+ Optional:
206
+ â€ĸ TOOLS - Available tools (default: Read, Write, Edit, Bash, Glob)
207
+ â€ĸ SCOPE - Directories and story tags
208
+
209
+ Usage:
210
+ /agileflow:agent AGENT_ID=AG-UI ROLE="Frontend Developer" TOOLS="Read,Write,Edit,Bash,Glob" SCOPE="src/components/,frontend"
211
+ ```
212
+
213
+ ### Agent Already Exists
214
+
215
+ ```
216
+ âš ī¸ Agent already exists: AG-UI
217
+
218
+ Existing agent profile: docs/02-practices/prompts/agents/agent-AG-UI.md
219
+
220
+ Options:
221
+ 1. Update existing agent profile
222
+ 2. Create new agent with different ID
223
+ 3. Cancel
224
+
225
+ [AskUserQuestion: "How to proceed?"]
226
+ ```
227
+
228
+ ### Roster File Created
229
+
230
+ ```
231
+ 📋 Onboarding New Agent: AG-API
232
+
233
+ Note: docs/09-agents/roster.yaml does not exist.
234
+ Creating new roster file.
235
+
236
+ Files to create:
237
+ ───────────────────────────────────────────────
238
+ 1. docs/02-practices/prompts/agents/agent-AG-API.md
239
+ 2. docs/09-agents/roster.yaml (NEW)
240
+
241
+ [AskUserQuestion: "Create agent profile and roster?"]
242
+
243
+ ✅ Agent onboarded successfully!
244
+ Profile: docs/02-practices/prompts/agents/agent-AG-API.md
245
+ Roster: docs/09-agents/roster.yaml created
246
+ ```
@@ -212,3 +212,148 @@ ACTIONS
212
212
  **JSON Safety**: Always use jq or Edit tool (never echo/cat > status.json). Validate after modifications.
213
213
 
214
214
  Preview changes; YES/NO.
215
+
216
+ ---
217
+
218
+ ## Expected Output
219
+
220
+ ### Successful Assignment
221
+
222
+ ```
223
+ 📋 Assigning Story: US-0042
224
+
225
+ Current state:
226
+ Owner: unassigned
227
+ Status: ready
228
+
229
+ New assignment:
230
+ Owner: AG-UI
231
+ Status: in-progress
232
+
233
+ Files to update:
234
+ ───────────────────────────────────────────────
235
+ 1. docs/06-stories/EP-0010/US-0042-login-form.md
236
+
237
+ Frontmatter changes:
238
+ -owner: unassigned
239
+ +owner: AG-UI
240
+ -status: ready
241
+ +status: in-progress
242
+ +updated: 2026-01-21T14:30:00Z
243
+
244
+ 2. docs/09-agents/status.json
245
+
246
+ "US-0042": {
247
+ -"owner": "unassigned",
248
+ +"owner": "AG-UI",
249
+ -"status": "ready",
250
+ +"status": "in-progress",
251
+ +"last_update": "2026-01-21T14:30:00Z"
252
+ }
253
+
254
+ 3. docs/09-agents/bus/log.jsonl (append)
255
+
256
+ + {"ts":"2026-01-21T14:30:00Z","type":"assign","from":"SYSTEM","to":"AG-UI","story":"US-0042","status":"in-progress"}
257
+
258
+ [AskUserQuestion: "Assign US-0042 to AG-UI as in-progress?"]
259
+
260
+ ✅ Assignment complete!
261
+ Story: US-0042
262
+ New owner: AG-UI
263
+ Status: in-progress
264
+ Bus message sent: assign → AG-UI
265
+ ```
266
+
267
+ ### Story Not Found
268
+
269
+ ```
270
+ ❌ Story not found: US-9999
271
+
272
+ Searched:
273
+ - docs/06-stories/**/US-9999*.md
274
+ - docs/09-agents/status.json
275
+
276
+ Available stories:
277
+ - US-0042: Login form (ready)
278
+ - US-0043: Profile page (ready)
279
+ - US-0044: Dashboard (in-progress)
280
+
281
+ Usage:
282
+ /agileflow:assign STORY=US-0042 NEW_OWNER=AG-UI
283
+ ```
284
+
285
+ ### WIP Limit Warning
286
+
287
+ ```
288
+ âš ī¸ WIP Limit Warning
289
+
290
+ AG-UI currently has 2 stories in-progress:
291
+ - US-0038: OAuth flow (in-progress, 3 days)
292
+ - US-0041: Session management (in-progress, 1 day)
293
+
294
+ Assigning US-0042 would exceed WIP limit (max 2 per agent).
295
+
296
+ Options:
297
+ 1. Complete US-0038 or US-0041 first
298
+ 2. Reassign one story to another agent
299
+ 3. Proceed anyway (override WIP limit)
300
+
301
+ [AskUserQuestion: "How to proceed?"]
302
+ - Complete existing story first (Recommended)
303
+ - Assign to different agent
304
+ - Proceed (override WIP limit)
305
+ ```
306
+
307
+ ### Invalid Status Transition
308
+
309
+ ```
310
+ ❌ Invalid status transition
311
+
312
+ Story: US-0042
313
+ Current status: done
314
+ Requested status: in-progress
315
+
316
+ Cannot transition from 'done' to 'in-progress'.
317
+
318
+ Valid transitions from 'done':
319
+ - No valid transitions (story is complete)
320
+
321
+ To reopen this story:
322
+ 1. Create a new story for follow-up work
323
+ 2. Or use /agileflow:status STORY=US-0042 STATUS=ready FORCE=yes
324
+ ```
325
+
326
+ ### Reassignment (Owner Change)
327
+
328
+ ```
329
+ 📋 Reassigning Story: US-0042
330
+
331
+ Current owner: AG-API
332
+ New owner: AG-UI
333
+ Status: in-progress (unchanged)
334
+
335
+ Reason: "Frontend specialist needed for UI work"
336
+
337
+ Files to update:
338
+ ───────────────────────────────────────────────
339
+ 1. docs/06-stories/EP-0010/US-0042-login-form.md
340
+ -owner: AG-API
341
+ +owner: AG-UI
342
+
343
+ 2. docs/09-agents/status.json
344
+ "US-0042": {
345
+ -"owner": "AG-API",
346
+ +"owner": "AG-UI",
347
+ }
348
+
349
+ 3. docs/09-agents/bus/log.jsonl (append)
350
+ + {"type":"reassign","from":"AG-API","to":"AG-UI","story":"US-0042","text":"Frontend specialist needed"}
351
+
352
+ [AskUserQuestion: "Reassign US-0042 from AG-API to AG-UI?"]
353
+
354
+ ✅ Reassignment complete!
355
+ Story: US-0042
356
+ Previous owner: AG-API
357
+ New owner: AG-UI
358
+ Notification sent to both agents
359
+ ```
@@ -217,9 +217,26 @@ node scripts/ralph-loop.js --reset # Reset loop state
217
217
 
218
218
  <!-- COMPACT_SUMMARY_START -->
219
219
 
220
- ## âš ī¸ COMPACT SUMMARY - /agileflow:babysit IS ACTIVE
220
+ ## 🛑 STOP - READ THIS FIRST - MANDATORY INSTRUCTIONS
221
+
222
+ **THIS IS NOT OPTIONAL.** You are currently running `/agileflow:babysit`. These are binding instructions that OVERRIDE your default behavior. Failure to follow these rules breaks the user's workflow.
223
+
224
+ ---
225
+
226
+ ## ⚡ IMMEDIATE ACTION REQUIRED
227
+
228
+ **YOUR VERY NEXT RESPONSE MUST END WITH THE `AskUserQuestion` TOOL.**
229
+
230
+ This is not a suggestion. This is a requirement. After reading this context, you will:
231
+ 1. Process the user's message
232
+ 2. Do your work (read files, spawn agents, etc.)
233
+ 3. **CALL THE AskUserQuestion TOOL** - not text like "What next?" but the ACTUAL TOOL
234
+
235
+ If you end your response without calling AskUserQuestion, you have violated these instructions.
236
+
237
+ ---
221
238
 
222
- **CRITICAL**: You are running `/agileflow:babysit`. This defines your behavior. Follow these rules EXACTLY.
239
+ ## âš ī¸ COMPACT SUMMARY - /agileflow:babysit IS ACTIVE
223
240
 
224
241
  **ROLE**: Mentor that delegates to domain experts. You coordinate, experts implement.
225
242
 
@@ -425,9 +442,6 @@ Present top 3-5 via AskUserQuestion, always include "Other" option.
425
442
  ### REMEMBER AFTER COMPACTION
426
443
 
427
444
  - `/agileflow:babysit` IS ACTIVE - follow these rules
428
- - **🔔 AskUserQuestion AFTER EVERY RESPONSE** - especially after task completion!
429
- - Don't say "Done!" and stop - call AskUserQuestion with next step options
430
- - Don't leave user waiting - proactively suggest what to do next
431
445
  - Plan mode FIRST for non-trivial tasks
432
446
  - Delegate complex work to experts
433
447
  - If stuck 2+ times → research prompt
@@ -437,6 +451,19 @@ Present top 3-5 via AskUserQuestion, always include "Other" option.
437
451
  2. AFTER user selects: `node .agileflow/scripts/lib/story-claiming.js claim <id>`
438
452
  3. WHEN done: `node .agileflow/scripts/lib/story-claiming.js release <id>`
439
453
 
454
+ ---
455
+
456
+ ## 🛑 FINAL ACTION REQUIRED - DO NOT SKIP
457
+
458
+ **BEFORE SENDING YOUR RESPONSE, YOU MUST:**
459
+
460
+ Call the `AskUserQuestion` tool with relevant options for the user's next steps.
461
+
462
+ **DO NOT** end with text like "What would you like to do?" or "Let me know!"
463
+ **DO** call the actual AskUserQuestion tool.
464
+
465
+ If you fail to do this, you have broken the /agileflow:babysit contract.
466
+
440
467
  <!-- COMPACT_SUMMARY_END -->
441
468
 
442
469
  ---
@@ -433,3 +433,121 @@ OUTPUT
433
433
  - Changelog entry preview
434
434
  - Updated CHANGELOG.md (if approved)
435
435
  - Optional: Git tag and release creation
436
+
437
+ ---
438
+
439
+ ## Expected Output
440
+
441
+ ### Successful Changelog Generation
442
+
443
+ ```
444
+ 📋 Generating Changelog
445
+
446
+ Detecting version...
447
+ ✅ Current version: v2.4.0
448
+ ✅ Last release: v2.4.0 (2026-01-15)
449
+
450
+ Collecting changes since v2.4.0...
451
+ Found: 12 commits, 8 PRs merged
452
+
453
+ Categorizing changes...
454
+ ───────────────────────────────────────────────
455
+ ### Added
456
+ - OAuth2 authentication support for Google and GitHub providers (#123)
457
+ - Dark mode toggle in user preferences (#137)
458
+ - User profile settings page with avatar upload (#135)
459
+
460
+ ### Changed
461
+ - âš ī¸ **BREAKING**: Redesigned API endpoints to RESTful structure (#126)
462
+ See migration guide at docs/migration-v2.md
463
+ - Improved user query performance by 50% with database indexing (#125)
464
+
465
+ ### Fixed
466
+ - Crash when user object is null in login endpoint (#124)
467
+ - Memory leak in WebSocket connection handler (#139)
468
+ - Incorrect timezone display in activity logs (#140)
469
+
470
+ ### Security
471
+ - Patched XSS vulnerability in comment rendering (#131)
472
+ ───────────────────────────────────────────────
473
+
474
+ 📊 Change Summary:
475
+ - Added: 3
476
+ - Changed: 2 (1 breaking)
477
+ - Fixed: 3
478
+ - Security: 1
479
+
480
+ 💡 Suggested version: 2.5.0 (MAJOR due to breaking change)
481
+
482
+ [AskUserQuestion: "Update CHANGELOG.md with these changes?"]
483
+
484
+ ✅ CHANGELOG.md updated
485
+ ✅ Commit created: "chore(release): update CHANGELOG for v2.5.0"
486
+
487
+ Next steps:
488
+ 1. Create git tag: git tag -a v2.5.0 -m "Release v2.5.0"
489
+ 2. Create GitHub release: gh release create v2.5.0 --generate-notes
490
+ ```
491
+
492
+ ### No Changes Detected
493
+
494
+ ```
495
+ 📋 Generating Changelog
496
+
497
+ Detecting version...
498
+ ✅ Current version: v2.4.0
499
+ ✅ Last release: v2.4.0 (2026-01-15)
500
+
501
+ Collecting changes since v2.4.0...
502
+ Found: 0 commits
503
+
504
+ â„šī¸ No changes detected since v2.4.0
505
+
506
+ Nothing to add to changelog.
507
+ ```
508
+
509
+ ### Unclear Commits (Manual Categorization)
510
+
511
+ ```
512
+ 📋 Generating Changelog
513
+
514
+ Found 3 commits that need manual categorization:
515
+
516
+ Unclear commits:
517
+ 1. "update stuff" (abc1234)
518
+ 2. "fix things" (def5678)
519
+ 3. "misc changes" (ghi9012)
520
+
521
+ [AskUserQuestion: "How should 'update stuff' be categorized?"]
522
+ - Added (new feature)
523
+ - Changed (modification)
524
+ - Fixed (bug fix)
525
+ - Skip (don't include)
526
+
527
+ User selected: Changed
528
+
529
+ [Continuing with remaining commits...]
530
+ ```
531
+
532
+ ### Version Suggestion
533
+
534
+ ```
535
+ 📊 Version Analysis
536
+
537
+ Changes detected:
538
+ - 3 Added (feat:)
539
+ - 5 Fixed (fix:)
540
+ - 1 BREAKING (feat!:)
541
+
542
+ Version calculation:
543
+ Current: 1.5.2
544
+ Breaking change detected → Major bump required
545
+
546
+ 💡 Suggested: 2.0.0 (MAJOR - breaking change)
547
+
548
+ [AskUserQuestion: "Accept version 2.0.0?"]
549
+ - Yes, use 2.0.0 (Recommended)
550
+ - Use minor: 1.6.0
551
+ - Use patch: 1.5.3
552
+ - Enter custom version
553
+ ```
@@ -51,6 +51,7 @@ node .agileflow/scripts/agileflow-configure.js --profile=full # Enable all
51
51
  node .agileflow/scripts/agileflow-configure.js --migrate # Fix format
52
52
  node .agileflow/scripts/agileflow-configure.js --upgrade # Update scripts
53
53
  node .agileflow/scripts/agileflow-configure.js --repair # Restore missing
54
+ node .agileflow/scripts/agileflow-configure.js --new-options # Check for new options
54
55
  ```
55
56
 
56
57
  ### Critical Rules
@@ -170,8 +171,8 @@ After handling issues (or if none), present the main category menu:
170
171
  "header": "Preset",
171
172
  "multiSelect": false,
172
173
  "options": [
173
- {"label": "Full (Recommended)", "description": "All features: hooks, archival, status line, AskUserQuestion"},
174
- {"label": "Basic", "description": "SessionStart + PreCompact + Archival + AskUserQuestion"},
174
+ {"label": "Full (Recommended)", "description": "All features: hooks, archival, status line, AskUserQuestion, TmuxAutoSpawn"},
175
+ {"label": "Basic", "description": "SessionStart + PreCompact + Archival + AskUserQuestion + TmuxAutoSpawn"},
175
176
  {"label": "Minimal", "description": "SessionStart + Archival only"},
176
177
  {"label": "None", "description": "Disable all AgileFlow features"}
177
178
  ]
@@ -313,7 +314,8 @@ Then ask about other features:
313
314
  {"label": "Archival", "description": "Auto-archive completed stories older than threshold"},
314
315
  {"label": "Status Line", "description": "Custom status bar showing story/epic info"},
315
316
  {"label": "Auto-Update", "description": "Automatically update AgileFlow on session start"},
316
- {"label": "AskUserQuestion Mode", "description": "End responses with guided options"}
317
+ {"label": "AskUserQuestion Mode", "description": "End responses with guided options"},
318
+ {"label": "Tmux Auto-Spawn", "description": "Auto-start Claude in tmux session when using af/agileflow wrapper"}
317
319
  ]
318
320
  }]</parameter>
319
321
  </invoke>
@@ -328,6 +330,7 @@ Map selections to commands:
328
330
  - Status Line → `statusline`
329
331
  - Auto-Update → `autoupdate`
330
332
  - AskUserQuestion Mode → `askuserquestion`
333
+ - Tmux Auto-Spawn → `tmuxautospawn`
331
334
 
332
335
  Then run:
333
336
  ```bash
@@ -379,20 +382,49 @@ Task({ subagent_type: "configuration-ci", description: "Configure CI/CD", prompt
379
382
  "header": "Maintenance",
380
383
  "multiSelect": false,
381
384
  "options": [
385
+ {"label": "Apply new options", "description": "Enable newly available configuration options"},
382
386
  {"label": "Fix format issues", "description": "Migrate invalid settings to correct format"},
383
387
  {"label": "Upgrade scripts", "description": "Update features to latest AgileFlow version"},
384
- {"label": "Repair missing scripts", "description": "Restore accidentally deleted scripts"},
385
- {"label": "Check status", "description": "View current configuration (already shown above)"}
388
+ {"label": "Repair missing scripts", "description": "Restore accidentally deleted scripts"}
386
389
  ]
387
390
  }]</parameter>
388
391
  </invoke>
389
392
  ```
390
393
 
391
394
  Then run:
395
+ - "Apply new options" → Show available new options and apply selected ones (see below)
392
396
  - "Fix format issues" → `node .agileflow/scripts/agileflow-configure.js --migrate`
393
397
  - "Upgrade scripts" → `node .agileflow/scripts/agileflow-configure.js --upgrade`
394
398
  - "Repair missing scripts" → `node .agileflow/scripts/agileflow-configure.js --repair`
395
- - "Check status" → Already shown in Step 1, no action needed
399
+
400
+ #### If "Apply new options" selected
401
+
402
+ Check for unconfigured options:
403
+ ```bash
404
+ node .agileflow/scripts/agileflow-configure.js --new-options
405
+ ```
406
+
407
+ If new options found, present them:
408
+ ```xml
409
+ <invoke name="AskUserQuestion">
410
+ <parameter name="questions">[{
411
+ "question": "Which new options do you want to enable?",
412
+ "header": "New Options",
413
+ "multiSelect": true,
414
+ "options": [
415
+ {"label": "CLAUDE.md reinforcement", "description": "Add /babysit context preservation rules to CLAUDE.md"},
416
+ {"label": "Skip for now", "description": "Don't enable any new options"}
417
+ ]
418
+ }]</parameter>
419
+ </invoke>
420
+ ```
421
+
422
+ Then apply selected options:
423
+ ```bash
424
+ node .agileflow/scripts/agileflow-configure.js --apply-option=claudeMdReinforcement
425
+ ```
426
+
427
+ If no new options: "✅ All configuration options are up to date!"
396
428
 
397
429
  ---
398
430
 
@@ -437,6 +469,10 @@ node .agileflow/scripts/agileflow-configure.js --upgrade
437
469
  node .agileflow/scripts/agileflow-configure.js --repair
438
470
  node .agileflow/scripts/agileflow-configure.js --list-scripts
439
471
  node .agileflow/scripts/agileflow-configure.js --version
472
+
473
+ # New config options
474
+ node .agileflow/scripts/agileflow-configure.js --new-options # List unconfigured options
475
+ node .agileflow/scripts/agileflow-configure.js --apply-option=optionName # Apply specific option
440
476
  ```
441
477
 
442
478
  ## Custom Profiles
@@ -277,3 +277,117 @@ fi
277
277
  - Display file sizes and story counts
278
278
  - Provide actionable recommendations for issues
279
279
  - Exit with code 0 if healthy, code 1 if issues found
280
+
281
+ ---
282
+
283
+ ## Expected Output
284
+
285
+ ### Healthy System
286
+
287
+ ```
288
+ 🔍 AgileFlow System Diagnostics
289
+ ================================
290
+
291
+ 📋 JSON File Validation
292
+ ----------------------
293
+ ✅ docs/00-meta/agileflow-metadata.json (2KB)
294
+ ✅ docs/09-agents/status.json (45KB)
295
+ â„šī¸ docs/09-agents/status-archive.json - not found (optional)
296
+ ✅ .claude/settings.json (8KB)
297
+
298
+ đŸ“Ļ Auto-Archival System
299
+ ----------------------
300
+ ✅ Archive script exists and is executable
301
+ ✅ Auto-archival hook configured
302
+ ✅ Archival threshold: 7 days
303
+
304
+ đŸĒ Hooks System
305
+ ---------------
306
+ ✅ .claude/settings.json is valid JSON
307
+ â„šī¸ SessionStart hooks: 3
308
+ â„šī¸ UserPromptSubmit hooks: 1
309
+ â„šī¸ Stop hooks: 0
310
+
311
+ 📏 File Size Analysis
312
+ ---------------------
313
+ status.json: 45KB (127 stories)
314
+ ✅ status.json size is healthy
315
+
316
+ 📊 Diagnostic Summary
317
+ =====================
318
+ ✅ All checks passed! System is healthy.
319
+ ```
320
+
321
+ ### System with Issues
322
+
323
+ ```
324
+ 🔍 AgileFlow System Diagnostics
325
+ ================================
326
+
327
+ 📋 JSON File Validation
328
+ ----------------------
329
+ ✅ docs/00-meta/agileflow-metadata.json (2KB)
330
+ ✅ docs/09-agents/status.json (156KB)
331
+ âš ī¸ WARNING: status.json is large (156KB). Consider running archival.
332
+ â„šī¸ docs/09-agents/status-archive.json - not found (optional)
333
+ ❌ .claude/settings.json - INVALID JSON
334
+ Error details:
335
+ parse error: Invalid numeric literal at line 42, column 15
336
+
337
+ đŸ“Ļ Auto-Archival System
338
+ ----------------------
339
+ âš ī¸ Archive script exists but is NOT executable
340
+ Fix: chmod +x scripts/archive-completed-stories.sh
341
+
342
+ đŸĒ Hooks System
343
+ ---------------
344
+ ❌ .claude/settings.json is INVALID JSON
345
+
346
+ 📏 File Size Analysis
347
+ ---------------------
348
+ status.json: 156KB (423 stories)
349
+ âš ī¸ WARNING: status.json exceeds 100KB
350
+ Recommendation: Run archival to reduce file size
351
+ Command: bash .agileflow/scripts/archive-completed-stories.sh 7
352
+
353
+ 📊 Diagnostic Summary
354
+ =====================
355
+ âš ī¸ Found 4 issue(s) that need attention.
356
+
357
+ Next steps:
358
+ 1. Fix JSON validation errors using: jq empty <file> to check, then repair manually
359
+ 2. Make archive script executable: chmod +x scripts/archive-completed-stories.sh
360
+ 3. Run archival: bash .agileflow/scripts/archive-completed-stories.sh
361
+ 4. Re-run diagnostics: /agileflow:diagnose
362
+ ```
363
+
364
+ ### Missing Critical Files
365
+
366
+ ```
367
+ 🔍 AgileFlow System Diagnostics
368
+ ================================
369
+
370
+ 📋 JSON File Validation
371
+ ----------------------
372
+ ❌ docs/00-meta/agileflow-metadata.json - NOT FOUND (CRITICAL)
373
+ ❌ docs/09-agents/status.json - NOT FOUND (CRITICAL)
374
+ â„šī¸ docs/09-agents/status-archive.json - not found (optional)
375
+ â„šī¸ .claude/settings.json - not found (optional)
376
+
377
+ đŸ“Ļ Auto-Archival System
378
+ ----------------------
379
+ ❌ Archive script NOT found (scripts/archive-completed-stories.sh)
380
+
381
+ đŸĒ Hooks System
382
+ ---------------
383
+ âš ī¸ Hooks system not configured
384
+
385
+ 📊 Diagnostic Summary
386
+ =====================
387
+ âš ī¸ Found 4 issue(s) that need attention.
388
+
389
+ Next steps:
390
+ 1. Run AgileFlow setup: npx agileflow setup
391
+ 2. Verify installation completed successfully
392
+ 3. Re-run diagnostics: /agileflow:diagnose
393
+ ```