monomind 1.6.9 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.claude/commands/monomind-createtask.md +75 -113
  2. package/.claude/commands/monomind-do.md +227 -115
  3. package/.claude/commands/monomind-idea.md +30 -104
  4. package/.claude/commands/monomind-improve.md +31 -103
  5. package/.claude/helpers/graphify-freshen.cjs +12 -97
  6. package/.claude/helpers/hook-handler.cjs +16 -0
  7. package/.claude/helpers/learning-service.mjs +0 -0
  8. package/.claude/helpers/metrics-db.mjs +0 -0
  9. package/.claude/helpers/statusline.cjs +89 -65
  10. package/.claude/helpers/swarm-hooks.sh +0 -0
  11. package/.claude/settings.local.json +2 -1
  12. package/.claude/skills/monomind-task-engine/SKILL.md +358 -0
  13. package/.claude/statusline-command.sh +0 -0
  14. package/.claude/statusline.sh +0 -0
  15. package/.claude-plugin/scripts/install.sh +0 -0
  16. package/.claude-plugin/scripts/uninstall.sh +0 -0
  17. package/.claude-plugin/scripts/verify.sh +0 -0
  18. package/package.json +17 -17
  19. package/packages/@monomind/cli/bin/cli.js +0 -0
  20. package/packages/@monomind/cli/bin/mcp-server.js +0 -0
  21. package/packages/@monomind/cli/dist/src/commands/doctor.js +36 -9
  22. package/packages/@monomind/cli/dist/src/init/executor.js +99 -28
  23. package/packages/@monomind/cli/dist/src/init/helpers-generator.js +14 -14
  24. package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.d.ts +38 -0
  25. package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.js +571 -0
  26. package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -1
  27. package/packages/@monomind/cli/dist/src/mcp-client.js +5 -2
  28. package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.d.ts +4 -67
  29. package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.js +40 -1226
  30. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +1 -0
  31. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +1 -0
  32. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.d.ts +9 -0
  33. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +495 -0
  34. package/packages/@monomind/cli/package.json +2 -1
  35. package/packages/@monomind/cli/README.md +0 -441
  36. package/packages/@monomind/guidance/README.md +0 -1195
  37. package/packages/@monomind/shared/README.md +0 -323
  38. package/packages/README.md +0 -514
