moflo 4.9.21 → 4.9.23

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 (194) hide show
  1. package/.claude/agents/analysis/analyze-code-quality.md +0 -121
  2. package/.claude/agents/analysis/code-analyzer.md +5 -26
  3. package/.claude/agents/architecture/system-design/arch-system-design.md +0 -119
  4. package/.claude/agents/base-template-generator.md +0 -1
  5. package/.claude/agents/core/coder.md +0 -22
  6. package/.claude/agents/core/planner.md +0 -16
  7. package/.claude/agents/core/researcher.md +0 -16
  8. package/.claude/agents/core/reviewer.md +0 -17
  9. package/.claude/agents/core/tester.md +0 -19
  10. package/.claude/agents/custom/test-long-runner.md +0 -2
  11. package/.claude/agents/development/dev-backend-api.md +0 -167
  12. package/.claude/agents/development/dev-database.md +43 -0
  13. package/.claude/agents/development/dev-frontend.md +42 -0
  14. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +0 -112
  15. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +0 -111
  16. package/.claude/agents/security/security-auditor.md +45 -0
  17. package/.claude/guidance/shipped/moflo-cli-reference.md +19 -16
  18. package/.claude/guidance/shipped/moflo-core-guidance.md +0 -2
  19. package/.claude/guidance/shipped/moflo-guidance-rules.md +5 -5
  20. package/.claude/guidance/shipped/moflo-spell-runner.md +1 -0
  21. package/.claude/guidance/shipped/moflo-spell-scheduling.md +225 -0
  22. package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +1 -0
  23. package/.claude/helpers/gate.cjs +70 -3
  24. package/.claude/skills/fl/execution-modes.md +38 -15
  25. package/.claude/skills/fl/phases.md +67 -0
  26. package/.claude/skills/spell-schedule/SKILL.md +18 -5
  27. package/README.md +1 -1
  28. package/bin/gate.cjs +70 -3
  29. package/bin/index-guidance.mjs +32 -6
  30. package/bin/lib/retired-files.mjs +146 -0
  31. package/bin/session-start-launcher.mjs +116 -8
  32. package/dist/src/cli/appliance/rvfa-builder.js +1 -1
  33. package/dist/src/cli/commands/agent.js +3 -9
  34. package/dist/src/cli/commands/daemon.js +13 -17
  35. package/dist/src/cli/commands/hooks.js +4 -9
  36. package/dist/src/cli/commands/index.js +2 -0
  37. package/dist/src/cli/commands/retire.js +111 -0
  38. package/dist/src/cli/commands/spell-schedule.js +237 -49
  39. package/dist/src/cli/hooks/reasoningbank/index.js +7 -7
  40. package/dist/src/cli/init/executor.js +26 -54
  41. package/dist/src/cli/init/helpers-generator.js +66 -3
  42. package/dist/src/cli/init/settings-generator.js +17 -6
  43. package/dist/src/cli/mcp-tools/agent-tools.js +9 -27
  44. package/dist/src/cli/mcp-tools/hooks-tools.js +23 -21
  45. package/dist/src/cli/mcp-tools/memory-tools.js +16 -5
  46. package/dist/src/cli/memory/bridge-embedder.js +26 -6
  47. package/dist/src/cli/memory/bridge-entries.js +33 -15
  48. package/dist/src/cli/memory/controllers/semantic-router.js +18 -12
  49. package/dist/src/cli/memory/sona-optimizer.js +6 -6
  50. package/dist/src/cli/neural/domain/services/learning-service.js +3 -3
  51. package/dist/src/cli/services/agent-router.js +2 -5
  52. package/dist/src/cli/services/daemon-autostart-lifecycle.js +62 -0
  53. package/dist/src/cli/services/daemon-dashboard.js +187 -18
  54. package/dist/src/cli/services/daemon-readiness.js +19 -31
  55. package/dist/src/cli/services/ephemeral-namespace-purge.js +61 -33
  56. package/dist/src/cli/services/headless-worker-executor.js +7 -94
  57. package/dist/src/cli/services/hook-block-hash.js +4 -0
  58. package/dist/src/cli/services/worker-daemon.js +40 -66
  59. package/dist/src/cli/shared/events/example-usage.js +6 -6
  60. package/dist/src/cli/shared/hooks/task-hooks.js +8 -8
  61. package/dist/src/cli/spells/core/runner.js +12 -0
  62. package/dist/src/cli/spells/scheduler/scheduler.js +24 -9
  63. package/dist/src/cli/spells/schema/validator.js +2 -1
  64. package/dist/src/cli/spells/schema/validators/top-level.js +18 -0
  65. package/dist/src/cli/version.js +1 -1
  66. package/package.json +5 -2
  67. package/retired-files.json +1989 -0
  68. package/src/cli/data/model-registry.json +2 -2
  69. package/.claude/agents/consensus/byzantine-coordinator.md +0 -63
  70. package/.claude/agents/consensus/crdt-synchronizer.md +0 -997
  71. package/.claude/agents/consensus/gossip-coordinator.md +0 -63
  72. package/.claude/agents/consensus/performance-benchmarker.md +0 -851
  73. package/.claude/agents/consensus/quorum-manager.md +0 -823
  74. package/.claude/agents/consensus/raft-manager.md +0 -63
  75. package/.claude/agents/consensus/security-manager.md +0 -622
  76. package/.claude/agents/data/ml/data-ml-model.md +0 -193
  77. package/.claude/agents/github/code-review-swarm.md +0 -538
  78. package/.claude/agents/github/github-modes.md +0 -172
  79. package/.claude/agents/github/issue-tracker.md +0 -311
  80. package/.claude/agents/github/multi-repo-swarm.md +0 -551
  81. package/.claude/agents/github/pr-manager.md +0 -183
  82. package/.claude/agents/github/project-board-sync.md +0 -508
  83. package/.claude/agents/github/release-manager.md +0 -360
  84. package/.claude/agents/github/release-swarm.md +0 -580
  85. package/.claude/agents/github/repo-architect.md +0 -391
  86. package/.claude/agents/github/swarm-issue.md +0 -566
  87. package/.claude/agents/github/swarm-pr.md +0 -414
  88. package/.claude/agents/github/sync-coordinator.md +0 -426
  89. package/.claude/agents/github/workflow-automation.md +0 -606
  90. package/.claude/agents/goal/code-goal-planner.md +0 -440
  91. package/.claude/agents/goal/goal-planner.md +0 -168
  92. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -127
  93. package/.claude/agents/hive-mind/queen-coordinator.md +0 -198
  94. package/.claude/agents/hive-mind/scout-explorer.md +0 -233
  95. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -184
  96. package/.claude/agents/hive-mind/worker-specialist.md +0 -208
  97. package/.claude/agents/neural/safla-neural.md +0 -73
  98. package/.claude/agents/optimization/benchmark-suite.md +0 -665
  99. package/.claude/agents/optimization/load-balancer.md +0 -431
  100. package/.claude/agents/optimization/performance-monitor.md +0 -672
  101. package/.claude/agents/optimization/resource-allocator.md +0 -674
  102. package/.claude/agents/optimization/topology-optimizer.md +0 -808
  103. package/.claude/agents/reasoning/goal-planner.md +0 -67
  104. package/.claude/agents/sona/sona-learning-optimizer.md +0 -74
  105. package/.claude/agents/sparc/architecture.md +0 -472
  106. package/.claude/agents/sparc/pseudocode.md +0 -318
  107. package/.claude/agents/sparc/refinement.md +0 -525
  108. package/.claude/agents/sparc/specification.md +0 -276
  109. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -225
  110. package/.claude/agents/swarm/adaptive-coordinator.md +0 -391
  111. package/.claude/agents/swarm/hierarchical-coordinator.md +0 -321
  112. package/.claude/agents/swarm/mesh-coordinator.md +0 -383
  113. package/.claude/agents/testing/production-validator.md +0 -395
  114. package/.claude/agents/testing/tdd-london-swarm.md +0 -244
  115. package/.claude/agents/v3/adr-architect.md +0 -184
  116. package/.claude/agents/v3/aidefence-guardian.md +0 -277
  117. package/.claude/agents/v3/claims-authorizer.md +0 -208
  118. package/.claude/agents/v3/collective-intelligence-coordinator.md +0 -988
  119. package/.claude/agents/v3/ddd-domain-expert.md +0 -220
  120. package/.claude/agents/v3/injection-analyst.md +0 -232
  121. package/.claude/agents/v3/memory-specialist.md +0 -987
  122. package/.claude/agents/v3/performance-engineer.md +0 -1225
  123. package/.claude/agents/v3/pii-detector.md +0 -146
  124. package/.claude/agents/v3/reasoningbank-learner.md +0 -213
  125. package/.claude/agents/v3/security-architect-aidefence.md +0 -405
  126. package/.claude/agents/v3/security-architect.md +0 -865
  127. package/.claude/agents/v3/security-auditor.md +0 -771
  128. package/.claude/agents/v3/sparc-orchestrator.md +0 -182
  129. package/.claude/agents/v3/swarm-memory-manager.md +0 -142
  130. package/.claude/agents/v3/v3-integration-architect.md +0 -205
  131. package/.claude/commands/claude-flow-help.md +0 -103
  132. package/.claude/commands/claude-flow-memory.md +0 -107
  133. package/.claude/commands/claude-flow-swarm.md +0 -205
  134. package/.claude/commands/flo-simplify.md +0 -101
  135. package/.claude/commands/github/README.md +0 -11
  136. package/.claude/commands/github/code-review-swarm.md +0 -514
  137. package/.claude/commands/github/code-review.md +0 -25
  138. package/.claude/commands/github/github-modes.md +0 -146
  139. package/.claude/commands/github/github-swarm.md +0 -113
  140. package/.claude/commands/github/issue-tracker.md +0 -284
  141. package/.claude/commands/github/issue-triage.md +0 -25
  142. package/.claude/commands/github/multi-repo-swarm.md +0 -519
  143. package/.claude/commands/github/pr-enhance.md +0 -26
  144. package/.claude/commands/github/pr-manager.md +0 -164
  145. package/.claude/commands/github/project-board-sync.md +0 -471
  146. package/.claude/commands/github/release-manager.md +0 -332
  147. package/.claude/commands/github/release-swarm.md +0 -544
  148. package/.claude/commands/github/repo-analyze.md +0 -25
  149. package/.claude/commands/github/repo-architect.md +0 -361
  150. package/.claude/commands/github/swarm-issue.md +0 -482
  151. package/.claude/commands/github/swarm-pr.md +0 -285
  152. package/.claude/commands/github/sync-coordinator.md +0 -294
  153. package/.claude/commands/github/workflow-automation.md +0 -442
  154. package/.claude/commands/hooks/README.md +0 -11
  155. package/.claude/commands/hooks/overview.md +0 -58
  156. package/.claude/commands/hooks/post-edit.md +0 -117
  157. package/.claude/commands/hooks/post-task.md +0 -112
  158. package/.claude/commands/hooks/pre-edit.md +0 -113
  159. package/.claude/commands/hooks/pre-task.md +0 -111
  160. package/.claude/commands/hooks/session-end.md +0 -118
  161. package/.claude/commands/hooks/setup.md +0 -103
  162. package/.claude/commands/sparc/analyzer.md +0 -42
  163. package/.claude/commands/sparc/architect.md +0 -43
  164. package/.claude/commands/sparc/ask.md +0 -86
  165. package/.claude/commands/sparc/batch-executor.md +0 -44
  166. package/.claude/commands/sparc/code.md +0 -78
  167. package/.claude/commands/sparc/coder.md +0 -44
  168. package/.claude/commands/sparc/debug.md +0 -72
  169. package/.claude/commands/sparc/debugger.md +0 -44
  170. package/.claude/commands/sparc/designer.md +0 -43
  171. package/.claude/commands/sparc/devops.md +0 -98
  172. package/.claude/commands/sparc/docs-writer.md +0 -69
  173. package/.claude/commands/sparc/documenter.md +0 -44
  174. package/.claude/commands/sparc/innovator.md +0 -44
  175. package/.claude/commands/sparc/integration.md +0 -72
  176. package/.claude/commands/sparc/mcp.md +0 -106
  177. package/.claude/commands/sparc/memory-manager.md +0 -44
  178. package/.claude/commands/sparc/optimizer.md +0 -44
  179. package/.claude/commands/sparc/orchestrator.md +0 -116
  180. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -72
  181. package/.claude/commands/sparc/refinement-optimization-mode.md +0 -72
  182. package/.claude/commands/sparc/researcher.md +0 -44
  183. package/.claude/commands/sparc/reviewer.md +0 -44
  184. package/.claude/commands/sparc/security-review.md +0 -69
  185. package/.claude/commands/sparc/sparc-modes.md +0 -139
  186. package/.claude/commands/sparc/sparc.md +0 -99
  187. package/.claude/commands/sparc/spec-pseudocode.md +0 -69
  188. package/.claude/commands/sparc/spell-manager.md +0 -44
  189. package/.claude/commands/sparc/supabase-admin.md +0 -337
  190. package/.claude/commands/sparc/swarm-coordinator.md +0 -44
  191. package/.claude/commands/sparc/tdd.md +0 -44
  192. package/.claude/commands/sparc/tester.md +0 -44
  193. package/.claude/commands/sparc/tutorial.md +0 -68
  194. package/.claude/commands/sparc.md +0 -151
