milens 0.6.5 → 0.6.7

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 (102) hide show
  1. package/.agents/skills/adapters/SKILL.md +14 -14
  2. package/.agents/skills/analyzer/SKILL.md +26 -24
  3. package/.agents/skills/apps/SKILL.md +10 -8
  4. package/.agents/skills/docs/SKILL.md +14 -8
  5. package/.agents/skills/milens/SKILL.md +164 -43
  6. package/.agents/skills/milens-security-review/SKILL.md +224 -224
  7. package/.agents/skills/orchestrator/SKILL.md +3 -1
  8. package/.agents/skills/parser/SKILL.md +16 -15
  9. package/.agents/skills/root/SKILL.md +20 -20
  10. package/.agents/skills/security/SKILL.md +1 -0
  11. package/.agents/skills/server/SKILL.md +13 -12
  12. package/.agents/skills/store/SKILL.md +12 -12
  13. package/.agents/skills/test/SKILL.md +57 -26
  14. package/README.md +170 -171
  15. package/adapters/claude-code/CLAUDE.md +36 -15
  16. package/adapters/codex/.codex/codex.md +38 -23
  17. package/adapters/copilot/.github/copilot-instructions.md +29 -22
  18. package/adapters/gemini/.gemini/context.md +33 -10
  19. package/adapters/opencode/AGENTS.md +36 -15
  20. package/dist/agents-md.d.ts.map +1 -1
  21. package/dist/agents-md.js +51 -2
  22. package/dist/agents-md.js.map +1 -1
  23. package/dist/analyzer/engine.d.ts +3 -0
  24. package/dist/analyzer/engine.d.ts.map +1 -1
  25. package/dist/analyzer/engine.js +342 -8
  26. package/dist/analyzer/engine.js.map +1 -1
  27. package/dist/analyzer/resolver.d.ts +2 -0
  28. package/dist/analyzer/resolver.d.ts.map +1 -1
  29. package/dist/analyzer/resolver.js +187 -9
  30. package/dist/analyzer/resolver.js.map +1 -1
  31. package/dist/analyzer/review.d.ts.map +1 -1
  32. package/dist/analyzer/review.js +254 -32
  33. package/dist/analyzer/review.js.map +1 -1
  34. package/dist/analyzer/scope-resolver.d.ts +42 -0
  35. package/dist/analyzer/scope-resolver.d.ts.map +1 -0
  36. package/dist/analyzer/scope-resolver.js +687 -0
  37. package/dist/analyzer/scope-resolver.js.map +1 -0
  38. package/dist/cli.js +294 -1
  39. package/dist/cli.js.map +1 -1
  40. package/dist/parser/extract.d.ts +6 -1
  41. package/dist/parser/extract.d.ts.map +1 -1
  42. package/dist/parser/extract.js +14 -2
  43. package/dist/parser/extract.js.map +1 -1
  44. package/dist/parser/lang-css.d.ts.map +1 -1
  45. package/dist/parser/lang-css.js +7 -1
  46. package/dist/parser/lang-css.js.map +1 -1
  47. package/dist/parser/lang-go.d.ts.map +1 -1
  48. package/dist/parser/lang-go.js +16 -0
  49. package/dist/parser/lang-go.js.map +1 -1
  50. package/dist/parser/lang-html.d.ts +4 -0
  51. package/dist/parser/lang-html.d.ts.map +1 -1
  52. package/dist/parser/lang-html.js +40 -1
  53. package/dist/parser/lang-html.js.map +1 -1
  54. package/dist/parser/lang-java.d.ts.map +1 -1
  55. package/dist/parser/lang-java.js +12 -0
  56. package/dist/parser/lang-java.js.map +1 -1
  57. package/dist/parser/lang-js.d.ts.map +1 -1
  58. package/dist/parser/lang-js.js +3 -0
  59. package/dist/parser/lang-js.js.map +1 -1
  60. package/dist/parser/lang-php.d.ts.map +1 -1
  61. package/dist/parser/lang-php.js +11 -0
  62. package/dist/parser/lang-php.js.map +1 -1
  63. package/dist/parser/lang-py.d.ts.map +1 -1
  64. package/dist/parser/lang-py.js +14 -0
  65. package/dist/parser/lang-py.js.map +1 -1
  66. package/dist/parser/lang-ruby.d.ts.map +1 -1
  67. package/dist/parser/lang-ruby.js +20 -0
  68. package/dist/parser/lang-ruby.js.map +1 -1
  69. package/dist/parser/lang-rust.d.ts.map +1 -1
  70. package/dist/parser/lang-rust.js +27 -4
  71. package/dist/parser/lang-rust.js.map +1 -1
  72. package/dist/parser/lang-ts.d.ts.map +1 -1
  73. package/dist/parser/lang-ts.js +3 -0
  74. package/dist/parser/lang-ts.js.map +1 -1
  75. package/dist/parser/lang-vue.d.ts +17 -1
  76. package/dist/parser/lang-vue.d.ts.map +1 -1
  77. package/dist/parser/lang-vue.js +177 -0
  78. package/dist/parser/lang-vue.js.map +1 -1
  79. package/dist/parser/language-provider.d.ts +27 -0
  80. package/dist/parser/language-provider.d.ts.map +1 -0
  81. package/dist/parser/language-provider.js +2 -0
  82. package/dist/parser/language-provider.js.map +1 -0
  83. package/dist/server/mcp.d.ts.map +1 -1
  84. package/dist/server/mcp.js +224 -50
  85. package/dist/server/mcp.js.map +1 -1
  86. package/dist/server/watcher.d.ts +8 -0
  87. package/dist/server/watcher.d.ts.map +1 -1
  88. package/dist/server/watcher.js +10 -8
  89. package/dist/server/watcher.js.map +1 -1
  90. package/dist/skills.js +163 -42
  91. package/dist/skills.js.map +1 -1
  92. package/dist/store/schema.sql +1 -1
  93. package/dist/ui/progress.d.ts +28 -0
  94. package/dist/ui/progress.d.ts.map +1 -0
  95. package/dist/ui/progress.js +100 -0
  96. package/dist/ui/progress.js.map +1 -0
  97. package/dist/uninstall.d.ts +54 -0
  98. package/dist/uninstall.d.ts.map +1 -0
  99. package/dist/uninstall.js +795 -0
  100. package/dist/uninstall.js.map +1 -0
  101. package/docs/README.md +4 -1
  102. package/package.json +1 -1