@@ -1,514 +0,0 @@
1
- # Monomind V1
2
-
3
- > **Modular AI Agent Coordination System** - A complete reimagining of Monomind with 15-agent hierarchical mesh swarm coordination.
4
-
5
- [![Version](https://img.shields.io/badge/version-3.0.0--alpha.1-blue.svg)](https://github.com/nokhodian/monomind)
6
- [![Node.js](https://img.shields.io/badge/node-%3E%3D20.0.0-green.svg)](https://nodejs.org/)
7
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org/)
8
- [![License](https://img.shields.io/badge/license-MIT-purple.svg)](../LICENSE)
9
-
10
- ## Introduction
11
-
12
- Monomind V1 is a next-generation AI agent coordination system built on 10 Architecture Decision Records (ADRs). It provides a modular, security-first, high-performance platform for orchestrating multi-agent swarms with hierarchical mesh topology.
13
-
14
- V1 represents a complete architectural overhaul:
15
-
16
- - **10x faster testing** with Vitest
17
- - **150x-12,500x faster search** with HNSW indexing
18
- - **2.49x-7.47x Flash Attention speedup**
19
- - **50-75% memory reduction**
20
-
21
- ## Features
22
-
23
- ### Core Capabilities
24
-
25
- - **15-Agent Hierarchical Mesh** - Queen-led coordination with specialized worker agents
26
- - **Domain-Driven Design** - Clean bounded contexts with separation of concerns
27
- - **Plugin Architecture** - Microkernel pattern for extensibility
28
- - **MCP-First API** - Consistent interfaces across all modules
29
- - **Event Sourcing** - Full audit trail for state changes
30
- - **Hybrid Memory Backend** - SQLite + AgentDB for optimal performance
31
-
32
- ### Security
33
-
34
- - **CVE Remediation** - All known vulnerabilities addressed
35
- - **Input Validation** - Zod-based schema validation
36
- - **Secure ID Generation** - Cryptographic random IDs
37
- - **Path Security** - Traversal protection
38
- - **SQL Injection Prevention** - Parameterized queries
39
-
40
- ### Performance
41
-
42
- | Metric | Target | Achieved |
43
- | ----------------------- | ------------ | ------------ |
44
- | Event Bus (100k events) | <50ms | ~6ms |
45
- | Map Lookup (100k gets) | <20ms | ~16ms |
46
- | Array.find vs Map O(1) | N/A | 978x speedup |
47
- | Flash Attention | 2.49x-7.47x | Validated |
48
- | AgentDB Search | 150x-12,500x | HNSW indexed |
49
-
50
- ## Architecture
51
-
52
- ### Architecture Decision Records (ADRs)
53
-
54
- | ADR | Decision |
55
- | ------- | ---------------------------------------------------- |
56
- | ADR-001 | Adopt agentic-flow as core foundation |
57
- | ADR-002 | Domain-Driven Design structure |
58
- | ADR-003 | Single coordination engine (UnifiedSwarmCoordinator) |
59
- | ADR-004 | Plugin-based architecture (microkernel) |
60
- | ADR-005 | MCP-first API design |
61
- | ADR-006 | Unified memory service (AgentDB) |
62
- | ADR-007 | Event sourcing for state changes |
63
- | ADR-008 | Vitest over Jest (10x faster) |
64
- | ADR-009 | Hybrid memory backend default |
65
- | ADR-010 | Remove Deno support (Node.js 20+ only) |
66
-
67
- ### Module Architecture
68
-
69
- ```
70
- ┌─────────────────────────────────────────────────────────────────┐
71
- │ @monomind/v1-monorepo │
72
- ├─────────────────────────────────────────────────────────────────┤
73
- │ │
74
- │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
75
- │ │ security │ │ memory │ │ swarm │ │
76
- │ │ CVE fixes │ │ AgentDB │ │ 15-agent │ │
77
- │ │ validation │ │ HNSW │ │ coordination │ │
78
- │ └──────────────┘ └──────────────┘ └──────────────┘ │
79
- │ │
80
- │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
81
- │ │ integration │ │ performance │ │ neural │ │
82
- │ │ agentic-flow │ │ Flash Attn │ │ SONA │ │
83
- │ │ bridge │ │ benchmarks │ │ learning │ │
84
- │ └──────────────┘ └──────────────┘ └──────────────┘ │
85
- │ │
86
- │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
87
- │ │ cli │ │ testing │ │ deployment │ │
88
- │ │ commands │ │ TDD London │ │ release │ │
89
- │ │ prompts │ │ School │ │ CI/CD │ │
90
- │ └──────────────┘ └──────────────┘ └──────────────┘ │
91
- │ │
92
- │ ┌─────────────────────────────────────────────────────────┐ │
93
- │ │ shared │ │
94
- │ │ types • events • core • hooks • resilience • plugins │ │
95
- │ └─────────────────────────────────────────────────────────┘ │
96
- │ │
97
- └─────────────────────────────────────────────────────────────────┘
98
- ```
99
-
100
- ## Directory Structure
101
-
102
- ```
103
- v1/
104
- ├── @monomind/ # Modular packages
105
- │ ├── security/ # Security module
106
- │ │ └── src/
107
- │ │ ├── index.ts # Password hashing, validators
108
- │ │ └── ...
109
- │ │
110
- │ ├── memory/ # Memory module
111
- │ │ ├── src/
112
- │ │ │ ├── agentdb-backend.ts # AgentDB integration
113
- │ │ │ ├── hnsw-index.ts # HNSW vector indexing
114
- │ │ │ ├── hybrid-backend.ts # SQLite + AgentDB
115
- │ │ │ ├── sqlite-backend.ts # SQLite backend
116
- │ │ │ ├── cache-manager.ts # Caching layer
117
- │ │ │ └── domain/ # DDD entities
118
- │ │ ├── benchmarks/ # Performance benchmarks
119
- │ │ └── examples/ # Usage examples
120
- │ │
121
- │ ├── swarm/ # Swarm coordination
122
- │ │ └── src/
123
- │ │ ├── unified-coordinator.ts # Main coordinator
124
- │ │ ├── topology-manager.ts # Topology management
125
- │ │ ├── consensus/ # Consensus protocols
126
- │ │ └── domain/ # DDD entities
127
- │ │
128
- │ ├── integration/ # agentic-flow integration
129
- │ │ └── src/
130
- │ │ ├── agentic-flow-bridge.ts # Core bridge
131
- │ │ ├── agent-adapter.ts # Agent adaptation
132
- │ │ └── sona-adapter.ts # SONA learning
133
- │ │
134
- │ ├── performance/ # Performance module
135
- │ │ ├── src/
136
- │ │ │ └── framework/ # Benchmark framework
137
- │ │ └── benchmarks/
138
- │ │ ├── startup/ # Startup benchmarks
139
- │ │ └── attention/ # Flash Attention
140
- │ │
141
- │ ├── neural/ # Neural/SONA module
142
- │ │ └── src/
143
- │ │ ├── algorithms/ # Learning algorithms
144
- │ │ └── modes/ # Neural modes
145
- │ │
146
- │ ├── cli/ # CLI module
147
- │ │ ├── bin/ # Executable
148
- │ │ └── src/
149
- │ │ └── commands/ # Command handlers
150
- │ │
151
- │ ├── testing/ # Testing framework
152
- │ │ └── src/
153
- │ │ ├── fixtures/ # Test fixtures
154
- │ │ ├── mocks/ # Mock services
155
- │ │ ├── helpers/ # Test helpers
156
- │ │ └── regression/ # Regression tests
157
- │ │
158
- │ ├── shared/ # Shared utilities
159
- │ │ └── src/
160
- │ │ ├── types/ # Shared types
161
- │ │ ├── events/ # Event system
162
- │ │ ├── core/ # Core interfaces
163
- │ │ ├── hooks/ # Hook system
164
- │ │ ├── resilience/ # Retry, circuit breaker
165
- │ │ ├── plugins/ # Plugin system
166
- │ │ └── security/ # Security utilities
167
- │ │
168
- │ └── deployment/ # Deployment module
169
- │ └── src/ # Release management
170
-
171
- ├── mcp/ # MCP Server
172
- │ ├── server.ts # Main server
173
- │ ├── tools/ # MCP tools
174
- │ │ ├── agent-tools.ts
175
- │ │ ├── swarm-tools.ts
176
- │ │ ├── memory-tools.ts
177
- │ │ └── hooks-tools.ts
178
- │ └── transport/ # Transport layers
179
- │ ├── stdio.ts
180
- │ ├── http.ts
181
- │ └── websocket.ts
182
-
183
- ├── __tests__/ # Integration tests
184
- │ └── integration/
185
- │ ├── memory-integration.test.ts
186
- │ ├── swarm-integration.test.ts
187
- │ ├── mcp-integration.test.ts
188
- │ └── workflow-integration.test.ts
189
-
190
- ├── docs/ # Documentation
191
- │ ├── README.md # Docs overview
192
- │ ├── guides/ # User guides
193
- │ └── implementation/ # Implementation details
194
-
195
- ├── helpers/ # Cross-platform helpers
196
- │ ├── monomind-v1.sh # Master helper (Linux/macOS)
197
- │ ├── monomind-v1.ps1 # Master helper (Windows)
198
- │ └── templates/ # Helper templates
199
-
200
- ├── scripts/ # Utility scripts
201
- │ └── quick-benchmark.mjs # Quick perf test
202
-
203
- ├── index.ts # Main entry point
204
- ├── swarm.config.ts # Swarm configuration
205
- ├── vitest.config.ts # Test configuration
206
- └── package.json # Monorepo package
207
- ```
208
-
209
- ## Modules
210
-
211
- ### @monomind/security
212
-
213
- Security-first implementation with CVE fixes, input validation, and credential management.
214
-
215
- ```typescript
216
- import {
217
- PasswordHasher,
218
- validateInput,
219
- sanitizePath,
220
- } from "@monomind/security";
221
-
222
- const hasher = new PasswordHasher();
223
- const hash = await hasher.hash("password");
224
- const valid = await hasher.verify("password", hash);
225
- ```
226
-
227
- ### @monomind/memory
228
-
229
- Unified memory service with AgentDB, HNSW indexing, and 150x-12,500x faster search.
230
-
231
- ```typescript
232
- import { HybridMemoryRepository, HNSWIndex } from '@monomind/memory';
233
-
234
- const memory = new HybridMemoryRepository({
235
- backend: 'agentdb',
236
- vectorSearch: true
237
- });
238
-
239
- await memory.store({ key: 'knowledge', value: 'context', embedding: [...] });
240
- const results = await memory.search({ query: 'knowledge', limit: 10 });
241
- ```
242
-
243
- ### @monomind/swarm
244
-
245
- 15-agent hierarchical mesh coordination with consensus protocols.
246
-
247
- ```typescript
248
- import { UnifiedSwarmCoordinator } from "@monomind/swarm";
249
-
250
- const coordinator = new UnifiedSwarmCoordinator({
251
- topology: "hierarchical-mesh",
252
- maxAgents: 15,
253
- });
254
-
255
- await coordinator.initialize();
256
- await coordinator.spawnAgent({ type: "queen-coordinator" });
257
- ```
258
-
259
- ### @monomind/integration
260
-
261
- Deep integration with agentic-flow@alpha per ADR-001.
262
-
263
- ```typescript
264
- import { AgenticFlowBridge } from "@monomind/integration";
265
-
266
- const bridge = new AgenticFlowBridge();
267
- await bridge.initialize();
268
- const agent = await bridge.createAgent({ type: "coder" });
269
- ```
270
-
271
- ### @monomind/performance
272
-
273
- Benchmarking framework with Flash Attention validation.
274
-
275
- ```typescript
276
- import { BenchmarkRunner, formatTime } from "@monomind/performance";
277
-
278
- const runner = new BenchmarkRunner();
279
- const result = await runner.run("map-lookup", () => map.get(key), {
280
- iterations: 100000,
281
- targetTime: 20,
282
- });
283
- ```
284
-
285
- ### @monomind/neural
286
-
287
- SONA learning integration for self-optimizing agents.
288
-
289
- ```typescript
290
- import { SONAAdapter } from "@monomind/neural";
291
-
292
- const sona = new SONAAdapter();
293
- await sona.train({ patterns: learningData });
294
- const prediction = await sona.predict(context);
295
- ```
296
-
297
- ### @monomind/cli
298
-
299
- Modern CLI with interactive prompts and formatted output.
300
-
301
- ```bash
302
- npx @monomind/cli swarm init --topology hierarchical-mesh
303
- npx @monomind/cli agent spawn --type queen-coordinator
304
- npx @monomind/cli memory search "knowledge"
305
- ```
306
-
307
- ### @monomind/testing
308
-
309
- TDD London School framework with mocks, fixtures, and regression testing.
310
-
311
- ```typescript
312
- import { createMockAgent, createTestFixture } from "@monomind/testing";
313
-
314
- const mockAgent = createMockAgent({ type: "coder" });
315
- const fixture = createTestFixture("swarm-coordination");
316
- ```
317
-
318
- ### @monomind/shared
319
-
320
- Common types, events, utilities, and core interfaces.
321
-
322
- ```typescript
323
- import { EventBus, Result, success, failure } from "@monomind/shared";
324
- import type { AgentId, TaskStatus } from "@monomind/shared/types";
325
- ```
326
-
327
- ### @monomind/deployment
328
-
329
- Release management and CI/CD automation.
330
-
331
- ```typescript
332
- import { ReleaseManager } from "@monomind/deployment";
333
-
334
- const release = new ReleaseManager();
335
- await release.prepare({ version: "3.0.0", changelog: "..." });
336
- ```
337
-
338
- ## Usage
339
-
340
- ### Quick Start
341
-
342
- ```typescript
343
- import { initializeSwarm } from "@monomind/v1";
344
-
345
- // Initialize the swarm
346
- const swarm = await initializeSwarm();
347
-
348
- // Spawn agents
349
- await swarm.spawnAllAgents();
350
-
351
- // Submit a task
352
- const task = swarm.submitTask({
353
- type: "implementation",
354
- title: "Implement feature X",
355
- description: "Detailed description...",
356
- domain: "core",
357
- phase: "phase-2-core",
358
- priority: "high",
359
- });
360
-
361
- // Wait for completion
362
- const result = await swarm.waitForTask(task.id);
363
- ```
364
-
365
- ### Import Specific Modules
366
-
367
- ```typescript
368
- // Import everything
369
- import * as monomind from "@monomind/v1";
370
-
371
- // Or import specific modules for tree-shaking
372
- import { UnifiedSwarmCoordinator } from "@monomind/swarm";
373
- import { PasswordHasher } from "@monomind/security";
374
- import { HNSWIndex } from "@monomind/memory";
375
- ```
376
-
377
- ### MCP Server
378
-
379
- ```typescript
380
- import { createMCPServer } from "@monomind/v1/mcp";
381
-
382
- const server = createMCPServer({
383
- transport: "stdio",
384
- tools: ["agent", "swarm", "memory", "hooks"],
385
- });
386
-
387
- await server.start();
388
- ```
389
-
390
- ## Helper System
391
-
392
- Cross-platform automation for V1 development:
393
-
394
- ```bash
395
- # Linux/macOS
396
- ./helpers/monomind-v1.sh init
397
- ./helpers/monomind-v1.sh status
398
- ./helpers/monomind-v1.sh update domain 3
399
-
400
- # Windows (PowerShell)
401
- .\helpers\monomind-v1.ps1 init
402
- .\helpers\monomind-v1.ps1 status
403
- .\helpers\monomind-v1.ps1 update domain 3
404
- ```
405
-
406
- Features:
407
-
408
- - **Progress Tracking**: Real-time domain/agent/performance metrics
409
- - **Checkpointing**: Auto-commit with development milestones
410
- - **Validation**: Environment and configuration verification
411
- - **GitHub Integration**: PR management and issue tracking
412
-
413
- ## Installation
414
-
415
- ```bash
416
- # Clone the repository
417
- git clone https://github.com/nokhodian/monomind.git
418
- cd monomind/v1
419
-
420
- # Install dependencies
421
- pnpm install
422
-
423
- # Build all modules
424
- pnpm build
425
- ```
426
-
427
- ## Testing
428
-
429
- ```bash
430
- # Run all tests
431
- pnpm test
432
-
433
- # Run integration tests
434
- pnpm test:integration
435
-
436
- # Run specific module tests
437
- pnpm test:memory
438
- pnpm test:swarm
439
- pnpm test:security
440
-
441
- # Run benchmarks
442
- pnpm bench
443
-
444
- # Quick benchmark (no dependencies)
445
- node scripts/quick-benchmark.mjs
446
-
447
- # Coverage report
448
- pnpm test:coverage
449
- ```
450
-
451
- ## Performance Targets
452
-
453
- | Category | Metric | Target |
454
- | ------------- | --------------- | ------------------- |
455
- | **Search** | AgentDB HNSW | 150x-12,500x faster |
456
- | **Attention** | Flash Attention | 2.49x-7.47x speedup |
457
- | **Memory** | Reduction | 50-75% |
458
- | **Code** | Total lines | <5,000 |
459
- | **Startup** | Cold start | <500ms |
460
- | **Learning** | SONA adaptation | <0.05ms |
461
-
462
- ## Links
463
-
464
- ### Documentation
465
-
466
- - [Docs Overview](./docs/README.md)
467
- - [Implementation Details](./docs/implementation/)
468
- - [User Guides](./docs/guides/)
469
- - [Helper System](./helpers/README.md)
470
-
471
- ### Modules
472
-
473
- - [@monomind/security](./@monomind/security/)
474
- - [@monomind/memory](./@monomind/memory/)
475
- - [@monomind/swarm](./@monomind/swarm/)
476
- - [@monomind/integration](./@monomind/integration/)
477
- - [@monomind/performance](./@monomind/performance/)
478
- - [@monomind/neural](./@monomind/neural/)
479
- - [@monomind/cli](./@monomind/cli/)
480
- - [@monomind/testing](./@monomind/testing/)
481
- - [@monomind/shared](./@monomind/shared/)
482
- - [@monomind/deployment](./@monomind/deployment/)
483
-
484
- ### Examples
485
-
486
- - [AgentDB Example](./@monomind/memory/examples/agentdb-example.ts)
487
- - [Cross-Platform Usage](./@monomind/memory/examples/cross-platform-usage.ts)
488
-
489
- ### MCP Tools
490
-
491
- - [Agent Tools](./mcp/tools/agent-tools.ts)
492
- - [Swarm Tools](./mcp/tools/swarm-tools.ts)
493
- - [Memory Tools](./mcp/tools/memory-tools.ts)
494
- - [Hooks Tools](./mcp/tools/hooks-tools.ts)
495
-
496
- ### External
497
-
498
- - [GitHub Repository](https://github.com/nokhodian/monomind)
499
- - [agentic-flow Integration](https://github.com/nokhodian/agentic-flow)
500
- - [AgentDB](https://github.com/nokhodian/agentdb)
501
-
502
- ## Requirements
503
-
504
- - **Node.js**: >=20.0.0
505
- - **pnpm**: >=8.0.0
506
- - **TypeScript**: >=5.3.0
507
-
508
- ## License
509
-
510
- MIT License - See [LICENSE](../LICENSE) for details.
511
-
512
- ---
513
-
514
- **Built with the SPARC methodology and 15-agent hierarchical mesh coordination.**