@@ -19,7 +19,7 @@ const startCommand = {
19
19
  name: 'start',
20
20
  description: 'Start the worker daemon with all enabled background workers',
21
21
  options: [
22
- { name: 'workers', short: 'w', type: 'string', description: 'Comma-separated list of workers to enable (default: map,audit,optimize,consolidate,testgaps)' },
22
+ { name: 'workers', short: 'w', type: 'string', description: 'Comma-separated list of workers to enable (default: map,optimize,consolidate,testgaps)' },
23
23
  { name: 'quiet', short: 'Q', type: 'boolean', description: 'Suppress output' },
24
24
  { name: 'background', short: 'b', type: 'boolean', description: 'Run daemon in background (detached process)', default: true },
25
25
  { name: 'foreground', short: 'f', type: 'boolean', description: 'Run daemon in foreground (blocks terminal)' },
@@ -33,7 +33,7 @@ const startCommand = {
33
33
  examples: [
34
34
  { command: 'claude-flow daemon start', description: 'Start daemon in background (default)' },
35
35
  { command: 'claude-flow daemon start --foreground', description: 'Start in foreground (blocks terminal)' },
36
- { command: 'claude-flow daemon start -w map,audit,optimize', description: 'Start with specific workers' },
36
+ { command: 'claude-flow daemon start -w map,optimize', description: 'Start with specific workers' },
37
37
  { command: 'claude-flow daemon start --headless --sandbox strict', description: 'Start with headless workers in strict sandbox' },
38
38
  ],
39
39
  action: async (ctx) => {
@@ -128,7 +128,7 @@ const startCommand = {
128
128
  `Max Concurrent: ${status.config.maxConcurrent}`,
129
129
  `Max CPU Load: ${status.config.resourceThresholds.maxCpuLoad}`,
130
130
  `Min Free Memory: ${status.config.resourceThresholds.minFreeMemoryPercent}%`,
131
- ...(dashboard ? [`Dashboard: http://localhost:${dashboard.port}`] : []),
131
+ ...(dashboard ? [`The Arcane Console: http://localhost:${dashboard.port}`] : []),
132
132
  ].join('\n'), 'Daemon Status');
133
133
  output.writeln();
134
134
  output.writeln(output.bold('Scheduled Workers'));
@@ -215,10 +215,10 @@ async function attachDaemonServices(daemon, opts) {
215
215
  schedulerEnabledInConfig: schedulerConfig.enabled,
216
216
  });
217
217
  if (opts.verbose)
218
- output.printSuccess(`Dashboard: http://localhost:${dashboard.port}`);
218
+ output.printSuccess(`The Arcane Console: http://localhost:${dashboard.port}`);
219
219
  }
220
220
  catch (err) {
221
- logWarn(`Dashboard failed to start: ${errorDetail(err)}`);
221
+ logWarn(`The Arcane Console failed to start: ${errorDetail(err)}`);
222
222
  }
223
223
  }
