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.
- package/.claude/agents/analysis/analyze-code-quality.md +0 -121
- package/.claude/agents/analysis/code-analyzer.md +5 -26
- package/.claude/agents/architecture/system-design/arch-system-design.md +0 -119
- package/.claude/agents/base-template-generator.md +0 -1
- package/.claude/agents/core/coder.md +0 -22
- package/.claude/agents/core/planner.md +0 -16
- package/.claude/agents/core/researcher.md +0 -16
- package/.claude/agents/core/reviewer.md +0 -17
- package/.claude/agents/core/tester.md +0 -19
- package/.claude/agents/custom/test-long-runner.md +0 -2
- package/.claude/agents/development/dev-backend-api.md +0 -167
- package/.claude/agents/development/dev-database.md +43 -0
- package/.claude/agents/development/dev-frontend.md +42 -0
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +0 -112
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +0 -111
- package/.claude/agents/security/security-auditor.md +45 -0
- package/.claude/guidance/shipped/moflo-agent-rules.md +172 -0
- package/.claude/guidance/shipped/moflo-claude-swarm-cohesion.md +73 -265
- package/.claude/guidance/shipped/moflo-cli-reference.md +6 -6
- package/.claude/guidance/shipped/moflo-core-guidance.md +66 -184
- package/.claude/guidance/shipped/moflo-cross-platform.md +1 -1
- package/.claude/guidance/shipped/moflo-error-handling.md +3 -3
- package/.claude/guidance/shipped/moflo-guidance-rules.md +17 -7
- package/.claude/guidance/shipped/moflo-memory-strategy.md +76 -182
- package/.claude/guidance/shipped/moflo-memorydb-maintenance.md +6 -8
- package/.claude/guidance/shipped/moflo-settings-injection.md +7 -9
- package/.claude/guidance/shipped/moflo-source-hygiene.md +5 -5
- package/.claude/guidance/shipped/moflo-spell-connectors.md +3 -4
- package/.claude/guidance/shipped/moflo-spell-custom-steps.md +3 -4
- package/.claude/guidance/shipped/moflo-spell-engine.md +40 -162
- package/.claude/guidance/shipped/moflo-spell-runner.md +134 -0
- package/.claude/guidance/shipped/moflo-spell-sandboxing.md +10 -57
- package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +149 -0
- package/.claude/guidance/shipped/moflo-subagents.md +43 -114
- package/.claude/guidance/shipped/moflo-task-icons.md +4 -4
- package/.claude/guidance/shipped/moflo-user-facing-language.md +3 -3
- package/.claude/guidance/shipped/moflo-verbose-command-filtering.md +3 -3
- package/.claude/guidance/shipped/moflo-yaml-reference.md +4 -5
- package/.claude/helpers/gate.cjs +192 -15
- package/.claude/helpers/prompt-hook.mjs +4 -38
- package/.claude/helpers/simplify-classify.cjs +32 -11
- package/.claude/helpers/subagent-bootstrap.json +1 -1
- package/.claude/helpers/subagent-start.cjs +1 -1
- package/.claude/skills/connector-builder/SKILL.md +42 -429
- package/.claude/skills/connector-builder/templates/connector.md +189 -0
- package/.claude/skills/connector-builder/templates/step-command.md +176 -0
- package/.claude/skills/eldar/SKILL.md +7 -7
- package/.claude/skills/fl/SKILL.md +3 -3
- package/.claude/skills/fl/execution-modes.md +39 -16
- package/.claude/skills/fl/phases.md +3 -3
- package/.claude/skills/{simplify → flo-simplify}/SKILL.md +11 -11
- package/.claude/skills/guidance/SKILL.md +17 -9
- package/.claude/skills/memory-patterns/SKILL.md +1 -1
- package/.claude/skills/publish/SKILL.md +121 -36
- package/.claude/skills/reset-epic/SKILL.md +2 -2
- package/.claude/skills/spell-builder/SKILL.md +39 -226
- package/.claude/skills/spell-builder/architecture.md +1 -1
- package/.claude/skills/spell-builder/permissions.md +107 -0
- package/.claude/skills/spell-builder/preflight.md +101 -0
- package/.claude/skills/spell-schedule/SKILL.md +2 -3
- package/bin/gate.cjs +192 -15
- package/bin/lib/retired-files.mjs +146 -0
- package/bin/prompt-hook.mjs +4 -38
- package/bin/session-start-launcher.mjs +120 -1
- package/bin/setup-project.mjs +63 -69
- package/bin/simplify-classify.cjs +32 -11
- package/dist/src/cli/appliance/rvfa-builder.js +1 -1
- package/dist/src/cli/commands/agent.js +3 -9
- package/dist/src/cli/commands/doctor-checks-deep.js +4 -0
- package/dist/src/cli/commands/hooks.js +1 -3
- package/dist/src/cli/commands/index.js +2 -0
- package/dist/src/cli/commands/retire.js +111 -0
- package/dist/src/cli/hooks/reasoningbank/index.js +7 -7
- package/dist/src/cli/init/claudemd-generator.js +30 -33
- package/dist/src/cli/init/executor.js +53 -69
- package/dist/src/cli/init/helpers-generator.js +165 -52
- package/dist/src/cli/init/moflo-init.js +41 -114
- package/dist/src/cli/init/settings-generator.js +44 -14
- package/dist/src/cli/mcp-tools/agent-tools.js +9 -27
- package/dist/src/cli/mcp-tools/hooks-tools.js +23 -21
- package/dist/src/cli/memory/controllers/semantic-router.js +18 -12
- package/dist/src/cli/memory/sona-optimizer.js +6 -6
- package/dist/src/cli/neural/domain/services/learning-service.js +3 -3
- package/dist/src/cli/services/agent-router.js +2 -5
- package/dist/src/cli/services/hook-block-hash.js +11 -2
- package/dist/src/cli/services/hook-wiring.js +86 -3
- package/dist/src/cli/services/subagent-bootstrap.js +1 -1
- package/dist/src/cli/shared/events/example-usage.js +6 -6
- package/dist/src/cli/shared/hooks/task-hooks.js +8 -8
- package/dist/src/cli/version.js +1 -1
- package/package.json +3 -2
- package/retired-files.json +1989 -0
- package/scripts/post-install-bootstrap.mjs +19 -0
- package/src/cli/data/model-registry.json +2 -2
- package/.claude/agents/consensus/byzantine-coordinator.md +0 -63
- package/.claude/agents/consensus/crdt-synchronizer.md +0 -997
- package/.claude/agents/consensus/gossip-coordinator.md +0 -63
- package/.claude/agents/consensus/performance-benchmarker.md +0 -851
- package/.claude/agents/consensus/quorum-manager.md +0 -823
- package/.claude/agents/consensus/raft-manager.md +0 -63
- package/.claude/agents/consensus/security-manager.md +0 -622
- package/.claude/agents/data/ml/data-ml-model.md +0 -193
- package/.claude/agents/github/code-review-swarm.md +0 -538
- package/.claude/agents/github/github-modes.md +0 -172
- package/.claude/agents/github/issue-tracker.md +0 -311
- package/.claude/agents/github/multi-repo-swarm.md +0 -551
- package/.claude/agents/github/pr-manager.md +0 -183
- package/.claude/agents/github/project-board-sync.md +0 -508
- package/.claude/agents/github/release-manager.md +0 -360
- package/.claude/agents/github/release-swarm.md +0 -580
- package/.claude/agents/github/repo-architect.md +0 -391
- package/.claude/agents/github/swarm-issue.md +0 -566
- package/.claude/agents/github/swarm-pr.md +0 -414
- package/.claude/agents/github/sync-coordinator.md +0 -426
- package/.claude/agents/github/workflow-automation.md +0 -606
- package/.claude/agents/goal/code-goal-planner.md +0 -440
- package/.claude/agents/goal/goal-planner.md +0 -168
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -127
- package/.claude/agents/hive-mind/queen-coordinator.md +0 -198
- package/.claude/agents/hive-mind/scout-explorer.md +0 -233
- package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -184
- package/.claude/agents/hive-mind/worker-specialist.md +0 -208
- package/.claude/agents/neural/safla-neural.md +0 -73
- package/.claude/agents/optimization/benchmark-suite.md +0 -665
- package/.claude/agents/optimization/load-balancer.md +0 -431
- package/.claude/agents/optimization/performance-monitor.md +0 -672
- package/.claude/agents/optimization/resource-allocator.md +0 -674
- package/.claude/agents/optimization/topology-optimizer.md +0 -808
- package/.claude/agents/reasoning/goal-planner.md +0 -67
- package/.claude/agents/sona/sona-learning-optimizer.md +0 -74
- package/.claude/agents/sparc/architecture.md +0 -472
- package/.claude/agents/sparc/pseudocode.md +0 -318
- package/.claude/agents/sparc/refinement.md +0 -525
- package/.claude/agents/sparc/specification.md +0 -276
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -225
- package/.claude/agents/swarm/adaptive-coordinator.md +0 -391
- package/.claude/agents/swarm/hierarchical-coordinator.md +0 -321
- package/.claude/agents/swarm/mesh-coordinator.md +0 -383
- package/.claude/agents/testing/production-validator.md +0 -395
- package/.claude/agents/testing/tdd-london-swarm.md +0 -244
- package/.claude/agents/v3/adr-architect.md +0 -184
- package/.claude/agents/v3/aidefence-guardian.md +0 -277
- package/.claude/agents/v3/claims-authorizer.md +0 -208
- package/.claude/agents/v3/collective-intelligence-coordinator.md +0 -988
- package/.claude/agents/v3/ddd-domain-expert.md +0 -220
- package/.claude/agents/v3/injection-analyst.md +0 -232
- package/.claude/agents/v3/memory-specialist.md +0 -987
- package/.claude/agents/v3/performance-engineer.md +0 -1225
- package/.claude/agents/v3/pii-detector.md +0 -146
- package/.claude/agents/v3/reasoningbank-learner.md +0 -213
- package/.claude/agents/v3/security-architect-aidefence.md +0 -405
- package/.claude/agents/v3/security-architect.md +0 -865
- package/.claude/agents/v3/security-auditor.md +0 -771
- package/.claude/agents/v3/sparc-orchestrator.md +0 -182
- package/.claude/agents/v3/swarm-memory-manager.md +0 -142
- package/.claude/agents/v3/v3-integration-architect.md +0 -205
- package/.claude/commands/claude-flow-help.md +0 -103
- package/.claude/commands/claude-flow-memory.md +0 -107
- package/.claude/commands/claude-flow-swarm.md +0 -205
- package/.claude/commands/github/README.md +0 -11
- package/.claude/commands/github/code-review-swarm.md +0 -514
- package/.claude/commands/github/code-review.md +0 -25
- package/.claude/commands/github/github-modes.md +0 -146
- package/.claude/commands/github/github-swarm.md +0 -113
- package/.claude/commands/github/issue-tracker.md +0 -284
- package/.claude/commands/github/issue-triage.md +0 -25
- package/.claude/commands/github/multi-repo-swarm.md +0 -519
- package/.claude/commands/github/pr-enhance.md +0 -26
- package/.claude/commands/github/pr-manager.md +0 -164
- package/.claude/commands/github/project-board-sync.md +0 -471
- package/.claude/commands/github/release-manager.md +0 -332
- package/.claude/commands/github/release-swarm.md +0 -544
- package/.claude/commands/github/repo-analyze.md +0 -25
- package/.claude/commands/github/repo-architect.md +0 -361
- package/.claude/commands/github/swarm-issue.md +0 -482
- package/.claude/commands/github/swarm-pr.md +0 -285
- package/.claude/commands/github/sync-coordinator.md +0 -294
- package/.claude/commands/github/workflow-automation.md +0 -442
- package/.claude/commands/hooks/README.md +0 -11
- package/.claude/commands/hooks/overview.md +0 -58
- package/.claude/commands/hooks/post-edit.md +0 -117
- package/.claude/commands/hooks/post-task.md +0 -112
- package/.claude/commands/hooks/pre-edit.md +0 -113
- package/.claude/commands/hooks/pre-task.md +0 -111
- package/.claude/commands/hooks/session-end.md +0 -118
- package/.claude/commands/hooks/setup.md +0 -103
- package/.claude/commands/simplify.md +0 -101
- package/.claude/commands/sparc/analyzer.md +0 -42
- package/.claude/commands/sparc/architect.md +0 -43
- package/.claude/commands/sparc/ask.md +0 -86
- package/.claude/commands/sparc/batch-executor.md +0 -44
- package/.claude/commands/sparc/code.md +0 -78
- package/.claude/commands/sparc/coder.md +0 -44
- package/.claude/commands/sparc/debug.md +0 -72
- package/.claude/commands/sparc/debugger.md +0 -44
- package/.claude/commands/sparc/designer.md +0 -43
- package/.claude/commands/sparc/devops.md +0 -98
- package/.claude/commands/sparc/docs-writer.md +0 -69
- package/.claude/commands/sparc/documenter.md +0 -44
- package/.claude/commands/sparc/innovator.md +0 -44
- package/.claude/commands/sparc/integration.md +0 -72
- package/.claude/commands/sparc/mcp.md +0 -106
- package/.claude/commands/sparc/memory-manager.md +0 -44
- package/.claude/commands/sparc/optimizer.md +0 -44
- package/.claude/commands/sparc/orchestrator.md +0 -116
- package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -72
- package/.claude/commands/sparc/refinement-optimization-mode.md +0 -72
- package/.claude/commands/sparc/researcher.md +0 -44
- package/.claude/commands/sparc/reviewer.md +0 -44
- package/.claude/commands/sparc/security-review.md +0 -69
- package/.claude/commands/sparc/sparc-modes.md +0 -139
- package/.claude/commands/sparc/sparc.md +0 -99
- package/.claude/commands/sparc/spec-pseudocode.md +0 -69
- package/.claude/commands/sparc/spell-manager.md +0 -44
- package/.claude/commands/sparc/supabase-admin.md +0 -337
- package/.claude/commands/sparc/swarm-coordinator.md +0 -44
- package/.claude/commands/sparc/tdd.md +0 -44
- package/.claude/commands/sparc/tester.md +0 -44
- package/.claude/commands/sparc/tutorial.md +0 -68
- package/.claude/commands/sparc.md +0 -151
- package/.claude/guidance/shipped/moflo-session-start.md +0 -154
- package/.claude/guidance/shipped/moflo-spell-engine-architecture.md +0 -145
- package/.claude/skills/browser/SKILL.md +0 -204
- package/.claude/skills/github-code-review/SKILL.md +0 -1140
- package/.claude/skills/github-multi-repo/SKILL.md +0 -866
- package/.claude/skills/github-project-management/SKILL.md +0 -1272
- package/.claude/skills/github-release-management/SKILL.md +0 -1074
- package/.claude/skills/github-workflow-automation/SKILL.md +0 -1060
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
- package/.claude/skills/hooks-automation/SKILL.md +0 -1193
- package/.claude/skills/pair-programming/SKILL.md +0 -1202
- package/.claude/skills/performance-analysis/SKILL.md +0 -563
- package/.claude/skills/skill-builder/SKILL.md +0 -910
- package/.claude/skills/sparc-methodology/SKILL.md +0 -904
- package/.claude/skills/stream-chain/SKILL.md +0 -563
- package/.claude/skills/swarm-advanced/SKILL.md +0 -811
- package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
- package/.claude/skills/verification-quality/SKILL.md +0 -649
- package/.claude/skills/worker-benchmarks/skill.md +0 -135
- package/.claude/skills/worker-integration/skill.md +0 -154
package/bin/setup-project.mjs
CHANGED
|
@@ -11,78 +11,50 @@
|
|
|
11
11
|
* flo-setup --check # Check if setup is current
|
|
12
12
|
*
|
|
13
13
|
* What it does:
|
|
14
|
-
* 1. Copies
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
//
|
|
33
|
-
|
|
34
|
-
const
|
|
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
|
|
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-
|
|
96
|
+
const target = join(targetDir, 'moflo-subagents.md');
|
|
125
97
|
|
|
126
98
|
if (!existsSync(source)) {
|
|
127
|
-
log('❌ Source
|
|
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-
|
|
118
|
+
log('✅ moflo-subagents.md is current');
|
|
147
119
|
return true;
|
|
148
120
|
}
|
|
149
|
-
log('📝 Updating moflo-
|
|
121
|
+
log('📝 Updating moflo-subagents.md');
|
|
150
122
|
} else {
|
|
151
|
-
log('📝 Creating .claude/guidance/moflo-
|
|
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, ...
|
|
177
|
-
const allEnds = [MARKER_END, ...
|
|
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
|
|
239
|
-
const bootstrapOk =
|
|
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
|
|
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
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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
|
|
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
|
|
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
|
|
190
|
-
|
|
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] :
|
|
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-
|
|
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: '
|
|
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-
|
|
848
|
-
|
|
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-
|
|
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-
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
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/
|
|
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
|
-
* ~
|
|
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
|
-
|
|
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
|
-
###
|
|
34
|
+
### Auto-enforced gates
|
|
34
35
|
|
|
35
|
-
|
|
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
|
-
###
|
|
39
|
+
### Tools
|
|
41
40
|
|
|
42
|
-
|
|
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
|
|
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
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
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,
|
|
77
|
-
{ name: 'standard', description: 'Same as minimal (detailed docs in .claude/guidance/
|
|
78
|
-
{ name: 'full', description: 'Same as minimal (detailed docs in .claude/guidance/
|
|
79
|
-
{ name: 'security', description: 'Same as minimal (detailed docs in .claude/guidance/
|
|
80
|
-
{ name: 'performance', description: 'Same as minimal (detailed docs in .claude/guidance/
|
|
81
|
-
{ name: 'solo', description: 'Same as minimal (detailed docs in .claude/guidance/
|
|
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
|