milens 0.6.3 → 0.6.5

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 (155) hide show
  1. package/.agents/skills/adapters/SKILL.md +51 -0
  2. package/.agents/skills/analyzer/SKILL.md +77 -0
  3. package/.agents/skills/apps/SKILL.md +66 -0
  4. package/.agents/skills/docs/SKILL.md +73 -0
  5. package/.agents/skills/milens/SKILL.md +198 -0
  6. package/.agents/skills/milens-architect/SKILL.md +128 -0
  7. package/.agents/skills/milens-code-review/SKILL.md +186 -0
  8. package/.agents/skills/milens-debugger/SKILL.md +141 -0
  9. package/.agents/skills/milens-eval/SKILL.md +221 -0
  10. package/.agents/skills/milens-plan/SKILL.md +227 -0
  11. package/.agents/skills/milens-refactor-clean/SKILL.md +209 -0
  12. package/.agents/skills/milens-security-review/SKILL.md +224 -0
  13. package/.agents/skills/milens-tdd/SKILL.md +156 -0
  14. package/.agents/skills/orchestrator/SKILL.md +59 -0
  15. package/.agents/skills/parser/SKILL.md +81 -0
  16. package/.agents/skills/root/SKILL.md +86 -0
  17. package/.agents/skills/scripts/SKILL.md +45 -0
  18. package/.agents/skills/security/SKILL.md +65 -0
  19. package/.agents/skills/server/SKILL.md +72 -0
  20. package/.agents/skills/store/SKILL.md +75 -0
  21. package/.agents/skills/test/SKILL.md +121 -0
  22. package/LICENSE +21 -75
  23. package/README.md +356 -453
  24. package/adapters/README.md +107 -0
  25. package/adapters/claude-code/.claude/mcp.json +9 -0
  26. package/adapters/claude-code/CLAUDE.md +58 -0
  27. package/adapters/codex/.codex/codex.md +52 -0
  28. package/adapters/copilot/.github/copilot-instructions.md +62 -0
  29. package/adapters/cursor/.cursorrules +9 -0
  30. package/adapters/gemini/.gemini/context.md +58 -0
  31. package/adapters/opencode/.opencode/config.json +9 -0
  32. package/adapters/opencode/AGENTS.md +58 -0
  33. package/adapters/zed/.zed/settings.json +8 -0
  34. package/dist/agents-md.d.ts +3 -0
  35. package/dist/agents-md.d.ts.map +1 -0
  36. package/dist/agents-md.js +114 -0
  37. package/dist/agents-md.js.map +1 -0
  38. package/dist/analyzer/engine.d.ts +1 -0
  39. package/dist/analyzer/engine.d.ts.map +1 -1
  40. package/dist/analyzer/engine.js +37 -7
  41. package/dist/analyzer/engine.js.map +1 -1
  42. package/dist/cli.js +1472 -406
  43. package/dist/cli.js.map +1 -1
  44. package/dist/metrics.d.ts +51 -0
  45. package/dist/metrics.d.ts.map +1 -0
  46. package/dist/metrics.js +64 -0
  47. package/dist/metrics.js.map +1 -0
  48. package/dist/orchestrator/orchestrator.d.ts +65 -0
  49. package/dist/orchestrator/orchestrator.d.ts.map +1 -0
  50. package/dist/orchestrator/orchestrator.js +178 -0
  51. package/dist/orchestrator/orchestrator.js.map +1 -0
  52. package/dist/orchestrator/reporter.d.ts +15 -0
  53. package/dist/orchestrator/reporter.d.ts.map +1 -0
  54. package/dist/orchestrator/reporter.js +38 -0
  55. package/dist/orchestrator/reporter.js.map +1 -0
  56. package/dist/parser/lang-go.js +47 -47
  57. package/dist/parser/lang-java.js +29 -29
  58. package/dist/parser/lang-js.js +105 -105
  59. package/dist/parser/lang-php.js +38 -38
  60. package/dist/parser/lang-py.js +34 -34
  61. package/dist/parser/lang-ruby.js +14 -14
  62. package/dist/parser/lang-rust.js +30 -30
  63. package/dist/parser/lang-ts.js +191 -191
  64. package/dist/security/deps.d.ts +38 -0
  65. package/dist/security/deps.d.ts.map +1 -0
  66. package/dist/security/deps.js +685 -0
  67. package/dist/security/deps.js.map +1 -0
  68. package/dist/security/rules.d.ts +42 -0
  69. package/dist/security/rules.d.ts.map +1 -0
  70. package/dist/security/rules.js +943 -0
  71. package/dist/security/rules.js.map +1 -0
  72. package/dist/server/hooks.d.ts +29 -0
  73. package/dist/server/hooks.d.ts.map +1 -0
  74. package/dist/server/hooks.js +332 -0
  75. package/dist/server/hooks.js.map +1 -0
  76. package/dist/server/mcp-prompts.d.ts +277 -0
  77. package/dist/server/mcp-prompts.d.ts.map +1 -0
  78. package/dist/server/mcp-prompts.js +627 -0
  79. package/dist/server/mcp-prompts.js.map +1 -0
  80. package/dist/server/mcp.d.ts.map +1 -1
  81. package/dist/server/mcp.js +1030 -652
  82. package/dist/server/mcp.js.map +1 -1
  83. package/dist/server/test-plan.d.ts +20 -0
  84. package/dist/server/test-plan.d.ts.map +1 -0
  85. package/dist/server/test-plan.js +100 -0
  86. package/dist/server/test-plan.js.map +1 -0
  87. package/dist/server/watcher.d.ts +39 -0
  88. package/dist/server/watcher.d.ts.map +1 -0
  89. package/dist/server/watcher.js +134 -0
  90. package/dist/server/watcher.js.map +1 -0
  91. package/dist/skills.js +197 -153
  92. package/dist/skills.js.map +1 -1
  93. package/dist/store/annotations.d.ts +41 -0
  94. package/dist/store/annotations.d.ts.map +1 -0
  95. package/dist/store/annotations.js +195 -0
  96. package/dist/store/annotations.js.map +1 -0
  97. package/dist/store/confidence.d.ts +28 -0
  98. package/dist/store/confidence.d.ts.map +1 -0
  99. package/dist/store/confidence.js +109 -0
  100. package/dist/store/confidence.js.map +1 -0
  101. package/dist/store/db.d.ts +53 -14
  102. package/dist/store/db.d.ts.map +1 -1
  103. package/dist/store/db.js +447 -240
  104. package/dist/store/db.js.map +1 -1
  105. package/dist/store/schema.sql +143 -116
  106. package/dist/store/vectors.js +2 -2
  107. package/dist/types.d.ts +101 -0
  108. package/dist/types.d.ts.map +1 -1
  109. package/docs/README.md +22 -0
  110. package/package.json +81 -66
  111. package/dist/gateway/analyzer.d.ts +0 -6
  112. package/dist/gateway/analyzer.d.ts.map +0 -1
  113. package/dist/gateway/analyzer.js +0 -218
  114. package/dist/gateway/analyzer.js.map +0 -1
  115. package/dist/gateway/cache.d.ts +0 -35
  116. package/dist/gateway/cache.d.ts.map +0 -1
  117. package/dist/gateway/cache.js +0 -175
  118. package/dist/gateway/cache.js.map +0 -1
  119. package/dist/gateway/config.d.ts +0 -10
  120. package/dist/gateway/config.d.ts.map +0 -1
  121. package/dist/gateway/config.js +0 -167
  122. package/dist/gateway/config.js.map +0 -1
  123. package/dist/gateway/context-memory.d.ts +0 -68
  124. package/dist/gateway/context-memory.d.ts.map +0 -1
  125. package/dist/gateway/context-memory.js +0 -157
  126. package/dist/gateway/context-memory.js.map +0 -1
  127. package/dist/gateway/observability.d.ts +0 -83
  128. package/dist/gateway/observability.d.ts.map +0 -1
  129. package/dist/gateway/observability.js +0 -152
  130. package/dist/gateway/observability.js.map +0 -1
  131. package/dist/gateway/privacy.d.ts +0 -27
  132. package/dist/gateway/privacy.d.ts.map +0 -1
  133. package/dist/gateway/privacy.js +0 -139
  134. package/dist/gateway/privacy.js.map +0 -1
  135. package/dist/gateway/providers.d.ts +0 -66
  136. package/dist/gateway/providers.d.ts.map +0 -1
  137. package/dist/gateway/providers.js +0 -377
  138. package/dist/gateway/providers.js.map +0 -1
  139. package/dist/gateway/router.d.ts +0 -18
  140. package/dist/gateway/router.d.ts.map +0 -1
  141. package/dist/gateway/router.js +0 -102
  142. package/dist/gateway/router.js.map +0 -1
  143. package/dist/gateway/server.d.ts +0 -20
  144. package/dist/gateway/server.d.ts.map +0 -1
  145. package/dist/gateway/server.js +0 -387
  146. package/dist/gateway/server.js.map +0 -1
  147. package/dist/gateway/translator.d.ts +0 -19
  148. package/dist/gateway/translator.d.ts.map +0 -1
  149. package/dist/gateway/translator.js +0 -340
  150. package/dist/gateway/translator.js.map +0 -1
  151. package/dist/gateway/types.d.ts +0 -215
  152. package/dist/gateway/types.d.ts.map +0 -1
  153. package/dist/gateway/types.js +0 -3
  154. package/dist/gateway/types.js.map +0 -1
  155. package/dist/store/gateway-schema.sql +0 -53
