moflo 4.9.20 → 4.9.22

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 (240) 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-agent-rules.md +172 -0
  18. package/.claude/guidance/shipped/moflo-claude-swarm-cohesion.md +73 -265
  19. package/.claude/guidance/shipped/moflo-cli-reference.md +6 -6
  20. package/.claude/guidance/shipped/moflo-core-guidance.md +66 -184
  21. package/.claude/guidance/shipped/moflo-cross-platform.md +1 -1
  22. package/.claude/guidance/shipped/moflo-error-handling.md +3 -3
  23. package/.claude/guidance/shipped/moflo-guidance-rules.md +17 -7
  24. package/.claude/guidance/shipped/moflo-memory-strategy.md +76 -182
  25. package/.claude/guidance/shipped/moflo-memorydb-maintenance.md +6 -8
  26. package/.claude/guidance/shipped/moflo-settings-injection.md +7 -9
  27. package/.claude/guidance/shipped/moflo-source-hygiene.md +5 -5
  28. package/.claude/guidance/shipped/moflo-spell-connectors.md +3 -4
  29. package/.claude/guidance/shipped/moflo-spell-custom-steps.md +3 -4
  30. package/.claude/guidance/shipped/moflo-spell-engine.md +40 -162
  31. package/.claude/guidance/shipped/moflo-spell-runner.md +134 -0
  32. package/.claude/guidance/shipped/moflo-spell-sandboxing.md +10 -57
  33. package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +149 -0
  34. package/.claude/guidance/shipped/moflo-subagents.md +43 -114
  35. package/.claude/guidance/shipped/moflo-task-icons.md +4 -4
  36. package/.claude/guidance/shipped/moflo-user-facing-language.md +3 -3
  37. package/.claude/guidance/shipped/moflo-verbose-command-filtering.md +3 -3
  38. package/.claude/guidance/shipped/moflo-yaml-reference.md +4 -5
  39. package/.claude/helpers/gate.cjs +192 -15
  40. package/.claude/helpers/prompt-hook.mjs +4 -38
  41. package/.claude/helpers/simplify-classify.cjs +32 -11
  42. package/.claude/helpers/subagent-bootstrap.json +1 -1
  43. package/.claude/helpers/subagent-start.cjs +1 -1
  44. package/.claude/skills/connector-builder/SKILL.md +42 -429
  45. package/.claude/skills/connector-builder/templates/connector.md +189 -0
  46. package/.claude/skills/connector-builder/templates/step-command.md +176 -0
  47. package/.claude/skills/eldar/SKILL.md +7 -7
  48. package/.claude/skills/fl/SKILL.md +3 -3
  49. package/.claude/skills/fl/execution-modes.md +39 -16
  50. package/.claude/skills/fl/phases.md +3 -3
  51. package/.claude/skills/{simplify → flo-simplify}/SKILL.md +11 -11
  52. package/.claude/skills/guidance/SKILL.md +17 -9
  53. package/.claude/skills/memory-patterns/SKILL.md +1 -1
  54. package/.claude/skills/publish/SKILL.md +121 -36
  55. package/.claude/skills/reset-epic/SKILL.md +2 -2
  56. package/.claude/skills/spell-builder/SKILL.md +39 -226
  57. package/.claude/skills/spell-builder/architecture.md +1 -1
  58. package/.claude/skills/spell-builder/permissions.md +107 -0
  59. package/.claude/skills/spell-builder/preflight.md +101 -0
  60. package/.claude/skills/spell-schedule/SKILL.md +2 -3
  61. package/bin/gate.cjs +192 -15
  62. package/bin/lib/retired-files.mjs +146 -0
  63. package/bin/prompt-hook.mjs +4 -38
  64. package/bin/session-start-launcher.mjs +120 -1
  65. package/bin/setup-project.mjs +63 -69
  66. package/bin/simplify-classify.cjs +32 -11
  67. package/dist/src/cli/appliance/rvfa-builder.js +1 -1
  68. package/dist/src/cli/commands/agent.js +3 -9
  69. package/dist/src/cli/commands/doctor-checks-deep.js +4 -0
  70. package/dist/src/cli/commands/hooks.js +1 -3
  71. package/dist/src/cli/commands/index.js +2 -0
  72. package/dist/src/cli/commands/retire.js +111 -0
  73. package/dist/src/cli/hooks/reasoningbank/index.js +7 -7
  74. package/dist/src/cli/init/claudemd-generator.js +30 -33
  75. package/dist/src/cli/init/executor.js +53 -69
  76. package/dist/src/cli/init/helpers-generator.js +165 -52
  77. package/dist/src/cli/init/moflo-init.js +41 -114
  78. package/dist/src/cli/init/settings-generator.js +44 -14
  79. package/dist/src/cli/mcp-tools/agent-tools.js +9 -27
  80. package/dist/src/cli/mcp-tools/hooks-tools.js +23 -21
  81. package/dist/src/cli/memory/controllers/semantic-router.js +18 -12
  82. package/dist/src/cli/memory/sona-optimizer.js +6 -6
  83. package/dist/src/cli/neural/domain/services/learning-service.js +3 -3
  84. package/dist/src/cli/services/agent-router.js +2 -5
  85. package/dist/src/cli/services/hook-block-hash.js +11 -2
  86. package/dist/src/cli/services/hook-wiring.js +86 -3
  87. package/dist/src/cli/services/subagent-bootstrap.js +1 -1
  88. package/dist/src/cli/shared/events/example-usage.js +6 -6
  89. package/dist/src/cli/shared/hooks/task-hooks.js +8 -8
  90. package/dist/src/cli/version.js +1 -1
  91. package/package.json +3 -2
  92. package/retired-files.json +1989 -0
  93. package/scripts/post-install-bootstrap.mjs +19 -0
  94. package/src/cli/data/model-registry.json +2 -2
  95. package/.claude/agents/consensus/byzantine-coordinator.md +0 -63
  96. package/.claude/agents/consensus/crdt-synchronizer.md +0 -997
  97. package/.claude/agents/consensus/gossip-coordinator.md +0 -63
  98. package/.claude/agents/consensus/performance-benchmarker.md +0 -851
  99. package/.claude/agents/consensus/quorum-manager.md +0 -823
  100. package/.claude/agents/consensus/raft-manager.md +0 -63
  101. package/.claude/agents/consensus/security-manager.md +0 -622
  102. package/.claude/agents/data/ml/data-ml-model.md +0 -193
  103. package/.claude/agents/github/code-review-swarm.md +0 -538
  104. package/.claude/agents/github/github-modes.md +0 -172
  105. package/.claude/agents/github/issue-tracker.md +0 -311
  106. package/.claude/agents/github/multi-repo-swarm.md +0 -551
  107. package/.claude/agents/github/pr-manager.md +0 -183
  108. package/.claude/agents/github/project-board-sync.md +0 -508
  109. package/.claude/agents/github/release-manager.md +0 -360
  110. package/.claude/agents/github/release-swarm.md +0 -580
  111. package/.claude/agents/github/repo-architect.md +0 -391
  112. package/.claude/agents/github/swarm-issue.md +0 -566
  113. package/.claude/agents/github/swarm-pr.md +0 -414
  114. package/.claude/agents/github/sync-coordinator.md +0 -426
  115. package/.claude/agents/github/workflow-automation.md +0 -606
  116. package/.claude/agents/goal/code-goal-planner.md +0 -440
  117. package/.claude/agents/goal/goal-planner.md +0 -168
  118. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -127
  119. package/.claude/agents/hive-mind/queen-coordinator.md +0 -198
  120. package/.claude/agents/hive-mind/scout-explorer.md +0 -233
  121. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -184
  122. package/.claude/agents/hive-mind/worker-specialist.md +0 -208
  123. package/.claude/agents/neural/safla-neural.md +0 -73
  124. package/.claude/agents/optimization/benchmark-suite.md +0 -665
  125. package/.claude/agents/optimization/load-balancer.md +0 -431
  126. package/.claude/agents/optimization/performance-monitor.md +0 -672
  127. package/.claude/agents/optimization/resource-allocator.md +0 -674
  128. package/.claude/agents/optimization/topology-optimizer.md +0 -808
  129. package/.claude/agents/reasoning/goal-planner.md +0 -67
  130. package/.claude/agents/sona/sona-learning-optimizer.md +0 -74
  131. package/.claude/agents/sparc/architecture.md +0 -472
  132. package/.claude/agents/sparc/pseudocode.md +0 -318
  133. package/.claude/agents/sparc/refinement.md +0 -525
  134. package/.claude/agents/sparc/specification.md +0 -276
  135. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -225
  136. package/.claude/agents/swarm/adaptive-coordinator.md +0 -391
  137. package/.claude/agents/swarm/hierarchical-coordinator.md +0 -321
  138. package/.claude/agents/swarm/mesh-coordinator.md +0 -383
  139. package/.claude/agents/testing/production-validator.md +0 -395
  140. package/.claude/agents/testing/tdd-london-swarm.md +0 -244
  141. package/.claude/agents/v3/adr-architect.md +0 -184
  142. package/.claude/agents/v3/aidefence-guardian.md +0 -277
  143. package/.claude/agents/v3/claims-authorizer.md +0 -208
  144. package/.claude/agents/v3/collective-intelligence-coordinator.md +0 -988
  145. package/.claude/agents/v3/ddd-domain-expert.md +0 -220
  146. package/.claude/agents/v3/injection-analyst.md +0 -232
  147. package/.claude/agents/v3/memory-specialist.md +0 -987
  148. package/.claude/agents/v3/performance-engineer.md +0 -1225
  149. package/.claude/agents/v3/pii-detector.md +0 -146
  150. package/.claude/agents/v3/reasoningbank-learner.md +0 -213
  151. package/.claude/agents/v3/security-architect-aidefence.md +0 -405
  152. package/.claude/agents/v3/security-architect.md +0 -865
  153. package/.claude/agents/v3/security-auditor.md +0 -771
  154. package/.claude/agents/v3/sparc-orchestrator.md +0 -182
  155. package/.claude/agents/v3/swarm-memory-manager.md +0 -142
  156. package/.claude/agents/v3/v3-integration-architect.md +0 -205
  157. package/.claude/commands/claude-flow-help.md +0 -103
  158. package/.claude/commands/claude-flow-memory.md +0 -107
  159. package/.claude/commands/claude-flow-swarm.md +0 -205
  160. package/.claude/commands/github/README.md +0 -11
  161. package/.claude/commands/github/code-review-swarm.md +0 -514
  162. package/.claude/commands/github/code-review.md +0 -25
  163. package/.claude/commands/github/github-modes.md +0 -146
  164. package/.claude/commands/github/github-swarm.md +0 -113
  165. package/.claude/commands/github/issue-tracker.md +0 -284
  166. package/.claude/commands/github/issue-triage.md +0 -25
  167. package/.claude/commands/github/multi-repo-swarm.md +0 -519
  168. package/.claude/commands/github/pr-enhance.md +0 -26
  169. package/.claude/commands/github/pr-manager.md +0 -164
  170. package/.claude/commands/github/project-board-sync.md +0 -471
  171. package/.claude/commands/github/release-manager.md +0 -332
  172. package/.claude/commands/github/release-swarm.md +0 -544
  173. package/.claude/commands/github/repo-analyze.md +0 -25
  174. package/.claude/commands/github/repo-architect.md +0 -361
  175. package/.claude/commands/github/swarm-issue.md +0 -482
  176. package/.claude/commands/github/swarm-pr.md +0 -285
  177. package/.claude/commands/github/sync-coordinator.md +0 -294
  178. package/.claude/commands/github/workflow-automation.md +0 -442
  179. package/.claude/commands/hooks/README.md +0 -11
  180. package/.claude/commands/hooks/overview.md +0 -58
  181. package/.claude/commands/hooks/post-edit.md +0 -117
  182. package/.claude/commands/hooks/post-task.md +0 -112
  183. package/.claude/commands/hooks/pre-edit.md +0 -113
  184. package/.claude/commands/hooks/pre-task.md +0 -111
  185. package/.claude/commands/hooks/session-end.md +0 -118
  186. package/.claude/commands/hooks/setup.md +0 -103
  187. package/.claude/commands/simplify.md +0 -101
  188. package/.claude/commands/sparc/analyzer.md +0 -42
  189. package/.claude/commands/sparc/architect.md +0 -43
  190. package/.claude/commands/sparc/ask.md +0 -86
  191. package/.claude/commands/sparc/batch-executor.md +0 -44
  192. package/.claude/commands/sparc/code.md +0 -78
  193. package/.claude/commands/sparc/coder.md +0 -44
  194. package/.claude/commands/sparc/debug.md +0 -72
  195. package/.claude/commands/sparc/debugger.md +0 -44
  196. package/.claude/commands/sparc/designer.md +0 -43
  197. package/.claude/commands/sparc/devops.md +0 -98
  198. package/.claude/commands/sparc/docs-writer.md +0 -69
  199. package/.claude/commands/sparc/documenter.md +0 -44
  200. package/.claude/commands/sparc/innovator.md +0 -44
  201. package/.claude/commands/sparc/integration.md +0 -72
  202. package/.claude/commands/sparc/mcp.md +0 -106
  203. package/.claude/commands/sparc/memory-manager.md +0 -44
  204. package/.claude/commands/sparc/optimizer.md +0 -44
  205. package/.claude/commands/sparc/orchestrator.md +0 -116
  206. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -72
  207. package/.claude/commands/sparc/refinement-optimization-mode.md +0 -72
  208. package/.claude/commands/sparc/researcher.md +0 -44
  209. package/.claude/commands/sparc/reviewer.md +0 -44
  210. package/.claude/commands/sparc/security-review.md +0 -69
  211. package/.claude/commands/sparc/sparc-modes.md +0 -139
  212. package/.claude/commands/sparc/sparc.md +0 -99
  213. package/.claude/commands/sparc/spec-pseudocode.md +0 -69
  214. package/.claude/commands/sparc/spell-manager.md +0 -44
  215. package/.claude/commands/sparc/supabase-admin.md +0 -337
  216. package/.claude/commands/sparc/swarm-coordinator.md +0 -44
  217. package/.claude/commands/sparc/tdd.md +0 -44
  218. package/.claude/commands/sparc/tester.md +0 -44
  219. package/.claude/commands/sparc/tutorial.md +0 -68
  220. package/.claude/commands/sparc.md +0 -151
  221. package/.claude/guidance/shipped/moflo-session-start.md +0 -154
  222. package/.claude/guidance/shipped/moflo-spell-engine-architecture.md +0 -145
  223. package/.claude/skills/browser/SKILL.md +0 -204
  224. package/.claude/skills/github-code-review/SKILL.md +0 -1140
  225. package/.claude/skills/github-multi-repo/SKILL.md +0 -866
  226. package/.claude/skills/github-project-management/SKILL.md +0 -1272
  227. package/.claude/skills/github-release-management/SKILL.md +0 -1074
  228. package/.claude/skills/github-workflow-automation/SKILL.md +0 -1060
  229. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
  230. package/.claude/skills/hooks-automation/SKILL.md +0 -1193
  231. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  232. package/.claude/skills/performance-analysis/SKILL.md +0 -563
  233. package/.claude/skills/skill-builder/SKILL.md +0 -910
  234. package/.claude/skills/sparc-methodology/SKILL.md +0 -904
  235. package/.claude/skills/stream-chain/SKILL.md +0 -563
  236. package/.claude/skills/swarm-advanced/SKILL.md +0 -811
  237. package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
  238. package/.claude/skills/verification-quality/SKILL.md +0 -649
  239. package/.claude/skills/worker-benchmarks/skill.md +0 -135
  240. package/.claude/skills/worker-integration/skill.md +0 -154
