milens 0.6.9 → 0.7.1

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 (189) hide show
  1. package/.agents/skills/adapters/SKILL.md +54 -51
  2. package/.agents/skills/analyzer/SKILL.md +78 -79
  3. package/.agents/skills/apps/SKILL.md +60 -68
  4. package/.agents/skills/docs/SKILL.md +58 -79
  5. package/.agents/skills/milens/SKILL.md +319 -318
  6. package/.agents/skills/orchestrator/SKILL.md +59 -61
  7. package/.agents/skills/parser/SKILL.md +81 -82
  8. package/.agents/skills/root/SKILL.md +84 -86
  9. package/.agents/skills/scripts/SKILL.md +51 -45
  10. package/.agents/skills/security/SKILL.md +62 -66
  11. package/.agents/skills/server/SKILL.md +77 -73
  12. package/.agents/skills/store/SKILL.md +72 -75
  13. package/.agents/skills/test/SKILL.md +148 -152
  14. package/.agents/skills/ui/SKILL.md +51 -0
  15. package/README.md +577 -527
  16. package/adapters/README.md +144 -107
  17. package/adapters/claude-code/.claude/mcp.json +9 -9
  18. package/adapters/claude-code/.claude/settings.json.hooks-snippet.json +26 -0
  19. package/adapters/claude-code/.claude-plugin/plugin.json +11 -0
  20. package/adapters/claude-code/.mcp.json +9 -0
  21. package/adapters/claude-code/CLAUDE.md +79 -79
  22. package/adapters/codex/.codex/config.toml +3 -0
  23. package/adapters/copilot/.vscode/mcp.json +10 -0
  24. package/adapters/cursor/.cursor/mcp.json +9 -0
  25. package/adapters/cursor/.cursorrules +69 -9
  26. package/adapters/gemini/.gemini/context.md +81 -81
  27. package/adapters/gemini/.gemini/settings.json +9 -0
  28. package/adapters/opencode/.opencode/config.json +8 -8
  29. package/adapters/zed/.zed/settings.json +8 -8
  30. package/dist/agents-md.d.ts +0 -1
  31. package/dist/agents-md.js +2 -2
  32. package/dist/agents-md.js.map +1 -1
  33. package/dist/analyzer/config.d.ts +0 -1
  34. package/dist/analyzer/engine.d.ts +0 -1
  35. package/dist/analyzer/engine.js +42 -40
  36. package/dist/analyzer/engine.js.map +1 -1
  37. package/dist/analyzer/enrich.d.ts +0 -1
  38. package/dist/analyzer/enrich.js +13 -0
  39. package/dist/analyzer/enrich.js.map +1 -1
  40. package/dist/analyzer/resolver.d.ts +0 -1
  41. package/dist/analyzer/resolver.js +48 -4
  42. package/dist/analyzer/resolver.js.map +1 -1
  43. package/dist/analyzer/review.d.ts +2 -2
  44. package/dist/analyzer/review.js +7 -59
  45. package/dist/analyzer/review.js.map +1 -1
  46. package/dist/analyzer/risk.d.ts +20 -0
  47. package/dist/analyzer/risk.js +76 -0
  48. package/dist/analyzer/risk.js.map +1 -0
  49. package/dist/analyzer/scanner.d.ts +0 -1
  50. package/dist/analyzer/scanner.js +2 -4
  51. package/dist/analyzer/scanner.js.map +1 -1
  52. package/dist/analyzer/scope-resolver.d.ts +0 -1
  53. package/dist/analyzer/scope-resolver.js +1 -1
  54. package/dist/analyzer/scope-resolver.js.map +1 -1
  55. package/dist/build-info.d.ts +2 -0
  56. package/dist/build-info.js +4 -0
  57. package/dist/build-info.js.map +1 -0
  58. package/dist/cli.d.ts +0 -1
  59. package/dist/cli.js +143 -17
  60. package/dist/cli.js.map +1 -1
  61. package/dist/metrics.d.ts +0 -1
  62. package/dist/orchestrator/orchestrator.d.ts +0 -1
  63. package/dist/orchestrator/orchestrator.js +16 -1
  64. package/dist/orchestrator/orchestrator.js.map +1 -1
  65. package/dist/orchestrator/reporter.d.ts +0 -1
  66. package/dist/parser/extract.d.ts +0 -1
  67. package/dist/parser/extract.js +53 -28
  68. package/dist/parser/extract.js.map +1 -1
  69. package/dist/parser/lang-css.d.ts +0 -1
  70. package/dist/parser/lang-go.d.ts +0 -1
  71. package/dist/parser/lang-html.d.ts +0 -1
  72. package/dist/parser/lang-java.d.ts +0 -1
  73. package/dist/parser/lang-js.d.ts +0 -1
  74. package/dist/parser/lang-md.d.ts +0 -1
  75. package/dist/parser/lang-php.d.ts +0 -1
  76. package/dist/parser/lang-py.d.ts +0 -1
  77. package/dist/parser/lang-ruby.d.ts +0 -1
  78. package/dist/parser/lang-rust.d.ts +0 -1
  79. package/dist/parser/lang-ts.d.ts +0 -1
  80. package/dist/parser/lang-vue.d.ts +0 -1
  81. package/dist/parser/language-provider.d.ts +0 -1
  82. package/dist/parser/languages.d.ts +0 -1
  83. package/dist/parser/loader.d.ts +0 -1
  84. package/dist/security/deps.d.ts +0 -1
  85. package/dist/security/rules.d.ts +0 -1
  86. package/dist/security/rules.js +13 -12
  87. package/dist/security/rules.js.map +1 -1
  88. package/dist/server/hooks.d.ts +0 -1
  89. package/dist/server/hooks.js +10 -0
  90. package/dist/server/hooks.js.map +1 -1
  91. package/dist/server/mcp-prompts.d.ts +0 -1
  92. package/dist/server/mcp-prompts.js +509 -523
  93. package/dist/server/mcp-prompts.js.map +1 -1
  94. package/dist/server/mcp.d.ts +0 -1
  95. package/dist/server/mcp.js +156 -655
  96. package/dist/server/mcp.js.map +1 -1
  97. package/dist/server/test-plan.d.ts +0 -1
  98. package/dist/server/tools/deps.d.ts +28 -0
  99. package/dist/server/tools/deps.js +2 -0
  100. package/dist/server/tools/deps.js.map +1 -0
  101. package/dist/server/tools/resources.d.ts +3 -0
  102. package/dist/server/tools/resources.js +103 -0
  103. package/dist/server/tools/resources.js.map +1 -0
  104. package/dist/server/tools/security.d.ts +3 -0
  105. package/dist/server/tools/security.js +176 -0
  106. package/dist/server/tools/security.js.map +1 -0
  107. package/dist/server/tools/session.d.ts +3 -0
  108. package/dist/server/tools/session.js +140 -0
  109. package/dist/server/tools/session.js.map +1 -0
  110. package/dist/server/tools/testing.d.ts +3 -0
  111. package/dist/server/tools/testing.js +200 -0
  112. package/dist/server/tools/testing.js.map +1 -0
  113. package/dist/server/watcher.d.ts +0 -1
  114. package/dist/server/watcher.js +1 -1
  115. package/dist/server/watcher.js.map +1 -1
  116. package/dist/skills.d.ts +0 -1
  117. package/dist/skills.js +11 -5
  118. package/dist/skills.js.map +1 -1
  119. package/dist/store/annotations.d.ts +1 -1
  120. package/dist/store/annotations.js +14 -3
  121. package/dist/store/annotations.js.map +1 -1
  122. package/dist/store/confidence.d.ts +0 -1
  123. package/dist/store/confidence.js +2 -0
  124. package/dist/store/confidence.js.map +1 -1
  125. package/dist/store/db.d.ts +9 -1
  126. package/dist/store/db.js +88 -25
  127. package/dist/store/db.js.map +1 -1
  128. package/dist/store/registry.d.ts +0 -1
  129. package/dist/store/vectors.d.ts +0 -1
  130. package/dist/types.d.ts +7 -1
  131. package/dist/ui/progress.d.ts +0 -1
  132. package/dist/uninstall.d.ts +0 -1
  133. package/dist/utils.d.ts +2 -1
  134. package/dist/utils.js +0 -0
  135. package/dist/utils.js.map +1 -1
  136. package/package.json +12 -9
  137. package/dist/agents-md.d.ts.map +0 -1
  138. package/dist/analyzer/config.d.ts.map +0 -1
  139. package/dist/analyzer/engine.d.ts.map +0 -1
  140. package/dist/analyzer/enrich.d.ts.map +0 -1
  141. package/dist/analyzer/resolver.d.ts.map +0 -1
  142. package/dist/analyzer/review.d.ts.map +0 -1
  143. package/dist/analyzer/scanner.d.ts.map +0 -1
  144. package/dist/analyzer/scope-resolver.d.ts.map +0 -1
  145. package/dist/analyzer/testplan.d.ts +0 -59
  146. package/dist/analyzer/testplan.d.ts.map +0 -1
  147. package/dist/analyzer/testplan.js +0 -218
  148. package/dist/analyzer/testplan.js.map +0 -1
  149. package/dist/cli.d.ts.map +0 -1
  150. package/dist/metrics.d.ts.map +0 -1
  151. package/dist/orchestrator/orchestrator.d.ts.map +0 -1
  152. package/dist/orchestrator/reporter.d.ts.map +0 -1
  153. package/dist/parser/extract.d.ts.map +0 -1
  154. package/dist/parser/lang-css.d.ts.map +0 -1
  155. package/dist/parser/lang-go.d.ts.map +0 -1
  156. package/dist/parser/lang-html.d.ts.map +0 -1
  157. package/dist/parser/lang-java.d.ts.map +0 -1
  158. package/dist/parser/lang-js.d.ts.map +0 -1
  159. package/dist/parser/lang-md.d.ts.map +0 -1
  160. package/dist/parser/lang-php.d.ts.map +0 -1
  161. package/dist/parser/lang-py.d.ts.map +0 -1
  162. package/dist/parser/lang-ruby.d.ts.map +0 -1
  163. package/dist/parser/lang-rust.d.ts.map +0 -1
  164. package/dist/parser/lang-ts.d.ts.map +0 -1
  165. package/dist/parser/lang-vue.d.ts.map +0 -1
  166. package/dist/parser/language-provider.d.ts.map +0 -1
  167. package/dist/parser/languages.d.ts.map +0 -1
  168. package/dist/parser/loader.d.ts.map +0 -1
  169. package/dist/security/deps.d.ts.map +0 -1
  170. package/dist/security/rules.d.ts.map +0 -1
  171. package/dist/server/hooks.d.ts.map +0 -1
  172. package/dist/server/mcp-prompts.d.ts.map +0 -1
  173. package/dist/server/mcp.d.ts.map +0 -1
  174. package/dist/server/test-plan.d.ts.map +0 -1
  175. package/dist/server/watcher.d.ts.map +0 -1
  176. package/dist/skills.d.ts.map +0 -1
  177. package/dist/store/annotations.d.ts.map +0 -1
  178. package/dist/store/confidence.d.ts.map +0 -1
  179. package/dist/store/db.d.ts.map +0 -1
  180. package/dist/store/registry.d.ts.map +0 -1
  181. package/dist/store/vectors.d.ts.map +0 -1
  182. package/dist/types.d.ts.map +0 -1
  183. package/dist/ui/progress.d.ts.map +0 -1
  184. package/dist/uninstall.d.ts.map +0 -1
  185. package/dist/utils.d.ts.map +0 -1
  186. package/docs/README.md +0 -25
  187. package/docs/diagram1.svg +0 -1
  188. package/docs/diagram2.svg +0 -1
  189. package/docs/diagram3.svg +0 -1