@@ -26,24 +26,24 @@ When working with code in **adapters/**, follow these mandatory safety rules:
26
26
  | See file symbols | `mcp_milens_get_file_symbols` |
27
27
 
28
28
  ## Overview
29
- Contains 30 symbols (27 exported) across 3 files.
29
+ Contains 34 symbols (31 exported) across 3 files.
30
30
 
31
31
  ## Key Symbols
32
32
  - **`Milens — Code Intelligence for Claude Code`** [section] (adapters/claude-code/CLAUDE.md:1) — 0 refs
33
- - **`Available Tools`** [section] (adapters/claude-code/CLAUDE.md:5) — 0 refs
34
- - **`Session Workflow`** [section] (adapters/claude-code/CLAUDE.md:25) — 0 refs
35
- - **`Edit Safety (Mandatory)`** [section] (adapters/claude-code/CLAUDE.md:33) — 0 refs
36
- - **`Tool Selection`** [section] (adapters/claude-code/CLAUDE.md:49) — 0 refs
37
- - **`Reference`** [section] (adapters/claude-code/CLAUDE.md:55) — 0 refs
33
+ - **`⚠️ BEFORE ANYTHING ELSE`** [section] (adapters/claude-code/CLAUDE.md:3) — 0 refs
34
+ - **`⭐ Core Tools (Use Every Session)`** [section] (adapters/claude-code/CLAUDE.md:19) — 0 refs
35
+ - **`🔧 Situational Tools (Use When Needed)`** [section] (adapters/claude-code/CLAUDE.md:32) — 0 refs
36
+ - **`Session Workflow`** [section] (adapters/claude-code/CLAUDE.md:46) — 0 refs
37
+ - **`Edit Safety (Mandatory)`** [section] (adapters/claude-code/CLAUDE.md:54) — 0 refs
38
+ - **`Tool Selection`** [section] (adapters/claude-code/CLAUDE.md:70) — 0 refs
39
+ - **`Reference`** [section] (adapters/claude-code/CLAUDE.md:76) — 0 refs
38
40
  - **`Milens — Code Intelligence for OpenCode`** [section] (adapters/opencode/AGENTS.md:1) — 0 refs
39
- - **`Available Tools`** [section] (adapters/opencode/AGENTS.md:5) — 0 refs
40
- - **`Session Workflow`** [section] (adapters/opencode/AGENTS.md:25) — 0 refs
41
- - **`Edit Safety (Mandatory)`** [section] (adapters/opencode/AGENTS.md:33) — 0 refs
42
- - **`Tool Selection`** [section] (adapters/opencode/AGENTS.md:49) — 0 refs
43
- - **`Reference`** [section] (adapters/opencode/AGENTS.md:55) — 0 refs
44
- - **`Milens Adapter Packs`** [section] (adapters/README.md:1) — 0 refs
45
- - **`What is milens?`** [section] (adapters/README.md:5) — 0 refs
46
- - **`Available Adapters`** [section] (adapters/README.md:9) — 0 refs
41
+ - **`⚠️ BEFORE ANYTHING ELSE`** [section] (adapters/opencode/AGENTS.md:3) — 0 refs
42
+ - **`⭐ Core Tools (Use Every Session)`** [section] (adapters/opencode/AGENTS.md:19) — 0 refs
43
+ - **`🔧 Situational Tools (Use When Needed)`** [section] (adapters/opencode/AGENTS.md:32) — 0 refs
44
+ - **`Session Workflow`** [section] (adapters/opencode/AGENTS.md:46) — 0 refs
45
+ - **`Edit Safety (Mandatory)`** [section] (adapters/opencode/AGENTS.md:54) — 0 refs
46
+ - **`Tool Selection`** [section] (adapters/opencode/AGENTS.md:70) — 0 refs
47
47
 
48
48
  ## Files
49
49
  - adapters/README.md
@@ -26,46 +26,47 @@ When working with code in **analyzer/**, follow these mandatory safety rules:
26
26
  | See file symbols | `mcp_milens_get_file_symbols` |
27
27
 
28
28
  ## Overview
29
- Contains 80 symbols (21 exported) across 7 files.
29
+ Contains 128 symbols (29 exported) across 8 files.
30
30
 
31
31
  ## Key Symbols
32
- - **`reviewPr`** [function] (src/analyzer/review.ts:101) — 7 refs
33
- - **`resolveLinksWithStats`** [function] (src/analyzer/resolver.ts:35) — 5 refs
34
- - **`loadAliases`** [function] (src/analyzer/config.ts:10) — 4 refs
35
- - **`analyze`** [function] (src/analyzer/engine.ts:125) — 4 refs
32
+ - **`resolveLinksWithStats`** [function] (src/analyzer/resolver.ts:37) — 9 refs
33
+ - **`reviewPr`** [function] (src/analyzer/review.ts:280) — 9 refs
34
+ - **`analyze`** [function] (src/analyzer/engine.ts:137) — 8 refs
35
+ - **`loadAliases`** [function] (src/analyzer/config.ts:10) — 6 refs
36
+ - **`ResolutionResult`** [interface] (src/analyzer/resolver.ts:24) — 6 refs
37
+ - **`diffResolutions`** [function] (src/analyzer/scope-resolver.ts:736) — 5 refs
36
38
  - **`enrichMetadata`** [function] (src/analyzer/enrich.ts:21) — 4 refs
37
39
  - **`ReviewResult`** [interface] (src/analyzer/review.ts:17) — 4 refs
38
40
  - **`scanFiles`** [function] (src/analyzer/scanner.ts:11) — 4 refs
39
- - **`resolveLinks`** [function] (src/analyzer/resolver.ts:30) — 3 refs
40
- - **`reviewSymbol`** [function] (src/analyzer/review.ts:167) — 2 refs
41
- - **`generateTestPlan`** [function] (src/analyzer/testplan.ts:104) — 2 refs
42
- - **`findCoverageGaps`** [function] (src/analyzer/testplan.ts:175) — 2 refs
43
- - **`analyzeTestImpact`** [function] (src/analyzer/testplan.ts:208) — 2 refs
44
- - **`ResolutionResult`** [interface] (src/analyzer/resolver.ts:22) — 1 refs
45
- - **`SymbolRisk`** [interface] (src/analyzer/review.ts:8) — 1 refs
46
- - **`RiskLevel`** [type] (src/analyzer/review.ts:6) — 1 refs
41
+ - **`resolveWithScopes`** [function] (src/analyzer/scope-resolver.ts:48) — 4 refs
42
+ - **`clearTreeCache`** [function] (src/analyzer/engine.ts:28) — 3 refs
43
+ - **`resolveLinks`** [function] (src/analyzer/resolver.ts:32) — 3 refs
44
+ - **`computeDiffStats`** [function] (src/analyzer/scope-resolver.ts:774) — 3 refs
45
+ - **`getCachedTree`** [function] (src/analyzer/engine.ts:25) — 2 refs
46
+ - **`reviewSymbol`** [function] (src/analyzer/review.ts:392) — 2 refs
47
47
 
48
48
  ## Entry Points
49
- - **`find`** [function] — 22 incoming references
50
- - **`resolve`** [method] — 15 incoming references
51
- - **`reviewPr`** [function] — 7 incoming references
52
- - **`resolveLinksWithStats`** [function] — 5 incoming references
53
- - **`loadAliases`** [function] — 4 incoming references
49
+ - **`resolve`** [method] — 23 incoming references
50
+ - **`find`** [function] — 14 incoming references
51
+ - **`ScopeNode`** [interface] — 11 incoming references
52
+ - **`resolveLinksWithStats`** [function] — 9 incoming references
53
+ - **`reviewPr`** [function] — 9 incoming references
54
54
 
55
55
  ## Dependencies
56
- - **parser**: `langForFile`, `supportedExtensions`, `getParser`, `loadLanguage`, `extractFromTree`, `clearQueryCache`, `extractVueScript`, `extractVueTemplateRefs` (+6 more)
56
+ - **parser**: `langForFile`, `supportedExtensions`, `getParser`, `loadLanguage`, `extractFromTree`, `clearQueryCache`, `extractVueScript`, `extractVueTemplateRefs` (+9 more)
57
57
  - **root**: `isTestFile`, `CodeSymbol`, `ExtractionResult`, `RawImport`, `RawCall`, `RawHeritage`, `RawReExport`, `RawTypeBinding` (+8 more)
58
58
  - **store**: `Database`, `TfIdfProvider`, `EmbeddingStore`, `buildEmbeddingText`, `get`, `clearFiles`, `clear`, `isFileUpToDate` (+23 more)
59
- - **test**: `parser`, `lang`
59
+ - **test**: `add`, `parser`, `lang`
60
60
 
61
61
  ## Used By
62
62
  - **root**: `loadAliases`, `analyze`, `resolve`, `clear`
63
63
  - **orchestrator**: `reviewPr`, `ReviewResult`, `SymbolRisk`
64
- - **server**: `reviewPr`, `resolve`, `find`
65
- - **test**: `enrichMetadata`, `resolveLinks`, `resolveLinksWithStats`, `reviewSymbol`, `reviewPr`, `scanFiles`, `generateTestPlan`, `findCoverageGaps` (+5 more)
64
+ - **server**: `reviewPr`, `analyze`, `resolve`, `clear`
65
+ - **test**: `analyze`, `loadAliases`, `getCachedTree`, `clearTreeCache`, `enrichMetadata`, `resolveLinksWithStats`, `resolveLinks`, `reviewSymbol` (+10 more)
66
+ - **apps**: `resolve`
66
67
  - **scripts**: `resolve`
67
- - **parser**: `find`, `resolve`
68
- - **store**: `find`, `resolve`
68
+ - **parser**: `resolve`
69
+ - **store**: `resolve`
69
70
 
70
71
  ## Files
71
72
  - src/analyzer/config.ts
@@ -74,4 +75,5 @@ Contains 80 symbols (21 exported) across 7 files.
74
75
  - src/analyzer/resolver.ts
75
76
  - src/analyzer/review.ts
76
77
  - src/analyzer/scanner.ts
78
+ - src/analyzer/scope-resolver.ts
77
79
  - src/analyzer/testplan.ts
@@ -26,7 +26,7 @@ When working with code in **apps/**, follow these mandatory safety rules:
26
26
  | See file symbols | `mcp_milens_get_file_symbols` |
27
27
 
28
28
  ## Overview
29
- Contains 38 symbols (12 exported) across 10 files.
29
+ Contains 54 symbols (12 exported) across 10 files.
30
30
 
31
31
  ## Key Symbols
32
32
  - **`Milens Desktop Dashboard`** [section] (apps/dashboard/README.md:1) — 0 refs
@@ -43,15 +43,17 @@ Contains 38 symbols (12 exported) across 10 files.
43
43
  - **`MilensRunner`** [class] (apps/github/handlers/milens-runner.js:6) — 0 refs
44
44
 
45
45
  ## Entry Points
46
- - **`createWindow`** [function] — 1 incoming references
47
- - **`__dirname`** [variable] — 1 incoming references
48
- - **`checkRateLimit`** [function] — 1 incoming references
49
- - **`getTier`** [function] — 1 incoming references
50
- - **`runMilensAnalyze`** [function] — 1 incoming references
46
+ - **`DASHBOARD_URL`** [variable] — 3 incoming references
47
+ - **`loadOverview`** [function] — 2 incoming references
48
+ - **`poll`** [function] — 2 incoming references
49
+ - **`__dirname`** [variable] — 2 incoming references
50
+ - **`setStatus`** [function] — 1 incoming references
51
51
 
52
52
  ## Dependencies
53
- - **store**: `remove`, `Database`, `getCodebaseSummary`, `close`
54
- - **test**: `dbPath`
53
+ - **store**: `remove`, `getAnnotations`, `Database`, `getCodebaseSummary`, `close`
54
+ - **test**: `add`, `dbPath`
55
+ - **orchestrator**: `e`
56
+ - **analyzer**: `resolve`
55
57
 
56
58
  ## Files
57
59
  - apps/dashboard/README.md
@@ -26,9 +26,16 @@ When working with code in **docs/**, follow these mandatory safety rules:
26
26
  | See file symbols | `mcp_milens_get_file_symbols` |
27
27
 
28
28
  ## Overview
29
- Contains 129 symbols (109 exported) across 18 files.
29
+ Contains 187 symbols (162 exported) across 23 files.
30
30
 
31
31
  ## Key Symbols
32
+ - **`Accuracy Engine`** [section] (docs/accuracy.md:1) — 0 refs
33
+ - **`Type Bindings`** [section] (docs/accuracy.md:5) — 0 refs
34
+ - **`Method Resolution Order (MRO)`** [section] (docs/accuracy.md:29) — 0 refs
35
+ - **`C3 Linearization Example (Diamond)`** [section] (docs/accuracy.md:45) — 0 refs
36
+ - **`Import Semantics`** [section] (docs/accuracy.md:59) — 0 refs
37
+ - **`Accuracy Fixtures`** [section] (docs/accuracy.md:69) — 0 refs
38
+ - **`Dual-Path Resolution`** [section] (docs/accuracy.md:86) — 0 refs
32
39
  - **`Adapter Packs`** [section] (docs/adapters.md:1) — 0 refs
33
40
  - **`Available Adapters`** [section] (docs/adapters.md:5) — 0 refs
34
41
  - **`Quick Install`** [section] (docs/adapters.md:17) — 0 refs
@@ -37,13 +44,6 @@ Contains 129 symbols (109 exported) across 18 files.
37
44
  - **`Cursor`** [section] (docs/adapters.md:36) — 0 refs
38
45
  - **`GitHub Copilot`** [section] (docs/adapters.md:42) — 0 refs
39
46
  - **`Codex`** [section] (docs/adapters.md:48) — 0 refs
40
- - **`Gemini`** [section] (docs/adapters.md:54) — 0 refs
41
- - **`Zed`** [section] (docs/adapters.md:60) — 0 refs
42
- - **`Automated Install`** [section] (docs/adapters.md:66) — 0 refs
43
- - **`Profile Selection`** [section] (docs/adapters.md:74) — 0 refs
44
- - **`MCP Config Reference`** [section] (docs/adapters.md:86) — 0 refs
45
- - **`Milens Pricing`** [section] (docs/pricing.md:1) — 0 refs
46
- - **`Why Pay?`** [section] (docs/pricing.md:7) — 0 refs
47
47
 
48
48
  ## Entry Points
49
49
  - **`applyFilters`** [function] — 1 incoming references
@@ -51,20 +51,26 @@ Contains 129 symbols (109 exported) across 18 files.
51
51
 
52
52
  ## Dependencies
53
53
  - **store**: `remove`
54
+ - **test**: `add`
54
55
 
55
56
  ## Files
56
57
  - docs/README.md
58
+ - docs/accuracy.md
57
59
  - docs/adapters.html
58
60
  - docs/adapters.md
59
61
  - docs/changelog.html
62
+ - docs/cli.md
60
63
  - docs/compare.html
61
64
  - docs/github-app.html
62
65
  - docs/index.html
66
+ - docs/languages.md
63
67
  - docs/learning.html
68
+ - docs/milens-upgrade.md
64
69
  - docs/platforms.html
65
70
  - docs/pricing.html
66
71
  - docs/pricing.md
67
72
  - docs/quickstart.md
73
+ - docs/review.md
68
74
  - docs/scenarios.html
69
75
  - docs/security-presets.md
70
76
  - docs/security.html
@@ -6,12 +6,29 @@ description: Code intelligence MCP tools — symbol search, text grep, impact an
6
6
  <!-- milens:start -->
7
7
  # Milens — AI-DOS
8
8
 
9
- The Operating System for AI-Driven Development. This project is indexed by milens (1048 symbols, 1771 links, 129 files).
9
+ The Operating System for AI-Driven Development. This project is indexed by milens (1363 symbols, 2273 links, 165 files).
10
10
 
11
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
12
 
13
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
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
+
15
32
  ## Mandatory Workflows
16
33
 
17
34
  These are **hard pre-conditions**, not guidelines. Execute them automatically without asking.
@@ -49,6 +66,8 @@ These are **hard pre-conditions**, not guidelines. Execute them automatically wi
49
66
  ### When in doubt → use `mcp_milens_grep` first
50
67
  `grep` searches everything. `query` only searches indexed symbol definitions.
51
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
+
52
71
  ## Workflow Triggers
53
72
 
54
73
  When the user says... → do this FIRST:
@@ -89,7 +108,99 @@ When the user says... → do this FIRST:
89
108
  | "what did session X do" | `mcp_milens_session_context({session_id: "..."})` — get annotations + tool calls |
90
109
  | "file changed to X" | `mcp_milens_hook_onFileChange({files: ["path/to/file"], repo: "<workspaceRoot>"})` |
91
110
 
92
- ## Documentation Workflows
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
93
204
 
94
205
  Milens indexes **Markdown files** (.md, .mdx) — headings become `section` symbols with parent-child hierarchy, and local links become cross-file references.
95
206
 
@@ -118,52 +229,62 @@ Milens indexes **Markdown files** (.md, .mdx) — headings become `section` symb
118
229
 
119
230
  ## Reference
120
231
 
121
- ### Tools
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)
122
266
 
123
267
  | Tool | Purpose |
124
268
  |---|---|
125
- | `mcp_milens_query` | Find symbol definitions by name (FTS5) |
126
- | `mcp_milens_grep` | Text search ALL files (templates, styles, configs, docs) |
127
- | `mcp_milens_context` | 360° view: incoming refs + outgoing deps |
128
- | `mcp_milens_impact` | Blast radius before editing |
129
- | `mcp_milens_detect_changes` | Pre-commit scope check |
130
- | `mcp_milens_explain_relationship` | Shortest path between two symbols |
131
- | `mcp_milens_get_file_symbols` | All symbols in a file |
132
- | `mcp_milens_get_type_hierarchy` | Class inheritance tree |
133
- | `mcp_milens_find_dead_code` | Unused exported symbols |
134
- | `mcp_milens_status` | Index stats for a repository: symbols, links, files, coverage %, staleness |
135
- | `mcp_milens_edit_check` | Pre-edit safety: callers + export status + re-export chains + test coverage |
136
- | `mcp_milens_trace` | Execution flow: call chains from entrypoints to a symbol |
137
- | `mcp_milens_routes` | Detect framework routes/endpoints (Express, FastAPI, NestJS, etc.) |
138
- | `mcp_milens_smart_context` | Intent-aware context: understand/edit/debug/test |
139
- | `mcp_milens_overview` | Combined context + impact + grep in ONE call. Preferred before editing/deleting/renaming a symbol. |
140
- | `mcp_milens_domains` | Domain clusters: groups of files forming logical modules |
141
- | `mcp_milens_repos` | List all indexed repositories with summary stats |
142
- | `mcp_milens_ast_explore` | Explore raw AST structure of a code file |
143
- | `mcp_milens_test_query` | Run a tree-sitter query against a code snippet and return matched nodes with capture names |
144
- | `mcp_milens_review_pr` | PR risk assessment: scores changed symbols by blast radius + test coverage |
145
- | `mcp_milens_review_symbol` | Single symbol risk: role, heat, dependents, test status |
146
- | `mcp_milens_test_plan` | Dependency-aware test plan: mocks, strategies, suggested tests |
147
- | `mcp_milens_test_coverage_gaps` | Untested exported symbols sorted by risk |
148
- | `mcp_milens_test_impact` | Which tests to run for current changes |
149
- | `mcp_milens_annotate` | Store observation/note about a symbol (persists across sessions) |
150
- | `mcp_milens_recall` | Retrieve annotations (filter by symbol, key, agent, session) |
151
- | `mcp_milens_session_start` | Register agent session for multi-agent coordination |
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 |
152
275
  | `mcp_milens_session_context` | Get session metadata + annotations |
153
276
  | `mcp_milens_handoff` | Transfer context between agent sessions |
154
- | `mcp_milens_codebase_summary` | High-level bootstrapping context: domains, key symbols, coverage |
155
- | `mcp_milens_semantic_search` | Hybrid FTS5 + vector search (requires --embeddings) |
156
- | `mcp_milens_find_similar` | Find symbols similar by embedding proximity |
157
- | `mcp_milens_compare_impact` | Compare impact graph before/after edit — detects regressions |
158
- | `mcp_milens_orchestrate` | Run full orchestration cycle: detect_changes review_pr → impact → coverage gaps → dead code → action plan |
159
- | `mcp_milens_fix_apply` | Apply a security fix to a file (creates backup) |
160
- | `mcp_milens_test_generate` | Auto-generate test file: detects framework (vitest/jest/mocha/pytest) and writes complete test with mock strategy |
161
- | `mcp_milens_pre_commit_check` | Pre-commit risk scan: review_pr + dead code + coverage gaps |
162
- | `mcp_milens_hook_preCompact` | Save metrics snapshot before context compaction |
163
- | `mcp_milens_hook_postCompact` | Restore context by recalling annotations after compaction |
164
- | `mcp_milens_session_end` | End a session and record its stats. Use at the end of every session. |
165
- | `mcp_milens_hook_onFileChange` | Trigger the onFileChange hook. Call when files are modified to get impact summary. |
166
- | `mcp_milens_security_scan` | Scan codebase for security vulnerabilities using 50+ built-in rules. Replaces multiple manual grep() calls. |
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 |
167
288
 
168
289
  ### Keeping the Index Fresh
169
290