@@ -11,78 +11,50 @@
11
11
  * flo-setup --check # Check if setup is current
12
12
  *
13
13
  * What it does:
14
- * 1. Copies .claude/guidance/shipped/moflo-subagents.md → project's .claude/guidance/moflo-bootstrap.md
14
+ * 1. Copies moflo/.claude/guidance/shipped/moflo-subagents.md → project's .claude/guidance/moflo-subagents.md
15
15
  * 2. Appends a subagent protocol section to CLAUDE.md (idempotent, with markers)
16
16
  *
17
+ * Historical note (#939): pre-fix builds renamed the destination to
18
+ * moflo-bootstrap.md, but the launcher's stage-3 also synced the original name
19
+ * — consumers ended up with two copies of the same content. The launcher now
20
+ * prunes any legacy moflo-bootstrap.md on first session-start after upgrade.
21
+ *
17
22
  * The project can layer its own guidance files on top for
18
23
  * project-specific rules (companyId, entity templates, etc.).
24
+ *
25
+ * The CLAUDE.md content is owned by `src/cli/init/claudemd-generator.ts` (compiled to
26
+ * `dist/src/cli/init/claudemd-generator.js`). This script is a thin wrapper so consumers
27
+ * always get byte-identical output regardless of which entry point they use
28
+ * (`flo init` vs `flo-setup`).
19
29
  */
20
30
 
21
- import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'node:fs';
31
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync, unlinkSync } from 'node:fs';
22
32
  import { dirname, resolve, join } from 'node:path';
