agileflow 2.92.0 → 2.93.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 (123) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -6
  3. package/lib/codebase-indexer.js +2 -1
  4. package/package.json +1 -1
  5. package/scripts/agileflow-statusline.sh +106 -0
  6. package/scripts/agileflow-welcome.js +135 -22
  7. package/scripts/document-repl.js +793 -0
  8. package/scripts/lib/configure-features.js +8 -1
  9. package/scripts/lib/context-loader.js +16 -16
  10. package/scripts/query-codebase.js +8 -3
  11. package/scripts/session-manager.js +374 -16
  12. package/scripts/spawn-parallel.js +72 -30
  13. package/src/core/agents/accessibility.md +19 -125
  14. package/src/core/agents/adr-writer.md +18 -1
  15. package/src/core/agents/analytics.md +19 -125
  16. package/src/core/agents/api.md +5 -130
  17. package/src/core/agents/ci.md +26 -131
  18. package/src/core/agents/compliance.md +21 -125
  19. package/src/core/agents/database.md +20 -125
  20. package/src/core/agents/datamigration.md +20 -125
  21. package/src/core/agents/design.md +19 -125
  22. package/src/core/agents/devops.md +12 -129
  23. package/src/core/agents/documentation.md +18 -1
  24. package/src/core/agents/epic-planner.md +31 -10
  25. package/src/core/agents/integrations.md +19 -125
  26. package/src/core/agents/mobile.md +19 -125
  27. package/src/core/agents/monitoring.md +19 -125
  28. package/src/core/agents/performance.md +19 -125
  29. package/src/core/agents/product.md +18 -1
  30. package/src/core/agents/qa.md +21 -125
  31. package/src/core/agents/readme-updater.md +18 -1
  32. package/src/core/agents/refactor.md +19 -125
  33. package/src/core/agents/research.md +3 -1
  34. package/src/core/agents/rlm-subcore.md +202 -0
  35. package/src/core/agents/security.md +7 -125
  36. package/src/core/agents/testing.md +20 -125
  37. package/src/core/agents/ui.md +14 -135
  38. package/src/core/commands/adr/list.md +20 -0
  39. package/src/core/commands/adr/update.md +24 -1
  40. package/src/core/commands/adr/view.md +23 -1
  41. package/src/core/commands/adr.md +2 -2
  42. package/src/core/commands/agent.md +11 -1
  43. package/src/core/commands/assign.md +15 -6
  44. package/src/core/commands/auto.md +11 -1
  45. package/src/core/commands/babysit.md +15 -4
  46. package/src/core/commands/baseline.md +11 -1
  47. package/src/core/commands/batch.md +11 -1
  48. package/src/core/commands/blockers.md +11 -1
  49. package/src/core/commands/board.md +11 -1
  50. package/src/core/commands/changelog.md +11 -0
  51. package/src/core/commands/choose.md +16 -1
  52. package/src/core/commands/ci.md +11 -1
  53. package/src/core/commands/configure.md +73 -2
  54. package/src/core/commands/context/export.md +8 -0
  55. package/src/core/commands/context/full.md +8 -0
  56. package/src/core/commands/context/note.md +8 -0
  57. package/src/core/commands/debt.md +11 -0
  58. package/src/core/commands/deploy.md +10 -0
  59. package/src/core/commands/deps.md +11 -1
  60. package/src/core/commands/diagnose.md +10 -0
  61. package/src/core/commands/docs.md +12 -2
  62. package/src/core/commands/epic/list.md +20 -0
  63. package/src/core/commands/epic/view.md +25 -0
  64. package/src/core/commands/epic.md +5 -6
  65. package/src/core/commands/feedback.md +11 -0
  66. package/src/core/commands/handoff.md +12 -2
  67. package/src/core/commands/help.md +10 -0
  68. package/src/core/commands/ideate.md +10 -0
  69. package/src/core/commands/impact.md +11 -1
  70. package/src/core/commands/metrics.md +11 -1
  71. package/src/core/commands/multi-expert.md +11 -1
  72. package/src/core/commands/packages.md +11 -0
  73. package/src/core/commands/pr.md +10 -0
  74. package/src/core/commands/readme-sync.md +10 -5
  75. package/src/core/commands/research/analyze.md +60 -3
  76. package/src/core/commands/research/ask.md +9 -1
  77. package/src/core/commands/research/import.md +8 -0
  78. package/src/core/commands/research/list.md +8 -0
  79. package/src/core/commands/research/synthesize.md +9 -1
  80. package/src/core/commands/research/view.md +8 -0
  81. package/src/core/commands/retro.md +12 -2
  82. package/src/core/commands/review.md +11 -1
  83. package/src/core/commands/rlm.md +363 -0
  84. package/src/core/commands/roadmap/analyze.md +1 -1
  85. package/src/core/commands/rpi.md +9 -1
  86. package/src/core/commands/session/cleanup.md +250 -0
  87. package/src/core/commands/session/end.md +10 -0
  88. package/src/core/commands/session/history.md +11 -1
  89. package/src/core/commands/session/init.md +10 -0
  90. package/src/core/commands/session/new.md +132 -13
  91. package/src/core/commands/session/resume.md +10 -0
  92. package/src/core/commands/session/spawn.md +8 -0
  93. package/src/core/commands/session/status.md +10 -0
  94. package/src/core/commands/skill/create.md +1 -1
  95. package/src/core/commands/skill/delete.md +11 -1
  96. package/src/core/commands/skill/edit.md +11 -1
  97. package/src/core/commands/skill/test.md +11 -1
  98. package/src/core/commands/skill/upgrade.md +11 -1
  99. package/src/core/commands/sprint.md +14 -3
  100. package/src/core/commands/status.md +15 -6
  101. package/src/core/commands/story/list.md +23 -0
  102. package/src/core/commands/story/view.md +24 -0
  103. package/src/core/commands/story.md +4 -5
  104. package/src/core/commands/template.md +10 -0
  105. package/src/core/commands/tests.md +10 -0
  106. package/src/core/commands/update.md +10 -0
  107. package/src/core/commands/validate-expertise.md +10 -1
  108. package/src/core/commands/velocity.md +11 -1
  109. package/src/core/commands/verify.md +13 -1
  110. package/src/core/commands/whats-new.md +8 -0
  111. package/src/core/commands/workflow.md +16 -1
  112. package/src/core/templates/agent-coordination-pattern.md +38 -0
  113. package/src/core/templates/agileflow-metadata.json +25 -0
  114. package/src/core/templates/preserve-rules-common.md +107 -0
  115. package/src/core/templates/preserve-rules.json +42 -0
  116. package/src/core/templates/proactive-action-spec.md +29 -0
  117. package/src/core/templates/quality-gate-priorities.md +34 -0
  118. package/src/core/templates/session-harness-protocol.md +128 -0
  119. package/tools/cli/commands/setup.js +12 -3
  120. package/tools/cli/installers/ide/windsurf.js +1 -1
  121. package/tools/cli/lib/content-injector.js +336 -0
  122. package/tools/cli/lib/ide-registry.js +2 -4
  123. package/tools/cli/lib/ui.js +2 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.93.0] - 2026-01-24