package/README.md CHANGED
@@ -1,620 +1,523 @@
1
1
  <p align="center">
2
- <strong>milens</strong><br>
3
- <em>Code Intelligence Engine for AI Agents</em>
2
+ <strong>Milens</strong><br>
3
+ <em>AI-DOS The Operating System for AI-Driven Development</em>
4
4
  </p>
5
5
 
6
6
  <p align="center">
7
- <a href="https://www.npmjs.com/package/milens"><img src="https://img.shields.io/npm/v/milens" alt="npm version"></a>
8
- <a href="https://github.com/fuze210699/milens/blob/develop/LICENSE"><img src="https://img.shields.io/badge/license-PolyForm--Noncommercial-blue" alt="License: PolyForm Noncommercial"></a>
9
- <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node.js >= 20"></a>
10
- <img src="https://img.shields.io/badge/languages-12-orange" alt="12 Languages">
11
- <img src="https://img.shields.io/badge/MCP_tools-32-purple" alt="32 MCP Tools">
12
- </p>
13
-
14
- <p align="center">
15
- <strong>Index any codebase → Knowledge graph → AI agents that never miss code</strong>
16
- </p>
17
-
18
- <p align="center">
19
- <a href="#the-problem">Why?</a> •
20
- <a href="#quick-start">Quick Start</a> •
21
- <a href="#mcp-tools">MCP Tools</a> •
22
- <a href="#tool-examples">Examples</a> •
23
- <a href="#editor-setup">Editors</a> •
24
- <a href="#supported-languages">Languages</a>
7
+ <a href="https://www.npmjs.com/package/milens"><img src="https://img.shields.io/npm/v/milens" alt="npm"></a>
8
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node"></a>
9
+ <a href="https://github.com/fuze210699/milens/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="license"></a>
10
+ <img src="https://img.shields.io/badge/tools-41-purple" alt="41 tools">
11
+ <img src="https://img.shields.io/badge/prompts-7-orange" alt="7 prompts">
12
+ <img src="https://img.shields.io/badge/security-50%2B-red" alt="50+ rules">
13
+ <img src="https://img.shields.io/badge/harnesses-7-lightgrey" alt="7 harnesses">
25
14
  </p>
26
15
 
27
16
  ---
28
17
 
29
- ## The Problem
30
-
31
- You're burning tokens and premium requests on tasks that milens can handle at a fraction of the cost. Every time your agent explores a codebase — reading files one by one, searching for references, tracing call chains — you're paying for what a pre-built knowledge graph delivers instantly.
32
-
33
- **Why not let milens save your wallet?**
34
-
35
- One `milens analyze` replaces dozens of agent tool calls. Instead of the agent spending 10+ steps to map out a function's dependencies, `impact()` returns the full blast radius in a single call.
36
-
37
- If you're concerned about security, read our [Security & Privacy](#security--privacy) guarantees — milens is fully offline, zero telemetry, localhost-only.
38
-
39
- ### How milens Solves This
40
-
41
18
  <p align="center">
42
- <img src="https://raw.githubusercontent.com/fuze210699/milens/develop/docs/diagram1.svg" alt="Without milens vs With milens comparison" width="700">
19
+ <a href="https://github.com/fuze210699/milens">⭐ Star</a> ·
20
+ <a href="https://github.com/sponsors/fuze210699">💖 Sponsor</a> ·
21
+ <a href="https://github.com/fuze210699/milens/discussions">💬 Discussions</a> ·
22
+ <a href="https://github.com/fuze210699/milens/blob/main/docs/pricing.md">Pro $1/seat</a>
43
23
  </p>
44
24
 
45
- milens builds a **pre-indexed knowledge graph** at analysis time — resolving every import, call, and inheritance chain — so that any tool query returns the full dependency picture instantly, without multi-step exploration.
46
-
47
25
  ---
48
26
 
49
- ## Quick Start
27
+ ## Quick Install
50
28
 
51
29
  ```bash
52
- npx milens analyze # index your codebase
30
+ npx milens init --profile full
31
+ npx milens analyze -p . --force
53
32
  ```
54
33
 