23
33
  import { fileURLToPath } from 'node:url';
24
-
25
- const __dirname = dirname(fileURLToPath(import.meta.url));
26
- const mofloRoot = resolve(__dirname, '..');
34
+ import { mofloInternalURL } from './lib/moflo-resolve.mjs';
35
+
36
+ // Resolve moflo's installed package root via Node module resolution so the script
37
+ // works identically from bin/ (canonical) or from .claude/scripts/ (synced copy).
38
+ const mofloRoot = dirname(fileURLToPath(mofloInternalURL('package.json')));
39
+
40
+ // Single source of truth: claudemd-generator.ts owns the section content.
41
+ // Use the shared mofloInternalURL helper so the script works identically when
42
+ // invoked from bin/ (canonical) or from .claude/scripts/ (synced copy).
43
+ const {
44
+ generateClaudeMd,
45
+ MARKER_START,
46
+ MARKER_END,
47
+ LEGACY_MARKER_STARTS,
48
+ LEGACY_MARKER_ENDS,
49
+ } = await import(mofloInternalURL('dist/src/cli/init/claudemd-generator.js'));
27
50
 
28
51
  const args = process.argv.slice(2);
29
52
  const updateOnly = args.includes('--update');
30
53
  const checkOnly = args.includes('--check');
31
54
 
