milens 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.agents/skills/adapters/SKILL.md +51 -0
  2. package/.agents/skills/analyzer/SKILL.md +77 -0
  3. package/.agents/skills/apps/SKILL.md +66 -0
  4. package/.agents/skills/docs/SKILL.md +73 -0
  5. package/.agents/skills/milens/SKILL.md +198 -0
  6. package/.agents/skills/milens-architect/SKILL.md +128 -0
  7. package/.agents/skills/milens-code-review/SKILL.md +186 -0
  8. package/.agents/skills/milens-debugger/SKILL.md +141 -0
  9. package/.agents/skills/milens-eval/SKILL.md +221 -0
  10. package/.agents/skills/milens-plan/SKILL.md +227 -0
  11. package/.agents/skills/milens-refactor-clean/SKILL.md +209 -0
  12. package/.agents/skills/milens-security-review/SKILL.md +224 -0
  13. package/.agents/skills/milens-tdd/SKILL.md +156 -0
  14. package/.agents/skills/orchestrator/SKILL.md +59 -0
  15. package/.agents/skills/parser/SKILL.md +81 -0
  16. package/.agents/skills/root/SKILL.md +86 -0
  17. package/.agents/skills/scripts/SKILL.md +45 -0
  18. package/.agents/skills/security/SKILL.md +65 -0
  19. package/.agents/skills/server/SKILL.md +72 -0
  20. package/.agents/skills/store/SKILL.md +75 -0
  21. package/.agents/skills/test/SKILL.md +121 -0
  22. package/LICENSE +21 -75
  23. package/README.md +356 -453
  24. package/adapters/README.md +107 -0
  25. package/adapters/claude-code/.claude/mcp.json +9 -0
  26. package/adapters/claude-code/CLAUDE.md +58 -0
  27. package/adapters/codex/.codex/codex.md +52 -0
  28. package/adapters/copilot/.github/copilot-instructions.md +62 -0
  29. package/adapters/cursor/.cursorrules +9 -0
  30. package/adapters/gemini/.gemini/context.md +58 -0
  31. package/adapters/opencode/.opencode/config.json +9 -0
  32. package/adapters/opencode/AGENTS.md +58 -0
  33. package/adapters/zed/.zed/settings.json +8 -0
  34. package/dist/agents-md.d.ts +3 -0
  35. package/dist/agents-md.d.ts.map +1 -0
  36. package/dist/agents-md.js +114 -0
  37. package/dist/agents-md.js.map +1 -0
  38. package/dist/analyzer/engine.d.ts +1 -0
  39. package/dist/analyzer/engine.d.ts.map +1 -1
  40. package/dist/analyzer/engine.js +37 -7
  41. package/dist/analyzer/engine.js.map +1 -1
  42. package/dist/cli.js +1472 -406
  43. package/dist/cli.js.map +1 -1
  44. package/dist/metrics.d.ts +51 -0
  45. package/dist/metrics.d.ts.map +1 -0
  46. package/dist/metrics.js +64 -0
  47. package/dist/metrics.js.map +1 -0
  48. package/dist/orchestrator/orchestrator.d.ts +65 -0
  49. package/dist/orchestrator/orchestrator.d.ts.map +1 -0
  50. package/dist/orchestrator/orchestrator.js +178 -0
  51. package/dist/orchestrator/orchestrator.js.map +1 -0
  52. package/dist/orchestrator/reporter.d.ts +15 -0
  53. package/dist/orchestrator/reporter.d.ts.map +1 -0
  54. package/dist/orchestrator/reporter.js +38 -0
  55. package/dist/orchestrator/reporter.js.map +1 -0
  56. package/dist/parser/lang-go.js +47 -47
  57. package/dist/parser/lang-java.js +29 -29
  58. package/dist/parser/lang-js.js +105 -105
  59. package/dist/parser/lang-php.js +38 -38
  60. package/dist/parser/lang-py.js +34 -34
  61. package/dist/parser/lang-ruby.js +14 -14
  62. package/dist/parser/lang-rust.js +30 -30
  63. package/dist/parser/lang-ts.js +191 -191
  64. package/dist/security/deps.d.ts +38 -0
  65. package/dist/security/deps.d.ts.map +1 -0
  66. package/dist/security/deps.js +685 -0
  67. package/dist/security/deps.js.map +1 -0
  68. package/dist/security/rules.d.ts +42 -0
  69. package/dist/security/rules.d.ts.map +1 -0
  70. package/dist/security/rules.js +943 -0
  71. package/dist/security/rules.js.map +1 -0
  72. package/dist/server/hooks.d.ts +29 -0
  73. package/dist/server/hooks.d.ts.map +1 -0
  74. package/dist/server/hooks.js +332 -0
  75. package/dist/server/hooks.js.map +1 -0
  76. package/dist/server/mcp-prompts.d.ts +277 -0
  77. package/dist/server/mcp-prompts.d.ts.map +1 -0
  78. package/dist/server/mcp-prompts.js +627 -0
  79. package/dist/server/mcp-prompts.js.map +1 -0
  80. package/dist/server/mcp.d.ts.map +1 -1
  81. package/dist/server/mcp.js +1030 -652
  82. package/dist/server/mcp.js.map +1 -1
  83. package/dist/server/test-plan.d.ts +20 -0
  84. package/dist/server/test-plan.d.ts.map +1 -0
  85. package/dist/server/test-plan.js +100 -0
  86. package/dist/server/test-plan.js.map +1 -0
  87. package/dist/server/watcher.d.ts +39 -0
  88. package/dist/server/watcher.d.ts.map +1 -0
  89. package/dist/server/watcher.js +134 -0
  90. package/dist/server/watcher.js.map +1 -0
  91. package/dist/skills.js +197 -153
  92. package/dist/skills.js.map +1 -1
  93. package/dist/store/annotations.d.ts +41 -0
  94. package/dist/store/annotations.d.ts.map +1 -0
  95. package/dist/store/annotations.js +195 -0
  96. package/dist/store/annotations.js.map +1 -0
  97. package/dist/store/confidence.d.ts +28 -0
  98. package/dist/store/confidence.d.ts.map +1 -0
  99. package/dist/store/confidence.js +109 -0
  100. package/dist/store/confidence.js.map +1 -0
  101. package/dist/store/db.d.ts +53 -14
  102. package/dist/store/db.d.ts.map +1 -1
  103. package/dist/store/db.js +447 -240
  104. package/dist/store/db.js.map +1 -1
  105. package/dist/store/schema.sql +143 -116
  106. package/dist/store/vectors.js +2 -2
  107. package/dist/types.d.ts +101 -0
  108. package/dist/types.d.ts.map +1 -1
  109. package/docs/README.md +22 -0
  110. package/package.json +81 -66
  111. package/dist/gateway/analyzer.d.ts +0 -6
  112. package/dist/gateway/analyzer.d.ts.map +0 -1
  113. package/dist/gateway/analyzer.js +0 -218
  114. package/dist/gateway/analyzer.js.map +0 -1
  115. package/dist/gateway/cache.d.ts +0 -35
  116. package/dist/gateway/cache.d.ts.map +0 -1
  117. package/dist/gateway/cache.js +0 -175
  118. package/dist/gateway/cache.js.map +0 -1
  119. package/dist/gateway/config.d.ts +0 -10
  120. package/dist/gateway/config.d.ts.map +0 -1
  121. package/dist/gateway/config.js +0 -167
  122. package/dist/gateway/config.js.map +0 -1
  123. package/dist/gateway/context-memory.d.ts +0 -68
  124. package/dist/gateway/context-memory.d.ts.map +0 -1
  125. package/dist/gateway/context-memory.js +0 -157
  126. package/dist/gateway/context-memory.js.map +0 -1
  127. package/dist/gateway/observability.d.ts +0 -83
  128. package/dist/gateway/observability.d.ts.map +0 -1
  129. package/dist/gateway/observability.js +0 -152
  130. package/dist/gateway/observability.js.map +0 -1
  131. package/dist/gateway/privacy.d.ts +0 -27
  132. package/dist/gateway/privacy.d.ts.map +0 -1
  133. package/dist/gateway/privacy.js +0 -139
  134. package/dist/gateway/privacy.js.map +0 -1
  135. package/dist/gateway/providers.d.ts +0 -66
  136. package/dist/gateway/providers.d.ts.map +0 -1
  137. package/dist/gateway/providers.js +0 -377
  138. package/dist/gateway/providers.js.map +0 -1
  139. package/dist/gateway/router.d.ts +0 -18
  140. package/dist/gateway/router.d.ts.map +0 -1
  141. package/dist/gateway/router.js +0 -102
  142. package/dist/gateway/router.js.map +0 -1
  143. package/dist/gateway/server.d.ts +0 -20
  144. package/dist/gateway/server.d.ts.map +0 -1
  145. package/dist/gateway/server.js +0 -387
  146. package/dist/gateway/server.js.map +0 -1
  147. package/dist/gateway/translator.d.ts +0 -19
  148. package/dist/gateway/translator.d.ts.map +0 -1
  149. package/dist/gateway/translator.js +0 -340
  150. package/dist/gateway/translator.js.map +0 -1
  151. package/dist/gateway/types.d.ts +0 -215
  152. package/dist/gateway/types.d.ts.map +0 -1
  153. package/dist/gateway/types.js +0 -3
  154. package/dist/gateway/types.js.map +0 -1
  155. package/dist/store/gateway-schema.sql +0 -53
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: milens-tdd
3
+ description: Test-Driven Development with Code Intelligence — find gaps, generate test plans, implement, and verify
4
+ ---
5
+
6
+ # milens-tdd — Test-Driven Development with Code Intelligence
7
+
8
+ Identify untested symbols ranked by risk, generate targeted test strategies, implement tests, and verify coverage.
9
+
10
+ ## Tools Required
11
+
12
+ | Tool | Purpose |
13
+ |---|---|
14
+ | `mcp_milens_test_coverage_gaps` | Find untested symbols sorted by risk |
15
+ | `mcp_milens_test_plan` | Generate mock strategy and test scenarios for a symbol |
16
+ | `mcp_milens_test_impact` | Identify affected test files after changes |
17
+ | `mcp_milens_review_pr` | Post-change quality check for CRITICAL issues |
18
+
19
+ > **CRITICAL:** All milens MCP tool calls MUST include the `repo` parameter set to the **absolute path of the workspace root**.
20
+
21
+ ## Workflow
22
+
23
+ ### Step 1: Identify Untested Symbols
24
+
25
+ Start by finding symbols with no test coverage, sorted by risk (hotspots first).
26
+
27
+ ```
28
+ mcp_milens_test_coverage_gaps({repo: "<workspaceRoot>", limit: 10})
29
+ ```
30
+
31
+ Review the output:
32
+ - **HIGH risk symbols** — complex logic, high fan-in, many dependents. Prioritize these.
33
+ - **MEDIUM risk symbols** — moderate complexity, some dependents.
34
+ - **LOW risk symbols** — simple getters, one-liners. Lowest priority.
35
+
36
+ ### Step 2: Generate Test Plans
37
+
38
+ For each high-risk symbol identified in Step 1, request a test plan.
39
+
40
+ ```
41
+ mcp_milens_test_plan({name: "<symbolName>", repo: "<workspaceRoot>"})
42
+ ```
43
+
44
+ The test plan provides:
45
+ - **Mock strategy** — what to stub, what to isolate
46
+ - **3+ test scenarios** — happy path, edge cases, error states
47
+ - **Setup requirements** — dependencies to initialize
48
+ - **Expected assertions** — what each test should verify
49
+
50
+ ### Step 3: Implement Tests
51
+
52
+ Write test files based on the test plan output:
53
+
54
+ 1. Check if test files already exist for the module
55
+ 2. Follow existing test patterns in the codebase (frameworks, conventions, helper utilities)
56
+ 3. Implement each test scenario from the plan
57
+ 4. Keep tests focused — one behavior per test
58
+
59
+ ### Step 4: Verify Test Impact
60
+
61
+ After writing tests, confirm which test files changed and should run.
62
+
63
+ ```
64
+ mcp_milens_test_impact({repo: "<workspaceRoot>"})
65
+ ```
66
+
67
+ This lists all test files affected by the current changes. Run those tests to validate.
68
+
69
+ ### Step 5: Quality Check
70
+
71
+ Run the PR review to catch any CRITICAL issues before committing.
72
+
73
+ ```
74
+ mcp_milens_review_pr({repo: "<workspaceRoot>"})
75
+ ```
76
+
77
+ Address any CRITICAL or HIGH findings before completing the cycle.
78
+
79
+ ## Example Session
80
+
81
+ ### Input
82
+
83
+ ```
84
+ "add tests for the resolveLinks function"
85
+ ```
86
+
87
+ ### Tool Calls
88
+
89
+ **Step 1 — Find gaps:**
90
+ ```
91
+ mcp_milens_test_coverage_gaps({repo: "/home/user/project", limit: 10})
92
+ ```
93
+
94
+ **Output:**
95
+ ```
96
+ Coverage Gaps (untested exported symbols):
97
+ 1. resolveLinks [function] — HIGH risk (12 dependents, 8 callers)
98
+ 2. parseConfig [function] — MEDIUM risk (5 dependents)
99
+ 3. formatOutput [function] — LOW risk (1 dependent)
100
+ ...
101
+ ```
102
+
103
+ **Step 2 — Test plan for high-risk:**
104
+ ```
105
+ mcp_milens_test_plan({name: "resolveLinks", repo: "/home/user/project"})
106
+ ```
107
+
108
+ **Output:**
109
+ ```
110
+ Test Plan for resolveLinks:
111
+ Mock strategy: stub loadAliases, stub database queries
112
+ Tests:
113
+ 1. resolves direct links between two symbols
114
+ 2. handles circular dependency chain gracefully
115
+ 3. returns empty array when no links found
116
+ 4. throws on malformed symbol data
117
+ Setup: import SymbolLink from '@/types', mock store layer
118
+ ```
119
+
120
+ **Step 3 — Implement tests** in `src/__tests__/resolver.test.ts`
121
+
122
+ **Step 4 — Verify:**
123
+ ```
124
+ mcp_milens_test_impact({repo: "/home/user/project"})
125
+ ```
126
+
127
+ **Output:**
128
+ ```
129
+ Affected test files:
130
+ src/__tests__/resolver.test.ts (new)
131
+ src/__tests__/analyzer.test.ts (modified, re-export impact)
132
+ ```
133
+
134
+ **Step 5 — Quality:**
135
+ ```
136
+ mcp_milens_review_pr({repo: "/home/user/project"})
137
+ ```
138
+
139
+ **Output:** No CRITICAL issues. 2 LOW suggestions.
140
+
141
+ ## Best Practices
142
+
143
+ 1. **Prioritize by risk, not alphabetically.** A HIGH-risk utility with 50 callers matters more than a LOW-risk getter nobody uses.
144
+ 2. **Don't test implementation details.** Follow the test plan's mock strategy — stub at module boundaries, not internal functions.
145
+ 3. **One behavior per test.** Each test should verify a single scenario (happy path, edge case, error) with a descriptive name.
146
+ 4. **Verify before commit.** Always run Step 4 (`test_impact`) and Step 5 (`review_pr`) before merging. Don't skip the quality gate.
147
+ 5. **Re-check gaps after large refactors.** A refactor can move symbols from "tested" back to "untested."
148
+
149
+ ## Quality Gate
150
+
151
+ | Criteria | Pass | Fail |
152
+ |---|---|---|
153
+ | Test coverage gaps | HIGH-risk symbols have tests | HIGH-risk symbols still uncovered after session |
154
+ | Test plan adherence | ≥3 scenarios implemented per symbol | Tests don't match plan scenarios |
155
+ | Test impact verification | All affected test files pass | Any test file fails |
156
+ | PR review | No CRITICAL issues | Unresolved CRITICAL issues remain |
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: milens-orchestrator
3
+ description: Code intelligence for the orchestrator area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Orchestrator
7
+
8
+ ## Working with this area
9
+ When working with code in **orchestrator/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 22 symbols (7 exported) across 2 files.
30
+
31
+ ## Key Symbols
32
+ - **`Orchestrator`** [class] (src/orchestrator/orchestrator.ts:36) — 6 refs
33
+ - **`OrchestratorReport`** [interface] (src/orchestrator/reporter.ts:4) — 5 refs
34
+ - **`formatReport`** [function] (src/orchestrator/reporter.ts:17) — 4 refs
35
+ - **`OrchestratorConfig`** [interface] (src/orchestrator/orchestrator.ts:10) — 2 refs
36
+ - **`ImpactSnapshot`** [interface] (src/orchestrator/orchestrator.ts:18) — 2 refs
37
+ - **`ReportOptions`** [interface] (src/orchestrator/reporter.ts:13) — 2 refs
38
+ - **`ImpactDiff`** [interface] (src/orchestrator/orchestrator.ts:25) — 1 refs
39
+
40
+ ## Entry Points
41
+ - **`Orchestrator`** [class] — 6 incoming references
42
+ - **`OrchestratorReport`** [interface] — 5 incoming references
43
+ - **`formatReport`** [function] — 4 incoming references
44
+ - **`snapshot`** [method] — 3 incoming references
45
+ - **`run`** [method] — 3 incoming references
46
+
47
+ ## Dependencies
48
+ - **store**: `Database`, `findSymbolByName`, `findUpstream`, `clear`, `getTestCoverageGaps`, `findDeadCode`, `close`
49
+ - **analyzer**: `reviewPr`, `ReviewResult`, `SymbolRisk`
50
+ - **root**: `CodeSymbol`, `has`
51
+
52
+ ## Used By
53
+ - **root**: `Orchestrator`, `subscribe`, `runAndFormat`
54
+ - **server**: `Orchestrator`, `snapshot`, `compare`, `runAndFormat`
55
+ - **test**: `Orchestrator`, `formatReport`, `OrchestratorReport`, `subscribe`, `run`, `snapshot`, `compare`, `cancel` (+3 more)
56
+
57
+ ## Files
58
+ - src/orchestrator/orchestrator.ts
59
+ - src/orchestrator/reporter.ts
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: milens-parser
3
+ description: Code intelligence for the parser area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Parser
7
+
8
+ ## Working with this area
9
+ When working with code in **parser/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 76 symbols (26 exported) across 15 files.
30
+
31
+ ## Key Symbols
32
+ - **`LangSpec`** [interface] (src/parser/extract.ts:6) — 30 refs
33
+ - **`loadLanguage`** [function] (src/parser/loader.ts:21) — 14 refs
34
+ - **`getParser`** [function] (src/parser/loader.ts:32) — 13 refs
35
+ - **`extractFromTree`** [function] (src/parser/extract.ts:250) — 8 refs
36
+ - **`supportedExtensions`** [function] (src/parser/languages.ts:29) — 6 refs
37
+ - **`extractHtmlScripts`** [function] (src/parser/lang-html.ts:33) — 5 refs
38
+ - **`extractMarkdown`** [function] (src/parser/lang-md.ts:34) — 5 refs
39
+ - **`spec`** [variable] (src/parser/lang-ts.ts:5) — 5 refs
40
+ - **`extractVueScript`** [function] (src/parser/lang-vue.ts:18) — 5 refs
41
+ - **`initTreeSitter`** [function] (src/parser/loader.ts:15) — 5 refs
42
+ - **`clearQueryCache`** [function] (src/parser/extract.ts:67) — 4 refs
43
+ - **`extractHtmlRefs`** [function] (src/parser/lang-html.ts:52) — 4 refs
44
+ - **`extractVueTemplateRefs`** [function] (src/parser/lang-vue.ts:37) — 4 refs
45
+ - **`langForFile`** [function] (src/parser/languages.ts:24) — 4 refs
46
+ - **`spec`** [variable] (src/parser/lang-js.ts:5) — 3 refs
47
+
48
+ ## Entry Points
49
+ - **`LangSpec`** [interface] — 30 incoming references
50
+ - **`loadLanguage`** [function] — 14 incoming references
51
+ - **`getParser`** [function] — 13 incoming references
52
+ - **`extractFromTree`** [function] — 8 incoming references
53
+ - **`supportedExtensions`** [function] — 6 incoming references
54
+
55
+ ## Dependencies
56
+ - **root**: `CodeSymbol`, `RawImport`, `RawCall`, `RawHeritage`, `RawReExport`, `RawTypeBinding`, `RawAssignmentBinding`, `RawReturnType` (+4 more)
57
+ - **test**: `lang`, `parser`
58
+ - **analyzer**: `find`, `resolve`
59
+ - **store**: `load`
60
+
61
+ ## Used By
62
+ - **analyzer**: `langForFile`, `supportedExtensions`, `getParser`, `loadLanguage`, `extractFromTree`, `clearQueryCache`, `extractVueScript`, `extractVueTemplateRefs` (+6 more)
63
+ - **server**: `getParser`, `loadLanguage`, `ALL_LANGS`
64
+ - **test**: `getParser`, `loadLanguage`, `extractFromTree`, `extractVueScript`, `extractVueTemplateRefs`, `spec`, `extractHtmlScripts`, `extractHtmlRefs` (+7 more)
65
+
66
+ ## Files
67
+ - src/parser/extract.ts
68
+ - src/parser/lang-css.ts
69
+ - src/parser/lang-go.ts
70
+ - src/parser/lang-html.ts
71
+ - src/parser/lang-java.ts
72
+ - src/parser/lang-js.ts
73
+ - src/parser/lang-md.ts
74
+ - src/parser/lang-php.ts
75
+ - src/parser/lang-py.ts
76
+ - src/parser/lang-ruby.ts
77
+ - src/parser/lang-rust.ts
78
+ - src/parser/lang-ts.ts
79
+ - src/parser/lang-vue.ts
80
+ - src/parser/languages.ts
81
+ - src/parser/loader.ts
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: milens-root
3
+ description: Code intelligence for the root area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Root
7
+
8
+ ## Working with this area
9
+ When working with code in **root/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 198 symbols (147 exported) across 13 files.
30
+
31
+ ## Key Symbols
32
+ - **`CodeSymbol`** [interface] (src/types.ts:8) — 41 refs
33
+ - **`SymbolLink`** [interface] (src/types.ts:26) — 21 refs
34
+ - **`isTestFile`** [function] (src/utils.ts:2) — 11 refs
35
+ - **`RawCall`** [interface] (src/types.ts:44) — 7 refs
36
+ - **`RawImport`** [interface] (src/types.ts:35) — 6 refs
37
+ - **`ExtractionResult`** [interface] (src/types.ts:60) — 6 refs
38
+ - **`generateAgentsMd`** [function] (src/agents-md.ts:43) — 4 refs
39
+ - **`computeMetrics`** [function] (src/metrics.ts:21) — 4 refs
40
+ - **`formatMetricsReport`** [function] (src/metrics.ts:62) — 4 refs
41
+ - **`MilensMetrics`** [interface] (src/metrics.ts:4) — 4 refs
42
+ - **`generateSkills`** [function] (src/skills.ts:19) — 4 refs
43
+ - **`RawHeritage`** [interface] (src/types.ts:52) — 4 refs
44
+ - **`RawTypeBinding`** [interface] (src/types.ts:80) — 4 refs
45
+ - **`RawAssignmentBinding`** [interface] (src/types.ts:88) — 4 refs
46
+ - **`RawReturnType`** [interface] (src/types.ts:96) — 4 refs
47
+
48
+ ## Entry Points
49
+ - **`CodeSymbol`** [interface] — 41 incoming references
50
+ - **`has`** [function] — 29 incoming references
51
+ - **`SymbolLink`** [interface] — 21 incoming references
52
+ - **`isTestFile`** [function] — 11 incoming references
53
+ - **`RawCall`** [interface] — 7 incoming references
54
+
55
+ ## Dependencies
56
+ - **store**: `Database`, `RepoRegistry`, `AnnotationStore`, `runDecayPass`, `getIncomingLinks`, `getAllSymbols`, `getCodebaseSummary`, `register` (+25 more)
57
+ - **analyzer**: `loadAliases`, `analyze`, `resolve`, `clear`
58
+ - **server**: `startHttp`, `startStdio`, `HookManager`, `get`, `enableHook`, `loadConfig`, `saveConfig`, `disableHook`
59
+ - **security**: `loadRules`, `auditDependencies`
60
+ - **orchestrator**: `Orchestrator`, `subscribe`, `runAndFormat`
61
+ - **scripts**: `outDir`
62
+ - **test**: `dbPath`
63
+
64
+ ## Used By
65
+ - **analyzer**: `isTestFile`, `CodeSymbol`, `ExtractionResult`, `RawImport`, `RawCall`, `RawHeritage`, `RawReExport`, `RawTypeBinding` (+8 more)
66
+ - **orchestrator**: `CodeSymbol`, `has`
67
+ - **parser**: `CodeSymbol`, `RawImport`, `RawCall`, `RawHeritage`, `RawReExport`, `RawTypeBinding`, `RawAssignmentBinding`, `RawReturnType` (+4 more)
68
+ - **store**: `Annotation`, `AnnotationKey`, `Session`, `EvolutionEvent`, `CodeSymbol`, `SymbolLink`, `RepoEntry`, `has` (+1 more)
69
+ - **test**: `generateAgentsMd`, `AnnotationKey`, `CodeSymbol`, `SymbolLink`, `computeMetrics`, `formatMetricsReport`, `MilensMetrics`, `RawImport` (+9 more)
70
+ - **security**: `has`
71
+ - **server**: `has`
72
+
73
+ ## Files
74
+ - AGENTS.md
75
+ - CLAUDE.md
76
+ - CONTRIBUTING.md
77
+ - DEPLOY.md
78
+ - README.md
79
+ - milens-generate-skills-issue.md
80
+ - src/agents-md.ts
81
+ - src/cli.ts
82
+ - src/metrics.ts
83
+ - src/skills.ts
84
+ - src/types.ts
85
+ - src/utils.ts
86
+ - vitest.config.ts
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: milens-scripts
3
+ description: Code intelligence for the scripts area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Scripts
7
+
8
+ ## Working with this area
9
+ When working with code in **scripts/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 29 symbols (0 exported) across 1 files.
30
+
31
+ ## Entry Points
32
+ - **`ROOT`** [variable] — 2 incoming references
33
+ - **`outDir`** [variable] — 2 incoming references
34
+ - **`resolveTargets`** [function] — 1 incoming references
35
+ - **`run`** [function] — 1 incoming references
36
+ - **`__dirname`** [variable] — 1 incoming references
37
+
38
+ ## Dependencies
39
+ - **analyzer**: `resolve`
40
+
41
+ ## Used By
42
+ - **root**: `outDir`
43
+
44
+ ## Files
45
+ - scripts/build-standalone.mjs
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: milens-security
3
+ description: Code intelligence for the security area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Security
7
+
8
+ ## Working with this area
9
+ When working with code in **security/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 35 symbols (15 exported) across 2 files.
30
+
31
+ ## Key Symbols
32
+ - **`loadRules`** [function] (src/security/rules.ts:1044) — 6 refs
33
+ - **`auditDependencies`** [function] (src/security/deps.ts:732) — 4 refs
34
+ - **`detectEcosystem`** [function] (src/security/deps.ts:512) — 3 refs
35
+ - **`parseDependencies`** [function] (src/security/deps.ts:524) — 3 refs
36
+ - **`checkVulnerabilities`** [function] (src/security/deps.ts:687) — 3 refs
37
+ - **`Ecosystem`** [type] (src/security/deps.ts:8) — 3 refs
38
+ - **`VulnerabilityReport`** [interface] (src/security/deps.ts:26) — 2 refs
39
+ - **`getRulesByCategory`** [function] (src/security/rules.ts:1051) — 2 refs
40
+ - **`getRulesBySeverity`** [function] (src/security/rules.ts:1055) — 2 refs
41
+ - **`SecurityCategory`** [type] (src/security/rules.ts:3) — 1 refs
42
+ - **`Dependency`** [interface] (src/security/deps.ts:10) — 0 refs
43
+ - **`Vulnerability`** [interface] (src/security/deps.ts:16) — 0 refs
44
+ - **`SecurityRule`** [interface] (src/security/rules.ts:14) — 0 refs
45
+ - **`SecurityMatch`** [interface] (src/security/rules.ts:29) — 0 refs
46
+ - **`SecurityReport`** [interface] (src/security/rules.ts:41) — 0 refs
47
+
48
+ ## Entry Points
49
+ - **`readManifest`** [function] — 6 incoming references
50
+ - **`loadRules`** [function] — 6 incoming references
51
+ - **`auditDependencies`** [function] — 4 incoming references
52
+ - **`detectEcosystem`** [function] — 3 incoming references
53
+ - **`parseDependencies`** [function] — 3 incoming references
54
+
55
+ ## Dependencies
56
+ - **root**: `has`
57
+
58
+ ## Used By
59
+ - **root**: `loadRules`, `auditDependencies`
60
+ - **server**: `loadRules`
61
+ - **test**: `detectEcosystem`, `parseDependencies`, `checkVulnerabilities`, `auditDependencies`, `loadRules`, `getRulesByCategory`, `getRulesBySeverity`
62
+
63
+ ## Files
64
+ - src/security/deps.ts
65
+ - src/security/rules.ts
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: milens-server
3
+ description: Code intelligence for the server area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Server
7
+
8
+ ## Working with this area
9
+ When working with code in **server/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 81 symbols (15 exported) across 4 files.
30
+
31
+ ## Key Symbols
32
+ - **`HookManager`** [class] (src/server/hooks.ts:43) — 6 refs
33
+ - **`HookConfig`** [interface] (src/server/hooks.ts:5) — 5 refs
34
+ - **`defaultOnSessionStart`** [function] (src/server/hooks.ts:100) — 4 refs
35
+ - **`defaultOnSessionEnd`** [function] (src/server/hooks.ts:164) — 4 refs
36
+ - **`defaultOnPreCommit`** [function] (src/server/hooks.ts:227) — 4 refs
37
+ - **`defaultOnFileChange`** [function] (src/server/hooks.ts:313) — 4 refs
38
+ - **`defaultOnPreCompact`** [function] (src/server/hooks.ts:340) — 4 refs
39
+ - **`defaultOnPostCompact`** [function] (src/server/hooks.ts:358) — 4 refs
40
+ - **`SessionContext`** [interface] (src/server/hooks.ts:15) — 4 refs
41
+ - **`registerAllPrompts`** [function] (src/server/mcp-prompts.ts:637) — 4 refs
42
+ - **`createMcpServer`** [function] (src/server/mcp.ts:369) — 4 refs
43
+ - **`generateTestPlan`** [function] (src/server/test-plan.ts:14) — 4 refs
44
+ - **`startStdio`** [function] (src/server/mcp.ts:2716) — 2 refs
45
+ - **`startHttp`** [function] (src/server/mcp.ts:2724) — 2 refs
46
+ - **`TestPlan`** [interface] (src/server/test-plan.ts:3) — 1 refs
47
+
48
+ ## Entry Points
49
+ - **`get`** [method] — 9 incoming references
50
+ - **`HookManager`** [class] — 6 incoming references
51
+ - **`loadConfig`** [method] — 5 incoming references
52
+ - **`HookConfig`** [interface] — 5 incoming references
53
+ - **`defaultOnSessionStart`** [function] — 4 incoming references
54
+
55
+ ## Dependencies
56
+ - **store**: `Database`, `AnnotationStore`, `RepoRegistry`, `runDecayPass`, `getCodebaseSummary`, `recall`, `close`, `getStats` (+37 more)
57
+ - **analyzer**: `reviewPr`, `resolve`, `find`
58
+ - **parser**: `getParser`, `loadLanguage`, `ALL_LANGS`
59
+ - **security**: `loadRules`
60
+ - **orchestrator**: `Orchestrator`, `snapshot`, `compare`, `runAndFormat`
61
+ - **root**: `has`
62
+ - **test**: `dbPath`
63
+
64
+ ## Used By
65
+ - **root**: `startHttp`, `startStdio`, `HookManager`, `get`, `enableHook`, `loadConfig`, `saveConfig`, `disableHook`
66
+ - **test**: `HookManager`, `HookConfig`, `defaultOnSessionStart`, `defaultOnSessionEnd`, `defaultOnPreCommit`, `defaultOnFileChange`, `defaultOnPreCompact`, `defaultOnPostCompact` (+10 more)
67
+
68
+ ## Files
69
+ - src/server/hooks.ts
70
+ - src/server/mcp-prompts.ts
71
+ - src/server/mcp.ts
72
+ - src/server/test-plan.ts
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: milens-store
3
+ description: Code intelligence for the store area — symbols, dependencies, and entry points
4
+ ---
5
+
6
+ # Store
7
+
8
+ ## Working with this area
9
+ When working with code in **store/**, follow these mandatory safety rules:
10
+
11
+ ### Before editing any symbol in this area:
12
+ 1. Call `mcp_milens_impact({target: "<symbol>", repo: "<workspaceRoot>"})` — check blast radius
13
+ 2. If depth-1 dependents > 5 → **STOP and warn** before proceeding
14
+ 3. Call `mcp_milens_context({name: "<symbol>", repo: "<workspaceRoot>"})` — see all callers/callees
15
+
16
+ ### Before committing changes in this area:
17
+ 1. Call `mcp_milens_detect_changes({repo: "<workspaceRoot>"})` — verify scope
18
+ 2. If unexpected files changed → **STOP and report**
19
+
20
+ ### Key tools for this area:
21
+ | Task | Tool |
22
+ |---|---|
23
+ | Find all references | `mcp_milens_context` |
24
+ | Check edit safety | `mcp_milens_edit_check` |
25
+ | Text search across files | `mcp_milens_grep` |
26
+ | See file symbols | `mcp_milens_get_file_symbols` |
27
+
28
+ ## Overview
29
+ Contains 135 symbols (15 exported) across 5 files.
30
+
31
+ ## Key Symbols
32
+ - **`Database`** [class] (src/store/db.ts:10) — 77 refs
33
+ - **`AnnotationStore`** [class] (src/store/annotations.ts:10) — 19 refs
34
+ - **`RepoRegistry`** [class] (src/store/registry.ts:18) — 9 refs
35
+ - **`runDecayPass`** [function] (src/store/confidence.ts:85) — 6 refs
36
+ - **`buildEmbeddingText`** [function] (src/store/vectors.ts:250) — 4 refs
37
+ - **`TfIdfProvider`** [class] (src/store/vectors.ts:44) — 4 refs
38
+ - **`EmbeddingStore`** [class] (src/store/vectors.ts:170) — 4 refs
39
+ - **`decayConfidence`** [function] (src/store/confidence.ts:22) — 3 refs
40
+ - **`boostConfidence`** [function] (src/store/confidence.ts:6) — 2 refs
41
+ - **`getStaleAnnotations`** [function] (src/store/confidence.ts:38) — 2 refs
42
+ - **`promoteSecurityAnnotations`** [function] (src/store/confidence.ts:48) — 2 refs
43
+ - **`autoPromote`** [function] (src/store/confidence.ts:106) — 2 refs
44
+ - **`EmbeddingProvider`** [interface] (src/store/vectors.ts:15) — 2 refs
45
+ - **`NeuralProvider`** [class] (src/store/vectors.ts:122) — 0 refs
46
+ - **`SimilarResult`** [interface] (src/store/vectors.ts:23) — 0 refs
47
+
48
+ ## Entry Points
49
+ - **`Database`** [class] — 77 incoming references
50
+ - **`close`** [method] — 29 incoming references
51
+ - **`get`** [method] — 22 incoming references
52
+ - **`AnnotationStore`** [class] — 19 incoming references
53
+ - **`rowToSymbol`** [function] — 13 incoming references
54
+
55
+ ## Dependencies
56
+ - **root**: `Annotation`, `AnnotationKey`, `Session`, `EvolutionEvent`, `CodeSymbol`, `SymbolLink`, `RepoEntry`, `has` (+1 more)
57
+ - **analyzer**: `find`, `resolve`
58
+ - **test**: `dbPath`
59
+
60
+ ## Used By
61
+ - **root**: `Database`, `RepoRegistry`, `AnnotationStore`, `runDecayPass`, `getIncomingLinks`, `getAllSymbols`, `getCodebaseSummary`, `register` (+25 more)
62
+ - **analyzer**: `Database`, `TfIdfProvider`, `EmbeddingStore`, `buildEmbeddingText`, `get`, `clearFiles`, `clear`, `isFileUpToDate` (+23 more)
63
+ - **orchestrator**: `Database`, `findSymbolByName`, `findUpstream`, `clear`, `getTestCoverageGaps`, `findDeadCode`, `close`
64
+ - **server**: `Database`, `AnnotationStore`, `RepoRegistry`, `runDecayPass`, `getCodebaseSummary`, `recall`, `close`, `getStats` (+37 more)
65
+ - **test**: `Database`, `AnnotationStore`, `RepoRegistry`, `boostConfidence`, `decayConfidence`, `getStaleAnnotations`, `promoteSecurityAnnotations`, `runDecayPass` (+76 more)
66
+ - **apps**: `remove`, `Database`, `getCodebaseSummary`, `close`
67
+ - **docs**: `remove`
68
+ - **parser**: `load`
69
+
70
+ ## Files
71
+ - src/store/annotations.ts
72
+ - src/store/confidence.ts
73
+ - src/store/db.ts
74
+ - src/store/registry.ts
75
+ - src/store/vectors.ts