agileflow 2.94.1 โ†’ 2.95.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 (74) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +3 -3
  3. package/lib/colors.generated.js +117 -0
  4. package/lib/colors.js +59 -109
  5. package/lib/generator-factory.js +333 -0
  6. package/lib/path-utils.js +49 -0
  7. package/lib/session-registry.js +25 -15
  8. package/lib/smart-json-file.js +40 -32
  9. package/lib/state-machine.js +286 -0
  10. package/package.json +1 -1
  11. package/scripts/agileflow-configure.js +7 -6
  12. package/scripts/archive-completed-stories.sh +86 -11
  13. package/scripts/babysit-context-restore.js +89 -0
  14. package/scripts/claude-tmux.sh +111 -5
  15. package/scripts/damage-control/bash-tool-damage-control.js +11 -247
  16. package/scripts/damage-control/edit-tool-damage-control.js +9 -249
  17. package/scripts/damage-control/write-tool-damage-control.js +9 -244
  18. package/scripts/generate-colors.js +314 -0
  19. package/scripts/lib/colors.generated.sh +82 -0
  20. package/scripts/lib/colors.sh +10 -70
  21. package/scripts/lib/configure-features.js +401 -0
  22. package/scripts/lib/context-loader.js +181 -52
  23. package/scripts/precompact-context.sh +54 -17
  24. package/scripts/session-coordinator.sh +2 -2
  25. package/scripts/session-manager.js +653 -10
  26. package/src/core/commands/audit.md +93 -0
  27. package/src/core/commands/auto.md +73 -0
  28. package/src/core/commands/babysit.md +169 -13
  29. package/src/core/commands/baseline.md +73 -0
  30. package/src/core/commands/batch.md +64 -0
  31. package/src/core/commands/blockers.md +60 -0
  32. package/src/core/commands/board.md +66 -0
  33. package/src/core/commands/choose.md +77 -0
  34. package/src/core/commands/ci.md +77 -0
  35. package/src/core/commands/compress.md +27 -1
  36. package/src/core/commands/configure.md +126 -10
  37. package/src/core/commands/council.md +74 -0
  38. package/src/core/commands/debt.md +72 -0
  39. package/src/core/commands/deploy.md +73 -0
  40. package/src/core/commands/deps.md +68 -0
  41. package/src/core/commands/docs.md +60 -0
  42. package/src/core/commands/feedback.md +68 -0
  43. package/src/core/commands/ideate.md +74 -0
  44. package/src/core/commands/impact.md +74 -0
  45. package/src/core/commands/install.md +529 -0
  46. package/src/core/commands/maintain.md +558 -0
  47. package/src/core/commands/metrics.md +75 -0
  48. package/src/core/commands/multi-expert.md +74 -0
  49. package/src/core/commands/packages.md +69 -0
  50. package/src/core/commands/readme-sync.md +64 -0
  51. package/src/core/commands/research/analyze.md +285 -121
  52. package/src/core/commands/research/import.md +281 -109
  53. package/src/core/commands/retro.md +76 -0
  54. package/src/core/commands/review.md +72 -0
  55. package/src/core/commands/rlm.md +83 -0
  56. package/src/core/commands/rpi.md +90 -0
  57. package/src/core/commands/session/cleanup.md +214 -12
  58. package/src/core/commands/session/end.md +155 -17
  59. package/src/core/commands/sprint.md +72 -0
  60. package/src/core/commands/story-validate.md +68 -0
  61. package/src/core/commands/template.md +69 -0
  62. package/src/core/commands/tests.md +83 -0
  63. package/src/core/commands/update.md +59 -0
  64. package/src/core/commands/validate-expertise.md +76 -0
  65. package/src/core/commands/velocity.md +74 -0
  66. package/src/core/commands/verify.md +91 -0
  67. package/src/core/commands/whats-new.md +69 -0
  68. package/src/core/commands/workflow.md +88 -0
  69. package/src/core/templates/command-documentation.md +187 -0
  70. package/tools/cli/commands/session.js +1171 -0
  71. package/tools/cli/commands/setup.js +2 -81
  72. package/tools/cli/installers/core/installer.js +0 -5
  73. package/tools/cli/installers/ide/claude-code.js +6 -0
  74. package/tools/cli/lib/config-manager.js +42 -5