32
- // Markers for idempotent CLAUDE.md updates — keep in sync with claudemd-generator.ts
33
- const MARKER_START = '<!-- MOFLO:INJECTED:START -->';
34
- const MARKER_END = '<!-- MOFLO:INJECTED:END -->';
35
- // Legacy markers to detect and replace
36
- const LEGACY_STARTS = ['<!-- MOFLO:SUBAGENT-PROTOCOL:START -->', '<!-- MOFLO:START -->'];
37
- const LEGACY_ENDS = ['<!-- MOFLO:SUBAGENT-PROTOCOL:END -->', '<!-- MOFLO:END -->'];
38
-
39
- // Minimal injection — just enough for Claude to work with moflo.
40
- // All detailed docs live in .claude/guidance/shipped/moflo-core-guidance.md.
41
- const CLAUDE_MD_SECTION = `${MARKER_START}
42
- ## MoFlo — AI Agent Orchestration
43
-
44
- This project uses [MoFlo](https://github.com/eric-cielo/moflo) for AI-assisted development workflows.
45
-
46
- ### FIRST ACTION ON EVERY PROMPT: Search Memory
47
-
48
- Your first tool call for every new user prompt MUST be a memory search. Do this BEFORE Glob, Grep, Read, or any file exploration.
49
-
50
- \`\`\`
51
- mcp__moflo__memory_search — query: "<task description>", namespace: "guidance" or "patterns" or "learnings" or "code-map" or "tests"
52
- \`\`\`
53
-
54
- Search \`guidance\`, \`patterns\`, and \`learnings\` namespaces on every prompt. Search \`code-map\` when navigating the codebase, \`tests\` when looking for test inventory or coverage.
55
- When the user asks you to remember something: \`mcp__moflo__memory_store\` with namespace \`learnings\`.
56
-
57
- ### Workflow Gates (enforced automatically)
58
-
59
- - **Memory-first**: Must search memory before Glob/Grep/Read
60
- - **TaskCreate-first**: Must call TaskCreate before spawning Agent tool
61
-
62
- - **Task Icons**: \`TaskCreate\` MUST use ICON+[Role] format — see \`.claude/guidance/moflo-task-icons.md\`
63
-
64
- ### MCP Tools (preferred over CLI)
65
-
66
- | Tool | Purpose |
67
- |------|---------|
68
- | \`mcp__moflo__memory_search\` | Semantic search across indexed knowledge |
69
- | \`mcp__moflo__memory_store\` | Store patterns and decisions |
70
- | \`mcp__moflo__hooks_route\` | Route task to optimal agent type |
71
- | \`mcp__moflo__hooks_pre-task\` | Record task start |
72
- | \`mcp__moflo__hooks_post-task\` | Record task completion for learning |
73
-
74
- ### CLI Fallback
75
-
76
- \`\`\`bash
77
- flo-search "[query]" --namespace guidance # Semantic search
78
- flo doctor --fix # Health check
79
- \`\`\`
80
-
81
- ### Full Reference
82
-
83
- For CLI commands, hooks, agents, swarm config, memory commands, and moflo.yaml options, see:
84
- \`.claude/guidance/shipped/moflo-core-guidance.md\`
85
- ${MARKER_END}`;
55
+ // Canonical section content (owned by claudemd-generator.ts). Trim the trailing newline
56
+ // that generateClaudeMd appends so the marker-replace logic below stays exact.
57
+ const CLAUDE_MD_SECTION = generateClaudeMd({}).trimEnd();
86
58
 