@@ -1,107 +1,144 @@
1
- # Milens Adapter Packs
2
-
3
- Ready-to-use configuration files for connecting milens MCP server to popular AI coding harnesses.
4
-
5
- ## What is milens?
6
-
7
- Milens is a code intelligence MCP server that provides deep symbol search, dependency graphs, blast-radius analysis, and pre-commit change detection. These adapter packs wire milens into your AI coding tool so it can answer questions like "what calls this function?" and "what breaks if I change this?"
8
-
9
- ## Available Adapters
10
-
11
- | Harness | Directory | What's included |
12
- |---|---|---|
13
- | **Claude Code** | `claude-code/` | `.claude/mcp.json` + `CLAUDE.md` |
14
- | **OpenCode** | `opencode/` | `.opencode/config.json` + `AGENTS.md` |
15
- | **Codex** | `codex/` | `.codex/codex.md` |
16
- | **Cursor** | `cursor/` | `.cursorrules` |
17
- | **GitHub Copilot** | `copilot/` | `.github/copilot-instructions.md` |
18
- | **Gemini** | `gemini/` | `.gemini/context.md` |
19
- | **Zed** | `zed/` | `.zed/settings.json` |
20
-
21
- ## Installation
22
-
23
- ### Claude Code
24
-
25
- ```bash
26
- cp -r adapters/claude-code/.claude .claude/
27
- cp adapters/claude-code/CLAUDE.md CLAUDE.md
28
- ```
29
-
30
- ### OpenCode
31
-
32
- ```bash
33
- cp -r adapters/opencode/.opencode .opencode/
34
- cp adapters/opencode/AGENTS.md AGENTS.md
35
- ```
36
-
37
- ### Codex
38
-
39
- ```bash
40
- cp -r adapters/codex/.codex .codex/
41
- ```
42
-
43
- ### Cursor
44
-
45
- ```bash
46
- cp adapters/cursor/.cursorrules .cursorrules
47
- ```
48
-
49
- ### GitHub Copilot
50
-
51
- ```bash
52
- cp -r adapters/copilot/.github .github/
53
- ```
54
-
55
- ### Gemini
56
-
57
- ```bash
58
- cp -r adapters/gemini/.gemini .gemini/
59
- ```
60
-
61
- ### Zed
62
-
63
- ```bash
64
- cp -r adapters/zed/.zed .zed/
65
- ```
66
-
67
- ## Verification
68
-
69
- After installation, verify milens is connected:
70
-
71
- 1. Start your AI harness
72
- 2. Look for the milens MCP server in the tools list
73
- 3. Run `mcp_milens_status` to confirm the index is healthy
74
-
75
- ## Index Maintenance
76
-
77
- After significant code changes, refresh the index:
78
-
79
- ```bash
80
- npx milens analyze -p . --force
81
- ```
82
-
83
- ## All Tools Available
84
-
85
- | Tool | Purpose |
86
- |---|---|
87
- | `mcp_milens_overview` | Combined context + impact + grep |
88
- | `mcp_milens_edit_check` | Pre-edit safety check |
89
- | `mcp_milens_impact` | Blast radius analysis |
90
- | `mcp_milens_context` | 360° caller/callee view |
91
- | `mcp_milens_query` | Symbol definitions by name |
92
- | `mcp_milens_grep` | Full-text search all files |
93
- | `mcp_milens_detect_changes` | Pre-commit change detection |
94
- | `mcp_milens_explain_relationship` | Shortest path between symbols |
95
- | `mcp_milens_get_file_symbols` | All symbols in a file |
96
- | `mcp_milens_get_type_hierarchy` | Class inheritance tree |
97
- | `mcp_milens_find_dead_code` | Unused exported symbols |
98
- | `mcp_milens_trace` | Execution flow tracing |
99
- | `mcp_milens_status` | Index health check |
100
-
101
- ## Safety Rules (applies to all harnesses)
102
-
103
- - Never edit a symbol without `mcp_milens_edit_check` first
104
- - Never delete/rename without `mcp_milens_grep` + `mcp_milens_impact`
105
- - Never commit without `mcp_milens_detect_changes`
106
- - Use `mcp_milens_grep` for phrases/UI text, `mcp_milens_query` for code symbols
107
- - All milens calls require `repo` set to the absolute workspace root
1
+ # Milens Adapter Packs
2
+
3
+ Ready-to-use configuration files for connecting milens MCP server to popular AI coding harnesses.
4
+
5
+ ## What is milens?
6
+
7
+ Milens is a code intelligence MCP server that provides deep symbol search, dependency graphs, blast-radius analysis, and pre-commit change detection. These adapter packs wire milens into your AI coding tool so it can answer questions like "what calls this function?" and "what breaks if I change this?"
8
+
9
+ ## Available Adapters
10
+
11
+ | Harness | Directory | What's included |
12
+ |---|---|---|
13
+ | **Claude Code** | `claude-code/` | `.claude/mcp.json` + `CLAUDE.md` (+ optional hooks snippet) |
14
+ | **OpenCode** | `opencode/` | `.opencode/config.json` + `AGENTS.md` |
15
+ | **Codex** | `codex/` | `.codex/config.toml` + `.codex/codex.md` |
16
+ | **Cursor** | `cursor/` | `.cursor/mcp.json` + `.cursorrules` |
17
+ | **GitHub Copilot** | `copilot/` | `.vscode/mcp.json` + `.github/copilot-instructions.md` |
18
+ | **Gemini** | `gemini/` | `.gemini/settings.json` + `.gemini/context.md` |
19
+ | **Zed** | `zed/` | `.zed/settings.json` |
20
+
21
+ ## Installation
22
+
23
+ ### Claude Code
24
+
25
+ Register milens as a **project-scoped MCP server** — this is the one method that works identically across the Claude Code CLI, the VS Code extension, and the desktop app, because it relies on nothing but a plain `.mcp.json` file at your project root (no plugin marketplace involved).
26
+
27
+ ```bash
28
+ cp -r adapters/claude-code/.claude .claude/
29
+ cp adapters/claude-code/CLAUDE.md CLAUDE.md
30
+ claude mcp add milens -- milens serve -p .
31
+ ```
32
+
33
+ That command writes a `.mcp.json` at your project root equivalent to:
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "milens": {
39
+ "command": "milens",
40
+ "args": ["serve", "-p", "."]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ `-p .` is resolved against the process's working directory, which Claude Code always sets to your project root when it spawns the server — so this is the most portable form and needs no environment-variable substitution.
47
+
48
+ > **Prerequisite:** `npm i -g milens`
49
+
50
+ ### Claude Code — via `/plugin install` (marketplace)
51
+
52
+ ```bash
53
+ /plugin marketplace add fuze210699/milens
54
+ /plugin install milens
55
+ ```
56
+
57
+ This reads `.claude-plugin/marketplace.json` at the repo root, which points at `adapters/claude-code` as the plugin. That plugin ships its own `.mcp.json` with **no `-p` flag** — `milens serve` falls back to the `CLAUDE_PROJECT_DIR` environment variable, which Claude Code injects into every MCP server subprocess it spawns (project-scoped or plugin-scoped).
58
+
59
+ > **History:** we previously shipped a plugin manifest that passed `${CLAUDE_PLUGIN_ROOT}` as `-p`. That variable resolves to the *plugin's own install directory* (e.g. `~/.claude/plugins/cache/...`), not your project — so it silently indexed the wrong codebase. We removed it in favor of the manual `.mcp.json` method above.
60
+ >
61
+ > The current plugin fixes this by relying on `CLAUDE_PROJECT_DIR` (env var, not a `${...}` template substitution) read directly by the CLI — `resolve(opts.path ?? process.env.CLAUDE_PROJECT_DIR ?? '.')` in `src/cli.ts`. Claude Code's docs don't specify a minimum version for `CLAUDE_PROJECT_DIR` injection into plugin-scoped servers, so **verify with `mcp_milens_status` after install** — if the repo path looks wrong, fall back to the manual `.mcp.json` method above, which is unaffected by any of this and always works.
62
+
63
+ **Optional: session-start / pre-compact hooks.** Merge the `hooks` key from `adapters/claude-code/.claude/settings.json.hooks-snippet.json` into your project's `.claude/settings.json` (create the file if it doesn't exist yet). Not copied automatically since `.claude/settings.json` commonly holds other project settings you don't want overwritten.
64
+
65
+ ### OpenCode
66
+
67
+ ```bash
68
+ cp -r adapters/opencode/.opencode .opencode/
69
+ cp adapters/opencode/AGENTS.md AGENTS.md
70
+ ```
71
+
72
+ ### Codex
73
+
74
+ ```bash
75
+ cp -r adapters/codex/.codex .codex/
76
+ ```
77
+
78
+ ### Cursor
79
+
80
+ ```bash
81
+ cp -r adapters/cursor/.cursor .cursor/
82
+ cp adapters/cursor/.cursorrules .cursorrules
83
+ ```
84
+
85
+ ### GitHub Copilot
86
+
87
+ ```bash
88
+ cp -r adapters/copilot/.vscode .vscode/
89
+ cp -r adapters/copilot/.github .github/
90
+ ```
91
+
92
+ ### Gemini
93
+
94
+ ```bash
95
+ cp -r adapters/gemini/.gemini .gemini/
96
+ ```
97
+
98
+ ### Zed
99
+
100
+ ```bash
101
+ cp -r adapters/zed/.zed .zed/
102
+ ```
103
+
104
+ ## Verification
105
+
106
+ After installation, verify milens is connected:
107
+
108
+ 1. Start your AI harness
109
+ 2. Look for the milens MCP server in the tools list
110
+ 3. Run `mcp_milens_status` to confirm the index is healthy
111
+
112
+ ## Index Maintenance
113
+
114
+ After significant code changes, refresh the index:
115
+
116
+ ```bash
117
+ npx milens analyze -p . --force
118
+ ```
119
+
120
+ ## All Tools Available
121
+
122
+ | Tool | Purpose |
123
+ |---|---|
124
+ | `mcp_milens_overview` | Combined context + impact + grep |
125
+ | `mcp_milens_edit_check` | Pre-edit safety check |
126
+ | `mcp_milens_impact` | Blast radius analysis |
127
+ | `mcp_milens_context` | 360° caller/callee view |
128
+ | `mcp_milens_query` | Symbol definitions by name |
129
+ | `mcp_milens_grep` | Full-text search all files |
130
+ | `mcp_milens_detect_changes` | Pre-commit change detection |
131
+ | `mcp_milens_explain_relationship` | Shortest path between symbols |
132
+ | `mcp_milens_get_file_symbols` | All symbols in a file |
133
+ | `mcp_milens_get_type_hierarchy` | Class inheritance tree |
134
+ | `mcp_milens_find_dead_code` | Unused exported symbols |
135
+ | `mcp_milens_trace` | Execution flow tracing |
136
+ | `mcp_milens_status` | Index health check |
137
+
138
+ ## Safety Rules (applies to all harnesses)
139
+
140
+ - Never edit a symbol without `mcp_milens_edit_check` first
141
+ - Never delete/rename without `mcp_milens_grep` + `mcp_milens_impact`
142
+ - Never commit without `mcp_milens_detect_changes`
143
+ - Use `mcp_milens_grep` for phrases/UI text, `mcp_milens_query` for code symbols
144
+ - All milens calls require `repo` set to the absolute workspace root
@@ -1,9 +1,9 @@
1
- {
2
- "mcpServers": {
3
- "milens": {
4
- "command": "milens",
5
- "args": ["serve", "-p", "."],
6
- "env": { "MILENS_PROFILE": "standard" }
7
- }
8
- }
9
- }
1
+ {
2
+ "mcpServers": {
3
+ "milens": {
4
+ "command": "milens",
5
+ "args": ["serve", "-p", "."],
6
+ "env": { "MILENS_PROFILE": "standard" }
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "*",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "milens hooks session-start --repo ${CLAUDE_PROJECT_DIR} || true"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PreCompact": [
15
+ {
16
+ "matcher": "*",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "milens hooks pre-compact --repo ${CLAUDE_PROJECT_DIR} || true"
21
+ }
22
+ ]
23
+ }
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "milens",
3
+ "description": "AI-DOS Code Intelligence Platform — knowledge graph, security scanning, impact analysis, and closed-loop AI development with 43 MCP tools",
4
+ "version": "0.7.1",
5
+ "author": {
6
+ "name": "milens"
7
+ },
8
+ "homepage": "https://github.com/fuze210699/milens",
9
+ "repository": "https://github.com/fuze210699/milens",
10
+ "license": "MIT"
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "milens": {
4
+ "command": "milens",
5
+ "args": ["serve"],
6
+ "env": { "MILENS_PROFILE": "standard" }
7
+ }
8
+ }
9
+ }
@@ -1,79 +1,79 @@
1
- # Milens — Code Intelligence for Claude Code
2
-
3
- ## ⚠️ BEFORE ANYTHING ELSE
4
-
5
- This project is indexed by **milens**. You have MCP tools that are faster and more accurate than reading files directly.
6
-
7
- **HARD RULE: Use milens tools BEFORE built-in search/read tools.**
8
-
9
- | Situation | Built-in approach (❌) | Milens approach (✅) |
10
- |---|---|---|
11
- | Understand a function | Read 3-10 files | `mcp_milens_overview({name: "X"})` — 1 call |
12
- | Find references | grep in files | `mcp_milens_grep({pattern: "X"})` — searches everything |
13
- | Check edit safety | Hope nothing breaks | `mcp_milens_impact({target: "X"})` — exact blast radius |
14
- | Start working | Read README, explore files | `mcp_milens_codebase_summary()` — 500 token overview |
15
- | Before commit | `git diff` manually | `mcp_milens_detect_changes()` — symbols + risk scores |
16
-
17
- **If you skip milens tools, you're wasting tokens and risking breaking changes.**
18
-
19
- ## ⭐ Core Tools (Use Every Session)
20
-
21
- | Tool | Purpose |
22
- |---|---|
23
- | `mcp_milens_overview` | **Use this first.** Context + impact + grep combined. 1 call replaces 3-5 file reads. |
24
- | `mcp_milens_impact` | Blast radius BEFORE editing. Shows what WILL BREAK. |
25
- | `mcp_milens_edit_check` | Pre-edit safety: callers, export status, re-export chains, test coverage |
26
- | `mcp_milens_context` | 360° view: incoming refs + outgoing deps |
27
- | `mcp_milens_query` | Find symbol definitions by name (camelCase/PascalCase/snake_case) |
28
- | `mcp_milens_grep` | Text search ALL project files (code, templates, docs, configs, styles) |
29
- | `mcp_milens_detect_changes` | Pre-commit: changed symbols + dependents + risk scores |
30
- | `mcp_milens_codebase_summary` | 500-token project overview. Use instead of reading README. |
31
-
32
- ### 🔧 Situational Tools (Use When Needed)
33
-
34
- | Tool | Purpose | Use when... |
35
- |---|---|---|
36
- | `mcp_milens_guard_edit_check` | Hard pre-edit gate with audit tracking | Before every edit |
37
- | `mcp_milens_trace` | Execution flow from entrypoints | Debugging call chains |
38
- | `mcp_milens_explain_relationship` | Shortest path between two symbols | Understanding connections |
39
- | `mcp_milens_get_file_symbols` | All symbols in a file with ref/dep counts | Exploring a file |
40
- | `mcp_milens_get_type_hierarchy` | Inheritance/implementation tree | Class exploration |
41
- | `mcp_milens_find_dead_code` | Unused exported symbols | Before major refactors |
42
- | `mcp_milens_status` | Index health: symbols, links, files, coverage | Session start |
43
-
44
- All tool calls must include `repo` set to the absolute workspace root.
45
-
46
- ## Session Workflow
47
-
48
- 1. **Start** — The milens MCP server connects via `milens serve -p .`. Verify with `mcp_milens_status`.
49
- 2. **Recall** — When asked to work on a symbol, use `mcp_milens_overview` for a combined view of context, impact, and text references.
50
- 3. **Code** — Make changes following the edit-safety rules below.
51
- 4. **Verify** — Before committing, run `mcp_milens_detect_changes` to confirm only expected files changed.
52
- 5. **Annotate** — After significant changes, run `npx milens analyze -p . --force` to keep the index fresh.
53
-
54
- ## Edit Safety (Mandatory)
55
-
56
- **Before editing any function, class, or method:**
57
- 1. Call `mcp_milens_edit_check` on the target symbol to see callers and export status.
58
- 2. If depth-1 dependents > 5, **stop and warn the user** before proceeding.
59
- 3. Call `mcp_milens_context` to understand the full caller/callee picture.
60
- 4. Only then make the edit.
61
-
62
- **Before deleting or renaming:**
63
- 1. `mcp_milens_grep` — find ALL text references (templates, configs, docs).
64
- 2. `mcp_milens_impact` with `direction: "upstream"` — find code-level dependents.
65
- 3. Combine both results before acting.
66
-
67
- **Before committing:**
68
- - Call `mcp_milens_detect_changes` — if unexpected files appear, stop and report.
69
-
70
- ## Tool Selection
71
-
72
- - Use `mcp_milens_query` for symbol names (camelCase, PascalCase, snake_case).
73
- - Use `mcp_milens_grep` for multi-word phrases, UI labels, error messages, or text in templates/configs/docs.
74
- - When in doubt, use `mcp_milens_grep` first — it searches everything.
75
-
76
- ## Reference
77
-
78
- See `AGENTS.md` at the repo root for project-specific context and codebase structure.
79
- Skill files at `.agents/skills/milens/SKILL.md` provide advanced workflow guides.
1
+ # Milens — Code Intelligence for Claude Code
2
+
3
+ ## ⚠️ BEFORE ANYTHING ELSE
4
+
5
+ This project is indexed by **milens**. You have MCP tools that are faster and more accurate than reading files directly.
6
+
7
+ **HARD RULE: Use milens tools BEFORE built-in search/read tools.**
8
+
9
+ | Situation | Built-in approach (❌) | Milens approach (✅) |
10
+ |---|---|---|
11
+ | Understand a function | Read 3-10 files | `mcp_milens_overview({name: "X"})` — 1 call |
12
+ | Find references | grep in files | `mcp_milens_grep({pattern: "X"})` — searches everything |
13
+ | Check edit safety | Hope nothing breaks | `mcp_milens_impact({target: "X"})` — exact blast radius |
14
+ | Start working | Read README, explore files | `mcp_milens_codebase_summary()` — 500 token overview |
15
+ | Before commit | `git diff` manually | `mcp_milens_detect_changes()` — symbols + risk scores |
16
+
17
+ **If you skip milens tools, you're wasting tokens and risking breaking changes.**
18
+
19
+ ## ⭐ Core Tools (Use Every Session)
20
+
21
+ | Tool | Purpose |
22
+ |---|---|
23
+ | `mcp_milens_overview` | **Use this first.** Context + impact + grep combined. 1 call replaces 3-5 file reads. |
24
+ | `mcp_milens_impact` | Blast radius BEFORE editing. Shows what WILL BREAK. |
25
+ | `mcp_milens_edit_check` | Pre-edit safety: callers, export status, re-export chains, test coverage |
26
+ | `mcp_milens_context` | 360° view: incoming refs + outgoing deps |
27
+ | `mcp_milens_query` | Find symbol definitions by name (camelCase/PascalCase/snake_case) |
28
+ | `mcp_milens_grep` | Text search ALL project files (code, templates, docs, configs, styles) |
29
+ | `mcp_milens_detect_changes` | Pre-commit: changed symbols + dependents + risk scores |
30
+ | `mcp_milens_codebase_summary` | 500-token project overview. Use instead of reading README. |
31
+
32
+ ### 🔧 Situational Tools (Use When Needed)
33
+
34
+ | Tool | Purpose | Use when... |
35
+ |---|---|---|
36
+ | `mcp_milens_guard_edit_check` | Hard pre-edit gate with audit tracking | Before every edit |
37
+ | `mcp_milens_trace` | Execution flow from entrypoints | Debugging call chains |
38
+ | `mcp_milens_explain_relationship` | Shortest path between two symbols | Understanding connections |
39
+ | `mcp_milens_get_file_symbols` | All symbols in a file with ref/dep counts | Exploring a file |
40
+ | `mcp_milens_get_type_hierarchy` | Inheritance/implementation tree | Class exploration |
41
+ | `mcp_milens_find_dead_code` | Unused exported symbols | Before major refactors |
42
+ | `mcp_milens_status` | Index health: symbols, links, files, coverage | Session start |
43
+
44
+ All tool calls must include `repo` set to the absolute workspace root.
45
+
46
+ ## Session Workflow
47
+
48
+ 1. **Start** — The milens MCP server connects via `milens serve -p .`. Verify with `mcp_milens_status`.
49
+ 2. **Recall** — When asked to work on a symbol, use `mcp_milens_overview` for a combined view of context, impact, and text references.
50
+ 3. **Code** — Make changes following the edit-safety rules below.
51
+ 4. **Verify** — Before committing, run `mcp_milens_detect_changes` to confirm only expected files changed.
52
+ 5. **Annotate** — After significant changes, run `npx milens analyze -p . --force` to keep the index fresh.
53
+
54
+ ## Edit Safety (Mandatory)
55
+
56
+ **Before editing any function, class, or method:**
57
+ 1. Call `mcp_milens_edit_check` on the target symbol to see callers and export status.
58
+ 2. If depth-1 dependents > 5, **stop and warn the user** before proceeding.
59
+ 3. Call `mcp_milens_context` to understand the full caller/callee picture.
60
+ 4. Only then make the edit.
61
+
62
+ **Before deleting or renaming:**
63
+ 1. `mcp_milens_grep` — find ALL text references (templates, configs, docs).
64
+ 2. `mcp_milens_impact` with `direction: "upstream"` — find code-level dependents.
65
+ 3. Combine both results before acting.
66
+
67
+ **Before committing:**
68
+ - Call `mcp_milens_detect_changes` — if unexpected files appear, stop and report.
69
+
70
+ ## Tool Selection
71
+
72
+ - Use `mcp_milens_query` for symbol names (camelCase, PascalCase, snake_case).
73
+ - Use `mcp_milens_grep` for multi-word phrases, UI labels, error messages, or text in templates/configs/docs.
74
+ - When in doubt, use `mcp_milens_grep` first — it searches everything.
75
+
76
+ ## Reference
77
+
78
+ See `AGENTS.md` at the repo root for project-specific context and codebase structure.
79
+ Skill files at `.agents/skills/milens/SKILL.md` provide advanced workflow guides.
@@ -0,0 +1,3 @@
1
+ [mcp_servers.milens]
2
+ command = "milens"
3
+ args = ["serve", "-p", "."]
@@ -0,0 +1,10 @@
1
+ {
2
+ "servers": {
3
+ "milens": {
4
+ "type": "stdio",
5
+ "command": "milens",
6
+ "args": ["serve", "-p", "${workspaceFolder}"],
7
+ "env": { "MILENS_PROFILE": "standard" }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "milens": {
4
+ "command": "milens",
5
+ "args": ["serve", "-p", "${workspaceFolder}"],
6
+ "env": { "MILENS_PROFILE": "standard" }
7
+ }
8
+ }
9
+ }
@@ -1,9 +1,69 @@
1
- {
2
- "mcpServers": {
3
- "milens": {
4
- "command": "npx",
5
- "args": ["milens", "serve"],
6
- "env": { "MILENS_PROFILE": "standard" }
7
- }
8
- }
9
- }
1
+ # Milens — Code Intelligence for Cursor
2
+
3
+ ## ⚠️ BEFORE ANYTHING ELSE
4
+
5
+ This project is indexed by **milens**. You have MCP tools that are faster and more accurate than reading files directly.
6
+
7
+ **HARD RULE: Use milens tools BEFORE built-in search/read tools.**
8
+
9
+ | Situation | Built-in approach (❌) | Milens approach (✅) |
10
+ |---|---|---|
11
+ | Understand a function | Read 3-10 files | `mcp_milens_overview({name: "X"})` — 1 call |
12
+ | Find references | grep in files | `mcp_milens_grep({pattern: "X"})` — searches everything |
13
+ | Check edit safety | Hope nothing breaks | `mcp_milens_impact({target: "X"})` — exact blast radius |
14
+ | Start working | Read README, explore files | `mcp_milens_codebase_summary()` — 500 token overview |
15
+ | Before commit | `git diff` manually | `mcp_milens_detect_changes()` — symbols + risk scores |
16
+
17
+ **If you skip milens tools, you're wasting tokens and risking breaking changes.**
18
+
19
+ ## MCP Connection
20
+
21
+ Milens registers as an MCP server via `.cursor/mcp.json` (see that file in this adapter pack). All milens MCP calls require the `repo` parameter set to the absolute workspace root.
22
+
23
+ ## ⭐ Core Tools (Use Every Session)
24
+
25
+ | Tool | Description |
26
+ |---|---|
27
+ | `mcp_milens_overview` | **Use this first.** Context + impact + grep combined. 1 call replaces 3-5 file reads. |
28
+ | `mcp_milens_impact` | Blast radius BEFORE editing. Shows what WILL BREAK. |
29
+ | `mcp_milens_edit_check` | Pre-edit safety: callers, export status, re-export chains, test coverage |
30
+ | `mcp_milens_context` | Full incoming + outgoing dependency view |
31
+ | `mcp_milens_query` | Symbol search by name |
32
+ | `mcp_milens_grep` | Text search everywhere (templates, configs, docs, styles) |
33
+ | `mcp_milens_detect_changes` | Pre-commit: changed symbols + dependents + risk scores |
34
+ | `mcp_milens_codebase_summary` | 500-token project overview. Use instead of reading README. |
35
+
36
+ ### 🔧 Situational Tools (Use When Needed)
37
+
38
+ | Tool | Description | Use when... |
39
+ |---|---|---|
40
+ | `mcp_milens_guard_edit_check` | Hard pre-edit gate with audit tracking | Before every edit |
41
+ | `mcp_milens_trace` | Execution flow from entrypoints | Debugging call chains |
42
+ | `mcp_milens_explain_relationship` | Shortest dependency path | Understanding connections |
43
+ | `mcp_milens_get_type_hierarchy` | Class inheritance tree | Class exploration |
44
+ | `mcp_milens_find_dead_code` | Unused exported symbols | Before major refactors |
45
+ | `mcp_milens_status` | Index health: symbols, links, files, coverage | Session start |
46
+
47
+ ## Workflow
48
+
49
+ **Every session follows this pattern:**
50
+
51
+ 1. **Start** — `mcp_milens_status` to verify the index is healthy.
52
+ 2. **Understand** — `mcp_milens_overview({name, repo})` for any symbol mentioned.
53
+ 3. **Edit safely** — `mcp_milens_edit_check` before touching hub/shared code. Halt if dependents > 5.
54
+ 4. **Verify** — `mcp_milens_detect_changes` before committing. Report unexpected changes.
55
+ 5. **Refresh** — `npx milens analyze -p . --force` after significant edits.
56
+
57
+ ## Mandatory Safety Rules
58
+
59
+ - **Never edit** a symbol without `mcp_milens_edit_check` first.
60
+ - **Never delete/rename** without `mcp_milens_grep` AND `mcp_milens_impact`.
61
+ - **Never commit** without `mcp_milens_detect_changes`.
62
+ - **Never omit** the `repo` parameter from milens calls.
63
+ - **Use `mcp_milens_grep`** (not `mcp_milens_query`) for phrases, UI text, config strings.
64
+
65
+ ## Codebase Structure
66
+
67
+ - `.agents/skills/milens/SKILL.md` — full milens documentation
68
+ - `.agents/skills/` — area-specific skill files (analyzer, parser, server, store, etc.)
69
+ - `AGENTS.md` — project-level instructions and conventions