55
- Then add the MCP server to your editor ([setup below](#editor-setup)) and your agent immediately gets 32 code intelligence tools.
56
-
57
34
  ---
58
35
 
59
- ## CLI Commands
60
-
61
- ### `milens analyze` — Index a codebase
62
-
63
- Parse all source files, resolve cross-file dependencies, and build a searchable knowledge graph.
64
-
65
- ```bash
66
- milens analyze # index current directory
67
- milens analyze -p /path/to/repo # index a specific repo
68
- milens analyze -p . --force # full re-index (ignore cache)
69
- milens analyze -p . --force --verbose # full re-index with detailed progress
70
- ```
71
-
72
- **Output:** A `.milens/milens.db` SQLite database containing every symbol, relationship, and search index.
73
-
74
- **Incremental mode:** By default, only re-parses files whose SHA-256 hash has changed since the last run.
75
-
76
- #### Generating AI skill files
77
-
78
- Skill files teach your AI agent the codebase structure — key symbols, entry points, cross-area dependencies — without reading every file.
36
+ ## What is Milens?
79
37
 
80
- ```bash
81
- milens analyze -p . --skills # generate for all editors
82
- milens analyze -p . --skills-copilot # GitHub Copilot only
83
- milens analyze -p . --skills-cursor # Cursor only
84
- milens analyze -p . --skills-claude # Claude Code only
85
- milens analyze -p . --skills-agents # AGENTS.md only
86
- milens analyze -p . --skills-windsurf # Windsurf only
87
- ```
88
-
89
- | Flag | Output files |
90
- |---|---|
91
- | `--skills-copilot` | `.github/instructions/*.instructions.md` + `.github/copilot-instructions.md` |
92
- | `--skills-cursor` | `.cursor/rules/*.mdc` + `.cursor/index.mdc` |
93
- | `--skills-claude` | `.claude/skills/generated/*/SKILL.md` + `.claude/rules/*.md` + `CLAUDE.md` |
94
- | `--skills-agents` | `.agents/skills/*/SKILL.md` + `AGENTS.md` |
95
- | `--skills-windsurf` | `.windsurfrules` |
38
+ Milens is a code intelligence platform that gives AI coding agents instant understanding of your codebase. 41 MCP tools, 7 sub-agent prompts, 7 CLI workflows, and 50 security rules. It builds a knowledge graph of your entire project — every function, class, import, call, and inheritance chain — then exposes it through MCP tools. Agents query the graph instead of searching files. **70% fewer tokens** per session, **zero broken dependencies**, and a system that **learns from every session**.
96
39
 
97
- > Root config files use `<!-- milens:start/end -->` markers for **idempotent injection** — re-running replaces the milens section without overwriting your custom content.
40
+ - **Analyze once.** Tree-sitter parses 12 languages into a SQLite knowledge graph.
41
+ - **Query instantly.** FTS5 search, recursive CTE traversal — all in-database.
42
+ - **Edit safely.** Every tool returns a blast radius before you change anything.
43
+ - **Scan automatically.** 50+ security rules run in one call, not ten greps.
44
+ - **Learn continuously.** Annotations persist across sessions. Patterns auto-promote to rules.
98
45
 
99
- **Team Collaboration Notes:**
100
-
101
- - ✅ **Instruction files are safe to commit** - They use `<workspaceRoot>` placeholder instead of absolute paths
102
- - ✅ **No merge conflicts** - No machine-specific information (username, absolute paths, etc.)
103
- - ✅ **Consistent AI assistance** - All team members get the same codebase intelligence
104
- - ⚠️ **Database is gitignored** - `.milens/*.db` files are local; each developer runs `npx milens analyze` after clone
105
-
106
- See [`.milens/README.md`](https://github.com/fuze210699/milens/blob/develop/.milens/README.md) for more details on the index directory.
46
+ Fully offline. Zero telemetry. Localhost-only MCP server. One command to bootstrap.
107
47
 
108
48
  ---
109
49
 
110
- ### `milens search` — Find symbols by name
111
-
112
- Full-text search (BM25) across all indexed symbol names and file paths.
50
+ ## Architecture
113
51
 
114
- ```bash
115
- milens search "UserService" # search for symbols
116
- milens search "auth" --limit 50 # increase result limit (default: 20)
117
- milens search "handler" -p /path/to/repo # search in a specific repo
118
52
  ```
53
+ npx milens init
54
+
55
+ ┌─────▼──────┐
56
+ │ Analyzer │ ── Parse 12 langs
57
+ └─────┬──────┘ (tree-sitter WASM)
58
+
59
+ ┌─────▼──────┐
60
+ │ Store │ ── SQLite + FTS5
61
+ └─────┬──────┘ (symbols, links, metadata)
62
+
63
+ ┌─────▼──────┐
64
+ │ Server │ ── MCP stdio/HTTP
65
+ └─────┬──────┘ 41 tools
66
+
67
+ ┌──────────┴──────────┐
68
+ ▼ ▼
69
+ AI Agent (MCP) CLI (terminal)
119
70
 
120
- **Output format:** `name [kind] file:line (exported)`
121
-
122
- ```
123
- AuthService [class] src/auth.ts:15 (exported)
124
- hashPassword [function] src/auth.ts:3 (exported)
71
+ Pipeline stages: Parser (tree-sitter CST) → Analyzer (symbol extraction + dependency resolution) → Store (SQLite insert + index) → Server (MCP tool dispatch)
125
72
  ```
126
73
 
127
74
  ---
128
75
 
129
- ### `milens inspect` — 360° symbol view
130
-
131
- Show everything about a symbol: who calls it (incoming) and what it depends on (outgoing).
76
+ ## Quick Start
132
77
 
133
78
  ```bash
134
- milens inspect "AuthService"
135
- milens inspect "resolveLinks" -p .
79
+ npm install -g milens # install globally
80
+ cd your-project
81
+ milens init --profile full --interactive # bootstrap everything
136
82
  ```
137
83
 
138
- **Output:**
84
+ That single command analyzes your codebase, builds a knowledge graph, generates `AGENTS.md`, installs skill files, configures security rules, and sets up pre-commit hooks.
139
85
 
140
- ```
141
- AuthService [class] src/auth.ts:15
142
- incoming:
143
- calls: handleLogin (src/routes.ts)
144
- calls: UserController (src/controllers/user.ts)
145
- outgoing:
146
- imports: User (src/models.ts)
147
- calls: hashPassword (src/auth.ts)
148
- calls: createUser (src/models.ts)
149
- ```
150
-
151
- ---
152
-
153
- ### `milens impact` — Blast radius analysis
154
-
155
- Recursively trace what depends on a symbol (upstream) or what a symbol depends on (downstream).
86
+ Then connect your editor:
156
87
 
157
- ```bash
158
- milens impact "createUser" # upstream: what breaks if this changes?
159
- milens impact "UserModel" -d downstream # downstream: what does this depend on?
160
- milens impact "searchSymbols" --depth 2 # limit traversal depth (default: 3)
88
+ ```json
89
+ // .vscode/mcp.json VS Code / Copilot
90
+ {
91
+ "servers": {
92
+ "milens": {
93
+ "type": "stdio",
94
+ "command": "npx",
95
+ "args": ["-y", "milens", "serve", "-p", "${workspaceFolder}"]
96
+ }
97
+ }
98
+ }
161
99
  ```
162
100
 
163
- **Output:**
164
-
165
- ```
166
- TARGET: createUser [function] src/models.ts:42
167
- [depth 1] AuthService [class] src/auth.ts:15 (calls)
168
- [depth 1] UserController [class] src/controllers/user.ts:8 (calls)
169
- [depth 2] handleLogin [function] src/routes.ts:23 (calls)
170
- ```
101
+ ```bash
102
+ # Claude Code
103
+ claude mcp add milens -- npx -y milens serve -p .
171
104
 
172
- **Depth meaning:**
173
- - Depth 1 = **WILL BREAK** direct callers/dependents
174
- - Depth 2 = **LIKELY AFFECTED** — indirect dependents
175
- - Depth 3 = **MAY NEED TESTING** — transitive dependents
105
+ # Cursor — .cursor/mcp.json
106
+ { "mcpServers": { "milens": { "command": "npx", "args": ["-y", "milens", "serve", "-p", "."] } } }
176
107
 
177
- ---
108
+ # OpenCode — .opencode/config.json
109
+ { "mcp": { "milens": { "command": "npx", "args": ["-y", "milens", "serve"] } } }
178
110
 
179
- ### `milens serve` Start MCP server
111
+ # Codex.codex/config.toml
112
+ [mcp_servers.milens]
113
+ command = "npx"
114
+ args = ["-y", "milens", "serve", "-p", "."]
180
115
 
181
- Expose the knowledge graph to AI agents via the Model Context Protocol.
116
+ # Gemini .gemini/settings.json
117
+ { "mcpServers": { "milens": { "command": "npx", "args": ["-y", "milens", "serve", "-p", "."] } } }
182
118
 
183
- ```bash
184
- milens serve # stdio transport (for editors)
185
- milens serve -p /path/to/repo # serve a specific repo
186
- milens serve --http # HTTP transport on port 3100
187
- milens serve --http --port 8080 # HTTP on custom port
119
+ # Zed — .zed/settings.json
120
+ { "mcp_servers": { "milens": { "command": "npx", "args": ["-y", "milens", "serve", "-p", "."] } } }
188
121
  ```
189
122
 
190
- **stdio mode** (default): Used by editors like VS Code, Cursor, and Claude Code. The agent communicates through stdin/stdout.
191
-
192
- **HTTP mode**: Used by remote agents or custom integrations. Binds to `127.0.0.1` only — no network exposure.
193
-
194
- Endpoint: `POST http://localhost:3100/mcp`
123
+ Open your AI agent. It auto-loads `AGENTS.md` with codebase context. You're ready.
195
124
 
196
125
  ---
197
126
 
198
- ### `milens status` Show index stats
199
-
200
- ```bash
201
- milens status # current directory
202
- milens status -p /path/to/repo # specific repo
203
- ```
127
+ ## Without Milens vs With Milens
204
128
 
205
- **Output:**
129
+ | Situation | Without Milens | With Milens |
130
+ |---|---|---|
131
+ | **Understand a new codebase** | Agent reads 15 files blind (~30,000 tokens) | `codebase_summary()` — 500 tokens |
132
+ | **Edit a function safely** | No idea what depends on it | `impact({target, depth: 3})` — exact blast radius |
133
+ | **Find all references** | Grep 5 times, read 8 files | `context({name})` — incoming + outgoing, one call |
134
+ | **Review a PR** | Read diff, guess risk | `review_pr()` — every symbol scored CRITICAL/HIGH/MEDIUM/LOW |
135
+ | **Security audit** | 10 manual greps | `security_scan()` — 50 rules, one tool call |
136
+ | **Start a new session** | Zero context | `recall()` — agent remembers every past lesson |
137
+ | **Write tests** | Guess what needs testing | `test_plan()` — mock strategy + 3 scenarios |
138
+ | **Find dead code** | Manual search | `find_dead_code()` — every symbol with zero references |
206
139
 
207
- ```
208
- Repository: /home/user/my-project
209
- Database: /home/user/my-project/.milens/milens.db
210
- Indexed: 2026-04-11T10:30:00Z
211
- Symbols: 210
212
- Links: 348
213
- Files: 30
214
- ```
140
+ **Average savings: ~70% fewer tokens per session. ~50% faster task completion.**
215
141
 
216
142
  ---
217
143
 
218
- ### `milens list` List all indexed repositories
219
-
220
- ```bash
221
- milens list
222
- ```
144
+ ## Features at a Glance
223
145
 
224
- **Output:**
146
+ | Feature | Description |
147
+ |---|---|
148
+ | 🔍 Code Intelligence | 41 MCP tools — query, impact, context, trace, routes |
149
+ | 🛡️ Security Scanner | 50 rules, 9 categories, OWASP-mapped, dependency audit |
150
+ | 🤖 Sub-Agent Prompts | 7 prompts — plan, review, tdd, security, architect, debug, dead_code_remove |
151
+ | 🔄 CLI Workflows | 7 commands — tdd, review, plan, onboard, security-scan, refactor, handoff |
152
+ | 📊 Metrics | 7 quantified metrics — TER, LR, CQI, BRR, TCGR, DCER, CTR |
153
+ | 🧠 Learning Engine | Annotate → Recall → Evolve — confidence-based knowledge base |
154
+ | 🔌 12 Languages | TS, JS, Python, Java, Go, Rust, PHP, Ruby, Vue, HTML, CSS, Markdown |
155
+ | 🖥️ 7 Editors | Claude Code, Cursor, Copilot, OpenCode, Codex, Gemini CLI, Zed |
225
156
 
226
- ```
227
- 3 indexed repositories:
157
+ ---
228
158
 
229
- /home/user/project-a
230
- DB: /home/user/project-a/.milens/milens.db
231
- Indexed: 2026-04-11T10:30:00Z
159
+ ## CLI Commands
232
160
 
233
- /home/user/project-b
234
- DB: /home/user/project-b/.milens/milens.db
235
- Indexed: 2026-04-10T15:22:00Z
236
- ```
161
+ ### Core
237
162
 
238
- ---
163
+ | Command | Description |
164
+ |---|---|
165
+ | `analyze` | Index codebase into knowledge graph |
166
+ | `serve` | Start MCP server (stdio/HTTP) |
167
+ | `search` | FTS5 search across symbols |
168
+ | `status` | Index health check |
169
+ | `metrics` | 7-metric quality report |
170
+ | `init` | Bootstrap project with profile presets |
171
+ | `watch` | Auto-reindex on file changes |
239
172
 
240
- ### `milens clean` — Remove index
173
+ ### Workflows
241
174
 
242
- ```bash
243
- milens clean # remove index for current directory
244
- milens clean -p /path/to/repo # remove index for specific repo
245
- milens clean --all # remove ALL indexes
246
- ```
175
+ | Command | Description |
176
+ |---|---|
177
+ | `milens workflow tdd` | Test coverage gaps + risk-prioritized untested symbols |
178
+ | `milens workflow review` | PR risk analysis — git diff + heat scoring |
179
+ | `milens workflow plan` | Codebase summary — domains, top hubs |
180
+ | `milens workflow onboard` | Onboarding report — structure, entry points, next steps |
181
+ | `milens workflow security-scan` | Full security audit with all 50 rules |
182
+ | `milens workflow refactor` | Dead code detection + candidates |
183
+ | `milens workflow handoff` | Session knowledge summary + promotable annotations |
247
184
 
248
- ---
185
+ ### Security
249
186
 
250
- ### `milens dashboard` Usage analytics
187
+ | Command | Description |
188
+ |---|---|
189
+ | `security scan` | Scan for vulnerabilities (scope, severity filterable) |
190
+ | `security deps` | Audit dependencies against offline CVE database |
251
191
 
252
- Open a browser-based dashboard showing tool usage statistics, token savings, and response times.
192
+ ### Maintenance
253
193
 
254
- ```bash
255
- milens dashboard # open on port 3200
256
- milens dashboard --port 8080 # custom port
257
- ```
194
+ | Command | Description |
195
+ |---|---|
196
+ | `evolve` | Promote high-confidence annotations to rules/skills |
197
+ | `hooks` | Session lifecycle hook management |
258
198
 
259
199
  ---
260
200
 
261
201
  ## MCP Tools
262
202
 
263
- When the MCP server is running, your AI agent gets these 32 tools:
203
+ ### Search & Navigation
264
204
 
265
- ### Search & Navigate
266
-
267
- | Tool | What It Does | Example |
268
- |---|---|---|
269
- | `query` | Symbol search (FTS5 full-text) | `query({query: "UserService"})` |
270
- | `grep` | Text search ALL files code, templates, configs, docs | `grep({pattern: "TODO", scope: "all"})` |
271
- | `context` | 360° symbol view — incoming refs + outgoing deps | `context({name: "AuthService"})` |
272
- | `get_file_symbols` | All symbols in a file with ref/dep counts | `get_file_symbols({file: "src/auth.ts"})` |
273
- | `get_type_hierarchy` | Inheritance/implementation tree | `get_type_hierarchy({name: "BaseController"})` |
205
+ | Tool | Description |
206
+ |---|---|
207
+ | `query` | Find symbol definitions by name (FTS5) |
208
+ | `grep` | Text search ALL files (templates, styles, configs, docs) |
209
+ | `context` | 360° view: incoming refs + outgoing deps |
210
+ | `get_file_symbols` | All symbols in a file |
211
+ | `get_type_hierarchy` | Inheritance/implementation tree |
212
+ | `semantic_search` | Hybrid FTS5 + vector search |
213
+ | `find_similar` | Find symbols similar by topology |
274
214
 
275
215
  ### Impact & Safety
276
216
 
277
- | Tool | What It Does | Example |
278
- |---|---|---|
279
- | `impact` | Blast radius: what breaks if this changes? | `impact({target: "createUser"})` |
280
- | `edit_check` | Pre-edit safety: callers + exports + test coverage + warnings | `edit_check({name: "resolveLinks"})` |
281
- | `detect_changes` | Git diff affected symbols + direct dependents | `detect_changes({})` |
282
- | `find_dead_code` | Exported symbols with zero references | `find_dead_code({})` |
283
-
284
- ### Understanding
285
-
286
- | Tool | What It Does | Example |
287
- |---|---|---|
288
- | `smart_context` | Intent-aware context: `understand`/`edit`/`debug`/`test` | `smart_context({name: "analyze", intent: "edit"})` |
289
- | `trace` | Execution flow: call chains to/from entrypoints | `trace({to: "searchSymbols"})` |
290
- | `routes` | Detect framework routes/endpoints (11 frameworks) | `routes({})` |
291
- | `explain_relationship` | Shortest path between two symbols | `explain_relationship({from: "A", to: "B"})` |
292
- | `overview` | Combined context + impact + grep in ONE call | `overview({name: "Database"})` |
217
+ | Tool | Description |
218
+ |---|---|
219
+ | `impact` | Blast radius: what breaks if target changes |
220
+ | `edit_check` | Pre-edit safety: callers + export status + re-export chains |
221
+ | `overview` | Combined context + impact + grep in one call |
222
+ | `detect_changes` | Git diff affected symbols + dependents |
223
+ | `find_dead_code` | Exported symbols with zero incoming references |
224
+ | `pre_commit_check` | Pre-commit risk: review_pr + dead code + coverage gaps |
225
+ | `compare_impact` | Compare impact graph before/after edit — detects regressions |
293
226
 
294
- ### Codebase Overview
227
+ ### Review & Testing
295
228
 
296
- | Tool | What It Does | Example |
297
- |---|---|---|
298
- | `domains` | Domain clusters groups of files forming logical modules | `domains({})` |
299
- | `repos` | List all indexed repositories | `repos({})` |
300
- | `status` | Index stats, domains, test coverage, accuracy report | `status({})` |
229
+ | Tool | Description |
230
+ |---|---|
231
+ | `review_pr` | PR risk assessment: scored by blast radius + test coverage |
232
+ | `review_symbol` | Single symbol deep-dive: role, heat, dependents, risk |
233
+ | `codebase_summary` | Compact ~500 token overview |
234
+ | `test_plan` | Dependency-aware test plan: mocks, strategies, scenarios |
235
+ | `test_generate` | Auto-generate test file with framework detection |
236
+ | `test_coverage_gaps` | Untested exported symbols sorted by risk |
237
+ | `test_impact` | Which tests to run for current changes |
301
238
 
302
- ### Developer Tools
239
+ ### Orchestration
303
240
 
304
- | Tool | What It Does | Example |
305
- |---|---|---|
306
- | `ast_explore` | Parse code snippetS-expression AST tree | `ast_explore({code: "const x = 1", language: "typescript"})` |
307
- | `test_query` | Test tree-sitter query against code snippet | `test_query({query: "(identifier) @name", code: "const x = 1", language: "typescript"})` |
241
+ | Tool | Description |
242
+ |---|---|
243
+ | `orchestrate` | Full cycle: changesrisk gaps dead code action plan |
308
244
 
309
- ### Review & Risk Assessment
245
+ ### Understanding
310
246
 
311
- | Tool | What It Does | Example |
312
- |---|---|---|
313
- | `review_pr` | PR risk assessment: scores changed symbols by blast radius + test coverage | `review_pr({})` |
314
- | `review_symbol` | Single symbol risk: role, heat, dependents, test status | `review_symbol({name: "AuthService"})` |
315
- | `codebase_summary` | High-level bootstrapping context: domains, key symbols, coverage | `codebase_summary({})` |
247
+ | Tool | Description |
248
+ |---|---|
249
+ | `smart_context` | Intent-aware context: understand/edit/debug/test |
250
+ | `trace` | Execution flow: call chains from entrypoints to target |
251
+ | `routes` | Detect framework routes/endpoints |
252
+ | `explain_relationship` | Shortest dependency path between two symbols |
253
+ | `domains` | Domain clusters: files forming logical modules |
316
254
 
317
- ### Testing
255
+ ### Memory & Sessions
318
256
 
319
- | Tool | What It Does | Example |
320
- |---|---|---|
321
- | `test_plan` | Dependency-aware test plan: mocks, strategies, suggested tests | `test_plan({name: "createUser"})` |
322
- | `test_coverage_gaps` | Untested exported symbols sorted by risk | `test_coverage_gaps({})` |
323
- | `test_impact` | Maps git changes → test files to run | `test_impact({})` |
257
+ | Tool | Description |
258
+ |---|---|
259
+ | `annotate` | Record a note about a symbol (persists across sessions) |
260
+ | `recall` | Retrieve annotations from past sessions |
261
+ | `session_start` | Register agent session |
262
+ | `session_end` | End session and record stats |
263
+ | `session_context` | Get session metadata + annotations |
264
+ | `handoff` | Transfer context between agent sessions |
324
265
 
325
- ### Annotations & Sessions
266
+ ### Security
326
267
 
327
- | Tool | What It Does | Example |
328
- |---|---|---|
329
- | `annotate` | Store observation/note about a symbol (persists across sessions) | `annotate({symbol: "AuthService", key: "note", value: "needs refactor"})` |
330
- | `recall` | Retrieve annotations by symbol, key, agent, or session | `recall({symbol: "AuthService"})` |
331
- | `session_start` | Register agent session for multi-agent coordination | `session_start({agent: "copilot"})` |
332
- | `session_context` | Get session metadata + annotations | `session_context({})` |
333
- | `handoff` | Transfer context between agent sessions | `handoff({from_session: "abc", to_session: "def"})` |
268
+ | Tool | Description |
269
+ |---|---|
270
+ | `security_scan` | Scan for vulnerabilities (50+ rules, 9 categories) |
271
+ | `fix_apply` | Apply security fix to a file (creates backup) |
334
272
 
335
- ### Search & Similarity
273
+ ### Hooks
336
274
 
337
- | Tool | What It Does | Example |
338
- |---|---|---|
339
- | `semantic_search` | Hybrid FTS5 + vector cosine similarity search | `semantic_search({query: "authentication flow"})` |
340
- | `find_similar` | Find symbols similar by embedding proximity | `find_similar({name: "AuthService"})` |
275
+ | Tool | Description |
276
+ |---|---|
277
+ | `hook_onFileChange` | Re-analyze changed files + impact summary |
278
+ | `hook_preCompact` | Save metrics snapshot before context compaction |
279
+ | `hook_postCompact` | Restore context by recalling annotations |
341
280
 
342
- > `semantic_search` and `find_similar` require `milens analyze --embeddings` to generate vector embeddings.
281
+ ### Developer
343
282
 
344
- ### Resources & Prompts
283
+ | Tool | Description |
284
+ |---|---|
285
+ | `ast_explore` | Parse code snippet to S-expression AST tree |
286
+ | `test_query` | Run tree-sitter query against code snippet |
345
287
 
346
- **4 Resources:** `milens://overview`, `milens://symbol/{name}`, `milens://file/{path}`, `milens://domain/{name}`
288
+ ### Overview
347
289
 
348
- **3 Guided Prompts:** `delete-feature`, `refactor-symbol`, `explore-symbol` — each triggers a multi-step workflow using the tools above.
290
+ | Tool | Description |
291
+ |---|---|
292
+ | `status` | Index stats: symbols, links, files, coverage |
293
+ | `repos` | List all indexed repositories |
349
294
 
350
295
  ---
351
296
 
352
- ## Tool Examples
353
-
354
- ### Impact Analysis
355
-
356
- ```
357
- impact({target: "createUser"})
358
-
359
- TARGET: createUser [function] src/models.ts:42
297
+ ## Sub-Agent Prompts
360
298
 
361
- [depth 1] AuthService [class] src/auth.ts:15 (calls)
362
- [depth 1] UserController [class] src/controllers/user.ts:8 (calls)
363
- [depth 2] handleLogin [function] src/routes.ts:23 (calls)
364
-
365
- 3 dependents across 2 depths
366
- ```
367
-
368
- ### Context (360° Symbol View)
369
-
370
- ```
371
- context({name: "AuthService"})
299
+ | Prompt | Purpose |
300
+ |---|---|
301
+ | `milens-planner` | 5-step implementation planning with blast radius |
302
+ | `milens-reviewer` | PR review — risk scan → deep dive → dead code → security |
303
+ | `milens-tester` | TDD — coverage gaps → test plans → implement → verify |
304
+ | `milens-security` | Security audit — secrets, injection, unicode, crypto, config |
305
+ | `milens-architect` | Architecture analysis — domains, routes, coupling, hierarchy |
306
+ | `milens-debugger` | Root cause analysis — trace → blast radius → hypotheses → fixes |
307
+ | `dead_code_remove` | Safe dead code removal with impact verification |
372
308
 
373
- AuthService [class] src/auth.ts:15 (exported)
309
+ ---
374
310
 
375
- incoming (3):
376
- calls: handleLogin [function] src/routes.ts:23
377
- calls: UserController [class] src/controllers/user.ts:8
378
- imports: authRouter [variable] src/routes.ts:1
311
+ ## Security (50+ Rules)
379
312
 
380
- outgoing (3):
381
- imports: User [class] src/models.ts:5
382
- calls: hashPassword [function] src/auth.ts:3
383
- calls: createUser [function] src/models.ts:42
384
- ```
313
+ All 50 rules map to **OWASP Top 10 (2021)**. One tool call covers what used to take 10 manual greps.
385
314
 
386
- ### Edit Check (Pre-Edit Safety)
315
+ | Category | Rules | Detects |
316
+ |---|---|---|
317
+ | **secrets** | 10 | AWS keys, GitHub tokens, OpenAI keys, private keys, hardcoded passwords |
318
+ | **injection** | 9 | SQL injection, XSS, command injection, `eval()`, `exec()`, dangerous DOM |
319
+ | **unicode** | 4 | Zero-width chars, bidi override, homoglyph attacks |
320
+ | **dangerous** | 7 | `os.system`, `subprocess shell`, unsafe deserialization, `spawn shell` |
321
+ | **config** | 5 | CORS wildcards, insecure cookies, debug mode |
322
+ | **data-leak** | 5 | `console.log` of secrets, hardcoded URLs |
323
+ | **crypto** | 4 | MD5, SHA1, `Math.random()` for crypto, hardcoded salt/IV |
324
+ | **auth** | 4 | String comparison, missing middleware, JWT without expiry |
325
+ | **file-access** | 2 | Path traversal, unsafe file reads |
387
326
 
327
+ ```bash
328
+ milens security scan --scope secrets --severity HIGH --format json
329
+ milens security deps # Offline CVE check (35 CVEs, 5 ecosystems)
388
330
  ```
389
- edit_check({name: "resolveLinks"})
390
331
 
391
- resolveLinks [function] src/analyzer/resolver.ts:45 (exported)
332
+ From an AI agent: `security_scan({scope: "all", severity: "HIGH"})`
392
333
 
393
- callers (2):
394
- analyze [function] src/analyzer/engine.ts:89
395
- resolveLinksForFile [function] src/analyzer/resolver.ts:120
334
+ ---
396
335
 
397
- re-exported via:
398
- src/analyzer/index.ts:3
336
+ ## Supported Languages
399
337
 
400
- has test coverage
401
- ⚠ 2 direct callers will be affected
402
- ```
338
+ 12 languages through tree-sitter:
339
+
340
+ | Language | Files | Imports | Calls | Heritage |
341
+ |---|---|---|---|---|
342
+ | TypeScript | `.ts` `.tsx` | ESM + CJS + decorators | ✓ | extends / implements |
343
+ | JavaScript | `.js` `.jsx` `.mjs` `.cjs` | ESM + CJS | ✓ | extends |
344
+ | Python | `.py` | import + relative | ✓ + decorators | extends |
345
+ | Java | `.java` | import + static | ✓ + annotations | extends / implements |
346
+ | Go | `.go` | import + go.mod | ✓ | embedding |
347
+ | Rust | `.rs` | use | ✓ + macros | trait impl |
348
+ | PHP | `.php` | use + include | ✓ + static, new | extends + traits |
349
+ | Ruby | `.rb` | require | ✓ | extends |
350
+ | Vue | `.vue` | ESM | ✓ template refs | extends |
351
+ | HTML | `.html` `.htm` | `<script src>` `<link>` | ✓ inline | — |
352
+ | CSS | `.css` | `@import` | — | — |
353
+ | Markdown | `.md` `.mdx` | local `[links]()` | — | headings as sections |
354
+
355
+ **Framework detection** (via `routes()`)**: Express, FastAPI, NestJS, Flask, Django, Go net/http, Gin, PHP Laravel, Rails, Sinatra, Spring.
403
356
 
404
- ### Smart Context (Intent-Aware)
357
+ ---
405
358
 
406
- ```
407
- smart_context({name: "UserService", intent: "edit"})
408
-
409
- UserService [class] src/services/user.ts:10 (exported)
410
- role: hub | heat: 0.85
411
-
412
- callers (5):
413
- handleLogin, handleRegister, UserController, AdminController, testUserService
414
- direct dependencies (3):
415
- User [class], hashPassword [function], db [variable]
416
- indirect dependents (depth 2): 8 symbols
417
- re-exported via: src/services/index.ts:2
418
- ✓ has test coverage
419
- ```
359
+ ## Editor Adapters
420
360
 
421
- ### Routes Detection
361
+ Milens works with any MCP-compatible agent:
422
362
 
423
- ```
424
- routes({})
363
+ | Harness | Config File | Recommended Profile |
364
+ |---|---|---|
365
+ | **Claude Code** | `.claude/mcp.json` | standard |
366
+ | **OpenCode** | `.opencode/config.json` | standard |
367
+ | **VS Code / Copilot** | `.vscode/mcp.json` | standard |
368
+ | **Cursor** | `.cursorrules` | standard |
369
+ | **Codex** | `.codex/codex.md` | standard |
370
+ | **Gemini** | `.gemini/context.md` | minimal (10 tools) |
371
+ | **Zed** | `.zed/settings.json` | minimal |
425
372
 
426
- 11 routes detected:
373
+ Each adapter is in the `adapters/` directory with ready-to-copy config files and agent instructions.
427
374
 
428
- [express]
429
- GET /api/users (src/routes/users.ts:12) → getUsers [function]
430
- POST /api/users (src/routes/users.ts:25) → createUser [function]
375
+ ### Profile Selection
431
376
 
432
- [nestjs]
433
- GET /auth/login (src/auth/auth.controller.ts:15) login [method]
377
+ ```bash
378
+ MILENS_PROFILE=minimal milens serve # 10 tools — ~500 token overhead
379
+ MILENS_PROFILE=standard milens serve # 25 tools — full daily coding
380
+ milens serve --profile full # 41 tools — everything
434
381
  ```
435
382
 
436
383
  ---
437
384
 
438
- ## Editor Setup
385
+ ## Metrics
439
386
 
440
- ### Editor Support
387
+ Seven quantified metrics for AI-driven development:
441
388
 
442
- | Editor | MCP | Skills |
389
+ | Metric | Full Name | What It Tracks |
443
390
  |---|---|---|
444
- | **VS Code / Copilot** | | |
445
- | **Cursor** | | |
446
- | **Claude Code** | | |
447
- | **Windsurf** | | |
448
- | **Codex** | | |
449
-
450
- ### VS Code / GitHub Copilot
391
+ | **TER** | Token Efficiency Ratio | Useful tokens ÷ total tokens |
392
+ | **LR** | Learning Rate | Savings gained ÷ savings possible |
393
+ | **CQI** | Code Quality Index | Coverage + security + coupling + docs |
394
+ | **BRR** | Bug Recurrence Rate | Bugs repeated ÷ total fixed |
395
+ | **TCGR** | Test Coverage Growth Rate | Weekly coverage improvement |
396
+ | **DCER** | Dead Code Elimination Rate | Dead symbols ÷ total exported |
397
+ | **CTR** | Cycle Time Reduction | Time saved vs manual approach |
451
398
 
452
399
  ```bash
453
- npx milens analyze -p . # index your repo (run once)
400
+ milens metrics
454
401
  ```
455
402
 
456
- Add to `.vscode/mcp.json`:
457
-
458
- ```json
459
- {
460
- "servers": {
461
- "milens": {
462
- "type": "stdio",
463
- "command": "npx",
464
- "args": ["-y", "milens", "serve", "-p", "${workspaceFolder}"]
465
- }
466
- }
467
- }
468
- ```
469
-
470
- <details>
471
- <summary><strong>Other Editors</strong></summary>
403
+ ---
472
404
 
473
- #### Cursor
405
+ ## Learning & Evolution
474
406
 
475
- Add to `.cursor/mcp.json`:
407
+ The system gets smarter every session:
476
408
 
477
- ```json
478
- {
479
- "mcpServers": {
480
- "milens": {
481
- "command": "npx",
482
- "args": ["-y", "milens", "serve", "-p", "."]
483
- }
484
- }
485
- }
486
409
  ```
410
+ SESSION 1: Agent finds bug in createUser()
411
+ → annotate({symbol: "createUser", key: "bug", value: "Call createUser() before normalizeEmail()"})
412
+ → confidence: 0.5
487
413
 
488
- #### Claude Code
414
+ SESSION 2: Agent auto-recalls the annotation
415
+ → "I know createUser() has a known issue. I'll handle the order correctly."
416
+ → Bug avoided. confidence ↑ 0.7
489
417
 
490
- ```bash
491
- claude mcp add milens -- npx -y milens serve -p .
418
+ SESSION 5: Confidence reaches 0.9
419
+ milens evolve promotes it to .agents/skills/milens-bug/SKILL.md
420
+ → Now enforced as a rule for every future session
492
421
  ```
493
422
 
494
- #### Windsurf
495
-
496
- Add to `~/.codeium/windsurf/mcp_config.json`:
497
-
498
- ```json
499
- {
500
- "mcpServers": {
501
- "milens": {
502
- "command": "npx",
503
- "args": ["-y", "milens", "serve", "-p", "."]
504
- }
505
- }
506
- }
507
- ```
423
+ ---
508
424
 
509
- #### Codex
425
+ ## Hook System (6 Triggers)
510
426
 
511
- Add to `.codex/config.toml`:
427
+ | Hook | When | Default Action |
428
+ |---|---|---|
429
+ | `onSessionStart` | Agent begins work | Refresh index + codebase_summary + recall past warnings |
430
+ | `onSessionEnd` | Agent finishes | detect_changes + review_pr + auto-annotate changed symbols |
431
+ | `onPreCommit` | Before `git commit` | detect_changes + review_pr + find_dead_code |
432
+ | `onFileChange` | Files modified | Re-analyze changed files + impact on affected symbols |
433
+ | `onPreCompact` | Before context window compaction | Save codebase_summary snapshot |
434
+ | `onPostCompact` | After compaction | recall annotations to restore lost context |
512
435
 
513
- ```toml
514
- [mcp_servers.milens]
515
- command = "npx"
516
- args = ["-y", "milens", "serve", "-p", "."]
436
+ ```bash
437
+ milens hooks enable # Turn on all hooks
438
+ milens hooks profile standard # Preset: SessionStart, SessionEnd, PreCommit
439
+ milens hooks disable --hook preCommit # Turn off one hook
517
440
  ```
518
441
 
519
- </details>
520
-
521
- ---
522
-
523
- ## Supported Languages
524
-
525
- | Language | Extensions | Imports | Calls | Heritage | Frameworks |
526
- |---|---|---|---|---|---|
527
- | TypeScript | `.ts` `.tsx` | ✓ ESM + require | ✓ + decorators | ✓ extends/implements | NestJS, React JSX |
528
- | JavaScript | `.js` `.jsx` `.mjs` `.cjs` | ✓ ESM + require | ✓ | ✓ | React JSX, Express |
529
- | Python | `.py` | ✓ + relative | ✓ + decorators | ✓ | FastAPI, Flask, Django |
530
- | Java | `.java` | ✓ + static | ✓ + annotations, new | ✓ | Spring |
531
- | Go | `.go` | ✓ + go.mod | ✓ | ✓ embedding | net/http, Gin |
532
- | Rust | `.rs` | ✓ | ✓ + macros | ✓ | — |
533
- | PHP | `.php` | ✓ + include | ✓ + static, new | ✓ + traits | Laravel |
534
- | Ruby | `.rb` | ✓ | ✓ | ✓ | Rails, Sinatra |
535
- | Vue | `.vue` | ✓ | ✓ template refs | ✓ | Vue 3 SFC |
536
- | HTML | `.html` `.htm` | ✓ `<script src>` `<link>` | ✓ inline `<script>` | — | — |
537
- | CSS | `.css` | ✓ `@import` | — | — | Custom properties |
538
- | Markdown | `.md` `.mdx` | ✓ local `[links]()` | — | — | Headings → section symbols, parent-child hierarchy |
539
-
540
442
  ---
541
443
 
542
- ## Architecture
543
-
544
- <p align="center">
545
- <img src="https://raw.githubusercontent.com/fuze210699/milens/develop/docs/diagram2.svg" alt="milens architecture: Indexing Pipeline → MCP Server → AI Agent" width="700">
546
- </p>
444
+ ## Pricing
547
445
 
548
- ### How it works
446
+ | Tier | Price | Key Features |
447
+ |---|---|---|
448
+ | **Free** | $0 | All 41 tools, 7 prompts, 7 workflows, 50+ security rules, CLI, community support. MIT core. |
549
449
 
550
- 1. **Scan** find all source files matching supported extensions
551
- 2. **Parse** — tree-sitter extracts symbols (functions, classes, methods, etc.) and raw references (imports, calls, extends)
552
- 3. **Resolve** — cross-file link resolution: match import paths to files, match call names to symbol definitions
553
- 4. **Enrich** — compute roles (entrypoint/hub/utility/leaf), heat scores, domain clusters
554
- 5. **Persist** — store everything in SQLite with FTS5 search and recursive CTEs for graph traversal
450
+ [Full pricing details →](docs/pricing.md)
555
451
 
556
- ### Multi-Repo
452
+ ---
557
453
 
558
- milens uses a global registry (`~/.milens/`) — one MCP server serves all indexed repos. Pass `repo` to target a specific one when multiple are registered.
454
+ ## Changelog
559
455
 
560
- <p align="center">
561
- <img src="https://raw.githubusercontent.com/fuze210699/milens/develop/docs/diagram3.svg" alt="Multi-repo architecture" width="500">
562
- </p>
456
+ ### v0.6.5 (May 2026)
563
457
 
564
- ### Design Decisions
458
+ - 14 new test files (168 → 554 tests, 23% → 58% coverage)
459
+ - 7 CLI workflow commands: tdd, review, plan, onboard, security-scan, refactor, handoff
460
+ - Enhanced orchestrator with snapshot persistence
461
+ - Compare impact for regression detection
462
+ - Coverage thresholds in vitest.config.ts
463
+ - CI/CD: milens-ci-test.yml workflow
464
+ - 41 MCP tools in full profile (up from 33)
565
465
 
566
- | Decision | Rationale |
567
- |---|---|
568
- | **Declarative LangSpec** | Each language = 1 config object with tree-sitter queries. One universal extractor for all 12 languages |
569
- | **SQLite + recursive CTE** | Impact analysis runs entirely in the database — no full graph in memory |
570
- | **Token-compact output** | `name [kind] file:line` format — saves 40-60% tokens for AI |
571
- | **Incremental by hash** | SHA-256 file hashing — only changed files get re-parsed |
572
- | **Localhost-only HTTP** | Binds `127.0.0.1` — no network exposure without explicit intent |
466
+ ### v0.6.0 (March 2026)
573
467
 
574
- ### Tech Stack
468
+ - 41 MCP tools, 7 sub-agent prompts
469
+ - Learning engine: annotate → recall → evolve
470
+ - Offline CVE database with 35+ CVEs across 5 ecosystems
471
+ - 7 editor harness adapters
472
+ - Hook system with 6 event triggers
575
473
 
576
- | Layer | Technology |
577
- |---|---|
578
- | **Runtime** | Node.js ≥ 20 |
579
- | **Language** | TypeScript (ESM) |
580
- | **Parsing** | tree-sitter (WASM bindings) |
581
- | **Database** | SQLite (better-sqlite3) + FTS5 |
582
- | **Graph traversal** | Recursive CTEs |
583
- | **Agent protocol** | MCP (stdio + StreamableHTTP) |
584
- | **Testing** | Vitest (136 tests) |
474
+ [Full changelog →](https://github.com/fuze210699/milens/releases)
585
475
 
586
476
  ---
587
477
 
588
478
  ## Security & Privacy
589
479
 
590
- milens is **offline by design** zero network calls, zero telemetry.
480
+ **Zero network. Zero telemetry. Zero data leaving your machine.**
591
481
 
592
- | Layer | Protection |
482
+ | Layer | Guarantee |
593
483
  |---|---|
594
- | **Data locality** | Index lives in `.milens/` per repo (gitignored). No source code stored in registry |
595
- | **HTTP transport** | Binds to `127.0.0.1` only requires explicit `--http` flag |
596
- | **User-supplied regex** | Validated against ReDoS patterns |
597
- | **FTS5 queries** | Each token quoted as a literal no query injection |
598
- | **File access** | All reads bounded to the repo root — no path traversal |
599
- | **Git integration** | `execFileSync` with argument arrays no shell interpolation |
484
+ | **Data** | Index stored in `.milens/` per repo (gitignored). No source code in registry. |
485
+ | **Network** | HTTP binds `127.0.0.1` only. No outbound connections. |
486
+ | **Input** | User regex validated against ReDoS. FTS5 tokens quoted as literals. |
487
+ | **File access** | All paths bounded to repo root. No traversal possible. |
488
+ | **Git** | `execFileSync` with arg arrays. No shell interpolation. |
489
+ | **Embeddings** | Optional. Generated locally via Xenova transformers. No API calls. |
600
490
 
601
491
  ---
602
492
 
603
493
  ## Development
604
494
 
605
495
  ```bash
606
- npm install # install dependencies
607
- npm run build # tsc → dist/
608
- npm test # vitest (136 tests)
609
- npm run lint # tsc --noEmit
610
- npm run self-analyze # index this repo
611
- npm run self-serve # start MCP server on port 3100
496
+ git clone https://github.com/fuze210699/milens.git
497
+ cd milens
498
+ npm install
499
+ npm run build # tsc → dist/
500
+ npm test # vitest (554 tests, 30 test files)
501
+ npm run lint # tsc --noEmit
502
+ npm run self-analyze # Index milens with milens
503
+ npm run self-serve # Start MCP on port 3100
612
504
  ```
613
505
 
506
+ **Tech Stack:** TypeScript (ESM) · tree-sitter (WASM) · SQLite (better-sqlite3 + FTS5) · MCP SDK · Vitest · Commander
507
+
614
508
  ---
615
509
 
616
510
  ## License
617
511
 
618
- [PolyForm Noncommercial 1.0.0](https://github.com/fuze210699/milens/blob/develop/LICENSE)
512
+ Core (analyzer, parser, store, CLI, MCP tools): **MIT License**
513
+ Advanced features (GitHub App, enterprise): Commercial license
514
+ See [LICENSE](LICENSE) for details.
515
+
516
+ ---
619
517
 
620
- Architectural inspiration from [GitNexus](https://github.com/abhigyanpatwari/GitNexus) by Abhigyan Patwari.
518
+ <p align="center">
519
+ <a href="https://github.com/fuze210699/milens">GitHub</a> ·
520
+ <a href="https://github.com/fuze210699/milens/tree/main/docs">Docs</a> ·
521
+ <a href="https://github.com/fuze210699/milens/blob/main/docs/pricing.md">Pricing</a> ·
522
+ <a href="https://github.com/fuze210699/milens/blob/main/CONTRIBUTING.md">Contribute</a>
523
+ </p>