@@ -0,0 +1,558 @@
1
+ ---
2
+ description: Periodic maintenance
3
+ argument-hint: (no arguments)
4
+ compact_context:
5
+ priority: high
6
+ preserve_rules:
7
+ - "No arguments required - runs full maintenance check automatically"
8
+ - "Run weekly/monthly for ongoing health monitoring"
9
+ - "Check 6 areas: updates, config, status.json health, sessions, expertise, metrics"
10
+ - "Update Check - compare installed vs npm latest version"
11
+ - "Configuration Validity - validate hooks and metadata integrity"
12
+ - "Status.json Health - check size, story count, recommend archival"
13
+ - "Session Cleanup - detect stale or orphaned sessions"
14
+ - "Expert File Staleness - check for outdated expertise files"
15
+ - "Metrics Report - show velocity, completion rates, trends"
16
+ - "Report recommendations with indicators: โœ… (healthy), โš ๏ธ (attention), โ„น๏ธ (info)"
17
+ state_fields:
18
+ - update_available
19
+ - config_valid
20
+ - status_healthy
21
+ - sessions_clean
22
+ - recommendations_count
23
+ ---
24
+
25
+ # maintain
26
+
27
+ Run periodic maintenance checks on your AgileFlow installation. Use weekly or monthly to keep your setup healthy.
28
+
29
+ ## Prompt
30
+
31
+ ROLE: Maintenance Specialist
32
+
33
+ INPUTS
34
+ (no arguments - runs full maintenance suite)
35
+
36
+ ACTIONS
37
+ 1) Check for AgileFlow updates (npm view agileflow version)
38
+ 2) Validate configuration integrity (hooks, metadata)
39
+ 3) Analyze status.json health (size, story count, archival needs)
40
+ 4) Detect stale sessions and recommend cleanup
41
+ 5) Check expertise file staleness
42
+ 6) Generate metrics and recommendations report
43
+
44
+ OBJECTIVE: Perform routine maintenance checks, identify issues requiring attention, and provide actionable recommendations to keep AgileFlow running optimally.
45
+
46
+ <!-- COMPACT_SUMMARY_START -->
47
+ ## Compact Summary
48
+
49
+ The `maintain` command runs periodic health checks for ongoing AgileFlow maintenance:
50
+
51
+ **What it checks:**
52
+ - AgileFlow version updates (npm registry)
53
+ - Configuration integrity (hooks, metadata)
54
+ - Status.json health (size, story count)
55
+ - Session cleanup needs
56
+ - Expertise file staleness
57
+ - Project metrics and velocity
58
+
59
+ **Update Check**:
60
+ - Fetches latest version from npm registry
61
+ - Compares with installed version
62
+ - Reports update availability with command
63
+ - Shows changelog highlights for new versions
64
+
65
+ **Configuration Validation**:
66
+ - Validates all JSON config files
67
+ - Checks hook configuration consistency
68
+ - Verifies metadata schema version
69
+ - Reports misconfigurations
70
+
71
+ **Status.json Health**:
72
+ - Monitors file size (warns >50KB, critical >100KB)
73
+ - Counts active stories by status
74
+ - Checks for orphaned/invalid stories
75
+ - Recommends archival when needed
76
+
77
+ **Session Cleanup**:
78
+ - Detects stale sessions (>7 days inactive)
79
+ - Finds orphaned registry entries
80
+ - Identifies uncommitted changes in sessions
81
+ - Suggests cleanup commands
82
+
83
+ **Expertise Staleness**:
84
+ - Checks last_updated dates on expertise.yaml files
85
+ - Warns for files >30 days old
86
+ - Reports missing required fields
87
+ - Suggests refresh for stale files
88
+
89
+ **Metrics Report**:
90
+ - Stories completed this week/month
91
+ - Average cycle time
92
+ - Current velocity
93
+ - WIP limit adherence
94
+
95
+ **Output Format**:
96
+ - Indicators: โœ… (healthy), โš ๏ธ (needs attention), โ„น๏ธ (informational)
97
+ - Actionable recommendations with specific commands
98
+ - Overall health score (healthy/attention needed/critical)
99
+
100
+ **Usage**:
101
+ ```bash
102
+ /agileflow:maintain
103
+ ```
104
+
105
+ **Recommended frequency**: Weekly or monthly maintenance runs.
106
+ <!-- COMPACT_SUMMARY_END -->
107
+
108
+ **Run these maintenance checks**:
109
+
110
+ ```bash
111
+ #!/bin/bash
112
+
113
+ echo "๐Ÿ”ง AgileFlow Maintenance Check"
114
+ echo "=============================="
115
+ echo ""
116
+ echo "$(date '+%Y-%m-%d %H:%M:%S')"
117
+ echo ""
118
+
119
+ RECOMMENDATIONS=0
120
+ WARNINGS=0
121
+
122
+ # Check 1: Update Availability
123
+ echo "๐Ÿ“ฆ Update Check"
124
+ echo "---------------"
125
+
126
+ # Get installed version
127
+ INSTALLED=""
128
+ if [ -f ".agileflow/config.yaml" ]; then
129
+ INSTALLED=$(grep -E "^version:" .agileflow/config.yaml 2>/dev/null | sed "s/version:[[:space:]]*['\"]*//" | sed "s/['\"]//g")
130
+ fi
131
+
132
+ if [ -z "$INSTALLED" ] && [ -f "docs/00-meta/agileflow-metadata.json" ]; then
133
+ INSTALLED=$(jq -r '.version // empty' docs/00-meta/agileflow-metadata.json 2>/dev/null)
134
+ fi
135
+
136
+ if [ -z "$INSTALLED" ] && [ -f "packages/cli/package.json" ]; then
137
+ INSTALLED=$(jq -r '.version // empty' packages/cli/package.json 2>/dev/null)
138
+ fi
139
+
140
+ if [ -n "$INSTALLED" ]; then
141
+ echo " Installed: v$INSTALLED"
142
+
143
+ # Fetch latest from npm (with timeout)
144
+ LATEST=$(timeout 10 npm view agileflow version 2>/dev/null)
145
+
146
+ if [ -n "$LATEST" ]; then
147
+ echo " Latest: v$LATEST"
148
+
149
+ if [ "$INSTALLED" != "$LATEST" ]; then
150
+ echo " โš ๏ธ Update available!"
151
+ echo " Run: npx agileflow update"
152
+ WARNINGS=$((WARNINGS + 1))
153
+ RECOMMENDATIONS=$((RECOMMENDATIONS + 1))
154
+ else
155
+ echo " โœ… Up to date"
156
+ fi
157
+ else
158
+ echo " โ„น๏ธ Could not check npm registry (offline or timeout)"
159
+ fi
160
+ else
161
+ echo " โ„น๏ธ Could not determine installed version"
162
+ fi
163
+
164
+ echo ""
165
+
166
+ # Check 2: Configuration Validity
167
+ echo "โš™๏ธ Configuration Validity"
168
+ echo "--------------------------"
169
+
170
+ CONFIG_OK=true
171
+
172
+ # Check metadata
173
+ if [ -f "docs/00-meta/agileflow-metadata.json" ]; then
174
+ if jq empty docs/00-meta/agileflow-metadata.json 2>/dev/null; then
175
+ SCHEMA_VER=$(jq -r '.config_schema_version // "not set"' docs/00-meta/agileflow-metadata.json 2>/dev/null)
176
+ echo " โœ… Metadata valid (schema: $SCHEMA_VER)"
177
+ else
178
+ echo " โŒ Metadata file has invalid JSON"
179
+ CONFIG_OK=false
180
+ WARNINGS=$((WARNINGS + 1))
181
+ fi
182
+ else
183
+ echo " โš ๏ธ Metadata file missing"
184
+ CONFIG_OK=false
185
+ WARNINGS=$((WARNINGS + 1))
186
+ fi
187
+
188
+ # Check settings
189
+ if [ -f ".claude/settings.json" ]; then
190
+ if jq empty .claude/settings.json 2>/dev/null; then
191
+ HOOK_COUNT=$(jq '[.hooks | to_entries[] | .value | length] | add // 0' .claude/settings.json 2>/dev/null)
192
+ echo " โœ… Settings valid ($HOOK_COUNT hooks configured)"
193
+ else
194
+ echo " โŒ Settings file has invalid JSON"
195
+ CONFIG_OK=false
196
+ WARNINGS=$((WARNINGS + 1))
197
+ fi
198
+ else
199
+ echo " โš ๏ธ Settings file missing"
200
+ CONFIG_OK=false
201
+ WARNINGS=$((WARNINGS + 1))
202
+ fi
203
+
204
+ # Check config.yaml
205
+ if [ -f ".agileflow/config.yaml" ]; then
206
+ echo " โœ… Config.yaml present"
207
+ else
208
+ echo " โš ๏ธ Config.yaml missing"
209
+ CONFIG_OK=false
210
+ fi
211
+
212
+ if [ "$CONFIG_OK" = false ]; then
213
+ echo ""
214
+ echo " Recommendation: Run /agileflow:configure to fix configuration"
215
+ RECOMMENDATIONS=$((RECOMMENDATIONS + 1))
216
+ fi
217
+
218
+ echo ""
219
+
220
+ # Check 3: Status.json Health
221
+ echo "๐Ÿ“Š Status.json Health"
222
+ echo "---------------------"
223
+
224
+ if [ -f "docs/09-agents/status.json" ]; then
225
+ if jq empty docs/09-agents/status.json 2>/dev/null; then
226
+ SIZE=$(stat -f%z docs/09-agents/status.json 2>/dev/null || stat -c%s docs/09-agents/status.json 2>/dev/null)
227
+ SIZE_KB=$((SIZE / 1024))
228
+ STORY_COUNT=$(jq '.stories | length // 0' docs/09-agents/status.json 2>/dev/null)
229
+ COMPLETED=$(jq '[.stories | to_entries[] | select(.value.status == "completed")] | length' docs/09-agents/status.json 2>/dev/null)
230
+ IN_PROGRESS=$(jq '[.stories | to_entries[] | select(.value.status == "in_progress")] | length' docs/09-agents/status.json 2>/dev/null)
231
+ BLOCKED=$(jq '[.stories | to_entries[] | select(.value.status == "blocked")] | length' docs/09-agents/status.json 2>/dev/null)
232
+ READY=$(jq '[.stories | to_entries[] | select(.value.status == "ready")] | length' docs/09-agents/status.json 2>/dev/null)
233
+
234
+ echo " File size: ${SIZE_KB}KB"
235
+ echo " Total stories: $STORY_COUNT"
236
+ echo " โ€ข In Progress: $IN_PROGRESS"
237
+ echo " โ€ข Blocked: $BLOCKED"
238
+ echo " โ€ข Ready: $READY"
239
+ echo " โ€ข Completed: $COMPLETED"
240
+
241
+ if [ $SIZE -gt 102400 ]; then
242
+ echo ""
243
+ echo " โš ๏ธ File size exceeds 100KB - archival recommended"
244
+ echo " Run: bash scripts/archive-completed-stories.sh"
245
+ WARNINGS=$((WARNINGS + 1))
246
+ RECOMMENDATIONS=$((RECOMMENDATIONS + 1))
247
+ elif [ $SIZE -gt 51200 ]; then
248
+ echo ""
249
+ echo " โ„น๏ธ File size >50KB - consider archival soon"
250
+ else
251
+ echo ""
252
+ echo " โœ… File size healthy"
253
+ fi
254
+
255
+ # Check for stories without required fields
256
+ INVALID=$(jq '[.stories | to_entries[] | select(.value.title == null or .value.status == null)] | length' docs/09-agents/status.json 2>/dev/null)
257
+ if [ "$INVALID" -gt 0 ]; then
258
+ echo " โš ๏ธ $INVALID story/stories missing required fields"
259
+ WARNINGS=$((WARNINGS + 1))
260
+ fi
261
+ else
262
+ echo " โŒ status.json has invalid JSON"
263
+ WARNINGS=$((WARNINGS + 1))
264
+ fi
265
+ else
266
+ echo " โš ๏ธ status.json not found"
267
+ echo " Run: /agileflow:status to initialize"
268
+ WARNINGS=$((WARNINGS + 1))
269
+ fi
270
+
271
+ echo ""
272
+
273
+ # Check 4: Session Cleanup
274
+ echo "๐Ÿ”„ Session Health"
275
+ echo "-----------------"
276
+
277
+ SESSION_REGISTRY=".agileflow/sessions/registry.json"
278
+ if [ -f "$SESSION_REGISTRY" ]; then
279
+ TOTAL_SESSIONS=$(jq '.sessions | length // 0' "$SESSION_REGISTRY" 2>/dev/null)
280
+ echo " Registered sessions: $TOTAL_SESSIONS"
281
+
282
+ # Check for stale sessions (last_active > 7 days ago)
283
+ CUTOFF=$(date -d '7 days ago' +%s 2>/dev/null || date -v-7d +%s 2>/dev/null)
284
+ if [ -n "$CUTOFF" ]; then
285
+ STALE=$(jq --arg cutoff "$CUTOFF" '[.sessions | to_entries[] | select((.value.last_active | fromdateiso8601) < ($cutoff | tonumber))] | length' "$SESSION_REGISTRY" 2>/dev/null)
286
+ if [ "$STALE" -gt 0 ]; then
287
+ echo " โš ๏ธ $STALE stale session(s) (>7 days inactive)"
288
+ echo " Run: /agileflow:session:cleanup to clean up"
289
+ WARNINGS=$((WARNINGS + 1))
290
+ RECOMMENDATIONS=$((RECOMMENDATIONS + 1))
291
+ else
292
+ echo " โœ… No stale sessions"
293
+ fi
294
+ fi
295
+ else
296
+ echo " โ„น๏ธ No session registry (parallel sessions not used)"
297
+ fi
298
+
299
+ # Check session-state.json
300
+ if [ -f "docs/09-agents/session-state.json" ]; then
301
+ ACTIVE_CMDS=$(jq '.active_commands | length // 0' docs/09-agents/session-state.json 2>/dev/null)
302
+ if [ "$ACTIVE_CMDS" -gt 0 ]; then
303
+ echo " โ„น๏ธ $ACTIVE_CMDS active command(s) in session state"
304
+ fi
305
+ fi
306
+
307
+ echo ""
308
+
309
+ # Check 5: Expertise File Staleness
310
+ echo "๐Ÿง  Expertise Files"
311
+ echo "------------------"
312
+
313
+ EXPERTS_DIR=""
314
+ if [ -d ".agileflow/experts" ]; then
315
+ EXPERTS_DIR=".agileflow/experts"
316
+ elif [ -d "packages/cli/src/core/experts" ]; then
317
+ EXPERTS_DIR="packages/cli/src/core/experts"
318
+ fi
319
+
320
+ if [ -n "$EXPERTS_DIR" ] && [ -d "$EXPERTS_DIR" ]; then
321
+ TOTAL_EXPERTS=$(find "$EXPERTS_DIR" -name "expertise.yaml" -type f 2>/dev/null | wc -l | tr -d ' ')
322
+ echo " Total expertise files: $TOTAL_EXPERTS"
323
+
324
+ # Check for stale files (>30 days)
325
+ STALE_COUNT=0
326
+ while IFS= read -r FILE; do
327
+ LAST_UPDATED=$(grep -E "^last_updated:" "$FILE" 2>/dev/null | sed 's/last_updated:[[:space:]]*//' | tr -d "'" | tr -d '"')
328
+ if [ -n "$LAST_UPDATED" ]; then
329
+ # Convert to timestamp for comparison
330
+ LAST_TS=$(date -d "$LAST_UPDATED" +%s 2>/dev/null || date -jf "%Y-%m-%d" "$LAST_UPDATED" +%s 2>/dev/null)
331
+ CUTOFF_TS=$(date -d '30 days ago' +%s 2>/dev/null || date -v-30d +%s 2>/dev/null)
332
+ if [ -n "$LAST_TS" ] && [ -n "$CUTOFF_TS" ] && [ "$LAST_TS" -lt "$CUTOFF_TS" ]; then
333
+ STALE_COUNT=$((STALE_COUNT + 1))
334
+ fi
335
+ fi
336
+ done < <(find "$EXPERTS_DIR" -name "expertise.yaml" -type f 2>/dev/null | head -10)
337
+
338
+ if [ $STALE_COUNT -gt 0 ]; then
339
+ echo " โš ๏ธ $STALE_COUNT expertise file(s) >30 days old"
340
+ echo " Run: /agileflow:validate-expertise for details"
341
+ WARNINGS=$((WARNINGS + 1))
342
+ RECOMMENDATIONS=$((RECOMMENDATIONS + 1))
343
+ else
344
+ echo " โœ… Expertise files up to date"
345
+ fi
346
+ else
347
+ echo " โ„น๏ธ No expertise files found"
348
+ fi
349
+
350
+ echo ""
351
+
352
+ # Check 6: Metrics Summary
353
+ echo "๐Ÿ“ˆ Project Metrics"
354
+ echo "------------------"
355
+
356
+ if [ -f "docs/09-agents/status.json" ]; then
357
+ # Count completions in last 7 days
358
+ WEEK_AGO=$(date -d '7 days ago' +%Y-%m-%d 2>/dev/null || date -v-7d +%Y-%m-%d 2>/dev/null)
359
+ if [ -n "$WEEK_AGO" ]; then
360
+ COMPLETED_THIS_WEEK=$(jq --arg since "$WEEK_AGO" '[.stories | to_entries[] | select(.value.status == "completed" and .value.completed_at != null and .value.completed_at >= $since)] | length' docs/09-agents/status.json 2>/dev/null)
361
+ echo " Completed this week: $COMPLETED_THIS_WEEK stories"
362
+ fi
363
+
364
+ # WIP count
365
+ WIP=$(jq '[.stories | to_entries[] | select(.value.status == "in_progress")] | length' docs/09-agents/status.json 2>/dev/null)
366
+ echo " Current WIP: $WIP"
367
+
368
+ # WIP limit check (default 3)
369
+ WIP_LIMIT=3
370
+ if [ -f "docs/00-meta/agileflow-metadata.json" ]; then
371
+ CUSTOM_LIMIT=$(jq -r '.wip_limit // empty' docs/00-meta/agileflow-metadata.json 2>/dev/null)
372
+ if [ -n "$CUSTOM_LIMIT" ]; then
373
+ WIP_LIMIT=$CUSTOM_LIMIT
374
+ fi
375
+ fi
376
+
377
+ if [ "$WIP" -gt "$WIP_LIMIT" ]; then
378
+ echo " โš ๏ธ WIP exceeds limit ($WIP > $WIP_LIMIT)"
379
+ WARNINGS=$((WARNINGS + 1))
380
+ else
381
+ echo " โœ… WIP within limit ($WIP / $WIP_LIMIT)"
382
+ fi
383
+
384
+ # Blocked stories
385
+ BLOCKED=$(jq '[.stories | to_entries[] | select(.value.status == "blocked")] | length' docs/09-agents/status.json 2>/dev/null)
386
+ if [ "$BLOCKED" -gt 0 ]; then
387
+ echo " โš ๏ธ $BLOCKED blocked story/stories need attention"
388
+ WARNINGS=$((WARNINGS + 1))
389
+ fi
390
+ fi
391
+
392
+ echo ""
393
+
394
+ # Final Summary
395
+ echo "๐Ÿ“‹ Maintenance Summary"
396
+ echo "======================"
397
+
398
+ if [ $WARNINGS -eq 0 ]; then
399
+ echo "โœ… System is healthy!"
400
+ echo ""
401
+ echo "No maintenance actions required."
402
+ else
403
+ echo "โš ๏ธ Found $WARNINGS item(s) needing attention"
404
+ echo ""
405
+ if [ $RECOMMENDATIONS -gt 0 ]; then
406
+ echo "Recommended actions ($RECOMMENDATIONS):"
407
+ [ -n "$LATEST" ] && [ "$INSTALLED" != "$LATEST" ] && echo " โ€ข Update AgileFlow: npx agileflow update"
408
+ [ "$CONFIG_OK" = false ] && echo " โ€ข Fix configuration: /agileflow:configure"
409
+ [ $SIZE -gt 102400 ] 2>/dev/null && echo " โ€ข Archive old stories: bash scripts/archive-completed-stories.sh"
410
+ [ $STALE -gt 0 ] 2>/dev/null && echo " โ€ข Clean up sessions: /agileflow:session:cleanup"
411
+ [ $STALE_COUNT -gt 0 ] 2>/dev/null && echo " โ€ข Review expertise: /agileflow:validate-expertise"
412
+ fi
413
+ fi
414
+
415
+ echo ""
416
+ echo "Run /agileflow:diagnose for detailed system health check."
417
+ ```
418
+
419
+ **Output Format**:
420
+ - Show all maintenance check results with โœ…/โš ๏ธ/โ„น๏ธ indicators
421
+ - Display actionable recommendations with specific commands
422
+ - Provide overall health status
423
+ - Group recommendations by priority
424
+
425
+ ---
426
+
427
+ ## Expected Output
428
+
429
+ ### Healthy System
430
+
431
+ ```
432
+ ๐Ÿ”ง AgileFlow Maintenance Check
433
+ ==============================
434
+
435
+ 2026-01-27 09:15:32
436
+
437
+ ๐Ÿ“ฆ Update Check
438
+ ---------------
439
+ Installed: v2.94.1
440
+ Latest: v2.94.1
441
+ โœ… Up to date
442
+
443
+ โš™๏ธ Configuration Validity
444
+ --------------------------
445
+ โœ… Metadata valid (schema: 2.94.0)
446
+ โœ… Settings valid (6 hooks configured)
447
+ โœ… Config.yaml present
448
+
449
+ ๐Ÿ“Š Status.json Health
450
+ ---------------------
451
+ File size: 45KB
452
+ Total stories: 127
453
+ โ€ข In Progress: 2
454
+ โ€ข Blocked: 0
455
+ โ€ข Ready: 5
456
+ โ€ข Completed: 120
457
+
458
+ โœ… File size healthy
459
+
460
+ ๐Ÿ”„ Session Health
461
+ -----------------
462
+ Registered sessions: 1
463
+ โœ… No stale sessions
464
+
465
+ ๐Ÿง  Expertise Files
466
+ ------------------
467
+ Total expertise files: 26
468
+ โœ… Expertise files up to date
469
+
470
+ ๐Ÿ“ˆ Project Metrics
471
+ ------------------
472
+ Completed this week: 8 stories
473
+ Current WIP: 2
474
+ โœ… WIP within limit (2 / 3)
475
+
476
+ ๐Ÿ“‹ Maintenance Summary
477
+ ======================
478
+ โœ… System is healthy!
479
+
480
+ No maintenance actions required.
481
+
482
+ Run /agileflow:diagnose for detailed system health check.
483
+ ```
484
+
485
+ ### System Needing Attention
486
+
487
+ ```
488
+ ๐Ÿ”ง AgileFlow Maintenance Check
489
+ ==============================
490
+
491
+ 2026-01-27 09:15:32
492
+
493
+ ๐Ÿ“ฆ Update Check
494
+ ---------------
495
+ Installed: v2.93.0
496
+ Latest: v2.94.1
497
+ โš ๏ธ Update available!
498
+ Run: npx agileflow update
499
+
500
+ โš™๏ธ Configuration Validity
501
+ --------------------------
502
+ โœ… Metadata valid (schema: 2.90.0)
503
+ โœ… Settings valid (4 hooks configured)
504
+ โœ… Config.yaml present
505
+
506
+ ๐Ÿ“Š Status.json Health
507
+ ---------------------
508
+ File size: 156KB
509
+ Total stories: 423
510
+ โ€ข In Progress: 5
511
+ โ€ข Blocked: 2
512
+ โ€ข Ready: 12
513
+ โ€ข Completed: 404
514
+
515
+ โš ๏ธ File size exceeds 100KB - archival recommended
516
+ Run: bash scripts/archive-completed-stories.sh
517
+
518
+ ๐Ÿ”„ Session Health
519
+ -----------------
520
+ Registered sessions: 4
521
+ โš ๏ธ 2 stale session(s) (>7 days inactive)
522
+ Run: /agileflow:session:cleanup to clean up
523
+
524
+ ๐Ÿง  Expertise Files
525
+ ------------------
526
+ Total expertise files: 26
527
+ โš ๏ธ 5 expertise file(s) >30 days old
528
+ Run: /agileflow:validate-expertise for details
529
+
530
+ ๐Ÿ“ˆ Project Metrics
531
+ ------------------
532
+ Completed this week: 3 stories
533
+ Current WIP: 5
534
+ โš ๏ธ WIP exceeds limit (5 > 3)
535
+ โš ๏ธ 2 blocked story/stories need attention
536
+
537
+ ๐Ÿ“‹ Maintenance Summary
538
+ ======================
539
+ โš ๏ธ Found 6 item(s) needing attention
540
+
541
+ Recommended actions (4):
542
+ โ€ข Update AgileFlow: npx agileflow update
543
+ โ€ข Archive old stories: bash scripts/archive-completed-stories.sh
544
+ โ€ข Clean up sessions: /agileflow:session:cleanup
545
+ โ€ข Review expertise: /agileflow:validate-expertise
546
+
547
+ Run /agileflow:diagnose for detailed system health check.
548
+ ```
549
+
550
+ ---
551
+
552
+ ## Related Commands
553
+
554
+ - `/agileflow:install` - Post-installation validation
555
+ - `/agileflow:diagnose` - Full system health diagnostics
556
+ - `/agileflow:configure` - Configure AgileFlow features
557
+ - `/agileflow:session:cleanup` - Clean up stale sessions
558
+ - `/agileflow:validate-expertise` - Validate expertise files
@@ -760,6 +760,81 @@ OUTPUT
760
760
 
