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.
- package/.agents/skills/adapters/SKILL.md +54 -51
- package/.agents/skills/analyzer/SKILL.md +78 -79
- package/.agents/skills/apps/SKILL.md +60 -68
- package/.agents/skills/docs/SKILL.md +58 -79
- package/.agents/skills/milens/SKILL.md +319 -318
- package/.agents/skills/orchestrator/SKILL.md +59 -61
- package/.agents/skills/parser/SKILL.md +81 -82
- package/.agents/skills/root/SKILL.md +84 -86
- package/.agents/skills/scripts/SKILL.md +51 -45
- package/.agents/skills/security/SKILL.md +62 -66
- package/.agents/skills/server/SKILL.md +77 -73
- package/.agents/skills/store/SKILL.md +72 -75
- package/.agents/skills/test/SKILL.md +148 -152
- package/.agents/skills/ui/SKILL.md +51 -0
- package/README.md +577 -527
- package/adapters/README.md +144 -107
- package/adapters/claude-code/.claude/mcp.json +9 -9
- package/adapters/claude-code/.claude/settings.json.hooks-snippet.json +26 -0
- package/adapters/claude-code/.claude-plugin/plugin.json +11 -0
- package/adapters/claude-code/.mcp.json +9 -0
- package/adapters/claude-code/CLAUDE.md +79 -79
- package/adapters/codex/.codex/config.toml +3 -0
- package/adapters/copilot/.vscode/mcp.json +10 -0
- package/adapters/cursor/.cursor/mcp.json +9 -0
- package/adapters/cursor/.cursorrules +69 -9
- package/adapters/gemini/.gemini/context.md +81 -81
- package/adapters/gemini/.gemini/settings.json +9 -0
- package/adapters/opencode/.opencode/config.json +8 -8
- package/adapters/zed/.zed/settings.json +8 -8
- package/dist/agents-md.d.ts +0 -1
- package/dist/agents-md.js +2 -2
- package/dist/agents-md.js.map +1 -1
- package/dist/analyzer/config.d.ts +0 -1
- package/dist/analyzer/engine.d.ts +0 -1
- package/dist/analyzer/engine.js +42 -40
- package/dist/analyzer/engine.js.map +1 -1
- package/dist/analyzer/enrich.d.ts +0 -1
- package/dist/analyzer/enrich.js +13 -0
- package/dist/analyzer/enrich.js.map +1 -1
- package/dist/analyzer/resolver.d.ts +0 -1
- package/dist/analyzer/resolver.js +48 -4
- package/dist/analyzer/resolver.js.map +1 -1
- package/dist/analyzer/review.d.ts +2 -2
- package/dist/analyzer/review.js +7 -59
- package/dist/analyzer/review.js.map +1 -1
- package/dist/analyzer/risk.d.ts +20 -0
- package/dist/analyzer/risk.js +76 -0
- package/dist/analyzer/risk.js.map +1 -0
- package/dist/analyzer/scanner.d.ts +0 -1
- package/dist/analyzer/scanner.js +2 -4
- package/dist/analyzer/scanner.js.map +1 -1
- package/dist/analyzer/scope-resolver.d.ts +0 -1
- package/dist/analyzer/scope-resolver.js +1 -1
- package/dist/analyzer/scope-resolver.js.map +1 -1
- package/dist/build-info.d.ts +2 -0
- package/dist/build-info.js +4 -0
- package/dist/build-info.js.map +1 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +143 -17
- package/dist/cli.js.map +1 -1
- package/dist/metrics.d.ts +0 -1
- package/dist/orchestrator/orchestrator.d.ts +0 -1
- package/dist/orchestrator/orchestrator.js +16 -1
- package/dist/orchestrator/orchestrator.js.map +1 -1
- package/dist/orchestrator/reporter.d.ts +0 -1
- package/dist/parser/extract.d.ts +0 -1
- package/dist/parser/extract.js +53 -28
- package/dist/parser/extract.js.map +1 -1
- package/dist/parser/lang-css.d.ts +0 -1
- package/dist/parser/lang-go.d.ts +0 -1
- package/dist/parser/lang-html.d.ts +0 -1
- package/dist/parser/lang-java.d.ts +0 -1
- package/dist/parser/lang-js.d.ts +0 -1
- package/dist/parser/lang-md.d.ts +0 -1
- package/dist/parser/lang-php.d.ts +0 -1
- package/dist/parser/lang-py.d.ts +0 -1
- package/dist/parser/lang-ruby.d.ts +0 -1
- package/dist/parser/lang-rust.d.ts +0 -1
- package/dist/parser/lang-ts.d.ts +0 -1
- package/dist/parser/lang-vue.d.ts +0 -1
- package/dist/parser/language-provider.d.ts +0 -1
- package/dist/parser/languages.d.ts +0 -1
- package/dist/parser/loader.d.ts +0 -1
- package/dist/security/deps.d.ts +0 -1
- package/dist/security/rules.d.ts +0 -1
- package/dist/security/rules.js +13 -12
- package/dist/security/rules.js.map +1 -1
- package/dist/server/hooks.d.ts +0 -1
- package/dist/server/hooks.js +10 -0
- package/dist/server/hooks.js.map +1 -1
- package/dist/server/mcp-prompts.d.ts +0 -1
- package/dist/server/mcp-prompts.js +509 -523
- package/dist/server/mcp-prompts.js.map +1 -1
- package/dist/server/mcp.d.ts +0 -1
- package/dist/server/mcp.js +156 -655
- package/dist/server/mcp.js.map +1 -1
- package/dist/server/test-plan.d.ts +0 -1
- package/dist/server/tools/deps.d.ts +28 -0
- package/dist/server/tools/deps.js +2 -0
- package/dist/server/tools/deps.js.map +1 -0
- package/dist/server/tools/resources.d.ts +3 -0
- package/dist/server/tools/resources.js +103 -0
- package/dist/server/tools/resources.js.map +1 -0
- package/dist/server/tools/security.d.ts +3 -0
- package/dist/server/tools/security.js +176 -0
- package/dist/server/tools/security.js.map +1 -0
- package/dist/server/tools/session.d.ts +3 -0
- package/dist/server/tools/session.js +140 -0
- package/dist/server/tools/session.js.map +1 -0
- package/dist/server/tools/testing.d.ts +3 -0
- package/dist/server/tools/testing.js +200 -0
- package/dist/server/tools/testing.js.map +1 -0
- package/dist/server/watcher.d.ts +0 -1
- package/dist/server/watcher.js +1 -1
- package/dist/server/watcher.js.map +1 -1
- package/dist/skills.d.ts +0 -1
- package/dist/skills.js +11 -5
- package/dist/skills.js.map +1 -1
- package/dist/store/annotations.d.ts +1 -1
- package/dist/store/annotations.js +14 -3
- package/dist/store/annotations.js.map +1 -1
- package/dist/store/confidence.d.ts +0 -1
- package/dist/store/confidence.js +2 -0
- package/dist/store/confidence.js.map +1 -1
- package/dist/store/db.d.ts +9 -1
- package/dist/store/db.js +88 -25
- package/dist/store/db.js.map +1 -1
- package/dist/store/registry.d.ts +0 -1
- package/dist/store/vectors.d.ts +0 -1
- package/dist/types.d.ts +7 -1
- package/dist/ui/progress.d.ts +0 -1
- package/dist/uninstall.d.ts +0 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +0 -0
- package/dist/utils.js.map +1 -1
- package/package.json +12 -9
- package/dist/agents-md.d.ts.map +0 -1
- package/dist/analyzer/config.d.ts.map +0 -1
- package/dist/analyzer/engine.d.ts.map +0 -1
- package/dist/analyzer/enrich.d.ts.map +0 -1
- package/dist/analyzer/resolver.d.ts.map +0 -1
- package/dist/analyzer/review.d.ts.map +0 -1
- package/dist/analyzer/scanner.d.ts.map +0 -1
- package/dist/analyzer/scope-resolver.d.ts.map +0 -1
- package/dist/analyzer/testplan.d.ts +0 -59
- package/dist/analyzer/testplan.d.ts.map +0 -1
- package/dist/analyzer/testplan.js +0 -218
- package/dist/analyzer/testplan.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/metrics.d.ts.map +0 -1
- package/dist/orchestrator/orchestrator.d.ts.map +0 -1
- package/dist/orchestrator/reporter.d.ts.map +0 -1
- package/dist/parser/extract.d.ts.map +0 -1
- package/dist/parser/lang-css.d.ts.map +0 -1
- package/dist/parser/lang-go.d.ts.map +0 -1
- package/dist/parser/lang-html.d.ts.map +0 -1
- package/dist/parser/lang-java.d.ts.map +0 -1
- package/dist/parser/lang-js.d.ts.map +0 -1
- package/dist/parser/lang-md.d.ts.map +0 -1
- package/dist/parser/lang-php.d.ts.map +0 -1
- package/dist/parser/lang-py.d.ts.map +0 -1
- package/dist/parser/lang-ruby.d.ts.map +0 -1
- package/dist/parser/lang-rust.d.ts.map +0 -1
- package/dist/parser/lang-ts.d.ts.map +0 -1
- package/dist/parser/lang-vue.d.ts.map +0 -1
- package/dist/parser/language-provider.d.ts.map +0 -1
- package/dist/parser/languages.d.ts.map +0 -1
- package/dist/parser/loader.d.ts.map +0 -1
- package/dist/security/deps.d.ts.map +0 -1
- package/dist/security/rules.d.ts.map +0 -1
- package/dist/server/hooks.d.ts.map +0 -1
- package/dist/server/mcp-prompts.d.ts.map +0 -1
- package/dist/server/mcp.d.ts.map +0 -1
- package/dist/server/test-plan.d.ts.map +0 -1
- package/dist/server/watcher.d.ts.map +0 -1
- package/dist/skills.d.ts.map +0 -1
- package/dist/store/annotations.d.ts.map +0 -1
- package/dist/store/confidence.d.ts.map +0 -1
- package/dist/store/db.d.ts.map +0 -1
- package/dist/store/registry.d.ts.map +0 -1
- package/dist/store/vectors.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/ui/progress.d.ts.map +0 -1
- package/dist/uninstall.d.ts.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/docs/README.md +0 -25
- package/docs/diagram1.svg +0 -1
- package/docs/diagram2.svg +0 -1
- package/docs/diagram3.svg +0 -1
package/adapters/README.md
CHANGED
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
+
}
|
|
@@ -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.
|
|
@@ -1,9 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|