87
59
  function log(msg) {
88
60
  console.log(`[flo-setup] ${msg}`);
@@ -115,16 +87,16 @@ function findProjectRoot() {
115
87
  return null;
116
88
  }
117
89
 
118
- function copyBootstrap(projectRoot) {
90
+ function copySubagentsGuidance(projectRoot) {
119
91
  const shippedSource = join(mofloRoot, '.claude', 'guidance', 'shipped', 'moflo-subagents.md');
120
92
  const source = existsSync(shippedSource)
121
93
  ? shippedSource
122
94
  : join(mofloRoot, '.claude', 'guidance', 'moflo-subagents.md');
123
95
  const targetDir = join(projectRoot, '.claude', 'guidance');
124
- const target = join(targetDir, 'moflo-bootstrap.md');
96
+ const target = join(targetDir, 'moflo-subagents.md');
125
97
 
126
98
  if (!existsSync(source)) {
127
- log('❌ Source bootstrap not found in moflo package');
99
+ log('❌ Source subagents guidance not found in moflo package');
128
100
  return false;
129
101
  }
130
102
 
@@ -143,12 +115,12 @@ function copyBootstrap(projectRoot) {
143
115
  const existing = readFileSync(target, 'utf-8');
144
116
  const newContent = header + content;
145
117
  if (existing === newContent) {
146
- log('✅ moflo-bootstrap.md is current');
118
+ log('✅ moflo-subagents.md is current');
147
119
  return true;
148
120
  }
149
- log('📝 Updating moflo-bootstrap.md');
121
+ log('📝 Updating moflo-subagents.md');
150
122
  } else {
151
- log('📝 Creating .claude/guidance/moflo-bootstrap.md');
123
+ log('📝 Creating .claude/guidance/moflo-subagents.md');
152
124
  }
153
125
 
154
126
  if (!checkOnly) {
@@ -157,6 +129,25 @@ function copyBootstrap(projectRoot) {
157
129
  return true;
158
130
  }
159
131
 
132
+ // Best-effort cleanup of pre-#939 moflo-bootstrap.md left over from prior
133
+ // installs. Only removes the file if it carries one of our auto-generated
134
+ // headers — never deletes a homonymous user-authored file. Idempotent.
135
+ function cleanupLegacyBootstrap(projectRoot) {
136
+ const legacy = join(projectRoot, '.claude', 'guidance', 'moflo-bootstrap.md');
137
+ if (!existsSync(legacy)) return;
138
+ try {
139
+ const head = readFileSync(legacy, 'utf-8').slice(0, 200);
140
+ const ours = head.includes('AUTO-GENERATED by moflo init') || head.includes('AUTO-GENERATED by flo-setup');
141
+ if (!ours) return;
142
+ if (!checkOnly) {
143
+ unlinkSync(legacy);
144
+ log('🧹 Removed legacy moflo-bootstrap.md (pre-#939 duplicate of moflo-subagents.md)');
145
+ } else {
146
+ log('⚠️ Legacy moflo-bootstrap.md present — will be removed on next non-check run');
147
+ }
148
+ } catch { /* non-fatal */ }
149
+ }
150
+
160
151
  function updateClaudeMd(projectRoot) {
161
152
  const claudeMdPath = join(projectRoot, 'CLAUDE.md');
162
153
 
@@ -173,8 +164,8 @@ function updateClaudeMd(projectRoot) {
173
164
  const content = readFileSync(claudeMdPath, 'utf-8');
174
165
 
175
166
  // Check for current or legacy markers and replace
176
- const allStarts = [MARKER_START, ...LEGACY_STARTS];
177
- const allEnds = [MARKER_END, ...LEGACY_ENDS];
167
+ const allStarts = [MARKER_START, ...LEGACY_MARKER_STARTS];
168
+ const allEnds = [MARKER_END, ...LEGACY_MARKER_ENDS];
178
169
 
179
170
  for (let i = 0; i < allStarts.length; i++) {
180
171
  if (content.includes(allStarts[i])) {
@@ -235,8 +226,11 @@ function main() {
235
226
  log(`Project: ${projectRoot}`);
236
227
  console.log('');
237
228
 
238
- // Step 1: Copy bootstrap file
239
- const bootstrapOk = copyBootstrap(projectRoot);
229
+ // Step 1: Copy subagents guidance under its real name (#939 — was moflo-bootstrap.md)
230
+ const bootstrapOk = copySubagentsGuidance(projectRoot);
231
+
232
+ // Step 1b: Remove pre-#939 moflo-bootstrap.md if it still exists from an older install
233
+ cleanupLegacyBootstrap(projectRoot);
240
234
 
241
235
  // Step 2: Update CLAUDE.md (skip on --update, only refresh the file)
242
236
  const claudeOk = updateOnly ? true : updateClaudeMd(projectRoot);
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * /simplify diff classifier — issue #908.
3
+ * /flo-simplify diff classifier.
4
4
  *
5
5
  * Decides which review tier the current diff warrants and returns a JSON
6
- * dispatch decision. The /simplify skill MUST call this first so routing is
6
+ * dispatch decision. The /flo-simplify skill MUST call this first so routing is
7
7
  * deterministic and unit-testable instead of a prose decision Claude makes
8
8
  * over and over per run.
9
9
  *
10
- * Rule (per user direction): default to single-agent Sonnet review. Only
11
- * escalate to a 3-agent fan-out when diff signals genuinely warrant it.
12
- * Opus is never selected — the existing skill already documents that.
10
+ * Rule: default to single-agent Sonnet review. Only escalate to a 3-agent
11
+ * fan-out when diff signals genuinely warrant it. Opus is never selected —
12
+ * the existing skill already documents that.
13
13
  *
14
14
  * Outputs JSON:
15
15
  * {
@@ -21,7 +21,8 @@
21
21
  * }
22
22
  *
23
23
  * Usage:
24
- * node bin/simplify-classify.cjs [--base main]
24
+ * node bin/simplify-classify.cjs # auto-detects default branch
25
+ * node bin/simplify-classify.cjs --base develop # explicit override
25
26
  * node bin/simplify-classify.cjs --diff <unified-diff-on-stdin>
26
27
  *
27
28
  * The --diff stdin form exists so unit tests can drive the classifier
@@ -31,7 +32,7 @@
31
32
 
32
33
  const { execSync } = require('child_process');
33
34
 
34
- // Paths where new logic warrants the 3-agent fan-out (issue #908).
35
+ // Paths where new logic warrants the 3-agent fan-out.
35
36
  // Mechanical edits inside these paths are still SMALL; only adding/removing
36
37
  // declarations triggers escalation.
37
38
  const SECURITY_PATHS = [
@@ -49,6 +50,25 @@ function safeExec(cmd) {
49
50
  catch { return ''; }
50
51
  }
51
52
 
53
+ // Detect the consumer's default branch. Hardcoding 'main' silently miscalibrates
54
+ // classification on repos that use 'master', 'develop', etc. — empty diff →
55
+ // TRIVIAL → gate stamps clean without any real review.
56
+ let _cachedDefaultBranch = null;
57
+ function detectDefaultBranch() {
58
+ if (_cachedDefaultBranch !== null) return _cachedDefaultBranch;
59
+
60
+ // Preferred: origin/HEAD points to whatever the remote considers default.
61
+ const symbolic = safeExec('git symbolic-ref --short refs/remotes/origin/HEAD').trim();
62
+ if (symbolic.startsWith('origin/')) return (_cachedDefaultBranch = symbolic.slice('origin/'.length));
63
+
64
+ // Fallback: local init.defaultBranch (set by `git init -b <name>` or config).
65
+ const configured = safeExec('git config --get init.defaultBranch').trim();
66
+ if (configured) return (_cachedDefaultBranch = configured);
67
+
68
+ // Last resort: 'main' (most common modern default).
69
+ return (_cachedDefaultBranch = 'main');
70
+ }
71
+
52
72
  function readDiffFromGit(base) {
53
73
  // Combined diff: committed-since-base + working-tree
54
74
  const committed = safeExec(`git diff ${base}...HEAD`);
@@ -186,14 +206,15 @@ function classifyDiff(diffText) {
186
206
  return decide(parseDiff(diffText));
187
207
  }
188
208
 
189
- function classifyFromGit(base = 'main') {
190
- return classifyDiff(readDiffFromGit(base));
209
+ function classifyFromGit(base) {
210
+ const resolved = base || detectDefaultBranch();
211
+ return classifyDiff(readDiffFromGit(resolved));
191
212
  }
192
213
 
193
214
  if (require.main === module) {
194
215
  const args = process.argv.slice(2);
195
216
  const baseIdx = args.indexOf('--base');
196
- const base = baseIdx >= 0 ? args[baseIdx + 1] : 'main';
217
+ const base = baseIdx >= 0 ? args[baseIdx + 1] : detectDefaultBranch();
197
218
  const stdinDiff = args.includes('--diff') || args.includes('--stdin');
198
219
 
199
220
  let result;
@@ -211,4 +232,4 @@ if (require.main === module) {
211
232
  }
212
233
  }
213
234
 
214
- module.exports = { parseDiff, decide, classifyDiff, classifyFromGit };
235
+ module.exports = { parseDiff, decide, classifyDiff, classifyFromGit, detectDefaultBranch };
@@ -20,7 +20,7 @@ const AES_TAG_LEN = 16;
20
20
  const AES_ALG = 'aes-256-gcm';
21
21
  // ── Catalog ──────────────────────────────────────────────────
22
22
  const RUFLO_COMMANDS = 'init agent swarm memory mcp task session config status start workflow hooks hive-mind daemon neural security performance providers plugins deployment embeddings claims migrate process doctor completions'.split(' ');
23
- const AGENT_TYPES = 'coder reviewer tester planner researcher security-architect security-auditor memory-specialist performance-engineer hierarchical-coordinator mesh-coordinator adaptive-coordinator collective-intelligence-coordinator swarm-memory-manager byzantine-coordinator raft-manager gossip-coordinator consensus-builder crdt-synchronizer quorum-manager security-manager perf-analyzer performance-benchmarker task-orchestrator memory-coordinator smart-agent github-modes pr-manager code-review-swarm issue-tracker release-manager workflow-automation project-board-sync repo-architect multi-repo-swarm sparc-coord sparc-coder specification pseudocode architecture refinement backend-dev mobile-dev ml-developer cicd-engineer api-docs system-architect code-analyzer base-template-generator tdd-london-swarm production-validator'.split(' ');
23
+ const AGENT_TYPES = 'coder reviewer tester planner researcher security-auditor backend-dev frontend-dev database-dev cicd-engineer api-docs system-architect code-analyzer analyst base-template-generator test-long-runner'.split(' ');
24
24
  const HOOK_TYPES = 'pre-edit post-edit pre-command post-command pre-task post-task session-start session-end session-restore notify route explain pretrain build-agents transfer teammate-idle task-completed'.split(' ');
25
25
  const WORKER_TYPES = 'ultralearn optimize consolidate predict audit map preload deepdive document refactor benchmark testgaps'.split(' ');
26
26
  const OFFLINE_MODELS = [
@@ -68,13 +68,8 @@ const AGENT_TYPES = [
68
68
  { value: 'coordinator', label: 'Coordinator', hint: 'Multi-agent orchestration and spell management' },
69
69
  { value: 'analyst', label: 'Analyst', hint: 'Performance analysis and optimization' },
70
70
  { value: 'optimizer', label: 'Optimizer', hint: 'Performance optimization and bottleneck analysis' },
71
- { value: 'security-architect', label: 'Security Architect', hint: 'Security architecture and threat modeling' },
72
71
  { value: 'security-auditor', label: 'Security Auditor', hint: 'CVE remediation and security testing' },
73
- { value: 'memory-specialist', label: 'Memory Specialist', hint: 'AgentDB unification (150x-12,500x faster)' },
74
- { value: 'swarm-specialist', label: 'Swarm Specialist', hint: 'Unified coordination engine' },
75
- { value: 'performance-engineer', label: 'Performance Engineer', hint: '2.49x-7.47x optimization targets' },
76
- { value: 'core-architect', label: 'Core Architect', hint: 'Domain-driven design restructure' },
77
- { value: 'test-architect', label: 'Test Architect', hint: 'TDD London School methodology' }
72
+ { value: 'planner', label: 'Planner', hint: 'Task planning and breakdown' },
78
73
  ];
79
74
  // Agent spawn subcommand
80
75
  const spawnCommand = {
@@ -844,9 +839,8 @@ function getAgentCapabilities(type) {
844
839
  reviewer: ['code-review', 'security-audit', 'quality-check', 'documentation'],
845
840
  architect: ['system-design', 'pattern-analysis', 'scalability', 'documentation'],
846
841
  coordinator: ['task-orchestration', 'agent-management', 'spell-control'],
847
- 'security-architect': ['threat-modeling', 'security-patterns', 'compliance', 'audit'],
848
- 'memory-specialist': ['vector-search', 'agentdb', 'caching', 'optimization'],
849
- 'performance-engineer': ['benchmarking', 'profiling', 'optimization', 'monitoring']
842
+ 'security-auditor': ['threat-modeling', 'security-patterns', 'compliance', 'audit', 'vulnerability-scan'],
843
+ planner: ['task-breakdown', 'sequencing', 'estimation'],
850
844
  };
851
845
  return capabilities[type] || ['general'];
852
846
  }
@@ -425,6 +425,10 @@ const REQUIRED_GATE_CASES = [
425
425
  'check-before-pr',
426
426
  'check-dangerous-command',
427
427
  'prompt-reminder',
428
+ // #931 — Defensive safety-net for the second UserPromptSubmit hook. State
429
+ // reset only, no emission. doctor warns if a consumer's gate.cjs is too old
430
+ // to handle it.
431
+ 'prompt-state-reset',
428
432
  'session-reset',
429
433
  ];
430
434
  // Import + re-export from the self-contained hook-wiring module (single source of truth).
@@ -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 = {
@@ -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
@@ -33,15 +33,15 @@ const DEFAULT_CONFIG = {
33
33
  useMockEmbeddings: false,
34
34
  };
35
35
  /**
36
- * Agent mapping for routing
36
+ * Agent mapping for routing — keys must match agents shipped in .claude/agents/
37
+ * (or the canonical AgentType union).
37
38
  */
38
39
  const AGENT_PATTERNS = {
39
- 'security-architect': /security|auth|cve|vuln|encrypt|password|token/i,
40
- 'test-architect': /test|spec|mock|coverage|tdd|assert/i,
41
- 'performance-engineer': /perf|optim|fast|memory|cache|speed|slow/i,
42
- 'core-architect': /architect|design|ddd|domain|refactor|struct/i,
43
- 'swarm-specialist': /swarm|agent|coordinate|orchestrat|parallel/i,
44
- 'memory-specialist': /memory|agentdb|hnsw|vector|embedding/i,
40
+ 'security-auditor': /security|auth|cve|vuln|encrypt|password|token/i,
41
+ 'tester': /test|spec|mock|coverage|tdd|assert/i,
42
+ 'architect': /architect|design|ddd|domain|refactor|struct|perf|optim|fast|memory|cache|speed|slow/i,
43
+ 'coordinator': /swarm|agent|coordinate|orchestrat|parallel|hive/i,
44
+ 'researcher': /memory|agentdb|hnsw|vector|embedding|recall|persist/i,
45
45
  'coder': /fix|bug|implement|create|add|build|error|code/i,
46
46
  'reviewer': /review|quality|lint|check|audit/i,
47
47
  };
@@ -3,60 +3,57 @@
3
3
  *
4
4
  * Generates ONLY the MoFlo section to inject into a project's CLAUDE.md.
5
5
  * This must be minimal — just enough for Claude to work with moflo.
6
- * All detailed docs live in .claude/guidance/shipped/moflo-core-guidance.md (copied at install).
6
+ * All detailed docs live in .claude/guidance/moflo-core-guidance.md on consumer projects (synced from .claude/guidance/shipped/ inside node_modules/moflo).
7
7
  *
8
8
  * Principle: we are guests in the user's CLAUDE.md. Keep it small.
9
9
  */
10
10
  const MARKER_START = '<!-- MOFLO:INJECTED:START -->';
11
11
  const MARKER_END = '<!-- MOFLO:INJECTED:END -->';
12
+ // Legacy markers from earlier moflo versions — detected and replaced on re-injection.
13
+ // Single source of truth so moflo-init.ts and bin/setup-project.mjs stay in sync.
14
+ const LEGACY_MARKER_STARTS = [
15
+ '<!-- MOFLO:START -->',
16
+ '<!-- MOFLO:SUBAGENT-PROTOCOL:START -->',
17
+ ];
18
+ const LEGACY_MARKER_ENDS = [
19
+ '<!-- MOFLO:END -->',
20
+ '<!-- MOFLO:SUBAGENT-PROTOCOL:END -->',
21
+ ];
12
22
  /**
13
23
  * The single moflo section injected into CLAUDE.md.
14
- * ~40 lines. Points to moflo-core-guidance.md for everything else.
24
+ * ~22 lines. Points to moflo-core-guidance.md for everything else.
15
25
  */
16
26
  function mofloSection() {
17
27
  return `${MARKER_START}
18
28
  ## MoFlo — AI Agent Orchestration
19
29
 
20
- This project uses [MoFlo](https://github.com/eric-cielo/moflo) for AI-assisted development spells.
21
-
22
30
  ### FIRST ACTION ON EVERY PROMPT: Search Memory
23
31
 
24
- MUST call \`mcp__moflo__memory_search\` BEFORE any Glob/Grep/Read/file exploration. Namespaces: \`guidance\`+\`patterns\`+\`learnings\` every prompt; \`code-map\` when navigating code; \`tests\` when looking for test inventory or coverage. When the user says "remember this": \`mcp__moflo__memory_store\` with namespace \`learnings\`.
25
-
26
- ### Spell Gates (enforced automatically)
27
-
28
- - **Memory-first**: Must search memory before Glob/Grep/Read
29
- - **TaskCreate-first**: Must call TaskCreate before spawning Agent tool
30
-
31
- - **Task Icons**: \`TaskCreate\` MUST use ICON+[Role] format — see \`.claude/guidance/moflo-task-icons.md\`
32
+ Your first tool call MUST be \`mcp__moflo__memory_search\` before any Glob/Grep/Read. Search \`guidance\`, \`patterns\`, and \`learnings\` every prompt; add \`code-map\` when navigating code, \`tests\` when looking for test inventory or coverage. When the user says "remember this", call \`mcp__moflo__memory_store\` with namespace \`learnings\`.
32
33
 
33
- ### MCP Tools (preferred over CLI)
34
+ ### Auto-enforced gates
34
35
 
35
- | Tool | Purpose |
36
- |------|---------|
37
- | \`mcp__moflo__memory_search\` | Semantic search across indexed knowledge |
38
- | \`mcp__moflo__memory_store\` | Store patterns and decisions |
36
+ - **TaskCreate-first**: Call \`TaskCreate\` before spawning the Agent tool
37
+ - **Task Icons**: \`TaskCreate\` entries MUST use ICON+[Role] format — see \`.claude/guidance/moflo-task-icons.md\`
39
38
 
40
- ### CLI Fallback
39
+ ### Tools
41
40
 
42
- \`\`\`bash
43
- flo-search "[query]" --namespace guidance # Semantic search
44
- flo doctor --fix # Health check
45
- \`\`\`
41
+ Prefer MCP (\`mcp__moflo__*\` — memory, swarm, agent, task, hooks, hive-mind, neural) over the CLI. CLI binaries: \`flo\` (main), \`flo-search\` (semantic search), \`flo doctor --fix\` (heal). Full catalog: \`.claude/guidance/moflo-core-guidance.md\`.
46
42
 
47
43
  ### After upgrading MoFlo
48
44
 
49
- After running \`npm install moflo@*\` (or \`npm install\` that touches moflo), check \`.moflo/restart-pending.json\`. If it exists, surface the \`message\` field to the user verbatim (Claude Code can't pick up new hooks/MCP tools/launcher mid-session — they're only loaded at session-start), then delete the file.
45
+ After \`npm install\` touches moflo, check \`.moflo/restart-pending.json\` if present, surface its \`message\` field to the user verbatim, then delete the file. (Claude Code only loads new hooks/MCP/launcher at session start.)
50
46
 
51
47
  ### Full Reference
52
48
 
53
- - **Subagents protocol:** \`.claude/guidance/shipped/moflo-subagents.md\`
54
- - **Task + swarm coordination:** \`.claude/guidance/shipped/moflo-claude-swarm-cohesion.md\`
55
- - **CLI, hooks, swarm, memory, moflo.yaml:** \`.claude/guidance/shipped/moflo-core-guidance.md\`
49
+ - Universal agent rules (memory protocol, git/PR conventions, file org, build/test): \`.claude/guidance/moflo-agent-rules.md\`
50
+ - Subagent spawn protocol: \`.claude/guidance/moflo-subagents.md\`
51
+ - Task + swarm coordination: \`.claude/guidance/moflo-claude-swarm-cohesion.md\`
52
+ - CLI, hooks, swarm, memory, moflo.yaml: \`.claude/guidance/moflo-core-guidance.md\`
56
53
  ${MARKER_END}`;
57
54
  }
58
55
  // --- Public API ---
59
- export { MARKER_START, MARKER_END };
56
+ export { MARKER_START, MARKER_END, LEGACY_MARKER_STARTS, LEGACY_MARKER_ENDS };
60
57
  /**
61
58
  * Generate the MoFlo section to inject into CLAUDE.md.
62
59
  * Template parameter is accepted for backward compatibility but ignored —
@@ -73,12 +70,12 @@ export function generateMinimalClaudeMd(options) {
73
70
  }
74
71
  /** Available template names for CLI wizard (kept for backward compat, all produce same output) */
75
72
  export const CLAUDE_MD_TEMPLATES = [
76
- { name: 'minimal', description: 'Recommended — memory search, spell gates, MCP tools (~40 lines injected)' },
77
- { name: 'standard', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo-core-guidance.md)' },
78
- { name: 'full', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo-core-guidance.md)' },
79
- { name: 'security', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo-core-guidance.md)' },
80
- { name: 'performance', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo-core-guidance.md)' },
81
- { name: 'solo', description: 'Same as minimal (detailed docs in .claude/guidance/shipped/moflo-core-guidance.md)' },
73
+ { name: 'minimal', description: 'Recommended — memory search, gates, tools, upgrade hint (~22 lines injected)' },
74
+ { name: 'standard', description: 'Same as minimal (detailed docs in .claude/guidance/moflo-core-guidance.md)' },
75
+ { name: 'full', description: 'Same as minimal (detailed docs in .claude/guidance/moflo-core-guidance.md)' },
76
+ { name: 'security', description: 'Same as minimal (detailed docs in .claude/guidance/moflo-core-guidance.md)' },
77
+ { name: 'performance', description: 'Same as minimal (detailed docs in .claude/guidance/moflo-core-guidance.md)' },
78
+ { name: 'solo', description: 'Same as minimal (detailed docs in .claude/guidance/moflo-core-guidance.md)' },
82
79
  ];
83
80
  export default generateClaudeMd;
84
81
  //# sourceMappingURL=claudemd-generator.js.map