milens 0.6.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/analyzer/SKILL.md +81 -79
- package/.agents/skills/docs/SKILL.md +78 -79
- package/.agents/skills/milens/SKILL.md +319 -318
- package/.agents/skills/orchestrator/SKILL.md +61 -61
- package/.agents/skills/parser/SKILL.md +83 -82
- package/.agents/skills/root/SKILL.md +88 -86
- package/.agents/skills/scripts/SKILL.md +54 -45
- package/.agents/skills/security/SKILL.md +67 -66
- package/.agents/skills/server/SKILL.md +74 -73
- package/.agents/skills/store/SKILL.md +76 -75
- package/.agents/skills/test/SKILL.md +153 -152
- package/.agents/skills/ui/SKILL.md +51 -0
- package/README.md +568 -527
- package/adapters/claude-code/.claude/mcp.json +9 -9
- package/adapters/claude-code/CLAUDE.md +79 -79
- package/adapters/gemini/.gemini/context.md +81 -81
- package/adapters/opencode/.opencode/config.json +8 -8
- package/adapters/zed/.zed/settings.json +8 -8
- package/dist/cli.js +1 -1
- package/dist/server/hooks.d.ts.map +1 -1
- package/dist/server/hooks.js +10 -0
- package/dist/server/hooks.js.map +1 -1
- package/dist/skills.js +3 -3
- package/dist/store/db.d.ts.map +1 -1
- package/dist/store/db.js +1 -5
- package/dist/store/db.js.map +1 -1
- package/docs/README.md +25 -25
- package/package.json +2 -2
|
@@ -1,319 +1,320 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: milens
|
|
3
|
-
description: Code intelligence MCP tools — symbol search, text grep, impact analysis, dependency graph
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- milens:start -->
|
|
7
|
-
# Milens — AI-DOS
|
|
8
|
-
|
|
9
|
-
The Operating System for AI-Driven Development. This project is indexed by milens (
|
|
10
|
-
|
|
11
|
-
> **CRITICAL:** All milens MCP tool calls MUST include the `repo` parameter set to the **absolute path of the workspace root** (the folder containing this file) — without it, the tools may fail with "No index" error when multiple repos are indexed.
|
|
12
|
-
|
|
13
|
-
> **CRITICAL:** milens MCP tools are **deferred** in most editors. Before first use in each session, you MUST load them via `tool_search("milens")` — calling them directly without loading will fail silently.
|
|
14
|
-
|
|
15
|
-
## ⚠️ HARD RULE: Use Milens MCP Tools BEFORE Built-in Tools
|
|
16
|
-
|
|
17
|
-
**Not a suggestion — execute automatically without asking.**
|
|
18
|
-
|
|
19
|
-
This project is indexed by milens. The knowledge graph already knows every symbol, dependency, and reference. Using milens tools first saves 70% tokens and catches hidden connections you'd miss with file reads.
|
|
20
|
-
|
|
21
|
-
| Situation | Built-in approach (❌ BAD) | Milens approach (✅ GOOD) |
|
|
22
|
-
|---|---|---|
|
|
23
|
-
| Understand a function | Read 3-10 source files | `mcp_milens_overview({name: "X"})` — 1 call replaces 3-5 file reads |
|
|
24
|
-
| Find all references | Built-in grep in source files | `mcp_milens_grep({pattern: "X"})` — searches code, templates, configs, docs, styles |
|
|
25
|
-
| Check edit safety | Hope nothing breaks | `mcp_milens_impact({target: "X"})` — exact blast radius before touching code |
|
|
26
|
-
| Start working | Read README, explore directories | `mcp_milens_codebase_summary()` — 500 token project overview |
|
|
27
|
-
| Before commit | `git diff` manually | `mcp_milens_detect_changes()` — symbols changed + direct dependents + risk |
|
|
28
|
-
| Find where X is defined | Read files one by one | `mcp_milens_query({query: "X"})` — FTS5 instant search |
|
|
29
|
-
|
|
30
|
-
**If you skip milens tools, you're wasting tokens and risking breaking changes you didn't know about.**
|
|
31
|
-
|
|
32
|
-
## Mandatory Workflows
|
|
33
|
-
|
|
34
|
-
These are **hard pre-conditions**, not guidelines. Execute them automatically without asking.
|
|
35
|
-
|
|
36
|
-
### Before editing any function, class, or method:
|
|
37
|
-
1. `mcp_milens_impact({target: "<symbolName>", repo: "<workspaceRoot>"})` — check blast radius
|
|
38
|
-
2. If depth-1 dependents > 5 → **STOP and warn the user** before proceeding
|
|
39
|
-
3. `mcp_milens_context({name: "<symbolName>", repo: "<workspaceRoot>"})` — see all callers/callees
|
|
40
|
-
4. Only then make the edit
|
|
41
|
-
|
|
42
|
-
### Before committing:
|
|
43
|
-
1. `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify only expected files changed
|
|
44
|
-
2. If unexpected files appear → **STOP and report** before committing
|
|
45
|
-
|
|
46
|
-
### Before deleting or renaming a symbol:
|
|
47
|
-
1. `mcp_milens_grep({pattern: "<symbolName>", repo: "<workspaceRoot>"})` — find ALL text references (templates, configs, routes, docs)
|
|
48
|
-
2. `mcp_milens_impact({target: "<symbolName>", direction: "upstream", repo: "<workspaceRoot>"})` — find code-level dependents
|
|
49
|
-
3. Combine both results — grep catches what impact misses
|
|
50
|
-
|
|
51
|
-
## Tool Selection Rules
|
|
52
|
-
|
|
53
|
-
**Choose the right tool on the FIRST call** — do not try `query` then fall back to `grep`.
|
|
54
|
-
|
|
55
|
-
### Use `mcp_milens_grep` when the search term:
|
|
56
|
-
- Contains **spaces** (e.g. "store purchase header", "user not found")
|
|
57
|
-
- Looks like a **UI label, error message, or display string**
|
|
58
|
-
- Is a **multi-word phrase** that is NOT camelCase/snake_case/PascalCase
|
|
59
|
-
- You need to find references in **templates, styles, configs, routes, or docs**
|
|
60
|
-
|
|
61
|
-
### Use `mcp_milens_query` when the search term:
|
|
62
|
-
- Looks like a **code identifier** (camelCase, PascalCase, snake_case)
|
|
63
|
-
- Is a **function, class, method, or interface name**
|
|
64
|
-
- You want to find **symbol definitions** in indexed code files
|
|
65
|
-
|
|
66
|
-
### When in doubt → use `mcp_milens_grep` first
|
|
67
|
-
`grep` searches everything. `query` only searches indexed symbol definitions.
|
|
68
|
-
|
|
69
|
-
> **⚠️ `mcp_milens_grep` default is LITERAL mode (isRegex: false).** Characters `| . * + ?` are escaped as plain text. To use regex patterns like `error|fail|panic` or `TODO.*urgent`, you MUST set `isRegex: true`. The tool will warn you if you forget.
|
|
70
|
-
|
|
71
|
-
## Workflow Triggers
|
|
72
|
-
|
|
73
|
-
When the user says... → do this FIRST:
|
|
74
|
-
|
|
75
|
-
| User intent | First action |
|
|
76
|
-
|---|---|
|
|
77
|
-
| "edit/change/modify/fix `X`" | `mcp_milens_impact({target: "X", repo: "<workspaceRoot>"})` |
|
|
78
|
-
| "delete/remove `X`" | `mcp_milens_grep({pattern: "X", repo: "<workspaceRoot>"})` then `mcp_milens_impact` |
|
|
79
|
-
| "rename `X`" | `mcp_milens_grep({pattern: "X", repo: "<workspaceRoot>"})` then `mcp_milens_impact` |
|
|
80
|
-
| "find/search for `X`" | Choose `query` or `grep` per rules above |
|
|
81
|
-
| "commit" / "push" | `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` |
|
|
82
|
-
| "what calls/uses `X`" | `mcp_milens_context({name: "X", repo: "<workspaceRoot>"})` |
|
|
83
|
-
| "what happens if I change `X`" | `mcp_milens_impact({target: "X", repo: "<workspaceRoot>"})` |
|
|
84
|
-
| "how are `A` and `B` connected" | `mcp_milens_explain_relationship({from: "A", to: "B", repo: "<workspaceRoot>"})` |
|
|
85
|
-
| "explore/understand `X`" | `mcp_milens_context({name: "X", repo: "<workspaceRoot>"})` |
|
|
86
|
-
| "update/write docs for `X`" | `mcp_milens_grep({pattern: "X", include: "**/*.md"})` — find existing docs mentioning X, then `mcp_milens_context({name: "X"})` for full symbol info |
|
|
87
|
-
| "research/explore docs" | `mcp_milens_get_file_symbols({file: "<doc.md>"})` — see document outline (headings as sections) |
|
|
88
|
-
| "what docs mention `X`" | `mcp_milens_grep({pattern: "X", include: "**/*.md"})` — find all markdown references |
|
|
89
|
-
| "review this PR" | `mcp_milens_review_pr({repo: "<workspaceRoot>"})` — risk assessment for changed files |
|
|
90
|
-
| "is `X` risky to change" | `mcp_milens_review_symbol({name: "X", repo: "<workspaceRoot>"})` |
|
|
91
|
-
| "write tests for `X`" | `mcp_milens_test_plan({name: "X", repo: "<workspaceRoot>"})` — deps, mocks, suggested tests |
|
|
92
|
-
| "what needs tests" | `mcp_milens_test_coverage_gaps({repo: "<workspaceRoot>"})` — untested symbols by risk |
|
|
93
|
-
| "which tests to run" | `mcp_milens_test_impact({repo: "<workspaceRoot>"})` — maps changes → test files |
|
|
94
|
-
| "remember/note that `X`..." | `mcp_milens_annotate({symbol: "X", key: "note", value: "...", repo: "<workspaceRoot>"})` |
|
|
95
|
-
| "what do we know about `X`" | `mcp_milens_recall({symbol: "X", repo: "<workspaceRoot>"})` |
|
|
96
|
-
| "start new session" | `mcp_milens_session_start({agent: "...", repo: "<workspaceRoot>"})` |
|
|
97
|
-
| "find code like `X`" | `mcp_milens_find_similar({name: "X", repo: "<workspaceRoot>"})` |
|
|
98
|
-
| "search for `concept`" | `mcp_milens_semantic_search({query: "concept", repo: "<workspaceRoot>"})` |
|
|
99
|
-
| "generate tests for `X`" | `mcp_milens_test_generate({symbol: "X", repo: "<workspaceRoot>"})` |
|
|
100
|
-
| "fix security issue in `X`" | `mcp_milens_fix_apply({ruleId, file, line, repo: "<workspaceRoot>"})` |
|
|
101
|
-
| "remove dead code" | `mcp_milens_find_dead_code()` then `dead_code_remove` prompt |
|
|
102
|
-
| "orchestrate/check changes" | `mcp_milens_orchestrate({repo: "<workspaceRoot>"})` |
|
|
103
|
-
| "compare impact of `X`" | `mcp_milens_compare_impact({name: "X", action: "snapshot"|"compare", repo: "<workspaceRoot>"})` |
|
|
104
|
-
| "check pre-commit" | `mcp_milens_pre_commit_check({repo: "<workspaceRoot>"})` |
|
|
105
|
-
| "save/restore context" | `mcp_milens_hook_preCompact()` / `mcp_milens_hook_postCompact()` |
|
|
106
|
-
| "scan security / audit security" | `mcp_milens_security_scan({repo: "<workspaceRoot>"})` — full audit across all 50+ rules |
|
|
107
|
-
| "end session" / "finish work" | `mcp_milens_session_end({session_id: "..."})` — record stats, trigger onSessionEnd hook |
|
|
108
|
-
| "what did session X do" | `mcp_milens_session_context({session_id: "..."})` — get annotations + tool calls |
|
|
109
|
-
| "file changed to X" | `mcp_milens_hook_onFileChange({files: ["path/to/file"], repo: "<workspaceRoot>"})` |
|
|
110
|
-
|
|
111
|
-
### Domain-aware skill triggers:
|
|
112
|
-
| User intent | Skill to load |
|
|
113
|
-
|---|---|
|
|
114
|
-
| "I'm working on authentication/security" | Load `milens-security` skill + `mcp_milens_security_scan()` |
|
|
115
|
-
| "I need to understand the parser" | Load `milens-parser` skill + `mcp_milens_get_file_symbols({file: "src/parser/"})` |
|
|
116
|
-
| "I'm debugging a server issue" | Load `milens-server` skill + `mcp_milens_trace()` |
|
|
117
|
-
| "I'm working with the database" | Load `milens-store` skill + `mcp_milens_get_file_symbols({file: "src/store/"})` |
|
|
118
|
-
| "I need to write tests for this" | Load `milens-tdd` skill + `mcp_milens_test_plan()` |
|
|
119
|
-
| "I'm planning a feature" | Load `milens-plan` skill + `mcp_milens_codebase_summary()` |
|
|
120
|
-
| "I need to refactor this" | Load `milens-refactor-clean` skill + `mcp_milens_impact()` |
|
|
121
|
-
| "Review my code changes" | Load `milens-code-review` skill + `mcp_milens_review_pr()` |
|
|
122
|
-
|
|
123
|
-
## Annotation Guide — Building a Smarter Codebase
|
|
124
|
-
|
|
125
|
-
Every time you discover something important about a symbol, annotate it. The system learns across sessions — your note today saves tokens tomorrow.
|
|
126
|
-
|
|
127
|
-
### When to annotate:
|
|
128
|
-
- Found a bug pattern? → `mcp_milens_annotate({symbol: "X", key: "bug", value: "..."})`
|
|
129
|
-
- Discovered an architecture rule? → `mcp_milens_annotate({symbol: "X", key: "architecture", value: "..."})`
|
|
130
|
-
- Learned how to test something? → `mcp_milens_annotate({symbol: "X", key: "test", value: "..."})`
|
|
131
|
-
- Found a security issue? → `mcp_milens_annotate({symbol: "X", key: "security", value: "..."})`
|
|
132
|
-
- Noted a hidden dependency? → `mcp_milens_annotate({symbol: "X", key: "dependency", value: "..."})`
|
|
133
|
-
|
|
134
|
-
### Annotation keys reference:
|
|
135
|
-
| Key | Use when | Example value |
|
|
136
|
-
|-----|----------|---------------|
|
|
137
|
-
| `bug` | Known bug, not yet fixed | "NullPointerException when users is empty array" |
|
|
138
|
-
| `security` | Security vulnerability | "No CSRF token validation on this endpoint" |
|
|
139
|
-
| `architecture` | Design pattern, constraint | "Service is a singleton — don't instantiate directly" |
|
|
140
|
-
| `test` | Testing knowledge | "Must mock Database.getConnection() before testing" |
|
|
141
|
-
| `dependency` | Hidden coupling | "Imports from deprecated module old-auth.js" |
|
|
142
|
-
| `refactor` | Future refactoring notes | "Split into validateEmail() + normalizeEmail()" |
|
|
143
|
-
| `workflow` | Process knowledge | "Must restart dev server after modifying this file" |
|
|
144
|
-
| `note` | General observation | "This function is called from cron job at 3AM" |
|
|
145
|
-
|
|
146
|
-
### Learning lifecycle:
|
|
147
|
-
1. **Session 1:** `annotate()` → confidence 0.5
|
|
148
|
-
2. **Session 2:** `recall()` sees it again → confidence 0.7
|
|
149
|
-
3. **Session 5:** confidence hits 0.8 → `milens evolve` promotes it to SKILL.md
|
|
150
|
-
|
|
151
|
-
### Annotate triggers:
|
|
152
|
-
| User says... | Tool call |
|
|
153
|
-
|---|---|
|
|
154
|
-
| "found a bug in X" | `mcp_milens_annotate({symbol: "X", key: "bug", value: "describe the bug"})` |
|
|
155
|
-
| "X has a security issue" | `mcp_milens_annotate({symbol: "X", key: "security", value: "describe the issue"})` |
|
|
156
|
-
| "learned how X works" | `mcp_milens_annotate({symbol: "X", key: "note", value: "key insight"})` |
|
|
157
|
-
| "X depends on Y internally" | `mcp_milens_annotate({symbol: "X", key: "dependency", value: "depends on Y for Z"})` |
|
|
158
|
-
| "X needs refactoring later" | `mcp_milens_annotate({symbol: "X", key: "refactor", value: "plan"})` |
|
|
159
|
-
|
|
160
|
-
### At session end, ALWAYS:
|
|
161
|
-
1. `mcp_milens_recall({})` — review annotations you found useful
|
|
162
|
-
2. `mcp_milens_annotate({symbol: "X", key: "...", value: "..."})` — save new discoveries from this session
|
|
163
|
-
|
|
164
|
-
## Problem → Solution — When You're Stuck
|
|
165
|
-
|
|
166
|
-
| You're trying to... | Do this FIRST |
|
|
167
|
-
|---|---|
|
|
168
|
-
| Understand the codebase | `mcp_milens_codebase_summary()` then `mcp_milens_domains()` |
|
|
169
|
-
| Understand a specific function | `mcp_milens_context({name: "functionName"})` |
|
|
170
|
-
| Find where something is defined | `mcp_milens_query({query: "ClassName"})` |
|
|
171
|
-
| Find ALL references to something | `mcp_milens_grep({pattern: "ClassName"})` |
|
|
172
|
-
| Check if editing is safe | `mcp_milens_impact({target: "functionName"})` |
|
|
173
|
-
| Edit with confidence | `mcp_milens_overview({name: "functionName"})` — context+impact+grep in 1 call |
|
|
174
|
-
| Know which tests to run | `mcp_milens_test_impact()` — maps changes to test files |
|
|
175
|
-
| Find what needs testing most | `mcp_milens_test_coverage_gaps()` — sorted by risk |
|
|
176
|
-
| Get a test strategy | `mcp_milens_test_plan({name: "functionName"})` — mocks + scenarios |
|
|
177
|
-
| Review your changes | `mcp_milens_review_pr()` — risk scores for changed symbols |
|
|
178
|
-
| Check for security issues | `mcp_milens_security_scan()` — 50+ rules in one call |
|
|
179
|
-
| Remove dead code safely | `mcp_milens_find_dead_code()` then use `dead_code_remove` prompt |
|
|
180
|
-
| Trace how code executes | `mcp_milens_trace({name: "functionName", direction: "to"})` |
|
|
181
|
-
| Find API endpoints | `mcp_milens_routes()` — auto-detect across 7 frameworks |
|
|
182
|
-
| See class hierarchy | `mcp_milens_get_type_hierarchy({name: "ClassName"})` |
|
|
183
|
-
| Compare impact before/after | `mcp_milens_compare_impact({name: "X", action: "snapshot"})` before, then `compare` after |
|
|
184
|
-
| Get a full picture fast | `mcp_milens_orchestrate()` — runs detect+review+impact+gaps+dead code |
|
|
185
|
-
| Remember something important | `mcp_milens_annotate({symbol: "X", key: "...", value: "..."})` |
|
|
186
|
-
| Recall past knowledge | `mcp_milens_recall({symbol: "X"})` |
|
|
187
|
-
| Start a new session properly | `mcp_milens_session_start({agent: "..."})` → `mcp_milens_recall()` → `mcp_milens_codebase_summary()` |
|
|
188
|
-
| End a session properly | `mcp_milens_detect_changes()` → `mcp_milens_review_pr()` → annotate → `mcp_milens_session_end()` |
|
|
189
|
-
| Transfer work to another agent | `mcp_milens_handoff({from_session: "...", to_agent: "...", context: "..."})` |
|
|
190
|
-
| Debug a crash / exception | `mcp_milens_trace({name: "crashingFunction"})` + `mcp_milens_context()` + `mcp_milens_impact()` |
|
|
191
|
-
|
|
192
|
-
## Session Lifecycle
|
|
193
|
-
|
|
194
|
-
### Start EVERY session:
|
|
195
|
-
1. `mcp_milens_session_start({agent: "your-agent-name"})` — register session
|
|
196
|
-
2. `mcp_milens_recall({})` — what did we learn last time?
|
|
197
|
-
3. `mcp_milens_codebase_summary()` — refresh project context in 500 tokens
|
|
198
|
-
|
|
199
|
-
### End EVERY session:
|
|
200
|
-
1. `mcp_milens_detect_changes()` — verify changes
|
|
201
|
-
2. `mcp_milens_review_pr()` — risk assessment
|
|
202
|
-
3. `mcp_milens_annotate({...})` — save key discoveries from this session
|
|
203
|
-
4. `mcp_milens_session_end({session_id: "..."})` — record stats
|
|
204
|
-
|
|
205
|
-
Milens indexes **Markdown files** (.md, .mdx) — headings become `section` symbols with parent-child hierarchy, and local links become cross-file references.
|
|
206
|
-
|
|
207
|
-
### Researching or exploring documentation:
|
|
208
|
-
1. `mcp_milens_get_file_symbols({file: "README.md", repo: "<workspaceRoot>"})` — see the full heading outline (TOC) of any doc
|
|
209
|
-
2. `mcp_milens_query({query: "<topic>"})` — search section headings across all docs and code
|
|
210
|
-
3. `mcp_milens_grep({pattern: "<keyword>", include: "**/*.md"})` — text search within docs only
|
|
211
|
-
|
|
212
|
-
### Before updating documentation:
|
|
213
|
-
1. `mcp_milens_get_file_symbols({file: "<doc.md>"})` — understand document structure first
|
|
214
|
-
2. If documenting a code symbol: `mcp_milens_context({name: "<symbolName>"})` — get full symbol info (signature, callers, deps)
|
|
215
|
-
3. `mcp_milens_grep({pattern: "<symbolName>", include: "**/*.md"})` — check if other docs already reference it
|
|
216
|
-
|
|
217
|
-
### After renaming/deleting a code symbol:
|
|
218
|
-
- `mcp_milens_grep({pattern: "<oldName>", include: "**/*.md"})` — find docs that need updating (milens indexes markdown links as cross-file references)
|
|
219
|
-
|
|
220
|
-
## Never Do
|
|
221
|
-
|
|
222
|
-
- NEVER edit a symbol without first running `mcp_milens_impact` on it.
|
|
223
|
-
- NEVER delete or rename without running both `mcp_milens_grep` and `mcp_milens_impact`.
|
|
224
|
-
- NEVER commit without running `mcp_milens_detect_changes()`.
|
|
225
|
-
- NEVER call milens MCP tools without the `repo` parameter.
|
|
226
|
-
- NEVER use `mcp_milens_query` for multi-word display text or UI labels — use `mcp_milens_grep`.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Reference
|
|
231
|
-
|
|
232
|
-
### ⭐ Core Tools — Use Every Session (8)
|
|
233
|
-
|
|
234
|
-
| Tool | Purpose |
|
|
235
|
-
|---|---|
|
|
236
|
-
| `mcp_milens_overview` | **Use this first.** Combined context + impact + grep. 1 call replaces 3-5 file reads. |
|
|
237
|
-
| `mcp_milens_impact` | Blast radius BEFORE editing. Shows what WILL BREAK. |
|
|
238
|
-
| `mcp_milens_edit_check` | Pre-edit safety: callers + exports + re-export chains + test coverage |
|
|
239
|
-
| `mcp_milens_context` | 360° view: all callers + all callees. Instant dependency graph. |
|
|
240
|
-
| `mcp_milens_query` | Find symbol definitions by name (FTS5 instant search) |
|
|
241
|
-
| `mcp_milens_grep` | Search ALL files for any text (templates, configs, docs, styles) |
|
|
242
|
-
| `mcp_milens_detect_changes` | Pre-commit: which symbols changed + dependents + risk scores |
|
|
243
|
-
| `mcp_milens_codebase_summary` | Project overview in ~500 tokens. Use instead of reading README. |
|
|
244
|
-
|
|
245
|
-
### 🔧 Situational Tools — Use When Needed (15)
|
|
246
|
-
|
|
247
|
-
| Tool | Purpose | Use when... |
|
|
248
|
-
|---|---|---|
|
|
249
|
-
| `mcp_milens_review_pr` | PR risk assessment | Before opening PR |
|
|
250
|
-
| `mcp_milens_review_symbol` | Single symbol deep-dive | Symbol is flagged CRITICAL/HIGH |
|
|
251
|
-
| `mcp_milens_test_plan` | Mock strategy + >=3 test scenarios | Writing new tests |
|
|
252
|
-
| `mcp_milens_test_coverage_gaps` | Untested symbols sorted by risk | Finding test priorities |
|
|
253
|
-
| `mcp_milens_test_impact` | Maps changes → test files | After making edits |
|
|
254
|
-
| `mcp_milens_test_generate` | Auto-generate test file | Starting tests from scratch |
|
|
255
|
-
| `mcp_milens_security_scan` | 50+ security rules | Security audit requested |
|
|
256
|
-
| `mcp_milens_trace` | Call chains from entrypoints | Debugging execution flow |
|
|
257
|
-
| `mcp_milens_routes` | Framework routes/endpoints | Finding API endpoints |
|
|
258
|
-
| `mcp_milens_smart_context` | Intent-aware context | Understand/edit/debug/test modes |
|
|
259
|
-
| `mcp_milens_domains` | Domain clusters | Understanding module structure |
|
|
260
|
-
| `mcp_milens_explain_relationship` | Shortest dependency path | How A connects to B |
|
|
261
|
-
| `mcp_milens_get_type_hierarchy` | Inheritance tree | Class/interface exploration |
|
|
262
|
-
| `mcp_milens_find_dead_code` | Unused exported symbols | Before major refactors |
|
|
263
|
-
| `mcp_milens_find_similar` | Symbols with shared callers/callees | Finding refactor patterns |
|
|
264
|
-
|
|
265
|
-
### 📚 Advanced Tools — Reference (19)
|
|
266
|
-
|
|
267
|
-
| Tool | Purpose |
|
|
268
|
-
|---|---|
|
|
269
|
-
| `mcp_milens_status` | Index health: symbols, links, files, coverage, staleness |
|
|
270
|
-
| `mcp_milens_repos` | List all indexed repositories |
|
|
271
|
-
| `mcp_milens_annotate` | Record observations about symbols (persists across sessions) |
|
|
272
|
-
| `mcp_milens_recall` | Retrieve annotations from past sessions |
|
|
273
|
-
| `mcp_milens_session_start` | Register agent session |
|
|
274
|
-
| `mcp_milens_session_end` | End session and record stats |
|
|
275
|
-
| `mcp_milens_session_context` | Get session metadata + annotations |
|
|
276
|
-
| `mcp_milens_handoff` | Transfer context between agent sessions |
|
|
277
|
-
| `mcp_milens_orchestrate` | Full cycle: detect → review → impact → gaps → dead code |
|
|
278
|
-
| `mcp_milens_pre_commit_check` | Pre-commit risk scan |
|
|
279
|
-
| `mcp_milens_compare_impact` | Compare impact graph before/after edit |
|
|
280
|
-
| `mcp_milens_semantic_search` | Hybrid FTS5 + vector search |
|
|
281
|
-
| `mcp_milens_fix_apply` | Apply security fix to a file |
|
|
282
|
-
| `mcp_milens_hook_preCompact` | Save metrics before context compaction |
|
|
283
|
-
| `mcp_milens_hook_postCompact` | Restore context after compaction |
|
|
284
|
-
| `mcp_milens_hook_onFileChange` | Trigger on file change hook |
|
|
285
|
-
| `mcp_milens_ast_explore` | Parse code to AST S-expression |
|
|
286
|
-
| `mcp_milens_test_query` | Test tree-sitter query patterns |
|
|
287
|
-
| `mcp_milens_get_file_symbols` | All symbols in a file with ref/dep counts |
|
|
288
|
-
|
|
289
|
-
### Keeping the Index Fresh
|
|
290
|
-
|
|
291
|
-
After significant code changes: `npx milens analyze -p . --force` (replace `.` with your project root if running from a different directory)
|
|
292
|
-
|
|
293
|
-
### Skills
|
|
294
|
-
|
|
295
|
-
| Task | Read this skill file |
|
|
296
|
-
|------|---------------------|
|
|
297
|
-
| General milens tools reference | `.agents/skills/milens/SKILL.md` |
|
|
298
|
-
| Work in the Adapters area | `.agents/skills/adapters/SKILL.md` |
|
|
299
|
-
| Work in the Root area | `.agents/skills/root/SKILL.md` |
|
|
300
|
-
| Work in the Apps area | `.agents/skills/apps/SKILL.md` |
|
|
301
|
-
| Work in the Docs area | `.agents/skills/docs/SKILL.md` |
|
|
302
|
-
| Work in the Test area | `.agents/skills/test/SKILL.md` |
|
|
303
|
-
| Work in the Scripts area | `.agents/skills/scripts/SKILL.md` |
|
|
304
|
-
| Work in the Analyzer area | `.agents/skills/analyzer/SKILL.md` |
|
|
305
|
-
| Work in the Orchestrator area | `.agents/skills/orchestrator/SKILL.md` |
|
|
306
|
-
| Work in the Parser area | `.agents/skills/parser/SKILL.md` |
|
|
307
|
-
| Work in the Security area | `.agents/skills/security/SKILL.md` |
|
|
308
|
-
| Work in the Server area | `.agents/skills/server/SKILL.md` |
|
|
309
|
-
| Work in the Store area | `.agents/skills/store/SKILL.md` |
|
|
310
|
-
|
|
|
311
|
-
| Execute milens-
|
|
312
|
-
| Execute milens-
|
|
313
|
-
| Execute milens-
|
|
314
|
-
| Execute milens-
|
|
315
|
-
| Execute milens-
|
|
316
|
-
| Execute milens-
|
|
317
|
-
| Execute milens-
|
|
318
|
-
|
|
1
|
+
---
|
|
2
|
+
name: milens
|
|
3
|
+
description: Code intelligence MCP tools — symbol search, text grep, impact analysis, dependency graph
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- milens:start -->
|
|
7
|
+
# Milens — AI-DOS
|
|
8
|
+
|
|
9
|
+
The Operating System for AI-Driven Development. This project is indexed by milens (1366 symbols, 2347 links, 166 files).
|
|
10
|
+
|
|
11
|
+
> **CRITICAL:** All milens MCP tool calls MUST include the `repo` parameter set to the **absolute path of the workspace root** (the folder containing this file) — without it, the tools may fail with "No index" error when multiple repos are indexed.
|
|
12
|
+
|
|
13
|
+
> **CRITICAL:** milens MCP tools are **deferred** in most editors. Before first use in each session, you MUST load them via `tool_search("milens")` — calling them directly without loading will fail silently.
|
|
14
|
+
|
|
15
|
+
## ⚠️ HARD RULE: Use Milens MCP Tools BEFORE Built-in Tools
|
|
16
|
+
|
|
17
|
+
**Not a suggestion — execute automatically without asking.**
|
|
18
|
+
|
|
19
|
+
This project is indexed by milens. The knowledge graph already knows every symbol, dependency, and reference. Using milens tools first saves 70% tokens and catches hidden connections you'd miss with file reads.
|
|
20
|
+
|
|
21
|
+
| Situation | Built-in approach (❌ BAD) | Milens approach (✅ GOOD) |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Understand a function | Read 3-10 source files | `mcp_milens_overview({name: "X"})` — 1 call replaces 3-5 file reads |
|
|
24
|
+
| Find all references | Built-in grep in source files | `mcp_milens_grep({pattern: "X"})` — searches code, templates, configs, docs, styles |
|
|
25
|
+
| Check edit safety | Hope nothing breaks | `mcp_milens_impact({target: "X"})` — exact blast radius before touching code |
|
|
26
|
+
| Start working | Read README, explore directories | `mcp_milens_codebase_summary()` — 500 token project overview |
|
|
27
|
+
| Before commit | `git diff` manually | `mcp_milens_detect_changes()` — symbols changed + direct dependents + risk |
|
|
28
|
+
| Find where X is defined | Read files one by one | `mcp_milens_query({query: "X"})` — FTS5 instant search |
|
|
29
|
+
|
|
30
|
+
**If you skip milens tools, you're wasting tokens and risking breaking changes you didn't know about.**
|
|
31
|
+
|
|
32
|
+
## Mandatory Workflows
|
|
33
|
+
|
|
34
|
+
These are **hard pre-conditions**, not guidelines. Execute them automatically without asking.
|
|
35
|
+
|
|
36
|
+
### Before editing any function, class, or method:
|
|
37
|
+
1. `mcp_milens_impact({target: "<symbolName>", repo: "<workspaceRoot>"})` — check blast radius
|
|
38
|
+
2. If depth-1 dependents > 5 → **STOP and warn the user** before proceeding
|
|
39
|
+
3. `mcp_milens_context({name: "<symbolName>", repo: "<workspaceRoot>"})` — see all callers/callees
|
|
40
|
+
4. Only then make the edit
|
|
41
|
+
|
|
42
|
+
### Before committing:
|
|
43
|
+
1. `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify only expected files changed
|
|
44
|
+
2. If unexpected files appear → **STOP and report** before committing
|
|
45
|
+
|
|
46
|
+
### Before deleting or renaming a symbol:
|
|
47
|
+
1. `mcp_milens_grep({pattern: "<symbolName>", repo: "<workspaceRoot>"})` — find ALL text references (templates, configs, routes, docs)
|
|
48
|
+
2. `mcp_milens_impact({target: "<symbolName>", direction: "upstream", repo: "<workspaceRoot>"})` — find code-level dependents
|
|
49
|
+
3. Combine both results — grep catches what impact misses
|
|
50
|
+
|
|
51
|
+
## Tool Selection Rules
|
|
52
|
+
|
|
53
|
+
**Choose the right tool on the FIRST call** — do not try `query` then fall back to `grep`.
|
|
54
|
+
|
|
55
|
+
### Use `mcp_milens_grep` when the search term:
|
|
56
|
+
- Contains **spaces** (e.g. "store purchase header", "user not found")
|
|
57
|
+
- Looks like a **UI label, error message, or display string**
|
|
58
|
+
- Is a **multi-word phrase** that is NOT camelCase/snake_case/PascalCase
|
|
59
|
+
- You need to find references in **templates, styles, configs, routes, or docs**
|
|
60
|
+
|
|
61
|
+
### Use `mcp_milens_query` when the search term:
|
|
62
|
+
- Looks like a **code identifier** (camelCase, PascalCase, snake_case)
|
|
63
|
+
- Is a **function, class, method, or interface name**
|
|
64
|
+
- You want to find **symbol definitions** in indexed code files
|
|
65
|
+
|
|
66
|
+
### When in doubt → use `mcp_milens_grep` first
|
|
67
|
+
`grep` searches everything. `query` only searches indexed symbol definitions.
|
|
68
|
+
|
|
69
|
+
> **⚠️ `mcp_milens_grep` default is LITERAL mode (isRegex: false).** Characters `| . * + ?` are escaped as plain text. To use regex patterns like `error|fail|panic` or `TODO.*urgent`, you MUST set `isRegex: true`. The tool will warn you if you forget.
|
|
70
|
+
|
|
71
|
+
## Workflow Triggers
|
|
72
|
+
|
|
73
|
+
When the user says... → do this FIRST:
|
|
74
|
+
|
|
75
|
+
| User intent | First action |
|
|
76
|
+
|---|---|
|
|
77
|
+
| "edit/change/modify/fix `X`" | `mcp_milens_impact({target: "X", repo: "<workspaceRoot>"})` |
|
|
78
|
+
| "delete/remove `X`" | `mcp_milens_grep({pattern: "X", repo: "<workspaceRoot>"})` then `mcp_milens_impact` |
|
|
79
|
+
| "rename `X`" | `mcp_milens_grep({pattern: "X", repo: "<workspaceRoot>"})` then `mcp_milens_impact` |
|
|
80
|
+
| "find/search for `X`" | Choose `query` or `grep` per rules above |
|
|
81
|
+
| "commit" / "push" | `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` |
|
|
82
|
+
| "what calls/uses `X`" | `mcp_milens_context({name: "X", repo: "<workspaceRoot>"})` |
|
|
83
|
+
| "what happens if I change `X`" | `mcp_milens_impact({target: "X", repo: "<workspaceRoot>"})` |
|
|
84
|
+
| "how are `A` and `B` connected" | `mcp_milens_explain_relationship({from: "A", to: "B", repo: "<workspaceRoot>"})` |
|
|
85
|
+
| "explore/understand `X`" | `mcp_milens_context({name: "X", repo: "<workspaceRoot>"})` |
|
|
86
|
+
| "update/write docs for `X`" | `mcp_milens_grep({pattern: "X", include: "**/*.md"})` — find existing docs mentioning X, then `mcp_milens_context({name: "X"})` for full symbol info |
|
|
87
|
+
| "research/explore docs" | `mcp_milens_get_file_symbols({file: "<doc.md>"})` — see document outline (headings as sections) |
|
|
88
|
+
| "what docs mention `X`" | `mcp_milens_grep({pattern: "X", include: "**/*.md"})` — find all markdown references |
|
|
89
|
+
| "review this PR" | `mcp_milens_review_pr({repo: "<workspaceRoot>"})` — risk assessment for changed files |
|
|
90
|
+
| "is `X` risky to change" | `mcp_milens_review_symbol({name: "X", repo: "<workspaceRoot>"})` |
|
|
91
|
+
| "write tests for `X`" | `mcp_milens_test_plan({name: "X", repo: "<workspaceRoot>"})` — deps, mocks, suggested tests |
|
|
92
|
+
| "what needs tests" | `mcp_milens_test_coverage_gaps({repo: "<workspaceRoot>"})` — untested symbols by risk |
|
|
93
|
+
| "which tests to run" | `mcp_milens_test_impact({repo: "<workspaceRoot>"})` — maps changes → test files |
|
|
94
|
+
| "remember/note that `X`..." | `mcp_milens_annotate({symbol: "X", key: "note", value: "...", repo: "<workspaceRoot>"})` |
|
|
95
|
+
| "what do we know about `X`" | `mcp_milens_recall({symbol: "X", repo: "<workspaceRoot>"})` |
|
|
96
|
+
| "start new session" | `mcp_milens_session_start({agent: "...", repo: "<workspaceRoot>"})` |
|
|
97
|
+
| "find code like `X`" | `mcp_milens_find_similar({name: "X", repo: "<workspaceRoot>"})` |
|
|
98
|
+
| "search for `concept`" | `mcp_milens_semantic_search({query: "concept", repo: "<workspaceRoot>"})` |
|
|
99
|
+
| "generate tests for `X`" | `mcp_milens_test_generate({symbol: "X", repo: "<workspaceRoot>"})` |
|
|
100
|
+
| "fix security issue in `X`" | `mcp_milens_fix_apply({ruleId, file, line, repo: "<workspaceRoot>"})` |
|
|
101
|
+
| "remove dead code" | `mcp_milens_find_dead_code()` then `dead_code_remove` prompt |
|
|
102
|
+
| "orchestrate/check changes" | `mcp_milens_orchestrate({repo: "<workspaceRoot>"})` |
|
|
103
|
+
| "compare impact of `X`" | `mcp_milens_compare_impact({name: "X", action: "snapshot"|"compare", repo: "<workspaceRoot>"})` |
|
|
104
|
+
| "check pre-commit" | `mcp_milens_pre_commit_check({repo: "<workspaceRoot>"})` |
|
|
105
|
+
| "save/restore context" | `mcp_milens_hook_preCompact()` / `mcp_milens_hook_postCompact()` |
|
|
106
|
+
| "scan security / audit security" | `mcp_milens_security_scan({repo: "<workspaceRoot>"})` — full audit across all 50+ rules |
|
|
107
|
+
| "end session" / "finish work" | `mcp_milens_session_end({session_id: "..."})` — record stats, trigger onSessionEnd hook |
|
|
108
|
+
| "what did session X do" | `mcp_milens_session_context({session_id: "..."})` — get annotations + tool calls |
|
|
109
|
+
| "file changed to X" | `mcp_milens_hook_onFileChange({files: ["path/to/file"], repo: "<workspaceRoot>"})` |
|
|
110
|
+
|
|
111
|
+
### Domain-aware skill triggers:
|
|
112
|
+
| User intent | Skill to load |
|
|
113
|
+
|---|---|
|
|
114
|
+
| "I'm working on authentication/security" | Load `milens-security` skill + `mcp_milens_security_scan()` |
|
|
115
|
+
| "I need to understand the parser" | Load `milens-parser` skill + `mcp_milens_get_file_symbols({file: "src/parser/"})` |
|
|
116
|
+
| "I'm debugging a server issue" | Load `milens-server` skill + `mcp_milens_trace()` |
|
|
117
|
+
| "I'm working with the database" | Load `milens-store` skill + `mcp_milens_get_file_symbols({file: "src/store/"})` |
|
|
118
|
+
| "I need to write tests for this" | Load `milens-tdd` skill + `mcp_milens_test_plan()` |
|
|
119
|
+
| "I'm planning a feature" | Load `milens-plan` skill + `mcp_milens_codebase_summary()` |
|
|
120
|
+
| "I need to refactor this" | Load `milens-refactor-clean` skill + `mcp_milens_impact()` |
|
|
121
|
+
| "Review my code changes" | Load `milens-code-review` skill + `mcp_milens_review_pr()` |
|
|
122
|
+
|
|
123
|
+
## Annotation Guide — Building a Smarter Codebase
|
|
124
|
+
|
|
125
|
+
Every time you discover something important about a symbol, annotate it. The system learns across sessions — your note today saves tokens tomorrow.
|
|
126
|
+
|
|
127
|
+
### When to annotate:
|
|
128
|
+
- Found a bug pattern? → `mcp_milens_annotate({symbol: "X", key: "bug", value: "..."})`
|
|
129
|
+
- Discovered an architecture rule? → `mcp_milens_annotate({symbol: "X", key: "architecture", value: "..."})`
|
|
130
|
+
- Learned how to test something? → `mcp_milens_annotate({symbol: "X", key: "test", value: "..."})`
|
|
131
|
+
- Found a security issue? → `mcp_milens_annotate({symbol: "X", key: "security", value: "..."})`
|
|
132
|
+
- Noted a hidden dependency? → `mcp_milens_annotate({symbol: "X", key: "dependency", value: "..."})`
|
|
133
|
+
|
|
134
|
+
### Annotation keys reference:
|
|
135
|
+
| Key | Use when | Example value |
|
|
136
|
+
|-----|----------|---------------|
|
|
137
|
+
| `bug` | Known bug, not yet fixed | "NullPointerException when users is empty array" |
|
|
138
|
+
| `security` | Security vulnerability | "No CSRF token validation on this endpoint" |
|
|
139
|
+
| `architecture` | Design pattern, constraint | "Service is a singleton — don't instantiate directly" |
|
|
140
|
+
| `test` | Testing knowledge | "Must mock Database.getConnection() before testing" |
|
|
141
|
+
| `dependency` | Hidden coupling | "Imports from deprecated module old-auth.js" |
|
|
142
|
+
| `refactor` | Future refactoring notes | "Split into validateEmail() + normalizeEmail()" |
|
|
143
|
+
| `workflow` | Process knowledge | "Must restart dev server after modifying this file" |
|
|
144
|
+
| `note` | General observation | "This function is called from cron job at 3AM" |
|
|
145
|
+
|
|
146
|
+
### Learning lifecycle:
|
|
147
|
+
1. **Session 1:** `annotate()` → confidence 0.5
|
|
148
|
+
2. **Session 2:** `recall()` sees it again → confidence 0.7
|
|
149
|
+
3. **Session 5:** confidence hits 0.8 → `milens evolve` promotes it to SKILL.md
|
|
150
|
+
|
|
151
|
+
### Annotate triggers:
|
|
152
|
+
| User says... | Tool call |
|
|
153
|
+
|---|---|
|
|
154
|
+
| "found a bug in X" | `mcp_milens_annotate({symbol: "X", key: "bug", value: "describe the bug"})` |
|
|
155
|
+
| "X has a security issue" | `mcp_milens_annotate({symbol: "X", key: "security", value: "describe the issue"})` |
|
|
156
|
+
| "learned how X works" | `mcp_milens_annotate({symbol: "X", key: "note", value: "key insight"})` |
|
|
157
|
+
| "X depends on Y internally" | `mcp_milens_annotate({symbol: "X", key: "dependency", value: "depends on Y for Z"})` |
|
|
158
|
+
| "X needs refactoring later" | `mcp_milens_annotate({symbol: "X", key: "refactor", value: "plan"})` |
|
|
159
|
+
|
|
160
|
+
### At session end, ALWAYS:
|
|
161
|
+
1. `mcp_milens_recall({})` — review annotations you found useful
|
|
162
|
+
2. `mcp_milens_annotate({symbol: "X", key: "...", value: "..."})` — save new discoveries from this session
|
|
163
|
+
|
|
164
|
+
## Problem → Solution — When You're Stuck
|
|
165
|
+
|
|
166
|
+
| You're trying to... | Do this FIRST |
|
|
167
|
+
|---|---|
|
|
168
|
+
| Understand the codebase | `mcp_milens_codebase_summary()` then `mcp_milens_domains()` |
|
|
169
|
+
| Understand a specific function | `mcp_milens_context({name: "functionName"})` |
|
|
170
|
+
| Find where something is defined | `mcp_milens_query({query: "ClassName"})` |
|
|
171
|
+
| Find ALL references to something | `mcp_milens_grep({pattern: "ClassName"})` |
|
|
172
|
+
| Check if editing is safe | `mcp_milens_impact({target: "functionName"})` |
|
|
173
|
+
| Edit with confidence | `mcp_milens_overview({name: "functionName"})` — context+impact+grep in 1 call |
|
|
174
|
+
| Know which tests to run | `mcp_milens_test_impact()` — maps changes to test files |
|
|
175
|
+
| Find what needs testing most | `mcp_milens_test_coverage_gaps()` — sorted by risk |
|
|
176
|
+
| Get a test strategy | `mcp_milens_test_plan({name: "functionName"})` — mocks + scenarios |
|
|
177
|
+
| Review your changes | `mcp_milens_review_pr()` — risk scores for changed symbols |
|
|
178
|
+
| Check for security issues | `mcp_milens_security_scan()` — 50+ rules in one call |
|
|
179
|
+
| Remove dead code safely | `mcp_milens_find_dead_code()` then use `dead_code_remove` prompt |
|
|
180
|
+
| Trace how code executes | `mcp_milens_trace({name: "functionName", direction: "to"})` |
|
|
181
|
+
| Find API endpoints | `mcp_milens_routes()` — auto-detect across 7 frameworks |
|
|
182
|
+
| See class hierarchy | `mcp_milens_get_type_hierarchy({name: "ClassName"})` |
|
|
183
|
+
| Compare impact before/after | `mcp_milens_compare_impact({name: "X", action: "snapshot"})` before, then `compare` after |
|
|
184
|
+
| Get a full picture fast | `mcp_milens_orchestrate()` — runs detect+review+impact+gaps+dead code |
|
|
185
|
+
| Remember something important | `mcp_milens_annotate({symbol: "X", key: "...", value: "..."})` |
|
|
186
|
+
| Recall past knowledge | `mcp_milens_recall({symbol: "X"})` |
|
|
187
|
+
| Start a new session properly | `mcp_milens_session_start({agent: "..."})` → `mcp_milens_recall()` → `mcp_milens_codebase_summary()` |
|
|
188
|
+
| End a session properly | `mcp_milens_detect_changes()` → `mcp_milens_review_pr()` → annotate → `mcp_milens_session_end()` |
|
|
189
|
+
| Transfer work to another agent | `mcp_milens_handoff({from_session: "...", to_agent: "...", context: "..."})` |
|
|
190
|
+
| Debug a crash / exception | `mcp_milens_trace({name: "crashingFunction"})` + `mcp_milens_context()` + `mcp_milens_impact()` |
|
|
191
|
+
|
|
192
|
+
## Session Lifecycle
|
|
193
|
+
|
|
194
|
+
### Start EVERY session:
|
|
195
|
+
1. `mcp_milens_session_start({agent: "your-agent-name"})` — register session
|
|
196
|
+
2. `mcp_milens_recall({})` — what did we learn last time?
|
|
197
|
+
3. `mcp_milens_codebase_summary()` — refresh project context in 500 tokens
|
|
198
|
+
|
|
199
|
+
### End EVERY session:
|
|
200
|
+
1. `mcp_milens_detect_changes()` — verify changes
|
|
201
|
+
2. `mcp_milens_review_pr()` — risk assessment
|
|
202
|
+
3. `mcp_milens_annotate({...})` — save key discoveries from this session
|
|
203
|
+
4. `mcp_milens_session_end({session_id: "..."})` — record stats
|
|
204
|
+
|
|
205
|
+
Milens indexes **Markdown files** (.md, .mdx) — headings become `section` symbols with parent-child hierarchy, and local links become cross-file references.
|
|
206
|
+
|
|
207
|
+
### Researching or exploring documentation:
|
|
208
|
+
1. `mcp_milens_get_file_symbols({file: "README.md", repo: "<workspaceRoot>"})` — see the full heading outline (TOC) of any doc
|
|
209
|
+
2. `mcp_milens_query({query: "<topic>"})` — search section headings across all docs and code
|
|
210
|
+
3. `mcp_milens_grep({pattern: "<keyword>", include: "**/*.md"})` — text search within docs only
|
|
211
|
+
|
|
212
|
+
### Before updating documentation:
|
|
213
|
+
1. `mcp_milens_get_file_symbols({file: "<doc.md>"})` — understand document structure first
|
|
214
|
+
2. If documenting a code symbol: `mcp_milens_context({name: "<symbolName>"})` — get full symbol info (signature, callers, deps)
|
|
215
|
+
3. `mcp_milens_grep({pattern: "<symbolName>", include: "**/*.md"})` — check if other docs already reference it
|
|
216
|
+
|
|
217
|
+
### After renaming/deleting a code symbol:
|
|
218
|
+
- `mcp_milens_grep({pattern: "<oldName>", include: "**/*.md"})` — find docs that need updating (milens indexes markdown links as cross-file references)
|
|
219
|
+
|
|
220
|
+
## Never Do
|
|
221
|
+
|
|
222
|
+
- NEVER edit a symbol without first running `mcp_milens_impact` on it.
|
|
223
|
+
- NEVER delete or rename without running both `mcp_milens_grep` and `mcp_milens_impact`.
|
|
224
|
+
- NEVER commit without running `mcp_milens_detect_changes()`.
|
|
225
|
+
- NEVER call milens MCP tools without the `repo` parameter.
|
|
226
|
+
- NEVER use `mcp_milens_query` for multi-word display text or UI labels — use `mcp_milens_grep`.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Reference
|
|
231
|
+
|
|
232
|
+
### ⭐ Core Tools — Use Every Session (8)
|
|
233
|
+
|
|
234
|
+
| Tool | Purpose |
|
|
235
|
+
|---|---|
|
|
236
|
+
| `mcp_milens_overview` | **Use this first.** Combined context + impact + grep. 1 call replaces 3-5 file reads. |
|
|
237
|
+
| `mcp_milens_impact` | Blast radius BEFORE editing. Shows what WILL BREAK. |
|
|
238
|
+
| `mcp_milens_edit_check` | Pre-edit safety: callers + exports + re-export chains + test coverage |
|
|
239
|
+
| `mcp_milens_context` | 360° view: all callers + all callees. Instant dependency graph. |
|
|
240
|
+
| `mcp_milens_query` | Find symbol definitions by name (FTS5 instant search) |
|
|
241
|
+
| `mcp_milens_grep` | Search ALL files for any text (templates, configs, docs, styles) |
|
|
242
|
+
| `mcp_milens_detect_changes` | Pre-commit: which symbols changed + dependents + risk scores |
|
|
243
|
+
| `mcp_milens_codebase_summary` | Project overview in ~500 tokens. Use instead of reading README. |
|
|
244
|
+
|
|
245
|
+
### 🔧 Situational Tools — Use When Needed (15)
|
|
246
|
+
|
|
247
|
+
| Tool | Purpose | Use when... |
|
|
248
|
+
|---|---|---|
|
|
249
|
+
| `mcp_milens_review_pr` | PR risk assessment | Before opening PR |
|
|
250
|
+
| `mcp_milens_review_symbol` | Single symbol deep-dive | Symbol is flagged CRITICAL/HIGH |
|
|
251
|
+
| `mcp_milens_test_plan` | Mock strategy + >=3 test scenarios | Writing new tests |
|
|
252
|
+
| `mcp_milens_test_coverage_gaps` | Untested symbols sorted by risk | Finding test priorities |
|
|
253
|
+
| `mcp_milens_test_impact` | Maps changes → test files | After making edits |
|
|
254
|
+
| `mcp_milens_test_generate` | Auto-generate test file | Starting tests from scratch |
|
|
255
|
+
| `mcp_milens_security_scan` | 50+ security rules | Security audit requested |
|
|
256
|
+
| `mcp_milens_trace` | Call chains from entrypoints | Debugging execution flow |
|
|
257
|
+
| `mcp_milens_routes` | Framework routes/endpoints | Finding API endpoints |
|
|
258
|
+
| `mcp_milens_smart_context` | Intent-aware context | Understand/edit/debug/test modes |
|
|
259
|
+
| `mcp_milens_domains` | Domain clusters | Understanding module structure |
|
|
260
|
+
| `mcp_milens_explain_relationship` | Shortest dependency path | How A connects to B |
|
|
261
|
+
| `mcp_milens_get_type_hierarchy` | Inheritance tree | Class/interface exploration |
|
|
262
|
+
| `mcp_milens_find_dead_code` | Unused exported symbols | Before major refactors |
|
|
263
|
+
| `mcp_milens_find_similar` | Symbols with shared callers/callees | Finding refactor patterns |
|
|
264
|
+
|
|
265
|
+
### 📚 Advanced Tools — Reference (19)
|
|
266
|
+
|
|
267
|
+
| Tool | Purpose |
|
|
268
|
+
|---|---|
|
|
269
|
+
| `mcp_milens_status` | Index health: symbols, links, files, coverage, staleness |
|
|
270
|
+
| `mcp_milens_repos` | List all indexed repositories |
|
|
271
|
+
| `mcp_milens_annotate` | Record observations about symbols (persists across sessions) |
|
|
272
|
+
| `mcp_milens_recall` | Retrieve annotations from past sessions |
|
|
273
|
+
| `mcp_milens_session_start` | Register agent session |
|
|
274
|
+
| `mcp_milens_session_end` | End session and record stats |
|
|
275
|
+
| `mcp_milens_session_context` | Get session metadata + annotations |
|
|
276
|
+
| `mcp_milens_handoff` | Transfer context between agent sessions |
|
|
277
|
+
| `mcp_milens_orchestrate` | Full cycle: detect → review → impact → gaps → dead code |
|
|
278
|
+
| `mcp_milens_pre_commit_check` | Pre-commit risk scan |
|
|
279
|
+
| `mcp_milens_compare_impact` | Compare impact graph before/after edit |
|
|
280
|
+
| `mcp_milens_semantic_search` | Hybrid FTS5 + vector search |
|
|
281
|
+
| `mcp_milens_fix_apply` | Apply security fix to a file |
|
|
282
|
+
| `mcp_milens_hook_preCompact` | Save metrics before context compaction |
|
|
283
|
+
| `mcp_milens_hook_postCompact` | Restore context after compaction |
|
|
284
|
+
| `mcp_milens_hook_onFileChange` | Trigger on file change hook |
|
|
285
|
+
| `mcp_milens_ast_explore` | Parse code to AST S-expression |
|
|
286
|
+
| `mcp_milens_test_query` | Test tree-sitter query patterns |
|
|
287
|
+
| `mcp_milens_get_file_symbols` | All symbols in a file with ref/dep counts |
|
|
288
|
+
|
|
289
|
+
### Keeping the Index Fresh
|
|
290
|
+
|
|
291
|
+
After significant code changes: `npx milens analyze -p . --force` (replace `.` with your project root if running from a different directory)
|
|
292
|
+
|
|
293
|
+
### Skills
|
|
294
|
+
|
|
295
|
+
| Task | Read this skill file |
|
|
296
|
+
|------|---------------------|
|
|
297
|
+
| General milens tools reference | `.agents/skills/milens/SKILL.md` |
|
|
298
|
+
| Work in the Adapters area | `.agents/skills/adapters/SKILL.md` |
|
|
299
|
+
| Work in the Root area | `.agents/skills/root/SKILL.md` |
|
|
300
|
+
| Work in the Apps area | `.agents/skills/apps/SKILL.md` |
|
|
301
|
+
| Work in the Docs area | `.agents/skills/docs/SKILL.md` |
|
|
302
|
+
| Work in the Test area | `.agents/skills/test/SKILL.md` |
|
|
303
|
+
| Work in the Scripts area | `.agents/skills/scripts/SKILL.md` |
|
|
304
|
+
| Work in the Analyzer area | `.agents/skills/analyzer/SKILL.md` |
|
|
305
|
+
| Work in the Orchestrator area | `.agents/skills/orchestrator/SKILL.md` |
|
|
306
|
+
| Work in the Parser area | `.agents/skills/parser/SKILL.md` |
|
|
307
|
+
| Work in the Security area | `.agents/skills/security/SKILL.md` |
|
|
308
|
+
| Work in the Server area | `.agents/skills/server/SKILL.md` |
|
|
309
|
+
| Work in the Store area | `.agents/skills/store/SKILL.md` |
|
|
310
|
+
| Work in the Ui area | `.agents/skills/ui/SKILL.md` |
|
|
311
|
+
| Execute milens-plan workflow | `.agents/skills/milens-plan/SKILL.md` |
|
|
312
|
+
| Execute milens-code-review workflow | `.agents/skills/milens-code-review/SKILL.md` |
|
|
313
|
+
| Execute milens-tdd workflow | `.agents/skills/milens-tdd/SKILL.md` |
|
|
314
|
+
| Execute milens-security-review workflow | `.agents/skills/milens-security-review/SKILL.md` |
|
|
315
|
+
| Execute milens-refactor-clean workflow | `.agents/skills/milens-refactor-clean/SKILL.md` |
|
|
316
|
+
| Execute milens-eval workflow | `.agents/skills/milens-eval/SKILL.md` |
|
|
317
|
+
| Execute milens-architect workflow | `.agents/skills/milens-architect/SKILL.md` |
|
|
318
|
+
| Execute milens-debugger workflow | `.agents/skills/milens-debugger/SKILL.md` |
|
|
319
|
+
|
|
319
320
|
<!-- milens:end -->
|