11
+
12
+ ### Added
13
+ - RLM document analysis and session health improvements
14
+
15
+ ## [2.92.1] - 2026-01-23
16
+
17
+ ### Added
18
+ - Session worktree timeout, progress feedback, and docs folder copy
19
+
10
20
  ## [2.92.0] - 2026-01-23
11
21
 
12
22
  ### Added
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  </p>
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/agileflow?color=brightgreen)](https://www.npmjs.com/package/agileflow)
6
- [![Commands](https://img.shields.io/badge/commands-76-blue)](docs/04-architecture/commands.md)
7
- [![Agents/Experts](https://img.shields.io/badge/agents%2Fexperts-30-orange)](docs/04-architecture/subagents.md)
6
+ [![Commands](https://img.shields.io/badge/commands-78-blue)](docs/04-architecture/commands.md)
7
+ [![Agents/Experts](https://img.shields.io/badge/agents%2Fexperts-31-orange)](docs/04-architecture/subagents.md)
8
8
  [![Skills](https://img.shields.io/badge/skills-dynamic-purple)](docs/04-architecture/skills.md)
9
9
 
10
10
  **AI-driven agile development for Claude Code, Cursor, Windsurf, OpenAI Codex CLI, and more.** Combining Scrum, Kanban, ADRs, and docs-as-code principles into one framework-agnostic system.
@@ -65,8 +65,8 @@ AgileFlow combines three proven methodologies:
65
65
 
66
66
  | Component | Count | Description |
67
67
  |-----------|-------|-------------|
68
- | [Commands](docs/04-architecture/commands.md) | 76 | Slash commands for agile workflows |
69
- | [Agents/Experts](docs/04-architecture/subagents.md) | 30 | Specialized agents with self-improving knowledge bases |
68
+ | [Commands](docs/04-architecture/commands.md) | 78 | Slash commands for agile workflows |
69
+ | [Agents/Experts](docs/04-architecture/subagents.md) | 31 | Specialized agents with self-improving knowledge bases |
70
70
  | [Skills](docs/04-architecture/skills.md) | Dynamic | Generated on-demand with `/agileflow:skill:create` |
71
71
 
72
72
  ---
@@ -76,8 +76,8 @@ AgileFlow combines three proven methodologies:
76
76
  Full documentation lives in [`docs/04-architecture/`](docs/04-architecture/):
77
77
 
78
78
  ### Reference
79
- - [Commands](docs/04-architecture/commands.md) - All 76 slash commands
80
- - [Agents/Experts](docs/04-architecture/subagents.md) - 30 specialized agents with self-improving knowledge
79
+ - [Commands](docs/04-architecture/commands.md) - All 78 slash commands
80
+ - [Agents/Experts](docs/04-architecture/subagents.md) - 31 specialized agents with self-improving knowledge
81
81
  - [Skills](docs/04-architecture/skills.md) - Dynamic skill generator with MCP integration
82
82
 
83
83
  ### Architecture
@@ -643,7 +643,8 @@ function updateIndex(projectRoot, options = {}) {
643
643
  existingIndex.tags[tag].push(filePath);
644
644
  }
645
645
  for (const exp of fileData.exports || []) {
646
- if (!Object.hasOwn(existingIndex.symbols.exports, exp)) existingIndex.symbols.exports[exp] = [];
646
+ if (!Object.hasOwn(existingIndex.symbols.exports, exp))
647
+ existingIndex.symbols.exports[exp] = [];
647
648
  existingIndex.symbols.exports[exp].push(filePath);
648
649
  }
649
650
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agileflow",
3
- "version": "2.92.0",
3
+ "version": "2.93.0",
4
4
  "description": "AI-driven agile development system for Claude Code, Cursor, Windsurf, and more",
5
5
  "keywords": [
6
6
  "agile",
@@ -381,6 +381,91 @@ PYTHON
381
381
  fi
382
382
  fi
383
383
 
384
+ # ============================================================================
385
+ # Task Complexity Assessment (RLM-inspired)
386
+ # ============================================================================
387
+ # Detects task complexity based on:
388
+ # - Current story dependencies and blockers
389
+ # - File count affected
390
+ # - Cross-references needed
391
+ #
392
+ # Maps to context threshold recommendations:
393
+ # - LOW complexity: 70% context is fine
394
+ # - MEDIUM complexity: stay under 60%
395
+ # - HIGH complexity: stay under 40% (dumb zone starts sooner)
396
+ #
397
+ COMPLEXITY_DISPLAY=""
398
+ SHOW_COMPLEXITY=true
399
+
400
+ # Check component setting
401
+ if [ "$COMPONENTS" != "null" ] && [ -n "$COMPONENTS" ]; then
402
+ SHOW_COMPLEXITY=$(echo "$COMPONENTS" | jq -r '.complexity | if . == null then true else . end')
403
+ fi
404
+
405
+ if [ "$SHOW_COMPLEXITY" = "true" ]; then
406
+ TASK_COMPLEXITY="LOW"
407
+ COMPLEXITY_SCORE=0
408
+
409
+ # Check session-state.json for active task info
410
+ if [ -f "docs/09-agents/session-state.json" ]; then
411
+ SESSION_STATE=$(cat docs/09-agents/session-state.json 2>/dev/null)
412
+
413
+ # Check active commands (some commands are inherently complex)
414
+ # Get most recent active command name from array
415
+ ACTIVE_CMD=$(echo "$SESSION_STATE" | jq -r '.active_commands[-1].name // empty' 2>/dev/null)
416
+ case "$ACTIVE_CMD" in
417
+ babysit|mentor|orchestrator|multi-expert|rlm)
418
+ COMPLEXITY_SCORE=$((COMPLEXITY_SCORE + 2))
419
+ ;;
420
+ research*|ideate|rpi)
421
+ COMPLEXITY_SCORE=$((COMPLEXITY_SCORE + 1))
422
+ ;;
423
+ esac
424
+
425
+ # Check current story's dependencies
426
+ CURRENT_STORY=$(echo "$SESSION_STATE" | jq -r '.current_story // empty' 2>/dev/null)
427
+ if [ -n "$CURRENT_STORY" ] && [ -f "docs/09-agents/status.json" ]; then
428
+ STATUS_JSON=$(cat docs/09-agents/status.json 2>/dev/null)
429
+
430
+ # Count dependencies
431
+ DEP_COUNT=$(echo "$STATUS_JSON" | jq -r ".stories[\"$CURRENT_STORY\"].depends_on // [] | length" 2>/dev/null)
432
+ [ -n "$DEP_COUNT" ] && [ "$DEP_COUNT" -gt 2 ] 2>/dev/null && COMPLEXITY_SCORE=$((COMPLEXITY_SCORE + 1))
433
+
434
+ # Count acceptance criteria
435
+ AC_COUNT=$(echo "$STATUS_JSON" | jq -r ".stories[\"$CURRENT_STORY\"].acceptance_criteria // [] | length" 2>/dev/null)
436
+ [ -n "$AC_COUNT" ] && [ "$AC_COUNT" -gt 5 ] 2>/dev/null && COMPLEXITY_SCORE=$((COMPLEXITY_SCORE + 1))
437
+
438
+ # Check for blockers
439
+ BLOCKER_COUNT=$(echo "$STATUS_JSON" | jq -r ".stories[\"$CURRENT_STORY\"].blockers // [] | length" 2>/dev/null)
440
+ [ -n "$BLOCKER_COUNT" ] && [ "$BLOCKER_COUNT" -gt 0 ] 2>/dev/null && COMPLEXITY_SCORE=$((COMPLEXITY_SCORE + 1))
441
+ fi
442
+
443
+ # Check ralph loop mode (more complex)
444
+ LOOP_ENABLED=$(echo "$SESSION_STATE" | jq -r '.ralph_loop.enabled // false' 2>/dev/null)
445
+ [ "$LOOP_ENABLED" = "true" ] && COMPLEXITY_SCORE=$((COMPLEXITY_SCORE + 1))
446
+ fi
447
+
448
+ # Determine complexity level
449
+ if [ "$COMPLEXITY_SCORE" -ge 4 ]; then
450
+ TASK_COMPLEXITY="HIGH"
451
+ COMPLEXITY_COLOR="$RED"
452
+ COMPLEXITY_ICON="◆" # Diamond for high complexity
453
+ elif [ "$COMPLEXITY_SCORE" -ge 2 ]; then
454
+ TASK_COMPLEXITY="MED"
455
+ COMPLEXITY_COLOR="$YELLOW"
456
+ COMPLEXITY_ICON="◇" # Outline diamond for medium
457
+ else
458
+ TASK_COMPLEXITY="LOW"
459
+ COMPLEXITY_COLOR="$GREEN"
460
+ COMPLEXITY_ICON="○" # Circle for low
461
+ fi
462
+
463
+ # Only show if not LOW (to reduce noise)
464
+ if [ "$TASK_COMPLEXITY" != "LOW" ]; then
465
+ COMPLEXITY_DISPLAY="${COMPLEXITY_COLOR}${COMPLEXITY_ICON}${TASK_COMPLEXITY}${RESET}"
466
+ fi
467
+ fi
468
+
384
469
  # ============================================================================
385
470
  # AgileFlow Status - Read from status.json
386
471
  # ============================================================================
@@ -583,6 +668,21 @@ if [ "$SHOW_SESSION" = "true" ] && [ -n "$SESSION_INFO" ]; then
583
668
  fi
584
669
  fi
585
670
 
671
+ # Session health indicator (shows warning icon + count if issues exist)
672
+ if [ "$SHOW_SESSION" = "true" ]; then
673
+ SCRIPTS_DIR="$(dirname "$0")"
674
+ HEALTH_OUTPUT=$(node "$SCRIPTS_DIR/session-manager.js" health 2>/dev/null)
675
+ if [ -n "$HEALTH_OUTPUT" ]; then
676
+ HEALTH_ISSUES=$(echo "$HEALTH_OUTPUT" | jq -r '
677
+ (.uncommitted | length) + (.stale | length) + (.orphanedRegistry | length)
678
+ ' 2>/dev/null)
679
+ if [ -n "$HEALTH_ISSUES" ] && [ "$HEALTH_ISSUES" != "0" ] && [ "$HEALTH_ISSUES" != "null" ]; then
680
+ [ -n "$OUTPUT" ] && OUTPUT="${OUTPUT} "
681
+ OUTPUT="${OUTPUT}${YELLOW}⚠${HEALTH_ISSUES}${RESET}"
682
+ fi
683
+ fi
684
+ fi
685
+
586
686
  # Model with subtle styling (if enabled and available)
587
687
  if [ "$SHOW_MODEL" = "true" ] && [ -n "$MODEL_DISPLAY" ]; then
588
688
  [ -n "$OUTPUT" ] && OUTPUT="${OUTPUT}${SEP}"
@@ -623,6 +723,12 @@ if [ "$SHOW_CONTEXT" = "true" ] && [ -n "$CTX_DISPLAY" ]; then
623
723
  fi
624
724
  fi
625
725
 
726
+ # Add task complexity indicator (if enabled and not LOW)
727
+ if [ "$SHOW_COMPLEXITY" = "true" ] && [ -n "$COMPLEXITY_DISPLAY" ]; then
728
+ [ -n "$OUTPUT" ] && OUTPUT="${OUTPUT}${SEP}"
729
+ OUTPUT="${OUTPUT}${COMPLEXITY_DISPLAY}"
730
+ fi
731
+
626
732
  # Add session time remaining (if enabled and available)
627
733
  if [ "$SHOW_SESSION_TIME" = "true" ] && [ -n "$SESSION_DISPLAY" ]; then
628
734
  [ -n "$OUTPUT" ] && OUTPUT="${OUTPUT}${SEP}"
@@ -102,10 +102,20 @@ function detectPlatform() {
102
102
  // Try to detect Linux distribution
103
103
  try {
104
104
  const osRelease = fs.readFileSync('/etc/os-release', 'utf8');
105
- if (osRelease.includes('Ubuntu') || osRelease.includes('Debian') || osRelease.includes('Pop!_OS') || osRelease.includes('Mint')) {
105
+ if (
106
+ osRelease.includes('Ubuntu') ||
107
+ osRelease.includes('Debian') ||
108
+ osRelease.includes('Pop!_OS') ||
109
+ osRelease.includes('Mint')
110
+ ) {
106
111
  return { os: 'Ubuntu/Debian', installCmd: 'sudo apt install tmux', hasSudo: true };
107
112
  }
108
- if (osRelease.includes('Fedora') || osRelease.includes('Red Hat') || osRelease.includes('CentOS') || osRelease.includes('Rocky')) {
113
+ if (
114
+ osRelease.includes('Fedora') ||
115
+ osRelease.includes('Red Hat') ||
116
+ osRelease.includes('CentOS') ||
117
+ osRelease.includes('Rocky')
118
+ ) {
109
119
  return { os: 'Fedora/RHEL', installCmd: 'sudo dnf install tmux', hasSudo: true };
110
120
  }
111
121
  if (osRelease.includes('Arch')) {
@@ -662,15 +672,43 @@ function compareVersions(a, b) {
662
672
  * These are the options that can be configured through /agileflow:configure
663
673
  */
664
674
  const ALL_CONFIG_OPTIONS = {
665
- claudeMdReinforcement: { since: '2.92.0', description: 'Add /babysit rules to CLAUDE.md', autoApplyable: true },
666
- sessionStartHook: { since: '2.35.0', description: 'Welcome display on session start', autoApplyable: false },
667
- precompactHook: { since: '2.40.0', description: 'Context preservation during /compact', autoApplyable: false },
668
- damageControlHooks: { since: '2.50.0', description: 'Block destructive commands', autoApplyable: false },
675
+ claudeMdReinforcement: {
676
+ since: '2.92.0',
677
+ description: 'Add /babysit rules to CLAUDE.md',
678
+ autoApplyable: true,
679
+ },
680
+ sessionStartHook: {
681
+ since: '2.35.0',
682
+ description: 'Welcome display on session start',
683
+ autoApplyable: false,
684
+ },
685
+ precompactHook: {
686
+ since: '2.40.0',
687
+ description: 'Context preservation during /compact',
688
+ autoApplyable: false,
689
+ },
690
+ damageControlHooks: {
691
+ since: '2.50.0',
692
+ description: 'Block destructive commands',
693
+ autoApplyable: false,
694
+ },
669
695
  statusLine: { since: '2.35.0', description: 'Custom status bar display', autoApplyable: false },
670
- autoArchival: { since: '2.35.0', description: 'Auto-archive completed stories', autoApplyable: false },
671
- autoUpdate: { since: '2.70.0', description: 'Auto-update on session start', autoApplyable: false },
696
+ autoArchival: {
697
+ since: '2.35.0',
698
+ description: 'Auto-archive completed stories',
699
+ autoApplyable: false,
700
+ },
701
+ autoUpdate: {
702
+ since: '2.70.0',
703
+ description: 'Auto-update on session start',
704
+ autoApplyable: false,
705
+ },
672
706
  ralphLoop: { since: '2.60.0', description: 'Autonomous story processing', autoApplyable: false },
673
- tmuxAutoSpawn: { since: '2.92.0', description: 'Auto-start Claude in tmux session', autoApplyable: true },
707
+ tmuxAutoSpawn: {
708
+ since: '2.92.0',
709
+ description: 'Auto-start Claude in tmux session',
710
+ autoApplyable: true,
711
+ },
674
712
  };
675
713
 
676
714
  /**
@@ -719,7 +757,10 @@ function checkConfigStaleness(rootDir, currentVersion, cache = null) {
719
757
  // Check for unconfigured options in metadata
720
758
  for (const [name, option] of Object.entries(configOptions)) {
721
759
  if (option.configured === false) {
722
- const optionInfo = ALL_CONFIG_OPTIONS[name] || { description: name, autoApplyable: false };
760
+ const optionInfo = ALL_CONFIG_OPTIONS[name] || {
761
+ description: name,
762
+ autoApplyable: false,
763
+ };
723
764
  result.outdated = true;
724
765
  result.newOptionsCount++;
725
766
  result.newOptions.push({
@@ -776,22 +817,24 @@ function isOptionActuallyConfigured(optionName, hooks, settings) {
776
817
  case 'precompactHook':
777
818
  return hooks.PreCompact && hooks.PreCompact.length > 0;
778
819
  case 'damageControlHooks':
779
- return hooks.PreToolUse && hooks.PreToolUse.some(h =>
780
- h.hooks?.some(hk => hk.command?.includes('damage-control'))
820
+ return (
821
+ hooks.PreToolUse &&
822
+ hooks.PreToolUse.some(h => h.hooks?.some(hk => hk.command?.includes('damage-control')))
781
823
  );
782
824
  case 'statusLine':
783
825
  return settings.statusLine && settings.statusLine.command;
784
826
  case 'autoArchival':
785
827
  // Archival is tied to SessionStart hook running archive script
786
- return hooks.SessionStart && hooks.SessionStart.some(h =>
787
- h.hooks?.some(hk => hk.command?.includes('archive'))
828
+ return (
829
+ hooks.SessionStart &&
830
+ hooks.SessionStart.some(h => h.hooks?.some(hk => hk.command?.includes('archive')))
788
831
  );
789
832
  case 'autoUpdate':
790
833
  // Would need to check metadata for autoUpdate setting
791
834
  return false; // Default to not configured
792
835
  case 'ralphLoop':
793
- return hooks.Stop && hooks.Stop.some(h =>
794
- h.hooks?.some(hk => hk.command?.includes('ralph-loop'))
836
+ return (
837
+ hooks.Stop && hooks.Stop.some(h => h.hooks?.some(hk => hk.command?.includes('ralph-loop')))
795
838
  );
796
839
  case 'claudeMdReinforcement':
797
840
  // Check if CLAUDE.md has the marker - can't easily check from here
@@ -848,7 +891,10 @@ ${marker}
848
891
  if (fs.existsSync(metadataPath)) {
849
892
  const metadata = JSON.parse(fs.readFileSync(metadataPath, 'utf8'));
850
893
  if (!metadata.features) metadata.features = {};
851
- if (!metadata.features.tmuxAutoSpawn || metadata.features.tmuxAutoSpawn.enabled === undefined) {
894
+ if (
895
+ !metadata.features.tmuxAutoSpawn ||
896
+ metadata.features.tmuxAutoSpawn.enabled === undefined
897
+ ) {
852
898
  metadata.features.tmuxAutoSpawn = {
853
899
  enabled: true,
854
900
  version: metadata.version || '2.92.0',
@@ -1636,24 +1682,32 @@ async function main() {
1636
1682
  // Show config auto-apply confirmation (for "full" profile)
1637
1683
  if (configAutoApplied > 0) {
1638
1684
  console.log('');
1639
- console.log(`${c.mintGreen}✨ Auto-applied ${configAutoApplied} new config option(s)${c.reset}`);
1685
+ console.log(
1686
+ `${c.mintGreen}✨ Auto-applied ${configAutoApplied} new config option(s)${c.reset}`
1687
+ );
1640
1688
  console.log(` ${c.slate}Profile "full" enables all new features automatically.${c.reset}`);
1641
1689
  }
1642
1690
 
1643
1691
  // Show config staleness notification (for custom profiles)
1644
1692
  if (configStaleness.outdated && configStaleness.newOptionsCount > 0) {
1645
1693
  console.log('');
1646
- console.log(`${c.amber}⚙️ ${configStaleness.newOptionsCount} new configuration option(s) available${c.reset}`);
1694
+ console.log(
1695
+ `${c.amber}⚙️ ${configStaleness.newOptionsCount} new configuration option(s) available${c.reset}`
1696
+ );
1647
1697
  for (const opt of configStaleness.newOptions.slice(0, 3)) {
1648
1698
  console.log(` ${c.dim}• ${opt.description}${c.reset}`);
1649
1699
  }
1650
- console.log(` ${c.slate}Run ${c.skyBlue}/agileflow:configure${c.reset}${c.slate} to enable them.${c.reset}`);
1700
+ console.log(
1701
+ ` ${c.slate}Run ${c.skyBlue}/agileflow:configure${c.reset}${c.slate} to enable them.${c.reset}`
1702
+ );
1651
1703
  }
1652
1704
 
1653
1705
  // Show tmux installation notice if tmux auto-spawn is enabled but tmux not installed
1654
1706
  if (tmuxAutoSpawnEnabled && !tmuxCheck.available) {
1655
1707
  console.log('');
1656
- console.log(`${c.amber}📦 tmux not installed${c.reset} ${c.dim}(enables parallel sessions in one terminal)${c.reset}`);
1708
+ console.log(
1709
+ `${c.amber}📦 tmux not installed${c.reset} ${c.dim}(enables parallel sessions in one terminal)${c.reset}`
1710
+ );
1657
1711
 
1658
1712
  // Show platform-specific install command
1659
1713
  if (tmuxCheck.platform?.installCmd) {
@@ -1668,7 +1722,9 @@ async function main() {
1668
1722
  console.log(` ${c.dim}• Ubuntu:${c.reset} ${c.cyan}sudo apt install tmux${c.reset}`);
1669
1723
  console.log(` ${c.dim}• No sudo:${c.reset} ${c.cyan}${tmuxCheck.noSudoCmd}${c.reset}`);
1670
1724
  }
1671
- console.log(` ${c.dim}Or disable this notice: ${c.skyBlue}/agileflow:configure --disable=tmuxautospawn${c.reset}`);
1725
+ console.log(
1726
+ ` ${c.dim}Or disable this notice: ${c.skyBlue}/agileflow:configure --disable=tmuxautospawn${c.reset}`
1727
+ );
1672
1728
  }
1673
1729
 
1674
1730
  // Show warning and tip if other sessions are active (vibrant colors)
@@ -1697,6 +1753,63 @@ async function main() {
1697
1753
  );
1698
1754
  }
1699
1755
 
1756
+ // === SESSION HEALTH WARNINGS ===
1757
+ // Check for forgotten sessions with uncommitted changes, stale sessions, orphaned entries
1758
+ try {
1759
+ const healthResult = spawnSync(
1760
+ 'node',
1761
+ [SESSION_MANAGER_PATH, 'health'],
1762
+ { encoding: 'utf8', timeout: 10000 }
1763
+ );
1764
+
1765
+ if (healthResult.stdout) {
1766
+ const health = JSON.parse(healthResult.stdout);
1767
+ const hasIssues =
1768
+ health.uncommitted.length > 0 ||
1769
+ health.stale.length > 0 ||
1770
+ health.orphanedRegistry.length > 0;
1771
+
1772
+ if (hasIssues) {
1773
+ console.log('');
1774
+
1775
+ // Uncommitted changes - MOST IMPORTANT (potential data loss)
1776
+ if (health.uncommitted.length > 0) {
1777
+ console.log(
1778
+ `${c.coral}⚠️ ${health.uncommitted.length} session(s) have uncommitted changes:${c.reset}`
1779
+ );
1780
+ health.uncommitted.slice(0, 3).forEach((sess) => {
1781
+ const name = sess.nickname ? `"${sess.nickname}"` : `Session ${sess.id}`;
1782
+ console.log(`${c.dim} └─ ${name}: ${sess.changeCount} file(s)${c.reset}`);
1783
+ });
1784
+ if (health.uncommitted.length > 3) {
1785
+ console.log(
1786
+ `${c.dim} └─ ... and ${health.uncommitted.length - 3} more${c.reset}`
1787
+ );
1788
+ }
1789
+ console.log(
1790
+ `${c.slate} Run: ${c.skyBlue}/agileflow:session:status${c.slate} to see details${c.reset}`
1791
+ );
1792
+ }
1793
+
1794
+ // Stale sessions (inactive 7+ days)
1795
+ if (health.stale.length > 0) {
1796
+ console.log(
1797
+ `${c.amber}📅 ${health.stale.length} session(s) inactive for 7+ days${c.reset}`
1798
+ );
1799
+ }
1800
+
1801
+ // Orphaned registry entries (path doesn't exist)
1802
+ if (health.orphanedRegistry.length > 0) {
1803
+ console.log(
1804
+ `${c.peach}🗑️ ${health.orphanedRegistry.length} session(s) have missing directories${c.reset}`
1805
+ );
1806
+ }
1807
+ }
1808
+ }
1809
+ } catch (e) {
1810
+ // Health check failed, skip silently
1811
+ }
1812
+
1700
1813
  // Story claiming: cleanup stale claims and show warnings
1701
1814
  if (storyClaiming) {
1702
1815
  try {