224
224
  if (!schedulerConfig.enabled) {
@@ -378,7 +378,7 @@ async function startBackgroundDaemon(projectRoot, quiet, maxCpuLoad, minFreeMemo
378
378
  if (!quiet) {
379
379
  output.printSuccess(`Daemon started in background (PID: ${pid})`);
380
380
  if (!noDashboard) {
381
- output.printInfo(`Dashboard: http://localhost:${dashboardPort ?? DEFAULT_DASHBOARD_PORT}`);
381
+ output.printInfo(`The Arcane Console: http://localhost:${dashboardPort ?? DEFAULT_DASHBOARD_PORT}`);
382
382
  }
383
383
  output.printInfo(`Logs: ${logFile}`);
384
384
  output.printInfo(`Stop with: claude-flow daemon stop`);
@@ -624,15 +624,14 @@ const triggerCommand = {
624
624
  ],
625
625
  examples: [
626
626
  { command: 'claude-flow daemon trigger -w map', description: 'Trigger the map worker' },
627
- { command: 'claude-flow daemon trigger -w audit', description: 'Trigger security audit' },
628
- { command: 'claude-flow daemon trigger -w audit --headless', description: 'Trigger audit in headless sandbox' },
627
+ { command: 'claude-flow daemon trigger -w optimize --headless', description: 'Trigger optimize in headless sandbox' },
629
628
  ],
630
629
  action: async (ctx) => {
631
630
  const workerType = ctx.flags.worker;
632
631
  if (!workerType) {
633
632
  output.printError('Worker type is required. Use --worker or -w flag.');
634
633
  output.writeln();
635
- output.writeln('Available workers: map, audit, optimize, consolidate, testgaps, predict, document, ultralearn, refactor, benchmark, deepdive, preload');
634
+ output.writeln('Available workers: map, optimize, consolidate, testgaps, ultralearn, refactor, benchmark, deepdive, preload');
636
635
  return { success: false, exitCode: 1 };
637
636
  }
638
637
  try {
@@ -668,8 +667,8 @@ const enableCommand = {
668
667
  { name: 'disable', short: 'd', type: 'boolean', description: 'Disable instead of enable' },
669
668
  ],
670
669
  examples: [
671
- { command: 'claude-flow daemon enable -w predict', description: 'Enable predict worker' },
672
- { command: 'claude-flow daemon enable -w document --disable', description: 'Disable document worker' },
670
+ { command: 'claude-flow daemon enable -w testgaps', description: 'Enable testgaps worker' },
671
+ { command: 'claude-flow daemon enable -w refactor --disable', description: 'Disable refactor worker' },
673
672
  ],
674
673
  action: async (ctx) => {
675
674
  const workerType = ctx.flags.worker;
@@ -799,7 +798,7 @@ export const daemonCommand = {
799
798
  { command: 'claude-flow daemon start --headless', description: 'Start with headless workers (E2B sandbox)' },
800
799
  { command: 'claude-flow daemon status', description: 'Check daemon status' },
801
800
  { command: 'claude-flow daemon stop', description: 'Stop the daemon' },
802
- { command: 'claude-flow daemon trigger -w audit', description: 'Run security audit' },
801
+ { command: 'claude-flow daemon trigger -w optimize', description: 'Run the optimize worker' },
803
802
  { command: 'claude-flow daemon install', description: 'Register as OS login service' },
804
803
  { command: 'claude-flow daemon uninstall', description: 'Remove OS login service' },
805
804
  ],
@@ -808,7 +807,7 @@ export const daemonCommand = {
808
807
  output.writeln(output.bold('MoFlo Daemon - Background Task Management'));
809
808
  output.writeln();
810
809
  output.writeln('Node.js-based background worker system that auto-runs like shell daemons.');
811
- output.writeln('Manages 12 specialized workers for continuous optimization and monitoring.');
810
+ output.writeln('Manages 9 specialized workers for continuous optimization and monitoring.');
812
811
  output.writeln();
813
812
  output.writeln(output.bold('Headless Mode'));
814
813
  output.writeln('Workers can run in headless mode using E2B sandboxes for isolated execution.');
@@ -816,13 +815,10 @@ export const daemonCommand = {
816
815
  output.writeln();
817
816
  output.writeln(output.bold('Available Workers'));
818
817
  output.printList([
819
- `${output.highlight('map')} - Codebase mapping (5 min interval)`,
820
- `${output.highlight('audit')} - Security analysis (10 min interval)`,
818
+ `${output.highlight('map')} - Codebase mapping (15 min interval)`,
821
819
  `${output.highlight('optimize')} - Performance optimization (15 min interval)`,
822
820
  `${output.highlight('consolidate')} - Memory consolidation (30 min interval)`,
823
821
  `${output.highlight('testgaps')} - Test coverage analysis (20 min interval)`,
824
- `${output.highlight('predict')} - Predictive preloading (2 min, disabled by default)`,
825
- `${output.highlight('document')} - Auto-documentation (60 min, disabled by default)`,
826
822
  `${output.highlight('ultralearn')} - Deep knowledge acquisition (manual trigger)`,
827
823
  `${output.highlight('refactor')} - Code refactoring suggestions (manual trigger)`,
828
824
  `${output.highlight('benchmark')} - Performance benchmarking (manual trigger)`,
@@ -21,9 +21,7 @@ const HOOK_TYPES = [
21
21
  // Agent routing options
22
22
  const AGENT_TYPES = [
23
23
  'coder', 'researcher', 'tester', 'reviewer', 'architect',
24
- 'security-architect', 'security-auditor', 'memory-specialist',
25
- 'swarm-specialist', 'performance-engineer', 'core-architect',
26
- 'test-architect', 'coordinator', 'analyst', 'optimizer'
24
+ 'security-auditor', 'coordinator', 'analyst', 'optimizer', 'planner',
27
25
  ];
28
26
  // Pre-edit subcommand
29
27
  const preEditCommand = {
@@ -1768,14 +1766,14 @@ const workerDispatchCommand = {
1768
1766
  name: 'dispatch',
1769
1767
  description: 'Dispatch a background worker for analysis/optimization',
1770
1768
  options: [
1771
- { name: 'trigger', short: 't', type: 'string', description: 'Worker type (ultralearn, optimize, audit, map, etc.)', required: true },
1769
+ { name: 'trigger', short: 't', type: 'string', description: 'Worker type (ultralearn, optimize, map, testgaps, etc.)', required: true },
1772
1770
  { name: 'context', short: 'c', type: 'string', description: 'Context for the worker (file path, topic)' },
1773
1771
  { name: 'priority', short: 'p', type: 'string', description: 'Priority (low, normal, high, critical)' },
1774
1772
  { name: 'sync', short: 's', type: 'boolean', description: 'Wait for completion (synchronous)' },
1775
1773
  ],
1776
1774
  examples: [
1777
1775
  { command: 'claude-flow hooks worker dispatch -t optimize -c src/', description: 'Dispatch optimize worker' },
1778
- { command: 'claude-flow hooks worker dispatch -t audit -p critical', description: 'Security audit with critical priority' },
1776
+ { command: 'claude-flow hooks worker dispatch -t deepdive -p high', description: 'Deep code analysis with high priority' },
1779
1777
  { command: 'claude-flow hooks worker dispatch -t testgaps --sync', description: 'Test coverage analysis (sync)' },
1780
1778
  ],
1781
1779
  action: async (ctx) => {
@@ -1785,7 +1783,7 @@ const workerDispatchCommand = {
1785
1783
  const background = !ctx.flags['sync'];
1786
1784
  if (!trigger) {
1787
1785
  output.printError('--trigger is required');
1788
- output.writeln('Available triggers: ultralearn, optimize, consolidate, predict, audit, map, preload, deepdive, document, refactor, benchmark, testgaps');
1786
+ output.writeln('Available triggers: ultralearn, optimize, consolidate, map, preload, deepdive, refactor, benchmark, testgaps');
1789
1787
  return { success: false, exitCode: 1 };
1790
1788
  }
1791
1789
  const spinner = output.createSpinner({ text: `Dispatching ${trigger} worker...`, spinner: 'dots' });
@@ -2487,12 +2485,9 @@ const workerCommand = {
2487
2485
  `${output.highlight('ultralearn')} - Deep knowledge acquisition`,
2488
2486
  `${output.highlight('optimize')} - Performance optimization`,
2489
2487
  `${output.highlight('consolidate')} - Memory consolidation`,
2490
- `${output.highlight('predict')} - Predictive preloading`,
2491
- `${output.highlight('audit')} - Security analysis (critical)`,
2492
2488
  `${output.highlight('map')} - Codebase mapping`,
2493
2489
  `${output.highlight('preload')} - Resource preloading`,
2494
2490
  `${output.highlight('deepdive')} - Deep code analysis`,
2495
- `${output.highlight('document')} - Auto-documentation`,
2496
2491
  `${output.highlight('refactor')} - Refactoring suggestions`,
2497
2492
  `${output.highlight('benchmark')} - Performance benchmarks`,
2498
2493
  `${output.highlight('testgaps')} - Test coverage analysis`,
@@ -54,6 +54,8 @@ const commandLoaders = {
54
54
  issues: () => import('./issues.js'),
55
55
  // Auto-update System (ADR-025)
56
56
  update: () => import('./update.js'),
57
+ // Retired-files manifest helper (#948 — moflo dev only)
58
+ retire: () => import('./retire.js'),
57
59
  // Full integration diagnostics
58
60
  diagnose: () => import('./diagnose.js'),
59
61
  // Benchmark Suite (Pre-training, Neural, Memory)
@@ -0,0 +1,111 @@
1
+ /**
2
+ * `flo retire <path>` — record a shipped file as retired (#948).
3
+ *
4
+ * Run this inside the moflo source repo whenever a retirement PR deletes a
5
+ * `.claude/agents/**` or `.claude/skills/**` file. It computes content
6
+ * hashes for the last few moflo-shipped versions of the file (from git
7
+ * history) and appends an entry to `retired-files.json`. The launcher then
8
+ * prunes the matching file from consumer projects on their next upgrade —
9
+ * but only when their on-disk content matches a known-shipped hash, so
10
+ * customized files stay put.
11
+ *
12
+ * Refuses to run outside moflo's own repo because the seed script and
13
+ * `retired-files.json` live at the moflo package root and don't ship to
14
+ * consumer projects.
15
+ *
16
+ * Created with motailz.com
17
+ */
18
+ import { output } from '../output.js';
19
+ import { spawnSync } from 'child_process';
20
+ import { existsSync, readFileSync } from 'fs';
21
+ import { resolve, dirname } from 'path';
22
+ import { fileURLToPath } from 'url';
23
+ const __filename = fileURLToPath(import.meta.url);
24
+ // dist/src/cli/commands/retire.js → repo root is up 5 dirs.
25
+ // In dev (tsx) src/cli/commands/retire.ts → up 4 dirs. Walk to find package.json#name === 'moflo'.
26
+ function findMofloRepoRoot(start) {
27
+ let dir = start;
28
+ const root = resolve(dir, '/');
29
+ while (dir !== root) {
30
+ const pkg = resolve(dir, 'package.json');
31
+ if (existsSync(pkg)) {
32
+ try {
33
+ const parsed = JSON.parse(readFileSync(pkg, 'utf-8'));
34
+ if (parsed?.name === 'moflo')
35
+ return dir;
36
+ }
37
+ catch { /* keep walking */ }
38
+ }
39
+ dir = dirname(dir);
40
+ }
41
+ return null;
42
+ }
43
+ export const retireCommand = {
44
+ name: 'retire',
45
+ description: 'Record a retired shipped file in retired-files.json (moflo dev only) — usage: flo retire <path> [--retired-by #nnn]',
46
+ hidden: true,
47
+ options: [
48
+ {
49
+ name: 'retired-by',
50
+ description: 'GitHub PR/issue reference (e.g. #932)',
51
+ type: 'string',
52
+ },
53
+ {
54
+ name: 'retired-in',
55
+ description: 'moflo version that ships the retirement (defaults to current package.json version)',
56
+ type: 'string',
57
+ },
58
+ {
59
+ name: 'hashes',
60
+ description: 'Maximum number of historical content hashes to record (default 3)',
61
+ type: 'number',
62
+ default: 3,
63
+ },
64
+ ],
65
+ examples: [
66
+ { command: 'flo retire .claude/agents/v3/performance-engineer.md --retired-by #932', description: 'Record a retirement' },
67
+ { command: 'flo retire .claude/skills/skill-builder/SKILL.md --retired-by #945 --retired-in 4.9.21', description: 'Pin retiredIn' },
68
+ ],
69
+ action: async (ctx) => {
70
+ const repoRoot = findMofloRepoRoot(__filename) || findMofloRepoRoot(ctx.cwd);
71
+ if (!repoRoot) {
72
+ output.printError('flo retire must be run inside the moflo source repo');
73
+ output.printInfo('retired-files.json lives at the moflo package root and does not ship to consumer projects');
74
+ return { success: false, message: 'not in moflo repo', exitCode: 1 };
75
+ }
76
+ const path = ctx.args[0];
77
+ if (!path) {
78
+ output.printError('Missing required argument: <path>');
79
+ return { success: false, message: 'missing path', exitCode: 2 };
80
+ }
81
+ const scriptPath = resolve(repoRoot, 'scripts', 'build-retired-files.mjs');
82
+ if (!existsSync(scriptPath)) {
83
+ output.printError(`scripts/build-retired-files.mjs not found at ${scriptPath}`);
84
+ return { success: false, message: 'seed script missing', exitCode: 1 };
85
+ }
86
+ // Parser normalises kebab-case flag names to camelCase before storing
87
+ // (#787). Read as ctx.flags.<camelCase> — bracket-with-kebab is always
88
+ // undefined and ESLint blocks that pattern.
89
+ const args = ['--add', path];
90
+ if (ctx.flags.retiredBy)
91
+ args.push('--retired-by', String(ctx.flags.retiredBy));
92
+ if (ctx.flags.retiredIn)
93
+ args.push('--retired-in', String(ctx.flags.retiredIn));
94
+ if (ctx.flags.hashes)
95
+ args.push('--hashes', String(ctx.flags.hashes));
96
+ const result = spawnSync('node', [scriptPath, ...args], {
97
+ cwd: repoRoot,
98
+ stdio: 'inherit',
99
+ });
100
+ if (result.error) {
101
+ output.printError(`failed to invoke build-retired-files.mjs: ${result.error.message}`);
102
+ return { success: false, message: String(result.error), exitCode: 1 };
103
+ }
104
+ if (typeof result.status === 'number' && result.status !== 0) {
105
+ return { success: false, message: `exit ${result.status}`, exitCode: result.status };
106
+ }
107
+ return { success: true };
108
+ },
109
+ };
110
+ export default retireCommand;
111
+ //# sourceMappingURL=retire.js.map