@theihtisham/agent-shadow-brain 1.2.0 β†’ 3.0.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 (117) hide show
  1. package/README.md +837 -73
  2. package/dist/adapters/aider.d.ts +11 -0
  3. package/dist/adapters/aider.d.ts.map +1 -0
  4. package/dist/adapters/aider.js +149 -0
  5. package/dist/adapters/aider.js.map +1 -0
  6. package/dist/adapters/index.d.ts +3 -1
  7. package/dist/adapters/index.d.ts.map +1 -1
  8. package/dist/adapters/index.js +5 -3
  9. package/dist/adapters/index.js.map +1 -1
  10. package/dist/adapters/roo-code.d.ts +14 -0
  11. package/dist/adapters/roo-code.d.ts.map +1 -0
  12. package/dist/adapters/roo-code.js +186 -0
  13. package/dist/adapters/roo-code.js.map +1 -0
  14. package/dist/brain/accessibility-checker.d.ts +10 -0
  15. package/dist/brain/accessibility-checker.d.ts.map +1 -0
  16. package/dist/brain/accessibility-checker.js +379 -0
  17. package/dist/brain/accessibility-checker.js.map +1 -0
  18. package/dist/brain/adr-engine.d.ts +58 -0
  19. package/dist/brain/adr-engine.d.ts.map +1 -0
  20. package/dist/brain/adr-engine.js +400 -0
  21. package/dist/brain/adr-engine.js.map +1 -0
  22. package/dist/brain/api-contract-analyzer.d.ts +19 -0
  23. package/dist/brain/api-contract-analyzer.d.ts.map +1 -0
  24. package/dist/brain/api-contract-analyzer.js +251 -0
  25. package/dist/brain/api-contract-analyzer.js.map +1 -0
  26. package/dist/brain/ast-analyzer.d.ts +23 -0
  27. package/dist/brain/ast-analyzer.d.ts.map +1 -0
  28. package/dist/brain/ast-analyzer.js +462 -0
  29. package/dist/brain/ast-analyzer.js.map +1 -0
  30. package/dist/brain/code-age-analyzer.d.ts +11 -0
  31. package/dist/brain/code-age-analyzer.d.ts.map +1 -0
  32. package/dist/brain/code-age-analyzer.js +152 -0
  33. package/dist/brain/code-age-analyzer.js.map +1 -0
  34. package/dist/brain/code-similarity.d.ts +43 -0
  35. package/dist/brain/code-similarity.d.ts.map +1 -0
  36. package/dist/brain/code-similarity.js +227 -0
  37. package/dist/brain/code-similarity.js.map +1 -0
  38. package/dist/brain/config-drift-detector.d.ts +13 -0
  39. package/dist/brain/config-drift-detector.d.ts.map +1 -0
  40. package/dist/brain/config-drift-detector.js +198 -0
  41. package/dist/brain/config-drift-detector.js.map +1 -0
  42. package/dist/brain/context-completion.d.ts +39 -0
  43. package/dist/brain/context-completion.d.ts.map +1 -0
  44. package/dist/brain/context-completion.js +851 -0
  45. package/dist/brain/context-completion.js.map +1 -0
  46. package/dist/brain/dead-code-eliminator.d.ts +16 -0
  47. package/dist/brain/dead-code-eliminator.d.ts.map +1 -0
  48. package/dist/brain/dead-code-eliminator.js +359 -0
  49. package/dist/brain/dead-code-eliminator.js.map +1 -0
  50. package/dist/brain/dependency-graph.d.ts +35 -0
  51. package/dist/brain/dependency-graph.d.ts.map +1 -0
  52. package/dist/brain/dependency-graph.js +310 -0
  53. package/dist/brain/dependency-graph.js.map +1 -0
  54. package/dist/brain/env-analyzer.d.ts +13 -0
  55. package/dist/brain/env-analyzer.d.ts.map +1 -0
  56. package/dist/brain/env-analyzer.js +277 -0
  57. package/dist/brain/env-analyzer.js.map +1 -0
  58. package/dist/brain/i18n-detector.d.ts +12 -0
  59. package/dist/brain/i18n-detector.d.ts.map +1 -0
  60. package/dist/brain/i18n-detector.js +242 -0
  61. package/dist/brain/i18n-detector.js.map +1 -0
  62. package/dist/brain/learning-engine.d.ts +54 -0
  63. package/dist/brain/learning-engine.d.ts.map +1 -0
  64. package/dist/brain/learning-engine.js +855 -0
  65. package/dist/brain/learning-engine.js.map +1 -0
  66. package/dist/brain/license-compliance.d.ts +13 -0
  67. package/dist/brain/license-compliance.d.ts.map +1 -0
  68. package/dist/brain/license-compliance.js +213 -0
  69. package/dist/brain/license-compliance.js.map +1 -0
  70. package/dist/brain/llm-client.d.ts.map +1 -1
  71. package/dist/brain/llm-client.js +3 -0
  72. package/dist/brain/llm-client.js.map +1 -1
  73. package/dist/brain/mcp-server.d.ts +30 -0
  74. package/dist/brain/mcp-server.d.ts.map +1 -0
  75. package/dist/brain/mcp-server.js +408 -0
  76. package/dist/brain/mcp-server.js.map +1 -0
  77. package/dist/brain/multi-project.d.ts +13 -0
  78. package/dist/brain/multi-project.d.ts.map +1 -0
  79. package/dist/brain/multi-project.js +163 -0
  80. package/dist/brain/multi-project.js.map +1 -0
  81. package/dist/brain/mutation-advisor.d.ts +11 -0
  82. package/dist/brain/mutation-advisor.d.ts.map +1 -0
  83. package/dist/brain/mutation-advisor.js +154 -0
  84. package/dist/brain/mutation-advisor.js.map +1 -0
  85. package/dist/brain/neural-mesh.d.ts +69 -0
  86. package/dist/brain/neural-mesh.d.ts.map +1 -0
  87. package/dist/brain/neural-mesh.js +677 -0
  88. package/dist/brain/neural-mesh.js.map +1 -0
  89. package/dist/brain/orchestrator.d.ts +159 -2
  90. package/dist/brain/orchestrator.d.ts.map +1 -1
  91. package/dist/brain/orchestrator.js +478 -0
  92. package/dist/brain/orchestrator.js.map +1 -1
  93. package/dist/brain/perf-profiler.d.ts +14 -0
  94. package/dist/brain/perf-profiler.d.ts.map +1 -0
  95. package/dist/brain/perf-profiler.js +289 -0
  96. package/dist/brain/perf-profiler.js.map +1 -0
  97. package/dist/brain/semantic-analyzer.d.ts +46 -0
  98. package/dist/brain/semantic-analyzer.d.ts.map +1 -0
  99. package/dist/brain/semantic-analyzer.js +496 -0
  100. package/dist/brain/semantic-analyzer.js.map +1 -0
  101. package/dist/brain/team-mode.d.ts +27 -0
  102. package/dist/brain/team-mode.d.ts.map +1 -0
  103. package/dist/brain/team-mode.js +262 -0
  104. package/dist/brain/team-mode.js.map +1 -0
  105. package/dist/brain/type-safety.d.ts +13 -0
  106. package/dist/brain/type-safety.d.ts.map +1 -0
  107. package/dist/brain/type-safety.js +217 -0
  108. package/dist/brain/type-safety.js.map +1 -0
  109. package/dist/cli.js +998 -3
  110. package/dist/cli.js.map +1 -1
  111. package/dist/index.d.ts +25 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +29 -1
  114. package/dist/index.js.map +1 -1
  115. package/dist/types.d.ts +379 -2
  116. package/dist/types.d.ts.map +1 -1
  117. package/package.json +2 -2