761
761
  ---
762
762
 
763
+ ## Expected Output
764
+
765
+ ### Success - Metrics Dashboard
766
+
767
+ ```
768
+ ๐Ÿ“Š AgileFlow Metrics Dashboard
769
+ โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
770
+ Period: 2026-01-22 to 2026-01-29 (7 days)
771
+
772
+ ๐ŸŽฏ VELOCITY
773
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
774
+ โ”‚ Stories Completed: 12 โ”‚
775
+ โ”‚ Story Points: 34 โ”‚
776
+ โ”‚ Average: 4.9 stories/week โ”‚
777
+ โ”‚ Trend: โ†‘ 15% from previous week โ”‚
778
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
779
+
780
+ โฑ๏ธ CYCLE TIME
781
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
782
+ โ”‚ Average: 2.3 days โ”‚
783
+ โ”‚ Median: 1.8 days โ”‚
784
+ โ”‚ P95: 4.1 days โ”‚
785
+ โ”‚ Trend: โ†“ 10% (improving) โ”‚
786
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
787
+
788
+ ๐Ÿ“‹ WORK DISTRIBUTION
789
+ โ”‚ By Status: โ”‚ By Owner: โ”‚
790
+ โ”‚ โœ… Done: 24 (72%) โ”‚ AG-API: 12 stories โ”‚
791
+ โ”‚ ๐Ÿ”„ In Progress: 3 โ”‚ AG-UI: 8 stories โ”‚
792
+ โ”‚ ๐Ÿ“‹ Ready: 5 โ”‚ AG-DEVOPS: 7 stories โ”‚
793
+ โ”‚ ๐Ÿšง Blocked: 1 โ”‚ AG-CI: 6 stories โ”‚
794
+
795
+ ๐Ÿงช QUALITY
796
+ โ”‚ Test Pass Rate: 98.5% โ”‚
797
+ โ”‚ Coverage: 82% โ”‚
798
+ โ”‚ Bugs Found: 2 (both fixed) โ”‚
799
+
800
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
801
+ Health Score: ๐ŸŸข 92/100 (Excellent)
802
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
803
+
804
+ Insights:
805
+ - Velocity up 15% - team is hitting stride
806
+ - 1 blocked story needs attention (US-0055)
807
+ - Consider adding capacity to AG-CI (backlog growing)
808
+ ```
809
+
810
+ ### Success - Export to JSON
811
+
812
+ ```
813
+ ๐Ÿ“Š Metrics exported to: docs/08-project/metrics-2026-01-29.json
814
+
815
+ {
816
+ "period": { "start": "2026-01-22", "end": "2026-01-29" },
817
+ "velocity": { "stories": 12, "points": 34, "trend": 0.15 },
818
+ "cycleTime": { "average": 2.3, "median": 1.8, "p95": 4.1 },
819
+ "health": 92
820
+ }
821
+ ```
822
+
823
+ ### Error - No Data Available
824
+
825
+ ```
826
+ โš ๏ธ Insufficient data for metrics
827
+
828
+ No completed stories in the selected period.
829
+
830
+ Try:
831
+ - Expand date range: PERIOD=30d
832
+ - Check status.json has story history
833
+ - Run /agileflow:status to record completions
834
+ ```
835
+
836
+ ---
837
+
763
838
  ## Related Commands
764
839
 
765
840
  - `/agileflow:velocity` - Track velocity and forecast capacity