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
|
@@ -15,6 +15,8 @@ import { execSync } from 'child_process';
|
|
|
15
15
|
import { locateMofloRootPath } from '../services/moflo-require.js';
|
|
16
16
|
import { errorDetail } from '../shared/utils/error-detail.js';
|
|
17
17
|
import { discoverGuidanceDirs, discoverSrcDirs, discoverTestDirs, detectExtensions, renderMofloYaml, } from './moflo-yaml-template.js';
|
|
18
|
+
import { generateClaudeMd as generateMofloSection, MARKER_START, MARKER_END, LEGACY_MARKER_STARTS, LEGACY_MARKER_ENDS, } from './claudemd-generator.js';
|
|
19
|
+
import { DEFAULT_INIT_OPTIONS } from './types.js';
|
|
18
20
|
export { discoverTestDirs };
|
|
19
21
|
// ============================================================================
|
|
20
22
|
// Init
|
|
@@ -138,11 +140,10 @@ export async function initMoflo(options) {
|
|
|
138
140
|
steps.push(syncScripts(projectRoot, force));
|
|
139
141
|
// Step 6: .gitignore entries
|
|
140
142
|
steps.push(updateGitignore(projectRoot));
|
|
141
|
-
// Step 7:
|
|
142
|
-
|
|
143
|
-
// Step 8: Sync ALL shipped guidance docs from moflo to project
|
|
143
|
+
// Step 7: Sync ALL shipped guidance docs from moflo to project (includes
|
|
144
|
+
// moflo-subagents.md — no separate rename to moflo-bootstrap.md, see #939)
|
|
144
145
|
steps.push(...syncAllShippedGuidance(projectRoot, force));
|
|
145
|
-
// Step
|
|
146
|
+
// Step 8: Install global `flo` shim so bare `flo` command works without npx
|
|
146
147
|
steps.push(installGlobalFloShim(projectRoot));
|
|
147
148
|
return { steps };
|
|
148
149
|
}
|
|
@@ -222,6 +223,16 @@ function generateHooks(root, force, answers) {
|
|
|
222
223
|
{ "type": "command", "command": gateHook('check-dangerous-command'), "timeout": 2000 },
|
|
223
224
|
{ "type": "command", "command": gateHook('check-before-pr'), "timeout": 2000 }
|
|
224
225
|
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
// #931 — Advisory only; never blocks. TaskCreate REMINDER and the
|
|
229
|
+
// namespace hint moved here from UserPromptSubmit so they emit only
|
|
230
|
+
// when Claude is about to spawn an Agent — saves ~90 tokens × every
|
|
231
|
+
// prompt × every consumer. Routed via gate-hook.mjs so Claude Code's
|
|
232
|
+
// session_id is forwarded as HOOK_SESSION_ID, enabling per-actor
|
|
233
|
+
// single-shot emission (mirror of #879's record-memory-searched fix).
|
|
234
|
+
"matcher": "^Agent$",
|
|
235
|
+
"hooks": [{ "type": "command", "command": gateHook('check-before-agent'), "timeout": 2000 }]
|
|
225
236
|
}
|
|
226
237
|
],
|
|
227
238
|
"PostToolUse": [
|
|
@@ -252,12 +263,16 @@ function generateHooks(root, force, answers) {
|
|
|
252
263
|
"hooks": [{ "type": "command", "command": gateHook('record-skill-run'), "timeout": 2000 }]
|
|
253
264
|
},
|
|
254
265
|
{
|
|
266
|
+
// Anchored alternation — Claude Code anchors hook matchers (`^…$` semantics),
|
|
267
|
+
// so a bare `mcp__moflo__memory_` never matches any real MCP tool name and the
|
|
268
|
+
// hook silently no-ops (#929 regression). The explicit suffix list keeps the
|
|
269
|
+
// matcher narrow while catching every memory_* tool we ship.
|
|
255
270
|
// Use gateHook (not gate) so the wrapper forwards Claude Code's session_id as
|
|
256
271
|
// HOOK_SESSION_ID — record-memory-searched needs this to mark the per-actor map
|
|
257
272
|
// (memorySearchedBy[sid]) that check-before-read consults under #838's per-actor gating.
|
|
258
273
|
// Without it, the legacy boolean is set but the per-actor map stays empty, and the gate
|
|
259
274
|
// blocks every Read forever within the turn (issue #879).
|
|
260
|
-
"matcher": "mcp__moflo__memory_",
|
|
275
|
+
"matcher": "^mcp__moflo__memory_(search|retrieve|list|stats|store)$",
|
|
261
276
|
"hooks": [{ "type": "command", "command": gateHook('record-memory-searched'), "timeout": 3000 }]
|
|
262
277
|
},
|
|
263
278
|
{
|
|
@@ -272,11 +287,13 @@ function generateHooks(root, force, answers) {
|
|
|
272
287
|
]
|
|
273
288
|
},
|
|
274
289
|
{
|
|
275
|
-
// prompt-
|
|
276
|
-
// new prompt and reclassify memoryRequired. Without it, gate state leaks
|
|
277
|
-
// prompts. Separate hook entry so a prompt-hook.mjs exception doesn't
|
|
290
|
+
// prompt-state-reset is REQUIRED to reset memorySearched/memorySearchedBy on
|
|
291
|
+
// each new prompt and reclassify memoryRequired. Without it, gate state leaks
|
|
292
|
+
// across prompts. Separate hook entry so a prompt-hook.mjs exception doesn't
|
|
293
|
+
// skip the reset. Idempotent state reset only — no emission, no
|
|
294
|
+
// interactionCount increment (#931 dedupe).
|
|
278
295
|
"hooks": [
|
|
279
|
-
{ "type": "command", "command": gateHook('prompt-
|
|
296
|
+
{ "type": "command", "command": gateHook('prompt-state-reset'), "timeout": 3000 }
|
|
280
297
|
]
|
|
281
298
|
}
|
|
282
299
|
],
|
|
@@ -381,24 +398,16 @@ function generateSkill(root, force) {
|
|
|
381
398
|
// ============================================================================
|
|
382
399
|
// Step 4: CLAUDE.md MoFlo section
|
|
383
400
|
// ============================================================================
|
|
384
|
-
|
|
385
|
-
const MOFLO_MARKER = '<!-- MOFLO:INJECTED:START -->';
|
|
386
|
-
const MOFLO_MARKER_END = '<!-- MOFLO:INJECTED:END -->';
|
|
387
|
-
// Also detect legacy markers so we can replace them
|
|
388
|
-
const LEGACY_MARKERS = ['<!-- MOFLO:START -->', '<!-- MOFLO:SUBAGENT-PROTOCOL:START -->'];
|
|
389
|
-
const LEGACY_MARKERS_END = ['<!-- MOFLO:END -->', '<!-- MOFLO:SUBAGENT-PROTOCOL:END -->'];
|
|
390
|
-
function generateClaudeMd(root, force) {
|
|
401
|
+
function generateClaudeMd(root, _force) {
|
|
391
402
|
const claudeMdPath = path.join(root, 'CLAUDE.md');
|
|
392
403
|
let existing = '';
|
|
393
404
|
if (fs.existsSync(claudeMdPath)) {
|
|
394
405
|
existing = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
395
|
-
//
|
|
396
|
-
const allStartMarkers = [
|
|
397
|
-
const allEndMarkers = [
|
|
406
|
+
// Strip current or legacy MoFlo block so we can re-inject the latest content.
|
|
407
|
+
const allStartMarkers = [MARKER_START, ...LEGACY_MARKER_STARTS];
|
|
408
|
+
const allEndMarkers = [MARKER_END, ...LEGACY_MARKER_ENDS];
|
|
398
409
|
for (let i = 0; i < allStartMarkers.length; i++) {
|
|
399
410
|
if (existing.includes(allStartMarkers[i])) {
|
|
400
|
-
// Always strip the existing section so we can re-inject the latest version.
|
|
401
|
-
// This ensures CLAUDE.md stays current when moflo updates its injected content.
|
|
402
411
|
const startIdx = existing.indexOf(allStartMarkers[i]);
|
|
403
412
|
const endIdx = existing.indexOf(allEndMarkers[i]);
|
|
404
413
|
if (endIdx > startIdx) {
|
|
@@ -407,60 +416,14 @@ function generateClaudeMd(root, force) {
|
|
|
407
416
|
}
|
|
408
417
|
}
|
|
409
418
|
}
|
|
410
|
-
//
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
${MOFLO_MARKER}
|
|
414
|
-
## MoFlo — AI Agent Orchestration
|
|
415
|
-
|
|
416
|
-
This project uses [MoFlo](https://github.com/eric-cielo/moflo) for AI-assisted development spells.
|
|
417
|
-
|
|
418
|
-
### FIRST ACTION ON EVERY PROMPT: Search Memory
|
|
419
|
-
|
|
420
|
-
Your first tool call for every new user prompt MUST be a memory search. Do this BEFORE Glob, Grep, Read, or any file exploration.
|
|
421
|
-
|
|
422
|
-
\`\`\`
|
|
423
|
-
mcp__moflo__memory_search — query: "<task description>", namespace: "guidance" or "patterns" or "learnings" or "code-map" or "tests"
|
|
424
|
-
\`\`\`
|
|
425
|
-
|
|
426
|
-
Search \`guidance\`, \`patterns\`, and \`learnings\` namespaces on every prompt. Search \`code-map\` when navigating the codebase, \`tests\` when looking for test inventory or coverage.
|
|
427
|
-
When the user asks you to remember something: \`mcp__moflo__memory_store\` with namespace \`learnings\`.
|
|
428
|
-
|
|
429
|
-
### Spell Gates (enforced automatically)
|
|
430
|
-
|
|
431
|
-
- **Memory-first**: Must search memory before Glob/Grep/Read
|
|
432
|
-
- **TaskCreate-first**: Must call TaskCreate before spawning Agent tool
|
|
433
|
-
- **Task Icons**: \`TaskCreate\` MUST use ICON+[Role] format — see \`.claude/guidance/moflo-task-icons.md\`
|
|
434
|
-
|
|
435
|
-
### MCP Tools (preferred over CLI)
|
|
436
|
-
|
|
437
|
-
| Tool | Purpose |
|
|
438
|
-
|------|---------|
|
|
439
|
-
| \`mcp__moflo__memory_search\` | Semantic search across indexed knowledge |
|
|
440
|
-
| \`mcp__moflo__memory_store\` | Store patterns and decisions |
|
|
441
|
-
| \`mcp__moflo__hooks_route\` | Route task to optimal agent type |
|
|
442
|
-
| \`mcp__moflo__hooks_pre-task\` | Record task start |
|
|
443
|
-
| \`mcp__moflo__hooks_post-task\` | Record task completion for learning |
|
|
444
|
-
|
|
445
|
-
### CLI Fallback
|
|
446
|
-
|
|
447
|
-
\`\`\`bash
|
|
448
|
-
flo-search "[query]" --namespace guidance # Semantic search
|
|
449
|
-
flo doctor --fix # Health check
|
|
450
|
-
\`\`\`
|
|
451
|
-
|
|
452
|
-
### Full Reference
|
|
453
|
-
|
|
454
|
-
For CLI commands, hooks, agents, swarm config, memory commands, and moflo.yaml options, see:
|
|
455
|
-
\`.claude/guidance/shipped/moflo-core-guidance.md\`
|
|
456
|
-
${MOFLO_MARKER_END}
|
|
457
|
-
`;
|
|
458
|
-
const finalContent = existing.trimEnd() + '\n' + mofloSection;
|
|
419
|
+
// Single source of truth: claudemd-generator.ts owns the section content.
|
|
420
|
+
const canonical = generateMofloSection(DEFAULT_INIT_OPTIONS);
|
|
421
|
+
const finalContent = existing.trimEnd() + '\n\n' + canonical;
|
|
459
422
|
fs.writeFileSync(claudeMdPath, finalContent, 'utf-8');
|
|
460
423
|
return {
|
|
461
424
|
name: 'CLAUDE.md',
|
|
462
425
|
status: existing ? 'updated' : 'created',
|
|
463
|
-
detail: 'MoFlo section injected (~
|
|
426
|
+
detail: 'MoFlo section injected (~22 lines)',
|
|
464
427
|
};
|
|
465
428
|
}
|
|
466
429
|
// ============================================================================
|
|
@@ -561,48 +524,10 @@ function updateGitignore(root) {
|
|
|
561
524
|
return { name: '.gitignore', status: 'updated', detail: `Added: ${toAdd.join(', ')}` };
|
|
562
525
|
}
|
|
563
526
|
// ============================================================================
|
|
564
|
-
// Step 7:
|
|
565
|
-
// Copies the agent bootstrap guidance to the project so subagents can read it
|
|
566
|
-
// from disk without requiring memory search.
|
|
567
|
-
// ============================================================================
|
|
568
|
-
function syncBootstrapGuidance(root, force) {
|
|
569
|
-
const guidanceDir = path.join(root, '.claude', 'guidance');
|
|
570
|
-
const targetFile = path.join(guidanceDir, 'moflo-bootstrap.md');
|
|
571
|
-
const candidates = [
|
|
572
|
-
path.join(root, 'node_modules', 'moflo', '.claude', 'guidance', 'shipped', 'moflo-subagents.md'),
|
|
573
|
-
// Anchor on moflo's own package root (covers dev + installed; #782).
|
|
574
|
-
...mofloRootJoin('.claude', 'guidance', 'shipped', 'moflo-subagents.md'),
|
|
575
|
-
];
|
|
576
|
-
const sourceFile = candidates.find(f => { try {
|
|
577
|
-
return fs.existsSync(f);
|
|
578
|
-
}
|
|
579
|
-
catch {
|
|
580
|
-
return false;
|
|
581
|
-
} });
|
|
582
|
-
if (!sourceFile) {
|
|
583
|
-
return { name: 'guidance/moflo-bootstrap.md', status: 'skipped', detail: 'Source bootstrap not found' };
|
|
584
|
-
}
|
|
585
|
-
// Check if target exists and is up to date
|
|
586
|
-
if (fs.existsSync(targetFile) && !force) {
|
|
587
|
-
if (!isStale(sourceFile, targetFile)) {
|
|
588
|
-
return { name: 'guidance/moflo-bootstrap.md', status: 'skipped', detail: 'Already up to date' };
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
// Read source and prepend header
|
|
592
|
-
const content = fs.readFileSync(sourceFile, 'utf-8');
|
|
593
|
-
const header = `<!-- AUTO-GENERATED by moflo init. Do not edit — changes will be overwritten on next init. -->\n<!-- Source: moflo/.claude/guidance/shipped/moflo-subagents.md -->\n<!-- To customize, create your own project-specific guidance in .claude/guidance/. -->\n\n`;
|
|
594
|
-
fs.mkdirSync(guidanceDir, { recursive: true });
|
|
595
|
-
fs.writeFileSync(targetFile, header + content, 'utf-8');
|
|
596
|
-
return {
|
|
597
|
-
name: 'guidance/moflo-bootstrap.md',
|
|
598
|
-
status: fs.existsSync(targetFile) ? 'updated' : 'created',
|
|
599
|
-
detail: 'Subagent bootstrap protocol'
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
// ============================================================================
|
|
603
|
-
// Step 8: Sync ALL shipped guidance docs
|
|
527
|
+
// Step 7: Sync ALL shipped guidance docs
|
|
604
528
|
// Discovers all .md files in moflo/.claude/guidance/shipped/ and copies them
|
|
605
|
-
// to project .claude/guidance
|
|
529
|
+
// to project .claude/guidance/ (including moflo-subagents.md — see #939, prior
|
|
530
|
+
// versions renamed it to moflo-bootstrap.md, creating a structural duplicate).
|
|
606
531
|
// ============================================================================
|
|
607
532
|
function syncAllShippedGuidance(root, force) {
|
|
608
533
|
const guidanceDir = path.join(root, '.claude', 'guidance');
|
|
@@ -621,8 +546,10 @@ function syncAllShippedGuidance(root, force) {
|
|
|
621
546
|
if (!shippedDir) {
|
|
622
547
|
return [{ name: 'guidance/shipped/*', status: 'skipped', detail: 'Shipped guidance directory not found' }];
|
|
623
548
|
}
|
|
624
|
-
// Discover all .md files
|
|
625
|
-
|
|
549
|
+
// Discover all shipped .md files dynamically — including moflo-subagents.md
|
|
550
|
+
// (#939: prior versions renamed it to moflo-bootstrap.md as a separate step,
|
|
551
|
+
// which left two copies of the same content on consumer disk).
|
|
552
|
+
const files = fs.readdirSync(shippedDir).filter(f => f.endsWith('.md'));
|
|
626
553
|
if (files.length === 0) {
|
|
627
554
|
return [{ name: 'guidance/shipped/*', status: 'skipped', detail: 'No shipped guidance files found' }];
|
|
628
555
|
}
|
|
@@ -236,6 +236,18 @@ function generateHooksConfig(config) {
|
|
|
236
236
|
{ type: 'command', command: gateHookCmd('check-before-pr'), timeout: 2000 },
|
|
237
237
|
],
|
|
238
238
|
},
|
|
239
|
+
// #931 — TaskCreate REMINDER + namespace hint moved here from
|
|
240
|
+
// UserPromptSubmit. They only matter when Claude is about to spawn an
|
|
241
|
+
// Agent; emitting per-prompt cost ~90 tokens × every prompt × every
|
|
242
|
+
// consumer. Advisory only — never blocks. Routed through gate-hook.mjs
|
|
243
|
+
// so Claude Code's session_id is forwarded as HOOK_SESSION_ID — the
|
|
244
|
+
// namespace hint emission tracks per-actor (mirror of #879's fix for
|
|
245
|
+
// record-memory-searched), so subagents that spawn their own agents
|
|
246
|
+
// still get the hint on their first check.
|
|
247
|
+
{
|
|
248
|
+
matcher: '^Agent$',
|
|
249
|
+
hooks: [{ type: 'command', command: gateHookCmd('check-before-agent'), timeout: 2000 }],
|
|
250
|
+
},
|
|
239
251
|
];
|
|
240
252
|
}
|
|
241
253
|
// PostToolUse — record outcomes for learning
|
|
@@ -270,13 +282,16 @@ function generateHooksConfig(config) {
|
|
|
270
282
|
hooks: [{ type: 'command', command: gateHookCmd('record-skill-run'), timeout: 2000 }],
|
|
271
283
|
},
|
|
272
284
|
{
|
|
273
|
-
//
|
|
274
|
-
//
|
|
275
|
-
//
|
|
276
|
-
//
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
|
|
285
|
+
// Anchored alternation — Claude Code anchors hook matchers (`^…$` semantics),
|
|
286
|
+
// so a bare `mcp__moflo__memory_` never matches any real MCP tool name and the
|
|
287
|
+
// hook silently no-ops (#929 regression). Listing the explicit suffixes keeps
|
|
288
|
+
// the matcher narrow while still catching every memory_* tool we ship.
|
|
289
|
+
// Use gateHookCmd (not gateCmd) so the wrapper forwards Claude Code's session_id
|
|
290
|
+
// as HOOK_SESSION_ID — record-memory-searched needs this to mark the per-actor
|
|
291
|
+
// map (memorySearchedBy[sid]) that check-before-read consults under #838's
|
|
292
|
+
// per-actor gating. Without it, the legacy boolean is set but the per-actor map
|
|
293
|
+
// stays empty, and the gate blocks every Read forever within the turn (#879).
|
|
294
|
+
matcher: '^mcp__moflo__memory_(search|retrieve|list|stats|store)$',
|
|
280
295
|
hooks: [{ type: 'command', command: gateHookCmd('record-memory-searched'), timeout: 3000 }],
|
|
281
296
|
},
|
|
282
297
|
{
|
|
@@ -287,14 +302,29 @@ function generateHooksConfig(config) {
|
|
|
287
302
|
matcher: '^mcp__moflo__memory_store$',
|
|
288
303
|
hooks: [{ type: 'command', command: gateCmd('record-learnings-stored'), timeout: 2000 }],
|
|
289
304
|
},
|
|
305
|
+
{
|
|
306
|
+
// #952 — when /fl is invoked with -s/--swarm, the gate blocks Agent
|
|
307
|
+
// spawns until mcp__moflo__swarm_init runs. Record the call here so
|
|
308
|
+
// the hard block in check-before-agent passes for legitimate /fl runs.
|
|
309
|
+
matcher: '^mcp__moflo__swarm_init$',
|
|
310
|
+
hooks: [{ type: 'command', command: gateCmd('record-swarm-init'), timeout: 2000 }],
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
// #952 — symmetric record for /fl -h/--hive runs.
|
|
314
|
+
matcher: '^mcp__moflo__hive-mind_init$',
|
|
315
|
+
hooks: [{ type: 'command', command: gateCmd('record-hive-init'), timeout: 2000 }],
|
|
316
|
+
},
|
|
290
317
|
];
|
|
291
318
|
}
|
|
292
|
-
// UserPromptSubmit —
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
//
|
|
319
|
+
// UserPromptSubmit — per-prompt state reset + Context warnings.
|
|
320
|
+
// Two separate hook entries (not chained) so an exception in prompt-hook.mjs
|
|
321
|
+
// doesn't skip the reset. The first hook runs prompt-hook.mjs which invokes
|
|
322
|
+
// gate.cjs `prompt-reminder` (full reset + interactionCount + Context
|
|
323
|
+
// warnings). The second hook runs `prompt-state-reset` — a defensive
|
|
324
|
+
// safety-net that re-applies the idempotent state reset (memorySearched,
|
|
325
|
+
// memorySearchedBy, memoryRequired, lastNamespaceHint) without
|
|
326
|
+
// double-incrementing interactionCount or duplicating any user-visible
|
|
327
|
+
// emission (#931).
|
|
298
328
|
if (config.userPromptSubmit) {
|
|
299
329
|
hooks.UserPromptSubmit = [
|
|
300
330
|
{
|
|
@@ -304,7 +334,7 @@ function generateHooksConfig(config) {
|
|
|
304
334
|
},
|
|
305
335
|
{
|
|
306
336
|
hooks: [
|
|
307
|
-
{ type: 'command', command: gateHookCmd('prompt-
|
|
337
|
+
{ type: 'command', command: gateHookCmd('prompt-state-reset'), timeout: 3000 },
|
|
308
338
|
],
|
|
309
339
|
},
|
|
310
340
|
];
|
|
@@ -27,33 +27,16 @@ const CANONICAL_AGENT_TYPES = [
|
|
|
27
27
|
];
|
|
28
28
|
const ALLOWED_AGENT_TYPES = new Set([
|
|
29
29
|
...CANONICAL_AGENT_TYPES,
|
|
30
|
-
//
|
|
31
|
-
'
|
|
30
|
+
// Claude Code built-ins
|
|
31
|
+
'claude-code-guide', 'general-purpose',
|
|
32
|
+
// Shipped Claude Code agent definitions (.claude/agents/**) — both the
|
|
33
|
+
// canonical `name:` slug and the file basename are accepted.
|
|
32
34
|
'analyze-code-quality', 'api-docs', 'arch-system-design',
|
|
33
|
-
'backend-dev', 'base-template-generator', '
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'dev-backend-api', 'docs-api-openapi', 'general-purpose',
|
|
39
|
-
'github-modes', 'goal-planner', 'gossip-coordinator',
|
|
40
|
-
'hierarchical-coordinator', 'injection-analyst', 'issue-tracker',
|
|
41
|
-
'load-balancer', 'memory-specialist', 'mesh-coordinator',
|
|
42
|
-
'ml-developer', 'mobile-dev', 'multi-repo-swarm',
|
|
43
|
-
'ops-cicd-github', 'performance-benchmarker', 'performance-engineer',
|
|
44
|
-
'performance-monitor', 'pii-detector', 'planner',
|
|
45
|
-
'pr-manager', 'production-validator', 'project-board-sync',
|
|
46
|
-
'pseudocode', 'quorum-manager', 'queen-coordinator',
|
|
47
|
-
'raft-manager', 'reasoningbank-learner', 'refinement',
|
|
48
|
-
'release-manager', 'release-swarm', 'repo-architect',
|
|
49
|
-
'resource-allocator', 'safla-neural', 'scout-explorer',
|
|
50
|
-
'security-architect', 'security-architect-aidefence',
|
|
51
|
-
'security-auditor', 'security-manager', 'sona-learning-optimizer',
|
|
52
|
-
'sparc-orchestrator', 'spec-mobile-react-native', 'specification',
|
|
53
|
-
'swarm-issue', 'swarm-memory-manager', 'swarm-pr',
|
|
54
|
-
'sync-coordinator', 'system-architect', 'tdd-london-swarm',
|
|
55
|
-
'test-long-runner', 'topology-optimizer', 'v3-integration-architect',
|
|
56
|
-
'workflow-automation', 'worker-specialist',
|
|
35
|
+
'backend-dev', 'base-template-generator', 'cicd-engineer',
|
|
36
|
+
'code-analyzer', 'database-dev', 'dev-backend-api',
|
|
37
|
+
'dev-database', 'dev-frontend', 'docs-api-openapi',
|
|
38
|
+
'frontend-dev', 'ops-cicd-github', 'planner',
|
|
39
|
+
'security-auditor', 'system-architect', 'test-long-runner',
|
|
57
40
|
]);
|
|
58
41
|
const AGENT_TYPE_SLUG_RE = /^[a-z][a-z0-9-]*$/;
|
|
59
42
|
export function toNonNegativeInt(value, fallback) {
|
|
@@ -78,7 +61,6 @@ export function validateAgentType(value) {
|
|
|
78
61
|
const AGENT_TYPE_MODEL_DEFAULTS = {
|
|
79
62
|
// Complex agents → opus
|
|
80
63
|
'architect': 'opus',
|
|
81
|
-
'security-architect': 'opus',
|
|
82
64
|
'system-architect': 'opus',
|
|
83
65
|
'core-architect': 'opus',
|
|
84
66
|
// Medium complexity → sonnet
|
|
@@ -211,7 +211,7 @@ function learnedPatternsFromOutcomes() {
|
|
|
211
211
|
const TASK_PATTERNS = {
|
|
212
212
|
'security-task': {
|
|
213
213
|
keywords: ['authentication', 'security', 'auth', 'password', 'encryption', 'vulnerability', 'cve', 'audit'],
|
|
214
|
-
agents: ['security-
|
|
214
|
+
agents: ['security-auditor', 'reviewer'],
|
|
215
215
|
},
|
|
216
216
|
'testing-task': {
|
|
217
217
|
keywords: ['test', 'testing', 'spec', 'coverage', 'unit test', 'integration test', 'e2e'],
|
|
@@ -223,7 +223,7 @@ const TASK_PATTERNS = {
|
|
|
223
223
|
},
|
|
224
224
|
'performance-task': {
|
|
225
225
|
keywords: ['performance', 'optimize', 'speed', 'memory', 'benchmark', 'profiling', 'bottleneck'],
|
|
226
|
-
agents: ['
|
|
226
|
+
agents: ['reviewer', 'coder', 'tester'],
|
|
227
227
|
},
|
|
228
228
|
'refactor-task': {
|
|
229
229
|
keywords: ['refactor', 'restructure', 'clean', 'organize', 'modular', 'decouple'],
|
|
@@ -239,23 +239,25 @@ const TASK_PATTERNS = {
|
|
|
239
239
|
},
|
|
240
240
|
'database-task': {
|
|
241
241
|
keywords: ['database', 'sql', 'query', 'schema', 'migration', 'orm'],
|
|
242
|
-
agents: ['
|
|
242
|
+
agents: ['database-dev', 'coder', 'tester'],
|
|
243
243
|
},
|
|
244
244
|
'frontend-task': {
|
|
245
|
-
keywords: ['frontend', 'ui', 'component', 'react', 'css', 'style', 'layout'],
|
|
246
|
-
agents: ['
|
|
245
|
+
keywords: ['frontend', 'ui', 'component', 'react', 'vue', 'svelte', 'css', 'tailwind', 'style', 'layout', 'accessibility'],
|
|
246
|
+
agents: ['frontend-dev', 'reviewer', 'tester'],
|
|
247
247
|
},
|
|
248
248
|
'devops-task': {
|
|
249
249
|
keywords: ['deploy', 'ci', 'cd', 'pipeline', 'docker', 'kubernetes', 'infrastructure'],
|
|
250
|
-
agents: ['
|
|
250
|
+
agents: ['cicd-engineer', 'coder', 'tester'],
|
|
251
251
|
},
|
|
252
|
+
// (github-task intent removed — github work routes to generic coder/reviewer
|
|
253
|
+
// with the gh CLI; specialized github-* agents were retired in #932)
|
|
252
254
|
'swarm-task': {
|
|
253
255
|
keywords: ['swarm', 'agent', 'coordinator', 'hive', 'mesh', 'topology'],
|
|
254
|
-
agents: ['
|
|
256
|
+
agents: ['coordinator', 'architect'],
|
|
255
257
|
},
|
|
256
258
|
'memory-task': {
|
|
257
259
|
keywords: ['memory', 'cache', 'store', 'vector', 'embedding', 'persistence'],
|
|
258
|
-
agents: ['
|
|
260
|
+
agents: ['researcher', 'architect', 'coder'],
|
|
259
261
|
},
|
|
260
262
|
};
|
|
261
263
|
/**
|
|
@@ -436,30 +438,30 @@ const AGENT_PATTERNS = {
|
|
|
436
438
|
'.yaml': ['coder', 'devops'],
|
|
437
439
|
'.yml': ['coder', 'devops'],
|
|
438
440
|
'.sh': ['devops', 'coder'],
|
|
439
|
-
'.py': ['coder', '
|
|
441
|
+
'.py': ['coder', 'researcher'],
|
|
440
442
|
'.sql': ['coder', 'architect'],
|
|
441
443
|
'.css': ['coder', 'designer'],
|
|
442
444
|
'.scss': ['coder', 'designer'],
|
|
443
445
|
};
|
|
444
446
|
// Keyword patterns for fallback routing (when semantic routing doesn't match)
|
|
445
447
|
const KEYWORD_PATTERNS = {
|
|
446
|
-
'authentication': { agents: ['security-
|
|
447
|
-
'auth': { agents: ['security-
|
|
448
|
+
'authentication': { agents: ['security-auditor', 'coder', 'tester'], confidence: 0.9 },
|
|
449
|
+
'auth': { agents: ['security-auditor', 'coder', 'tester'], confidence: 0.85 },
|
|
448
450
|
'api': { agents: ['architect', 'coder', 'tester'], confidence: 0.85 },
|
|
449
451
|
'test': { agents: ['tester', 'reviewer'], confidence: 0.95 },
|
|
450
452
|
'refactor': { agents: ['architect', 'coder', 'reviewer'], confidence: 0.9 },
|
|
451
|
-
'performance': { agents: ['
|
|
452
|
-
'security': { agents: ['security-
|
|
453
|
-
'database': { agents: ['
|
|
454
|
-
'frontend': { agents: ['
|
|
455
|
-
'backend': { agents: ['architect', 'coder', 'tester'], confidence: 0.
|
|
453
|
+
'performance': { agents: ['reviewer', 'coder', 'tester'], confidence: 0.88 },
|
|
454
|
+
'security': { agents: ['security-auditor', 'reviewer'], confidence: 0.92 },
|
|
455
|
+
'database': { agents: ['database-dev', 'coder', 'tester'], confidence: 0.9 },
|
|
456
|
+
'frontend': { agents: ['frontend-dev', 'reviewer', 'tester'], confidence: 0.9 },
|
|
457
|
+
'backend': { agents: ['backend-dev', 'architect', 'coder', 'tester'], confidence: 0.9 },
|
|
456
458
|
'bug': { agents: ['coder', 'tester', 'reviewer'], confidence: 0.88 },
|
|
457
459
|
'fix': { agents: ['coder', 'tester', 'reviewer'], confidence: 0.85 },
|
|
458
460
|
'feature': { agents: ['architect', 'coder', 'tester'], confidence: 0.8 },
|
|
459
|
-
'swarm': { agents: ['
|
|
460
|
-
'memory': { agents: ['
|
|
461
|
-
'deploy': { agents: ['
|
|
462
|
-
'ci/cd': { agents: ['
|
|
461
|
+
'swarm': { agents: ['coordinator', 'architect'], confidence: 0.9 },
|
|
462
|
+
'memory': { agents: ['researcher', 'architect', 'coder'], confidence: 0.88 },
|
|
463
|
+
'deploy': { agents: ['cicd-engineer', 'coder', 'tester'], confidence: 0.85 },
|
|
464
|
+
'ci/cd': { agents: ['cicd-engineer', 'coder'], confidence: 0.9 },
|
|
463
465
|
};
|
|
464
466
|
function getFileExtension(filePath) {
|
|
465
467
|
const match = filePath.match(/\.[a-zA-Z0-9]+$/);
|
|
@@ -1675,7 +1677,7 @@ export const hooksBuildAgents = {
|
|
|
1675
1677
|
{ type: 'coder', configFile: join(outputDir, `coder.${format}`), capabilities: ['code-generation', 'refactoring', 'debugging'], optimizations: ['flash-attention', 'token-reduction'] },
|
|
1676
1678
|
{ type: 'architect', configFile: join(outputDir, `architect.${format}`), capabilities: ['system-design', 'api-design', 'documentation'], optimizations: ['context-caching', 'memory-persistence'] },
|
|
1677
1679
|
{ type: 'tester', configFile: join(outputDir, `tester.${format}`), capabilities: ['unit-testing', 'integration-testing', 'coverage'], optimizations: ['parallel-execution'] },
|
|
1678
|
-
{ type: 'security-
|
|
1680
|
+
{ type: 'security-auditor', configFile: join(outputDir, `security-auditor.${format}`), capabilities: ['threat-modeling', 'vulnerability-analysis', 'security-review'], optimizations: ['pattern-matching'] },
|
|
1679
1681
|
{ type: 'reviewer', configFile: join(outputDir, `reviewer.${format}`), capabilities: ['code-review', 'quality-analysis', 'best-practices'], optimizations: ['incremental-analysis'] },
|
|
1680
1682
|
];
|
|
1681
1683
|
const filteredAgents = focus === 'all' ? agents :
|
|
@@ -27,43 +27,49 @@ const DEFAULT_INTENTS = [
|
|
|
27
27
|
name: 'memory',
|
|
28
28
|
category: 'storage',
|
|
29
29
|
keywords: ['memory', 'store', 'retrieve', 'search', 'embedding', 'vector', 'recall', 'persist'],
|
|
30
|
-
agents: ['
|
|
30
|
+
agents: ['researcher', 'coder'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'frontend',
|
|
34
|
+
category: 'development',
|
|
35
|
+
keywords: ['frontend', 'ui', 'component', 'react', 'vue', 'svelte', 'css', 'tailwind', 'style', 'layout', 'accessibility', 'responsive'],
|
|
36
|
+
agents: ['frontend-dev', 'reviewer'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'database',
|
|
40
|
+
category: 'development',
|
|
41
|
+
keywords: ['database', 'sql', 'query', 'schema', 'migration', 'orm', 'index', 'postgres', 'mysql', 'sqlite', 'transaction'],
|
|
42
|
+
agents: ['database-dev', 'reviewer'],
|
|
31
43
|
},
|
|
32
44
|
{
|
|
33
45
|
name: 'spell',
|
|
34
46
|
category: 'workflow',
|
|
35
47
|
keywords: ['spell', 'workflow', 'orchestrate', 'cast', 'pipeline', 'step'],
|
|
36
|
-
agents: ['planner'
|
|
48
|
+
agents: ['planner'],
|
|
37
49
|
},
|
|
38
50
|
{
|
|
39
51
|
name: 'hooks',
|
|
40
52
|
category: 'automation',
|
|
41
53
|
keywords: ['hook', 'pre-task', 'post-task', 'event', 'trigger', 'automation'],
|
|
42
|
-
agents: ['cicd-engineer', '
|
|
54
|
+
agents: ['cicd-engineer', 'coder'],
|
|
43
55
|
},
|
|
44
56
|
{
|
|
45
57
|
name: 'security',
|
|
46
58
|
category: 'security',
|
|
47
59
|
keywords: ['security', 'vulnerability', 'cve', 'audit', 'threat', 'permission', 'auth'],
|
|
48
|
-
agents: ['security-auditor', '
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'neural',
|
|
52
|
-
category: 'ml',
|
|
53
|
-
keywords: ['neural', 'train', 'model', 'learning', 'reinforcement', 'sona', 'reasoningbank'],
|
|
54
|
-
agents: ['ml-developer', 'safla-neural'],
|
|
60
|
+
agents: ['security-auditor', 'reviewer'],
|
|
55
61
|
},
|
|
56
62
|
{
|
|
57
63
|
name: 'test',
|
|
58
64
|
category: 'quality',
|
|
59
65
|
keywords: ['test', 'vitest', 'unit', 'integration', 'tdd', 'coverage', 'assertion'],
|
|
60
|
-
agents: ['tester'
|
|
66
|
+
agents: ['tester'],
|
|
61
67
|
},
|
|
62
68
|
{
|
|
63
69
|
name: 'github',
|
|
64
70
|
category: 'integration',
|
|
65
71
|
keywords: ['github', 'pr', 'pull request', 'issue', 'release', 'commit', 'branch'],
|
|
66
|
-
agents: ['
|
|
72
|
+
agents: ['coder', 'reviewer'],
|
|
67
73
|
},
|
|
68
74
|
];
|
|
69
75
|
export class SemanticRouter {
|
|
@@ -38,8 +38,8 @@ const AGENT_TYPES = [
|
|
|
38
38
|
'optimizer',
|
|
39
39
|
'debugger',
|
|
40
40
|
'documenter',
|
|
41
|
-
'security-
|
|
42
|
-
'
|
|
41
|
+
'security-auditor',
|
|
42
|
+
'planner',
|
|
43
43
|
];
|
|
44
44
|
/**
|
|
45
45
|
* Task keywords for pattern extraction
|
|
@@ -77,13 +77,13 @@ const KEYWORD_CATEGORIES = {
|
|
|
77
77
|
'document', 'docs', 'readme', 'comment', 'explain', 'guide',
|
|
78
78
|
'tutorial', 'api-docs', 'specification', 'jsdoc',
|
|
79
79
|
],
|
|
80
|
-
'security-
|
|
80
|
+
'security-auditor': [
|
|
81
81
|
'security', 'auth', 'authentication', 'authorization', 'encrypt',
|
|
82
82
|
'vulnerability', 'cve', 'secure', 'permission', 'role',
|
|
83
83
|
],
|
|
84
|
-
|
|
85
|
-
'
|
|
86
|
-
'
|
|
84
|
+
planner: [
|
|
85
|
+
'plan', 'breakdown', 'sequencing', 'estimate', 'milestone', 'roadmap',
|
|
86
|
+
'task', 'dependency', 'goal',
|
|
87
87
|
],
|
|
88
88
|
};
|
|
89
89
|
// ============================================================================
|
|
@@ -118,9 +118,9 @@ export class LearningDomainService {
|
|
|
118
118
|
review: 'reviewer',
|
|
119
119
|
plan: 'planner',
|
|
120
120
|
research: 'researcher',
|
|
121
|
-
security: 'security-
|
|
122
|
-
performance: '
|
|
123
|
-
memory: '
|
|
121
|
+
security: 'security-auditor',
|
|
122
|
+
performance: 'reviewer',
|
|
123
|
+
memory: 'researcher',
|
|
124
124
|
};
|
|
125
125
|
for (const [keyword, role] of Object.entries(keywordMap)) {
|
|
126
126
|
if (taskLower.includes(keyword)) {
|
|
@@ -19,9 +19,7 @@ export const AGENT_CAPABILITIES = {
|
|
|
19
19
|
'backend-dev': ['api', 'database', 'server', 'authentication'],
|
|
20
20
|
'frontend-dev': ['ui', 'react', 'css', 'components'],
|
|
21
21
|
devops: ['ci-cd', 'docker', 'deployment', 'infrastructure'],
|
|
22
|
-
'security-
|
|
23
|
-
'security-auditor': ['vulnerability-scan', 'dependency-audit', 'compliance'],
|
|
24
|
-
'memory-specialist': ['memory-management', 'caching', 'persistence'],
|
|
22
|
+
'security-auditor': ['security-design', 'threat-modeling', 'auth-flow', 'vulnerability-scan', 'dependency-audit', 'compliance'],
|
|
25
23
|
coordinator: ['task-distribution', 'orchestration', 'scheduling'],
|
|
26
24
|
analyst: ['data-analysis', 'metrics', 'reporting', 'monitoring'],
|
|
27
25
|
optimizer: ['performance', 'profiling', 'optimization', 'benchmarking'],
|
|
@@ -41,8 +39,7 @@ const TASK_PATTERNS = [
|
|
|
41
39
|
{ regex: /ui|frontend|component|react|css|style/i, agentType: 'frontend-dev' },
|
|
42
40
|
{ regex: /deploy|docker|ci|cd|pipeline|infrastructure/i, agentType: 'devops' },
|
|
43
41
|
// Specialized patterns
|
|
44
|
-
{ regex: /security|auth|permission|rbac|oauth/i, agentType: 'security-
|
|
45
|
-
{ regex: /vulnerability|cve|dependency.*update|npm audit/i, agentType: 'security-auditor' },
|
|
42
|
+
{ regex: /security|auth|permission|rbac|oauth|vulnerability|cve|dependency.*update|npm audit/i, agentType: 'security-auditor' },
|
|
46
43
|
{ regex: /performance|optimize|profile|benchmark|speed/i, agentType: 'optimizer' },
|
|
47
44
|
{ regex: /analyz|metric|report|monitor|dashboard/i, agentType: 'analyst' },
|
|
48
45
|
];
|