moflo 4.9.21 → 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-guidance-rules.md +5 -5
- package/.claude/helpers/gate.cjs +70 -3
- package/.claude/skills/fl/execution-modes.md +38 -15
- package/bin/gate.cjs +70 -3
- package/bin/lib/retired-files.mjs +146 -0
- package/bin/session-start-launcher.mjs +101 -0
- package/dist/src/cli/appliance/rvfa-builder.js +1 -1
- package/dist/src/cli/commands/agent.js +3 -9
- 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/executor.js +26 -54
- package/dist/src/cli/init/helpers-generator.js +66 -3
- package/dist/src/cli/init/settings-generator.js +12 -0
- 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 +4 -0
- 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/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/flo-simplify.md +0 -101
- 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/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
|
@@ -59,41 +59,28 @@ export const INTERNAL_SKILLS = [
|
|
|
59
59
|
/**
|
|
60
60
|
* Commands to copy based on configuration
|
|
61
61
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
monitoring: [],
|
|
69
|
-
optimization: [],
|
|
70
|
-
sparc: ['sparc'],
|
|
71
|
-
};
|
|
62
|
+
// Empty after #949 retired the last shipped slash commands. moflo's user-facing
|
|
63
|
+
// functionality now lives entirely in `.claude/skills/` (canonical) and
|
|
64
|
+
// `.claude/agents/` (subagent surface). Kept as an empty-record placeholder
|
|
65
|
+
// because callers iterate `Object.entries(COMMANDS_MAP)` to gate per-category
|
|
66
|
+
// install — see init-copy-maps.test.ts for the iteration contract.
|
|
67
|
+
const COMMANDS_MAP = {};
|
|
72
68
|
/**
|
|
73
69
|
* Agents to copy based on configuration. Exported for integrity tests.
|
|
70
|
+
*
|
|
71
|
+
* Each value is a directory name under `.claude/agents/` that ships in the
|
|
72
|
+
* moflo package. After #932 retired ~50 ruflo-aspirational agents, the set
|
|
73
|
+
* is narrowed to actual development specialties Claude is likely to invoke.
|
|
74
74
|
*/
|
|
75
75
|
export const AGENTS_MAP = {
|
|
76
76
|
core: ['core'],
|
|
77
|
-
consensus: ['consensus'],
|
|
78
|
-
github: ['github'],
|
|
79
|
-
hiveMind: ['hive-mind'],
|
|
80
|
-
sparc: ['sparc'],
|
|
81
|
-
swarm: ['swarm'],
|
|
82
|
-
browser: ['browser'], // agent-browser integration
|
|
83
|
-
// V3-specific agents
|
|
84
|
-
v3: ['v3'],
|
|
85
|
-
optimization: ['optimization'],
|
|
86
|
-
testing: ['testing'],
|
|
87
77
|
analysis: ['analysis'],
|
|
88
78
|
architecture: ['architecture'],
|
|
79
|
+
custom: ['custom'],
|
|
89
80
|
development: ['development'],
|
|
90
81
|
devops: ['devops'],
|
|
91
82
|
documentation: ['documentation'],
|
|
92
|
-
|
|
93
|
-
goal: ['goal'],
|
|
94
|
-
sona: ['sona'],
|
|
95
|
-
data: ['data'],
|
|
96
|
-
custom: ['custom'],
|
|
83
|
+
security: ['security'],
|
|
97
84
|
};
|
|
98
85
|
/**
|
|
99
86
|
* Directory structure to create
|
|
@@ -1521,39 +1508,24 @@ npx moflo swarm monitor
|
|
|
1521
1508
|
### Core Development (5)
|
|
1522
1509
|
\`coder\`, \`reviewer\`, \`tester\`, \`planner\`, \`researcher\`
|
|
1523
1510
|
|
|
1524
|
-
###
|
|
1525
|
-
\`
|
|
1526
|
-
|
|
1527
|
-
### Swarm Coordination (5)
|
|
1528
|
-
\`hierarchical-coordinator\`, \`mesh-coordinator\`, \`adaptive-coordinator\`, \`collective-intelligence-coordinator\`, \`swarm-memory-manager\`
|
|
1529
|
-
|
|
1530
|
-
### Consensus & Distributed (7)
|
|
1531
|
-
\`byzantine-coordinator\`, \`raft-manager\`, \`gossip-coordinator\`, \`consensus-builder\`, \`crdt-synchronizer\`, \`quorum-manager\`, \`security-manager\`
|
|
1532
|
-
|
|
1533
|
-
### Performance & Optimization (5)
|
|
1534
|
-
\`perf-analyzer\`, \`performance-benchmarker\`, \`task-orchestrator\`, \`memory-coordinator\`, \`smart-agent\`
|
|
1535
|
-
|
|
1536
|
-
### GitHub & Repository (9)
|
|
1537
|
-
\`github-modes\`, \`pr-manager\`, \`code-review-swarm\`, \`issue-tracker\`, \`release-manager\`, \`workflow-automation\`, \`project-board-sync\`, \`repo-architect\`, \`multi-repo-swarm\`
|
|
1538
|
-
|
|
1539
|
-
### SPARC Methodology (6)
|
|
1540
|
-
\`sparc-coord\`, \`sparc-coder\`, \`specification\`, \`pseudocode\`, \`architecture\`, \`refinement\`
|
|
1511
|
+
### Code Analysis (2)
|
|
1512
|
+
\`code-analyzer\`, \`analyst\`
|
|
1541
1513
|
|
|
1542
|
-
### Specialized Development (
|
|
1543
|
-
\`backend-dev\`, \`
|
|
1514
|
+
### Specialized Development (5)
|
|
1515
|
+
\`backend-dev\`, \`frontend-dev\`, \`database-dev\`, \`cicd-engineer\`, \`api-docs\`
|
|
1544
1516
|
|
|
1545
|
-
###
|
|
1546
|
-
\`
|
|
1517
|
+
### Security (1)
|
|
1518
|
+
\`security-auditor\`
|
|
1547
1519
|
|
|
1548
1520
|
### Agent Routing by Task
|
|
1549
|
-
| Task Type | Recommended Agents |
|
|
1550
|
-
|
|
1551
|
-
| Bug Fix | researcher, coder, tester |
|
|
1552
|
-
| New Feature |
|
|
1553
|
-
| Refactoring |
|
|
1554
|
-
|
|
|
1555
|
-
|
|
|
1556
|
-
| Docs | researcher, api-docs |
|
|
1521
|
+
| Task Type | Recommended Agents |
|
|
1522
|
+
|-----------|--------------------|
|
|
1523
|
+
| Bug Fix | researcher, coder, tester |
|
|
1524
|
+
| New Feature | planner, coder, tester, reviewer |
|
|
1525
|
+
| Refactoring | coder, reviewer |
|
|
1526
|
+
| Security | security-auditor, reviewer |
|
|
1527
|
+
| GitHub workflow | coder, reviewer (with \`gh\` CLI) |
|
|
1528
|
+
| Docs | researcher, api-docs |
|
|
1557
1529
|
|
|
1558
1530
|
---
|
|
1559
1531
|
|
|
@@ -207,7 +207,7 @@ var path = require('path');
|
|
|
207
207
|
var PROJECT_DIR = (process.env.CLAUDE_PROJECT_DIR || process.cwd()).replace(/^\\/([a-z])\\//i, '$1:/');
|
|
208
208
|
var STATE_FILE = path.join(PROJECT_DIR, '.claude', 'workflow-state.json');
|
|
209
209
|
|
|
210
|
-
var STATE_DEFAULTS = { tasksCreated: false, taskCount: 0, memorySearched: false, memorySearchedBy: {}, memoryRequired: true, learningsStored: false, testsRun: false, simplifyRun: false, interactionCount: 0, sessionStart: null, lastBlockedAt: null, lastNamespaceHint: '', lastNamespaceHintEmittedBy: {} };
|
|
210
|
+
var STATE_DEFAULTS = { tasksCreated: false, taskCount: 0, memorySearched: false, memorySearchedBy: {}, memoryRequired: true, learningsStored: false, testsRun: false, simplifyRun: false, interactionCount: 0, sessionStart: null, lastBlockedAt: null, lastNamespaceHint: '', lastNamespaceHintEmittedBy: {}, flMode: null, swarmInitialized: false, hiveInitialized: false };
|
|
211
211
|
|
|
212
212
|
function readState() {
|
|
213
213
|
try {
|
|
@@ -255,7 +255,7 @@ function writeState(s) {
|
|
|
255
255
|
|
|
256
256
|
// Load moflo.yaml gate config (defaults: all enabled)
|
|
257
257
|
function loadGateConfig() {
|
|
258
|
-
var defaults = { memory_first: true, task_create_first: true, context_tracking: true, testing_gate: true, simplify_gate: true, learnings_gate: true };
|
|
258
|
+
var defaults = { memory_first: true, task_create_first: true, context_tracking: true, testing_gate: true, simplify_gate: true, learnings_gate: true, swarm_invocation_gate: true };
|
|
259
259
|
try {
|
|
260
260
|
var yamlPath = path.join(PROJECT_DIR, 'moflo.yaml');
|
|
261
261
|
if (fs.existsSync(yamlPath)) {
|
|
@@ -266,6 +266,7 @@ function loadGateConfig() {
|
|
|
266
266
|
if (/testing_gate:\\s*false/i.test(content)) defaults.testing_gate = false;
|
|
267
267
|
if (/simplify_gate:\\s*false/i.test(content)) defaults.simplify_gate = false;
|
|
268
268
|
if (/learnings_gate:\\s*false/i.test(content)) defaults.learnings_gate = false;
|
|
269
|
+
if (/swarm_invocation_gate:\\s*false/i.test(content)) defaults.swarm_invocation_gate = false;
|
|
269
270
|
}
|
|
270
271
|
} catch (e) { /* use defaults */ }
|
|
271
272
|
return defaults;
|
|
@@ -305,6 +306,21 @@ var NS_NAV_RES = [
|
|
|
305
306
|
/\\b(class|function|method|component|service|entity|module)\\b/,
|
|
306
307
|
];
|
|
307
308
|
|
|
309
|
+
// Detect whether the current prompt invoked /fl or /flo with a swarm/hive flag
|
|
310
|
+
// (#952). When set, check-before-agent BLOCKS the Agent spawn until the matching
|
|
311
|
+
// MCP init has been recorded — the user explicitly opted in to the protected
|
|
312
|
+
// coordination surface, so falling back to raw Agent dispatch silently regresses
|
|
313
|
+
// headline moflo product capability.
|
|
314
|
+
//
|
|
315
|
+
// SYNC: duplicated verbatim in bin/gate.cjs.
|
|
316
|
+
function detectFlMode(promptText) {
|
|
317
|
+
var p = promptText || '';
|
|
318
|
+
if (!/^\\s*\\/(?:fl|flo)\\b/i.test(p)) return null;
|
|
319
|
+
if (/(?:^|\\s)(?:-s|--swarm)\\b/.test(p)) return 'swarm';
|
|
320
|
+
if (/(?:^|\\s)(?:-h|--hive)\\b/.test(p)) return 'hive';
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
|
|
308
324
|
function classifyNamespaceHint(promptText) {
|
|
309
325
|
var lower = (promptText || '').toLowerCase();
|
|
310
326
|
if (NS_TEST_RE.test(lower)) return 'Memory namespace hint: use "tests" for test inventory and coverage lookups.';
|
|
@@ -334,6 +350,11 @@ function applyPromptStateReset(state, promptText) {
|
|
|
334
350
|
// Per-actor emission tracking — fresh window each prompt so subagents that
|
|
335
351
|
// spawn their own agents still see the hint on their first check-before-agent.
|
|
336
352
|
state.lastNamespaceHintEmittedBy = {};
|
|
353
|
+
// #952 — derive flMode from the user prompt and reset the matching init
|
|
354
|
+
// flag. Each /fl invocation must call its protected MCP init.
|
|
355
|
+
state.flMode = detectFlMode(promptText);
|
|
356
|
+
state.swarmInitialized = false;
|
|
357
|
+
state.hiveInitialized = false;
|
|
337
358
|
}
|
|
338
359
|
var TEST_RUNNER_RE = /(?:^|[^a-z])(?:npm|yarn|pnpm|bun)\\s+(?:run\\s+)?(?:test|t)(?:[:\\s]|$)|\\b(?:npx|pnpx)\\s+(?:vitest|jest|mocha|ava|tap|jasmine|pytest)\\b|(?:^|;|&&|\\|\\|)\\s*(?:vitest|jest|pytest|mocha|jasmine|tap|ava)\\s|\\b(?:cargo|go|deno|dotnet|mvn)\\s+test\\b|\\bgradle\\w*\\s+test\\b/i;
|
|
339
360
|
var EDIT_RESET_SKIP_BOTH_RE = /\\.(md|markdown|txt|rst|adoc|lock|gitignore)$|(?:^|[\\\\\\/])(CHANGELOG(?:\\.md)?|\\.env\\.example|package-lock\\.json|pnpm-lock\\.yaml|yarn\\.lock|bun\\.lockb)$/i;
|
|
@@ -373,6 +394,46 @@ switch (command) {
|
|
|
373
394
|
writeState(s);
|
|
374
395
|
}
|
|
375
396
|
}
|
|
397
|
+
// #952 — when /fl was invoked with -s/-h, the protected MCP init must run
|
|
398
|
+
// BEFORE any Agent spawn. Hard block: the user explicitly opted in to
|
|
399
|
+
// moflo's coordination surface, so silently dispatching Agent calls
|
|
400
|
+
// without mcp__moflo__swarm_init / mcp__moflo__hive-mind_init is the
|
|
401
|
+
// failure mode this gate exists to prevent (CLAUDE.md "⛔ Protected
|
|
402
|
+
// functionality"). Other Agent uses remain advisory.
|
|
403
|
+
if (config.swarm_invocation_gate) {
|
|
404
|
+
if (s.flMode === 'swarm' && !s.swarmInitialized) {
|
|
405
|
+
process.stderr.write('BLOCKED: /fl was invoked with -s/--swarm but mcp__moflo__swarm_init has not been called.\\n');
|
|
406
|
+
process.stderr.write('Run mcp__moflo__swarm_init first, then mcp__moflo__agent_spawn for each role, then dispatch Agent.\\n');
|
|
407
|
+
process.stderr.write('See .claude/skills/fl/execution-modes.md "SWARM mode" and CLAUDE.md "⛔ Protected functionality".\\n');
|
|
408
|
+
process.stderr.write('Disable via moflo.yaml: gates: swarm_invocation_gate: false\\n');
|
|
409
|
+
process.exit(2);
|
|
410
|
+
}
|
|
411
|
+
if (s.flMode === 'hive' && !s.hiveInitialized) {
|
|
412
|
+
process.stderr.write('BLOCKED: /fl was invoked with -h/--hive but mcp__moflo__hive-mind_init has not been called.\\n');
|
|
413
|
+
process.stderr.write('Run mcp__moflo__hive-mind_init first, then dispatch Agent or hive-mind workers.\\n');
|
|
414
|
+
process.stderr.write('See .claude/skills/fl/execution-modes.md "HIVE-MIND mode" and CLAUDE.md "⛔ Protected functionality".\\n');
|
|
415
|
+
process.stderr.write('Disable via moflo.yaml: gates: swarm_invocation_gate: false\\n');
|
|
416
|
+
process.exit(2);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
case 'record-swarm-init': {
|
|
422
|
+
// #952 — wired to mcp__moflo__swarm_init PostToolUse.
|
|
423
|
+
var s = readState();
|
|
424
|
+
if (!s.swarmInitialized) {
|
|
425
|
+
s.swarmInitialized = true;
|
|
426
|
+
writeState(s);
|
|
427
|
+
}
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
case 'record-hive-init': {
|
|
431
|
+
// #952 — wired to mcp__moflo__hive-mind_init PostToolUse.
|
|
432
|
+
var s = readState();
|
|
433
|
+
if (!s.hiveInitialized) {
|
|
434
|
+
s.hiveInitialized = true;
|
|
435
|
+
writeState(s);
|
|
436
|
+
}
|
|
376
437
|
break;
|
|
377
438
|
}
|
|
378
439
|
case 'check-before-scan': {
|
|
@@ -533,7 +594,9 @@ switch (command) {
|
|
|
533
594
|
break;
|
|
534
595
|
}
|
|
535
596
|
case 'session-reset': {
|
|
536
|
-
|
|
597
|
+
// Derive from STATE_DEFAULTS so adding a new state field requires only one
|
|
598
|
+
// edit (the defaults object).
|
|
599
|
+
writeState(Object.assign({}, STATE_DEFAULTS, { sessionStart: new Date().toISOString() }));
|
|
537
600
|
break;
|
|
538
601
|
}
|
|
539
602
|
default:
|
|
@@ -302,6 +302,18 @@ function generateHooksConfig(config) {
|
|
|
302
302
|
matcher: '^mcp__moflo__memory_store$',
|
|
303
303
|
hooks: [{ type: 'command', command: gateCmd('record-learnings-stored'), timeout: 2000 }],
|
|
304
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
|
+
},
|
|
305
317
|
];
|
|
306
318
|
}
|
|
307
319
|
// UserPromptSubmit — per-prompt state reset + Context warnings.
|
|
@@ -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
|
];
|
|
@@ -79,6 +79,10 @@ export function getReferenceHookBlock() {
|
|
|
79
79
|
{ matcher: '^mcp__moflo__memory_(search|retrieve|list|stats|store)$', hooks: [gateHook('record-memory-searched', 3000)] },
|
|
80
80
|
{ matcher: '^TaskUpdate$', hooks: [gateCjs('check-task-transition', 2000)] },
|
|
81
81
|
{ matcher: '^mcp__moflo__memory_store$', hooks: [gateCjs('record-learnings-stored', 2000)] },
|
|
82
|
+
// #952 — wired so /fl -s/--swarm and /fl -h/--hive runs satisfy the
|
|
83
|
+
// check-before-agent gate after the protected MCP init has been called.
|
|
84
|
+
{ matcher: '^mcp__moflo__swarm_init$', hooks: [gateCjs('record-swarm-init', 2000)] },
|
|
85
|
+
{ matcher: '^mcp__moflo__hive-mind_init$', hooks: [gateCjs('record-hive-init', 2000)] },
|
|
82
86
|
],
|
|
83
87
|
UserPromptSubmit: [
|
|
84
88
|
{ hooks: [helperHook('prompt-hook.mjs', '', 3000)] },
|
|
@@ -36,20 +36,20 @@ async function main() {
|
|
|
36
36
|
// 3. Record Agent Lifecycle Events
|
|
37
37
|
// =========================================================================
|
|
38
38
|
console.log('3. Recording Agent Lifecycle Events...');
|
|
39
|
-
// Agent 1:
|
|
40
|
-
await eventStore.append(createAgentSpawnedEvent('agent-1', '
|
|
39
|
+
// Agent 1: Coordinator
|
|
40
|
+
await eventStore.append(createAgentSpawnedEvent('agent-1', 'coordinator', 'coordination', [
|
|
41
41
|
'orchestration',
|
|
42
42
|
'task-assignment',
|
|
43
43
|
]));
|
|
44
44
|
await eventStore.append(createAgentStartedEvent('agent-1'));
|
|
45
|
-
// Agent 2: Security
|
|
46
|
-
await eventStore.append(createAgentSpawnedEvent('agent-2', 'security-
|
|
45
|
+
// Agent 2: Security Auditor
|
|
46
|
+
await eventStore.append(createAgentSpawnedEvent('agent-2', 'security-auditor', 'security', [
|
|
47
47
|
'threat-modeling',
|
|
48
48
|
'security-design',
|
|
49
49
|
]));
|
|
50
50
|
await eventStore.append(createAgentStartedEvent('agent-2'));
|
|
51
|
-
// Agent 3:
|
|
52
|
-
await eventStore.append(createAgentSpawnedEvent('agent-3', '
|
|
51
|
+
// Agent 3: Architect
|
|
52
|
+
await eventStore.append(createAgentSpawnedEvent('agent-3', 'architect', 'core', ['ddd-design', 'architecture']));
|
|
53
53
|
await eventStore.append(createAgentStartedEvent('agent-3'));
|
|
54
54
|
console.log(' Agent events recorded\n');
|
|
55
55
|
// =========================================================================
|
|
@@ -144,27 +144,27 @@ export class TaskHooksManager {
|
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
keywords: ['security', 'vulnerability', 'cve', 'threat'],
|
|
147
|
-
agent: 'security-
|
|
147
|
+
agent: 'security-auditor',
|
|
148
148
|
capabilities: ['security-analysis', 'vulnerability-detection', 'threat-modeling'],
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
|
-
keywords: ['performance', 'optimize', 'speed', 'memory'],
|
|
152
|
-
agent: '
|
|
151
|
+
keywords: ['performance', 'optimize', 'speed', 'memory', 'profile', 'benchmark'],
|
|
152
|
+
agent: 'reviewer',
|
|
153
153
|
capabilities: ['performance-optimization', 'profiling', 'benchmarking'],
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
keywords: ['architect', 'design', 'structure', 'pattern'],
|
|
157
|
-
agent: '
|
|
157
|
+
agent: 'architect',
|
|
158
158
|
capabilities: ['architecture-design', 'pattern-application', 'system-design'],
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
|
-
keywords: ['
|
|
162
|
-
agent: '
|
|
161
|
+
keywords: ['storage', 'database', 'cache', 'persistence'],
|
|
162
|
+
agent: 'researcher',
|
|
163
163
|
capabilities: ['memory-management', 'data-persistence', 'caching'],
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
|
-
keywords: ['swarm', 'coordinate', 'orchestrate', 'agent'],
|
|
167
|
-
agent: '
|
|
166
|
+
keywords: ['swarm', 'coordinate', 'orchestrate', 'agent', 'hive'],
|
|
167
|
+
agent: 'coordinator',
|
|
168
168
|
capabilities: ['swarm-coordination', 'agent-orchestration', 'distributed-systems'],
|
|
169
169
|
},
|
|
170
170
|
];
|
package/dist/src/cli/version.js
CHANGED