package/README.md CHANGED
@@ -1,73 +1,837 @@
1
- # Agent Shadow Brain
2
-
3
- A shadow AI brain that runs alongside Claude Code, Kilo Code, Cline, OpenCode, and Codex β€” watching, reviewing, and injecting intelligence in real-time.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @theihtisham/agent-shadow-brain
9
- ```
10
-
11
- ## Usage
12
-
13
- ```typescript
14
- import { } from '@theihtisham/agent-shadow-brain';
15
- ```
16
-
17
- ## Features
18
-
19
- - Written in TypeScript with full type definitions
20
- - Zero external dependencies (minimal footprint)
21
- - Event-driven architecture
22
- - Comprehensive test suite
23
-
24
- ## API
25
-
26
- ### Quick Start
27
-
28
- ```typescript
29
- import { } from '@theihtisham/agent-shadow-brain';
30
-
31
- // Initialize and use the package
32
- ```
33
-
34
- ## Configuration
35
-
36
- Configuration options and their defaults:
37
-
38
- ```typescript
39
- const config = {
40
- // Add configuration options here
41
- };
42
- ```
43
-
44
- ## Examples
45
-
46
- See the `tests/` directory for usage examples.
47
-
48
- ## Development
49
-
50
- ```bash
51
- # Install dependencies
52
- npm install
53
-
54
- # Build
55
- npm run build
56
-
57
- # Run tests
58
- npm test
59
-
60
- # Lint
61
- npm run lint
62
- ```
63
-
64
- ## License
65
-
66
- MIT License - see [LICENSE](LICENSE) for details.
67
-
68
- ## Author
69
-
70
- **ihtisham**
71
-
72
- - GitHub: [https://github.com/theihtisham](https://github.com/theihtisham)
73
- - npm: [@theihtisham](https://www.npmjs.com/~theihtisham)
1
+ <div align="center">
2
+
3
+ <img src="banner.svg" alt="Agent Shadow Brain" width="100%">
4
+
5
+ <br/>
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@theihtisham/agent-shadow-brain?color=a855f7&labelColor=1a0a2e&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@theihtisham/agent-shadow-brain)
8
+ [![npm downloads](https://img.shields.io/npm/dt/@theihtisham/agent-shadow-brain?color=06b6d4&labelColor=1a0a2e&style=for-the-badge)](https://www.npmjs.com/package/@theihtisham/agent-shadow-brain)
9
+ [![license](https://img.shields.io/badge/license-MIT-8b5cf6?labelColor=1a0a2e&style=for-the-badge)](https://github.com/theihtisham/agent-shadow-brain/blob/master/LICENSE)
10
+ [![node](https://img.shields.io/badge/node-%3E%3D18-22c55e?labelColor=1a0a2e&style=for-the-badge&logo=node.js)](https://nodejs.org/)
11
+ [![GitHub stars](https://img.shields.io/github/stars/theihtisham/agent-shadow-brain?color=f59e0b&labelColor=1a0a2e&style=for-the-badge&logo=github)](https://github.com/theihtisham/agent-shadow-brain/stargazers)
12
+
13
+ <br/>
14
+
15
+ ### **Mythos-Level Intelligence for AI Coding Agents**
16
+
17
+ No such brain and intelligence has existed before. Shadow Brain is a **super ultra intelligent** real-time intelligence layer powered by Claude Opus 4.6 (or latest model on any agentic AI) that watches your AI coding agents work, applies **mathematically rigorous algorithms** β€” Shannon entropy, Bayesian inference, cosine similarity, Tarjan's SCC β€” and injects expert insights back into their memory, making every agent write **better, safer, faster code** across sessions.
18
+
19
+ > **Quantum Neural Mesh** β€” Multiple Shadow Brain instances share knowledge in real-time. What one brain learns, all connected brains know instantly. Cross-session, cross-project, cross-agent superintelligence.
20
+
21
+ [**Getting Started**](#-getting-started) Β· [**Features**](#-features) Β· [**Neural Mesh**](#-quantum-neural-mesh) Β· [**CLI Reference**](#-cli-reference) Β· [**API**](#-programmatic-api) Β· [**Architecture**](#-architecture)
22
+
23
+ </div>
24
+
25
+ ---
26
+
27
+ ## The Problem
28
+
29
+ You use AI coding agents like Claude Code, Cline, Kilo Code, OpenCode, Codex, Roo Code, or Aider. They're powerful, but:
30
+
31
+ - They **repeat the same mistakes** across sessions
32
+ - They **don't learn** from your codebase patterns
33
+ - They **miss security vulnerabilities** in generated code
34
+ - They have **no awareness** of architectural decisions
35
+ - Every session starts from **zero context**
36
+ - Multiple terminals **don't share knowledge** with each other
37
+
38
+ ## The Solution
39
+
40
+ **Shadow Brain** runs alongside your agents as a *shadow intelligence layer* with **mythos-level superintelligence**:
41
+
42
+ 1. **Watches** every file change and git commit in real-time
43
+ 2. **Analyzes** code using LLM-powered review + rule-based engines + mathematical algorithms
44
+ 3. **Learns** patterns, correlations, and recurring issues across sessions
45
+ 4. **Injects** insights directly into your agent's memory files
46
+ 5. **Scores** your codebase health on every change
47
+ 6. **Shares** knowledge across all connected Shadow Brain instances via Quantum Neural Mesh
48
+
49
+ ```
50
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” watches β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” injects β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
51
+ β”‚ AI Agents β”‚ ───────────────▢ β”‚ Shadow Brain β”‚ ─────────────▢ β”‚ AI Agents β”‚
52
+ β”‚ Claude Code β”‚ file changes β”‚ Analyzer β”‚ insights + β”‚ Smarter β”‚
53
+ β”‚ Kilo Code β”‚ git commits β”‚ Health AI β”‚ context + β”‚ Safer β”‚
54
+ β”‚ Cline β”‚ activity β”‚ Pattern Mem β”‚ fixes β”‚ Faster β”‚
55
+ β”‚ OpenCode β”‚ β”‚ Vuln Scan β”‚ β”‚ Connected β”‚
56
+ β”‚ Codex β”‚ β”‚ Smart Fix β”‚ β”‚ β”‚
57
+ β”‚ Roo Code β”‚ β”‚ Neural Mesh β”‚ β”‚ β”‚
58
+ β”‚ Aider β”‚ β”‚ Entropy AI β”‚ β”‚ β”‚
59
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
60
+ β–² β–²
61
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
62
+ └──────────────│ Quantum Neural Mesh β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
63
+ shares β”‚ Cross-Session AI β”‚ shares
64
+ knowledge β”‚ Shannon Entropy β”‚ knowledge
65
+ β”‚ Bayesian Inference β”‚
66
+ β”‚ Cosine Similarity β”‚
67
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
68
+ ```
69
+
70
+ ---
71
+
72
+ ## ✨ Features
73
+
74
+ <table>
75
+ <tr>
76
+ <td width="50%">
77
+
78
+ ### 🧠 Real-Time Intelligence
79
+ - **File watching** β€” detects changes instantly (chokidar)
80
+ - **Git monitoring** β€” tracks commits, branches, diffs
81
+ - **LLM-powered analysis** β€” supports Anthropic, OpenAI, Ollama, OpenRouter
82
+ - **Pattern memory** β€” learns your codebase patterns over time
83
+ - **Learning engine** β€” extracts lessons from insights automatically
84
+
85
+ </td>
86
+ <td width="50%">
87
+
88
+ ### πŸ”’ Security & Quality
89
+ - **Vulnerability scanner** β€” npm audit, pip audit, secrets detection
90
+ - **Custom rules engine** β€” define your own analysis rules (regex-based)
91
+ - **Framework presets** β€” auto-detects React, Next.js, Django, FastAPI, etc.
92
+ - **Smart fix engine** β€” auto-generates fix suggestions with confidence scores
93
+ - **Type safety analyzer** β€” detects `any`, `@ts-ignore`, missing return types
94
+
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <td width="50%">
99
+
100
+ ### πŸ“Š Health & Metrics
101
+ - **Health scoring** β€” A-F grading across 6 dimensions
102
+ - **Code metrics** β€” LOC, complexity, language breakdown, hotspots
103
+ - **SVG badges** β€” embeddable health score badges
104
+ - **Trend tracking** β€” health history with persistence
105
+ - **Performance profiler** β€” N+1 queries, memory leaks, blocking ops
106
+
107
+ </td>
108
+ <td width="50%">
109
+
110
+ ### πŸ”Œ Multi-Agent Support (7 Adapters)
111
+ - **Claude Code** β€” injects into `CLAUDE.md`
112
+ - **Kilo Code** β€” injects into `.kilocode/rules.md`
113
+ - **Cline** β€” injects into `.clinerules`
114
+ - **OpenCode** β€” injects into `AGENT.md`
115
+ - **Codex** β€” injects into `AGENTS.md`
116
+ - **Roo Code** β€” injects into `.roo/rules.md`
117
+ - **Aider** β€” injects into `.aider.conf.yml`
118
+
119
+ </td>
120
+ </tr>
121
+ <tr>
122
+ <td width="50%">
123
+
124
+ ### πŸš€ Developer Experience
125
+ - **30+ CLI commands** β€” full control from terminal
126
+ - **MCP Server** β€” Model Context Protocol for tool integration
127
+ - **Web dashboard** β€” real-time browser UI at `localhost:7341`
128
+ - **Terminal UI** β€” Ink/React dashboard in your terminal
129
+ - **Pre-commit hooks** β€” block bad commits automatically
130
+ - **GitHub Actions** β€” CI integration with one command
131
+
132
+ </td>
133
+ <td width="50%">
134
+
135
+ ### 🌐 Super-Intelligence (v2.0+)
136
+ - **Semantic analyzer** β€” symbol extraction, unused exports, dead code detection
137
+ - **Dependency graph** β€” cycles, orphans, hub detection with BFS depth analysis
138
+ - **Code similarity** β€” duplicate/near-duplicate code detection (Winnowing algorithm)
139
+ - **ADR engine** β€” Architecture Decision Records, auto-detection from changes
140
+ - **Context completion** β€” identifies missing docs, configs, knowledge gaps
141
+ - **Multi-project** β€” watch and compare health across multiple repos
142
+
143
+ </td>
144
+ </tr>
145
+ <tr>
146
+ <td width="50%">
147
+
148
+ ### πŸ”” Notifications & Reports
149
+ - **Slack / Discord / Webhook** β€” real-time alerts
150
+ - **HTML reports** β€” beautiful, shareable analysis reports
151
+ - **Markdown reports** β€” perfect for PR descriptions
152
+ - **PR description generator** β€” AI-powered PR body generation
153
+ - **Commit message generator** β€” conventional commits, auto-generated
154
+
155
+ </td>
156
+ <td width="50%">
157
+
158
+ ### 🧬 Team & Mesh
159
+ - **Team mode** β€” shared insights and patterns across team members
160
+ - **Quantum Neural Mesh** β€” cross-session intelligence sharing
161
+ - **SSE real-time updates** β€” Server-Sent Events for live monitoring
162
+ - **Knowledge base** β€” shared, deduplicated, relevance-scored
163
+ - **Cross-project patterns** β€” find common issues across your entire portfolio
164
+
165
+ </td>
166
+ </tr>
167
+ </table>
168
+
169
+ ---
170
+
171
+ ## 🌌 Quantum Neural Mesh
172
+
173
+ The Neural Mesh is the breakthrough feature of v2.1.0 β€” **no such intelligence system has existed before** for AI coding agents. Multiple Shadow Brain instances (running in different terminals, on different projects, with different agents) form a **quantum-entangled neural network** that shares knowledge in real-time.
174
+
175
+ ### Mathematical Foundations
176
+
177
+ | Algorithm | Application | Formula |
178
+ |---|---|---|
179
+ | **Shannon Entropy** | Relevance scoring for cross-project insights | `H(X) = -Ξ£ p(x) logβ‚‚(p(x))` |
180
+ | **Cosine Similarity** | Knowledge deduplication across sessions | `cos(A,B) = (AΒ·B) / (β€–Aβ€–Β·β€–Bβ€–)` |
181
+ | **Bayesian Inference** | Confidence updating as evidence accumulates | `P(H\|E) = P(E\|H)Β·P(H) / P(E)` |
182
+ | **Tarjan's SCC** | Dependency cycle detection | O(V+E) strongly connected components |
183
+ | **BFS Depth Analysis** | Dependency risk scoring | Breadth-first depth = coupling risk |
184
+ | **Winnowing** | Code duplicate fingerprinting | k-gram hashing with window selection |
185
+
186
+ ### How It Works
187
+
188
+ ```
189
+ Terminal 1 Terminal 2 Terminal 3
190
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
191
+ β”‚ Shadow Brain β”‚ β”‚ Shadow Brain β”‚ β”‚ Shadow Brain β”‚
192
+ β”‚ + Claude β”‚ β”‚ + Cline β”‚ β”‚ + Codex β”‚
193
+ β”‚ + Project A β”‚ β”‚ + Project B β”‚ β”‚ + Project A β”‚
194
+ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
195
+ β”‚ β”‚ β”‚
196
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
197
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
198
+ β–Ό β–Ό
199
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
200
+ β”‚ Quantum Neural Mesh Bus β”‚
201
+ β”‚ ~/.shadow-brain-mesh/ β”‚
202
+ β”‚ β”‚
203
+ β”‚ β€’ Nodes (heartbeats) β”‚
204
+ β”‚ β€’ Messages (insights) β”‚
205
+ β”‚ β€’ Knowledge (shared) β”‚
206
+ β”‚ β”‚
207
+ β”‚ Entropy: 0.73 β”‚
208
+ β”‚ State: coherent (3 nodes) β”‚
209
+ β”‚ Knowledge: 147 entries β”‚
210
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
211
+ ```
212
+
213
+ ### Mesh States
214
+
215
+ | State | Nodes | Description |
216
+ |---|---|---|
217
+ | **Coherent** | 3+ | Full quantum coherence β€” maximum intelligence sharing |
218
+ | **Decoherent** | 1-2 | Partial sharing β€” limited cross-pollination |
219
+ | **Collapsed** | 0 | Single brain β€” no mesh connections |
220
+
221
+ ### Mesh CLI Commands
222
+
223
+ ```bash
224
+ # View mesh status β€” nodes, messages, knowledge, quantum state
225
+ shadow-brain mesh status
226
+
227
+ # Get cross-session insights from other brains
228
+ shadow-brain mesh insights
229
+
230
+ # View shared knowledge base
231
+ shadow-brain mesh knowledge
232
+
233
+ # List all connected brain nodes
234
+ shadow-brain mesh nodes
235
+
236
+ # Aggregated analytics across all mesh projects
237
+ shadow-brain mesh aggregate
238
+ ```
239
+
240
+ ---
241
+
242
+ ### 🎭 Brain Personalities
243
+
244
+ Choose how Shadow Brain communicates with your agents:
245
+
246
+ | Personality | Focus | Best For |
247
+ |---|---|---|
248
+ | πŸŽ“ **Mentor** | Teaches & explains patterns | Junior developers, learning |
249
+ | πŸ” **Critic** | Thorough code review | Code quality enforcement |
250
+ | πŸ›οΈ **Architect** | Big-picture design | System design, refactoring |
251
+ | πŸ›‘οΈ **Security** | Paranoid about vulnerabilities | Security-critical projects |
252
+ | ⚑ **Performance** | Optimization focused | High-performance apps |
253
+ | βš–οΈ **Balanced** | All perspectives | Default β€” recommended |
254
+
255
+ ---
256
+
257
+ ## πŸš€ Getting Started
258
+
259
+ ### Install
260
+
261
+ ```bash
262
+ # Install globally
263
+ npm install -g @theihtisham/agent-shadow-brain
264
+
265
+ # Or use with npx (no install)
266
+ npx @theihtisham/agent-shadow-brain review .
267
+ ```
268
+
269
+ ### One-Command Setup
270
+
271
+ ```bash
272
+ shadow-brain setup
273
+ ```
274
+
275
+ Interactive wizard that configures your LLM provider, personality, and review depth.
276
+
277
+ ### Start Watching
278
+
279
+ ```bash
280
+ shadow-brain start .
281
+ ```
282
+
283
+ That's it. Shadow Brain will:
284
+ 1. Auto-detect which AI agents are running
285
+ 2. Start watching your project files
286
+ 3. Analyze every change in real-time
287
+ 4. Inject insights into your agent's memory
288
+ 5. Connect to the Neural Mesh for cross-session intelligence
289
+
290
+ ### Enable Neural Mesh (Multiple Terminals)
291
+
292
+ ```bash
293
+ # Terminal 1 β€” Project A with Claude Code
294
+ shadow-brain start ./project-a --mesh
295
+
296
+ # Terminal 2 β€” Project B with Cline
297
+ shadow-brain start ./project-b --mesh
298
+
299
+ # Terminal 3 β€” Check mesh status
300
+ shadow-brain mesh status
301
+ ```
302
+
303
+ What Terminal 1's Shadow Brain learns about security vulnerabilities, Terminal 2 instantly knows too β€” filtered by relevance using Shannon entropy.
304
+
305
+ ### Quick Review (No Watch Mode)
306
+
307
+ ```bash
308
+ # One-shot analysis
309
+ shadow-brain review .
310
+
311
+ # With health score and fix suggestions
312
+ shadow-brain review . --show-health --show-fixes
313
+
314
+ # JSON output for scripting
315
+ shadow-brain review . --output json
316
+ ```
317
+
318
+ ---
319
+
320
+ ## πŸ“– CLI Reference
321
+
322
+ ### Core Commands
323
+
324
+ | Command | Description |
325
+ |---|---|
326
+ | `shadow-brain start [dir]` | Start watching in real-time |
327
+ | `shadow-brain review [dir]` | One-shot code analysis |
328
+ | `shadow-brain health [dir]` | Compute health score (A-F grading) |
329
+ | `shadow-brain fix [dir]` | Show smart fix suggestions |
330
+ | `shadow-brain report [dir]` | Generate HTML/MD/JSON report |
331
+ | `shadow-brain metrics [dir]` | Code metrics (LOC, complexity, languages) |
332
+ | `shadow-brain scan [dir]` | Vulnerability scanner |
333
+ | `shadow-brain pr [dir]` | Generate PR description |
334
+ | `shadow-brain commit-msg [dir]` | Generate commit message |
335
+ | `shadow-brain ci [dir]` | Generate GitHub Actions workflow |
336
+ | `shadow-brain hook [dir]` | Install pre-commit hook |
337
+ | `shadow-brain rules [dir]` | Manage custom analysis rules |
338
+ | `shadow-brain dash [dir]` | Web dashboard (port 7341) |
339
+ | `shadow-brain inject <msg>` | Manually inject into agent memory |
340
+ | `shadow-brain notify [dir]` | Test notification channels |
341
+ | `shadow-brain status` | Show current configuration |
342
+ | `shadow-brain config` | Manage configuration |
343
+ | `shadow-brain setup` | Interactive setup wizard |
344
+ | `shadow-brain doctor` | Health check & diagnostics |
345
+
346
+ ### Super-Intelligence Commands (v2.0+)
347
+
348
+ | Command | Description |
349
+ |---|---|
350
+ | `shadow-brain semantic [dir]` | Semantic analysis β€” symbols, unused exports, dead code |
351
+ | `shadow-brain deps [dir]` | Dependency graph β€” cycles, orphans, hubs |
352
+ | `shadow-brain duplicates [dir]` | Detect duplicate/near-duplicate code |
353
+ | `shadow-brain adr [dir]` | Architecture Decision Records |
354
+ | `shadow-brain typesafety [dir]` | TypeScript type safety analysis |
355
+ | `shadow-brain perf [dir]` | Performance profiling |
356
+ | `shadow-brain knowledge [dir]` | Build & view project knowledge base |
357
+ | `shadow-brain gaps [dir]` | Find context gaps (missing docs, configs) |
358
+ | `shadow-brain learn [dir]` | Run learning cycle β€” extract patterns & lessons |
359
+ | `shadow-brain team share [dir]` | Share insights with team |
360
+ | `shadow-brain team insights` | View team insights |
361
+ | `shadow-brain team stats` | Team activity statistics |
362
+
363
+ ### Neural Mesh Commands (v2.1+)
364
+
365
+ | Command | Description |
366
+ |---|---|
367
+ | `shadow-brain mesh status` | View mesh state β€” nodes, knowledge, quantum state |
368
+ | `shadow-brain mesh insights` | Cross-session insights from other brains |
369
+ | `shadow-brain mesh knowledge` | Shared knowledge base |
370
+ | `shadow-brain mesh nodes` | List all connected brain nodes |
371
+ | `shadow-brain mesh aggregate` | Aggregated cross-project analytics |
372
+
373
+ ### Global Options
374
+
375
+ ```
376
+ -p, --provider <provider> LLM provider: anthropic | openai | ollama | openrouter
377
+ -m, --model <model> Model name (e.g., claude-sonnet-4-20250514, gpt-4o, llama3)
378
+ -k, --api-key <key> API key for the provider
379
+ --personality <type> Brain personality: mentor | critic | architect | security | performance | balanced
380
+ --depth <depth> Review depth: quick | standard | deep
381
+ --agents <agents> Comma-separated list of agents to watch
382
+ --no-inject Disable auto-injection
383
+ --mesh Enable Quantum Neural Mesh
384
+ --team <name> Enable team mode with username
385
+ --mcp Start MCP server alongside
386
+ ```
387
+
388
+ ---
389
+
390
+ ## πŸ’» Programmatic API
391
+
392
+ ```typescript
393
+ import {
394
+ Orchestrator,
395
+ BrainConfig,
396
+ detectRunningAgents,
397
+ CodeMetricsEngine,
398
+ VulnScanner,
399
+ HealthScoreEngine,
400
+ SmartFixEngine,
401
+ CustomRulesEngine,
402
+ PRGenerator,
403
+ Notifier,
404
+ SemanticAnalyzer,
405
+ DependencyGraphBuilder,
406
+ CodeSimilarityDetector,
407
+ ADREngine,
408
+ TypeSafetyAnalyzer,
409
+ PerformanceProfiler,
410
+ LearningEngine,
411
+ MCPServer,
412
+ TeamMode,
413
+ MultiProjectManager,
414
+ NeuralMesh,
415
+ } from '@theihtisham/agent-shadow-brain';
416
+
417
+ // Create and start the brain
418
+ const config: BrainConfig = {
419
+ provider: 'anthropic',
420
+ projectDir: './my-project',
421
+ agents: ['claude-code', 'cline', 'roo-code'],
422
+ watchMode: true,
423
+ autoInject: true,
424
+ reviewDepth: 'standard',
425
+ brainPersonality: 'balanced',
426
+ };
427
+
428
+ const brain = new Orchestrator(config);
429
+
430
+ // Listen to events
431
+ brain.on('insights', ({ insights }) => {
432
+ console.log(`Generated ${insights.length} insights`);
433
+ });
434
+
435
+ brain.on('health-score', ({ score }) => {
436
+ console.log(`Health: ${score.overall}/100 (${score.grade})`);
437
+ });
438
+
439
+ brain.on('fixes', ({ fixes }) => {
440
+ console.log(`${fixes.length} fix suggestions available`);
441
+ });
442
+
443
+ await brain.start();
444
+
445
+ // ── Super-Intelligence API (v2.0+) ────────────────────────────────────
446
+
447
+ // Semantic analysis
448
+ const semantic = await brain.getSemanticInsights(100);
449
+ console.log(`Found ${semantic.unusedExports.length} unused exports`);
450
+
451
+ // Dependency graph
452
+ const deps = await brain.getDependencyGraph();
453
+ const details = brain.getDependencyDetails(deps);
454
+ console.log(`Cycles: ${details.cycles.length}, Hubs: ${details.hubs.length}`);
455
+
456
+ // Duplicate detection
457
+ const dupes = await brain.detectDuplicates(0.8);
458
+ console.log(`${dupes.length} duplicate groups found`);
459
+
460
+ // Type safety
461
+ const typeIssues = await brain.analyzeTypeSafety();
462
+ console.log(`${typeIssues.length} type safety issues`);
463
+
464
+ // Performance profiling
465
+ const perfInsights = await brain.profilePerformance();
466
+ console.log(`${perfInsights.length} performance suggestions`);
467
+
468
+ // Learning engine
469
+ await brain.runLearningCycle();
470
+ const lessons = await brain.getLearnedLessons();
471
+
472
+ // ── Team Mode ────────────────────────────────────────────────────────
473
+
474
+ brain.enableTeamMode('ihtisham');
475
+ await brain.shareTeamInsight(insights[0]);
476
+ const teamInsights = await brain.getTeamInsights(10);
477
+
478
+ // ── MCP Server ───────────────────────────────────────────────────────
479
+
480
+ await brain.startMCPServer({ port: 7342 });
481
+ // Now accessible via JSON-RPC 2.0 at http://localhost:7342/mcp
482
+
483
+ // ── Neural Mesh (v2.1+) ──────────────────────────────────────────────
484
+
485
+ const mesh = await brain.enableNeuralMesh();
486
+ console.log(`Connected as node ${mesh.getNodeId()}`);
487
+
488
+ // Get cross-session insights from other brains
489
+ const crossInsights = brain.getCrossSessionInsights(20);
490
+ console.log(`${crossInsights.length} relevant insights from other sessions`);
491
+
492
+ // View mesh state
493
+ const state = brain.getMeshState();
494
+ console.log(`Quantum state: ${state?.quantumState}`);
495
+ console.log(`Knowledge entries: ${state?.knowledge.length}`);
496
+
497
+ // Aggregated analytics
498
+ const aggregated = brain.getAggregatedInsights();
499
+ console.log(`Projects: ${aggregated?.totalProjects}, Patterns: ${aggregated?.crossProjectPatterns.length}`);
500
+
501
+ // ── Standard API ─────────────────────────────────────────────────────
502
+
503
+ // Get health score
504
+ const health = await brain.getHealthScore();
505
+
506
+ // Code metrics
507
+ const metrics = await brain.computeMetrics();
508
+
509
+ // Vulnerability scan
510
+ const vulns = await brain.runVulnScan();
511
+
512
+ // Generate PR description
513
+ const pr = await brain.generatePRDescription(changes, 'feature/auth');
514
+
515
+ // Custom rules
516
+ brain.addCustomRule({
517
+ id: 'no-console-log',
518
+ name: 'No Console.Log',
519
+ description: 'Prevent console.log in production code',
520
+ pattern: 'console\\.log\\(',
521
+ severity: 'medium',
522
+ category: 'quality',
523
+ enabled: true,
524
+ });
525
+
526
+ // Notifications
527
+ await brain.sendNotification('critical-insight', 'Security Issue', 'Hardcoded API key found');
528
+ ```
529
+
530
+ ---
531
+
532
+ ## πŸ—οΈ Architecture
533
+
534
+ ### Core Components
535
+
536
+ | Module | File | Purpose |
537
+ |---|---|---|
538
+ | **Orchestrator** | `brain/orchestrator.ts` | Central event loop β€” coordinates everything |
539
+ | **Analyzer** | `brain/analyzer.ts` | LLM + rule-based code analysis |
540
+ | **LLM Client** | `brain/llm-client.ts` | Multi-provider LLM abstraction (Anthropic, OpenAI, Ollama, OpenRouter) |
541
+ | **Project Context** | `brain/project-context.ts` | Builds project understanding |
542
+ | **Pattern Memory** | `brain/pattern-memory.ts` | Learns codebase patterns |
543
+ | **Health Score** | `brain/health-score.ts` | Multi-dimensional health scoring |
544
+ | **Smart Fix** | `brain/smart-fix.ts` | Auto-generates fix suggestions |
545
+ | **Framework Presets** | `brain/framework-presets.ts` | React, Next.js, Django, FastAPI, etc. |
546
+ | **Custom Rules** | `brain/custom-rules.ts` | User-defined analysis rules |
547
+ | **PR Generator** | `brain/pr-generator.ts` | AI-powered PR/commit messages |
548
+ | **Notifier** | `brain/notifier.ts` | Slack, Discord, Webhook alerts |
549
+ | **Code Metrics** | `brain/code-metrics.ts` | LOC, complexity, language stats |
550
+ | **Vuln Scanner** | `brain/vuln-scanner.ts` | Dependency & secrets scanning |
551
+ | **Report Generator** | `brain/report-generator.ts` | HTML, Markdown, JSON reports |
552
+ | **Auto-Update** | `brain/auto-update.ts` | Version update notifications |
553
+
554
+ ### Super-Intelligence Components (v2.0+)
555
+
556
+ | Module | File | Purpose |
557
+ |---|---|---|
558
+ | **Semantic Analyzer** | `brain/semantic-analyzer.ts` | Symbol extraction, unused exports, dead code |
559
+ | **Dependency Graph** | `brain/dependency-graph.ts` | Tarjan's SCC, BFS depth, cycle & hub detection |
560
+ | **Code Similarity** | `brain/code-similarity.ts` | Winnowing algorithm for duplicate detection |
561
+ | **ADR Engine** | `brain/adr-engine.ts` | Architecture Decision Records |
562
+ | **Type Safety** | `brain/type-safety.ts` | `any` detection, `@ts-ignore`, missing types |
563
+ | **Performance Profiler** | `brain/perf-profiler.ts` | N+1 queries, memory leaks, blocking ops |
564
+ | **Context Completion** | `brain/context-completion.ts` | Knowledge gaps, missing docs/configs |
565
+ | **Learning Engine** | `brain/learning-engine.ts` | Pattern extraction, lesson persistence |
566
+ | **MCP Server** | `brain/mcp-server.ts` | JSON-RPC 2.0 MCP protocol server |
567
+ | **Team Mode** | `brain/team-mode.ts` | Shared insights & patterns across team |
568
+ | **Multi-Project** | `brain/multi-project.ts` | Watch multiple repos, aggregate health |
569
+
570
+ ### Quantum Neural Mesh (v2.1+)
571
+
572
+ | Module | File | Purpose |
573
+ |---|---|---|
574
+ | **Neural Mesh** | `brain/neural-mesh.ts` | Cross-session shared intelligence |
575
+ | **Entropy Engine** | `brain/neural-mesh.ts` | Shannon entropy relevance scoring |
576
+ | **Knowledge Bus** | `~/.shadow-brain-mesh/` | Filesystem-based knowledge sharing |
577
+
578
+ ### Adapter Pattern
579
+
580
+ Each AI agent gets a dedicated adapter that knows how to read its memory files and inject context:
581
+
582
+ ```
583
+ BaseAdapter (abstract)
584
+ β”œβ”€β”€ ClaudeCodeAdapter β†’ CLAUDE.md, .claude/
585
+ β”œβ”€β”€ KiloCodeAdapter β†’ .kilocode/rules.md
586
+ β”œβ”€β”€ ClineAdapter β†’ .clinerules
587
+ β”œβ”€β”€ OpenCodeAdapter β†’ AGENT.md
588
+ β”œβ”€β”€ CodexAdapter β†’ AGENTS.md
589
+ β”œβ”€β”€ RooCodeAdapter β†’ .roo/rules.md
590
+ └── AiderAdapter β†’ .aider.conf.yml
591
+ ```
592
+
593
+ ---
594
+
595
+ ## πŸ”§ Configuration
596
+
597
+ ### Project Config (`.shadow-brain.json`)
598
+
599
+ ```json
600
+ {
601
+ "version": "2.1.0",
602
+ "rules": {
603
+ "customRules": [
604
+ {
605
+ "id": "no-any",
606
+ "name": "No TypeScript Any",
607
+ "description": "Prevent usage of 'any' type",
608
+ "pattern": ":\\s*any\\b",
609
+ "severity": "medium",
610
+ "category": "quality",
611
+ "suggestion": "Use a specific type instead of 'any'",
612
+ "enabled": true
613
+ }
614
+ ],
615
+ "ignorePaths": ["**/*.test.ts", "**/*.spec.ts"]
616
+ },
617
+ "notifications": {
618
+ "slack": "https://hooks.slack.com/services/...",
619
+ "discord": "https://discord.com/api/webhooks/...",
620
+ "onHealthDrop": true,
621
+ "onCriticalInsight": true
622
+ },
623
+ "health": {
624
+ "weights": {
625
+ "security": 0.25,
626
+ "performance": 0.15,
627
+ "quality": 0.25,
628
+ "architecture": 0.15,
629
+ "maintainability": 0.10,
630
+ "testCoverage": 0.10
631
+ }
632
+ }
633
+ }
634
+ ```
635
+
636
+ ### Global Config
637
+
638
+ ```bash
639
+ # Set LLM provider
640
+ shadow-brain config provider anthropic
641
+
642
+ # Set API key
643
+ shadow-brain config apiKey sk-ant-...
644
+
645
+ # Set brain personality
646
+ shadow-brain config brainPersonality security
647
+
648
+ # View all config
649
+ shadow-brain config --list
650
+
651
+ # Reset to defaults
652
+ shadow-brain config --reset
653
+ ```
654
+
655
+ ---
656
+
657
+ ## πŸ”Œ GitHub Actions Integration
658
+
659
+ ```bash
660
+ # Generate CI workflow
661
+ shadow-brain ci .
662
+ ```
663
+
664
+ Creates `.github/workflows/shadow-brain.yml` that:
665
+ - Runs Shadow Brain analysis on every PR
666
+ - Posts health score as a PR comment
667
+ - Uploads full HTML report as artifact
668
+ - Runs language-specific lint/test jobs
669
+ - Blocks merge on critical issues
670
+
671
+ ---
672
+
673
+ ## πŸͺ Pre-Commit Hook
674
+
675
+ ```bash
676
+ # Install hook
677
+ shadow-brain hook .
678
+
679
+ # Remove hook
680
+ shadow-brain hook . --uninstall
681
+ ```
682
+
683
+ Automatically analyzes your staged changes before each commit. If critical issues are found, the commit is blocked. Bypass with `git commit --no-verify`.
684
+
685
+ ---
686
+
687
+ ## πŸ“Š Health Score System
688
+
689
+ Shadow Brain computes a multi-dimensional health score (0-100, A-F):
690
+
691
+ | Dimension | Weight | What It Checks |
692
+ |---|---|---|
693
+ | πŸ›‘οΈ Security | 25% | Vulnerabilities, secrets, exposed keys |
694
+ | ✨ Quality | 25% | Code smells, anti-patterns, complexity |
695
+ | ⚑ Performance | 15% | N+1 queries, memory leaks, blocking ops |
696
+ | πŸ›οΈ Architecture | 15% | Coupling, cohesion, dependency health |
697
+ | πŸ”§ Maintainability | 10% | Code duplication, file sizes, comments |
698
+ | πŸ§ͺ Test Coverage | 10% | Test presence, assertion quality |
699
+
700
+ ```bash
701
+ # Get health score
702
+ shadow-brain health .
703
+
704
+ # JSON output
705
+ shadow-brain health . --json
706
+
707
+ # SVG badge for README
708
+ shadow-brain health . --badge > health-badge.svg
709
+ ```
710
+
711
+ ---
712
+
713
+ ## πŸ“ˆ Version History
714
+
715
+ ### v2.1.0 β€” Quantum Neural Mesh
716
+ - **Neural Mesh** β€” cross-session shared intelligence between multiple Shadow Brain instances
717
+ - **Shannon entropy** relevance scoring for cross-project insight filtering
718
+ - **Cosine similarity** knowledge deduplication with hash-based vectors
719
+ - **Bayesian confidence** updating as evidence accumulates
720
+ - **5 mesh CLI commands** β€” status, insights, knowledge, nodes, aggregate
721
+ - **Quantum state** tracking β€” coherent, decoherent, collapsed
722
+ - **Heartbeat & discovery** β€” automatic node detection with filesystem bus
723
+
724
+ ### v2.0.0 β€” Super-Intelligence Edition
725
+ - **Semantic analyzer** β€” symbol extraction, unused exports, dead code detection
726
+ - **Dependency graph** β€” Tarjan's SCC algorithm for cycle detection, BFS depth analysis
727
+ - **Code similarity detector** β€” Winnowing algorithm for duplicate detection
728
+ - **ADR engine** β€” Architecture Decision Records, auto-detection from changes
729
+ - **Type safety analyzer** β€” `any` detection, `@ts-ignore`, missing return types
730
+ - **Performance profiler** β€” N+1 queries, memory leaks, blocking operations
731
+ - **Context completion** β€” identifies missing documentation, configs, knowledge gaps
732
+ - **Learning engine** β€” extracts patterns and lessons from project insights
733
+ - **MCP Server** β€” JSON-RPC 2.0 Model Context Protocol server
734
+ - **Team mode** β€” shared insights and patterns across team members
735
+ - **Multi-project** β€” watch and compare health across multiple repos
736
+ - **Roo Code & Aider adapters** β€” extended agent coverage
737
+ - **11 new CLI commands** β€” semantic, deps, duplicates, adr, typesafety, perf, knowledge, gaps, learn, team, mesh
738
+
739
+ ### v1.2.0 β€” Feature Complete
740
+ - **Custom Rules Engine** β€” define your own analysis rules with regex patterns
741
+ - **PR Description Generator** β€” AI-powered PR titles and bodies
742
+ - **Commit Message Generator** β€” conventional commits, auto-generated
743
+ - **Vulnerability Scanner** β€” npm audit, pip audit, cargo audit, secrets detection
744
+ - **Code Metrics Engine** β€” LOC, complexity, language breakdown, hotspot detection
745
+ - **Notification System** β€” Slack, Discord, and webhook alerts for critical findings
746
+ - **Project Config** β€” `.shadow-brain.json` for per-project settings
747
+ - **Auto-Update Checker** β€” notifies when a new version is available
748
+
749
+ ---
750
+
751
+ ## 🀝 Supported Agents
752
+
753
+ | Agent | Status | Injection Target |
754
+ |---|---|---|
755
+ | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | βœ… Full Support | `CLAUDE.md`, `.claude/` |
756
+ | [Kilo Code](https://kilocode.ai/) | βœ… Full Support | `.kilocode/rules.md` |
757
+ | [Cline](https://github.com/cline/cline) | βœ… Full Support | `.clinerules` |
758
+ | [OpenCode](https://github.com/opencode-ai/opencode) | βœ… Full Support | `AGENT.md` |
759
+ | [Codex](https://github.com/openai/codex) | βœ… Full Support | `AGENTS.md` |
760
+ | [Roo Code](https://roocode.com/) | βœ… Full Support | `.roo/rules.md` |
761
+ | [Aider](https://aider.chat/) | βœ… Full Support | `.aider.conf.yml` |
762
+ | [Cursor](https://cursor.com/) | πŸ”„ Planned | β€” |
763
+
764
+ ---
765
+
766
+ ## πŸ› οΈ Development
767
+
768
+ ```bash
769
+ # Clone
770
+ git clone https://github.com/theihtisham/agent-shadow-brain.git
771
+ cd agent-shadow-brain
772
+
773
+ # Install dependencies
774
+ npm install
775
+
776
+ # Build
777
+ npm run build
778
+
779
+ # Run in dev mode
780
+ npm run dev start .
781
+
782
+ # Run tests
783
+ npm test
784
+
785
+ # Type check
786
+ npm run lint
787
+ ```
788
+
789
+ ---
790
+
791
+ ## πŸ—ΊοΈ Roadmap
792
+
793
+ - [x] ~~**MCP Server Mode** β€” run as a Model Context Protocol server~~ (v2.0)
794
+ - [x] ~~**Multi-project support** β€” watch multiple repos simultaneously~~ (v2.0)
795
+ - [x] ~~**Team mode** β€” shared pattern memory across team members~~ (v2.0)
796
+ - [x] ~~**Roo Code & Aider adapters** β€” extend agent coverage~~ (v2.0)
797
+ - [x] ~~**Cross-session intelligence** β€” Neural Mesh quantum sharing~~ (v2.1)
798
+ - [ ] **IDE extensions** β€” VS Code extension for inline insights
799
+ - [ ] **Custom LLM fine-tuning** β€” train on your codebase patterns
800
+ - [ ] **Docker image** β€” one-command containerized deployment
801
+ - [ ] **Web dashboard v2** β€” React-based interactive analytics dashboard
802
+ - [ ] **Language server** β€” LSP protocol for real-time inline feedback
803
+
804
+ ---
805
+
806
+ ## πŸ“„ License
807
+
808
+ MIT License β€” see [LICENSE](LICENSE) for details.
809
+
810
+ ---
811
+
812
+ ## πŸ‘€ Author
813
+
814
+ **theihtisham**
815
+
816
+ [![GitHub](https://img.shields.io/badge/GitHub-theihtisham-181717?style=flat-square&logo=github)](https://github.com/theihtisham)
817
+ [![npm](https://img.shields.io/badge/npm-@theihtisham-CB3837?style=flat-square&logo=npm)](https://www.npmjs.com/~theihtisham)
818
+
819
+ ---
820
+
821
+ <div align="center">
822
+
823
+ ### If Shadow Brain makes your AI agents smarter, give it a ⭐
824
+
825
+ [![Star History Chart](https://api.star-history.com/svg?repos=theihtisham/agent-shadow-brain&type=Date)](https://star-history.com/#theihtisham/agent-shadow-brain&Date)
826
+
827
+ **Built with 🧠 by [theihtisham](https://github.com/theihtisham)**
828
+
829
+ </div>
830
+
831
+ ---
832
+
833
+ <div align="center">
834
+
835
+ **Topics:** `ai` `artificial-intelligence` `llm` `claude-code` `cline` `kilo-code` `codex` `roo-code` `aider` `opencode` `code-review` `static-analysis` `developer-tools` `npm-package` `typescript` `ollama` `openai` `anthropic` `code-quality` `security-scanner` `health-score` `smart-fix` `vulnerability-scanner` `pattern-learning` `agent-tools` `ai-agent` `code-metrics` `pre-commit-hook` `github-actions` `developer-productivity` `shadow-ai` `neural-code-review` `auto-review` `intelligence-layer` `multi-agent` `ai-coding-assistant` `devtools` `cli-tool` `code-analysis` `software-quality` `tech-debt` `ai-tools` `prompt-engineering` `agentic-coding` `vibe-coding` `ai-engineering` `llm-tools` `ai-workflow` `code-intelligence` `neural-mesh` `quantum-computing` `shannon-entropy` `bayesian-inference` `mcp-server` `semantic-analysis` `dependency-graph` `team-collaboration` `cross-session` `super-intelligence`
836
+
837
+ </div>