milens 0.6.4 → 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.
- package/.agents/skills/adapters/SKILL.md +20 -0
- package/.agents/skills/analyzer/SKILL.md +35 -13
- package/.agents/skills/apps/SKILL.md +25 -1
- package/.agents/skills/docs/SKILL.md +32 -5
- package/.agents/skills/milens/SKILL.md +36 -6
- package/.agents/skills/milens-architect/SKILL.md +128 -0
- package/.agents/skills/milens-debugger/SKILL.md +141 -0
- package/.agents/skills/orchestrator/SKILL.md +59 -0
- package/.agents/skills/parser/SKILL.md +35 -14
- package/.agents/skills/root/SKILL.md +39 -17
- package/.agents/skills/scripts/SKILL.md +21 -3
- package/.agents/skills/security/SKILL.md +32 -11
- package/.agents/skills/server/SKILL.md +45 -19
- package/.agents/skills/store/SKILL.md +40 -18
- package/.agents/skills/test/SKILL.md +57 -9
- package/LICENSE +21 -75
- package/README.md +260 -433
- package/dist/agents-md.d.ts.map +1 -1
- package/dist/agents-md.js +5 -3
- package/dist/agents-md.js.map +1 -1
- package/dist/analyzer/engine.d.ts +1 -0
- package/dist/analyzer/engine.d.ts.map +1 -1
- package/dist/analyzer/engine.js +36 -6
- package/dist/analyzer/engine.js.map +1 -1
- package/dist/cli.js +296 -19
- package/dist/cli.js.map +1 -1
- package/dist/orchestrator/orchestrator.d.ts +65 -0
- package/dist/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator.js +178 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/orchestrator/reporter.d.ts +15 -0
- package/dist/orchestrator/reporter.d.ts.map +1 -0
- package/dist/orchestrator/reporter.js +38 -0
- package/dist/orchestrator/reporter.js.map +1 -0
- package/dist/security/rules.d.ts.map +1 -1
- package/dist/security/rules.js +4 -1
- package/dist/security/rules.js.map +1 -1
- package/dist/server/hooks.d.ts +3 -0
- package/dist/server/hooks.d.ts.map +1 -1
- package/dist/server/hooks.js +79 -0
- package/dist/server/hooks.js.map +1 -1
- package/dist/server/mcp-prompts.d.ts.map +1 -1
- package/dist/server/mcp-prompts.js +1 -1
- package/dist/server/mcp-prompts.js.map +1 -1
- package/dist/server/mcp.d.ts.map +1 -1
- package/dist/server/mcp.js +418 -15
- package/dist/server/mcp.js.map +1 -1
- package/dist/server/watcher.d.ts +39 -0
- package/dist/server/watcher.d.ts.map +1 -0
- package/dist/server/watcher.js +134 -0
- package/dist/server/watcher.js.map +1 -0
- package/dist/skills.js +51 -7
- package/dist/skills.js.map +1 -1
- package/dist/store/annotations.d.ts.map +1 -1
- package/dist/store/annotations.js +18 -15
- package/dist/store/annotations.js.map +1 -1
- package/dist/store/confidence.d.ts +10 -0
- package/dist/store/confidence.d.ts.map +1 -1
- package/dist/store/confidence.js +28 -1
- package/dist/store/confidence.js.map +1 -1
- package/dist/store/db.d.ts +16 -0
- package/dist/store/db.d.ts.map +1 -1
- package/dist/store/db.js +121 -7
- package/dist/store/db.js.map +1 -1
- package/dist/store/schema.sql +24 -9
- package/docs/README.md +3 -5
- package/package.json +4 -3
|
@@ -5,6 +5,26 @@ description: Code intelligence for the adapters area — symbols, dependencies,
|
|
|
5
5
|
|
|
6
6
|
# Adapters
|
|
7
7
|
|
|
8
|
+
## Working with this area
|
|
9
|
+
When working with code in **adapters/**, 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
|
+
|
|
8
28
|
## Overview
|
|
9
29
|
Contains 30 symbols (27 exported) across 3 files.
|
|
10
30
|
|
|
@@ -5,42 +5,64 @@ description: Code intelligence for the analyzer area — symbols, dependencies,
|
|
|
5
5
|
|
|
6
6
|
# Analyzer
|
|
7
7
|
|
|
8
|
+
## Working with this area
|
|
9
|
+
When working with code in **analyzer/**, 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
|
+
|
|
8
28
|
## Overview
|
|
9
|
-
Contains
|
|
29
|
+
Contains 80 symbols (21 exported) across 7 files.
|
|
10
30
|
|
|
11
31
|
## Key Symbols
|
|
32
|
+
- **`reviewPr`** [function] (src/analyzer/review.ts:101) — 7 refs
|
|
12
33
|
- **`resolveLinksWithStats`** [function] (src/analyzer/resolver.ts:35) — 5 refs
|
|
13
34
|
- **`loadAliases`** [function] (src/analyzer/config.ts:10) — 4 refs
|
|
14
|
-
- **`analyze`** [function] (src/analyzer/engine.ts:
|
|
35
|
+
- **`analyze`** [function] (src/analyzer/engine.ts:125) — 4 refs
|
|
36
|
+
- **`enrichMetadata`** [function] (src/analyzer/enrich.ts:21) — 4 refs
|
|
37
|
+
- **`ReviewResult`** [interface] (src/analyzer/review.ts:17) — 4 refs
|
|
15
38
|
- **`scanFiles`** [function] (src/analyzer/scanner.ts:11) — 4 refs
|
|
16
39
|
- **`resolveLinks`** [function] (src/analyzer/resolver.ts:30) — 3 refs
|
|
17
|
-
- **`reviewPr`** [function] (src/analyzer/review.ts:101) — 3 refs
|
|
18
|
-
- **`enrichMetadata`** [function] (src/analyzer/enrich.ts:21) — 2 refs
|
|
19
40
|
- **`reviewSymbol`** [function] (src/analyzer/review.ts:167) — 2 refs
|
|
20
41
|
- **`generateTestPlan`** [function] (src/analyzer/testplan.ts:104) — 2 refs
|
|
21
42
|
- **`findCoverageGaps`** [function] (src/analyzer/testplan.ts:175) — 2 refs
|
|
43
|
+
- **`analyzeTestImpact`** [function] (src/analyzer/testplan.ts:208) — 2 refs
|
|
22
44
|
- **`ResolutionResult`** [interface] (src/analyzer/resolver.ts:22) — 1 refs
|
|
23
|
-
- **`
|
|
45
|
+
- **`SymbolRisk`** [interface] (src/analyzer/review.ts:8) — 1 refs
|
|
24
46
|
- **`RiskLevel`** [type] (src/analyzer/review.ts:6) — 1 refs
|
|
25
|
-
- **`TestImpactResult`** [interface] (src/analyzer/testplan.ts:35) — 1 refs
|
|
26
|
-
- **`SymbolRisk`** [interface] (src/analyzer/review.ts:8) — 0 refs
|
|
27
47
|
|
|
28
48
|
## Entry Points
|
|
29
|
-
- **`find`** [function] —
|
|
30
|
-
- **`resolve`** [method] —
|
|
49
|
+
- **`find`** [function] — 22 incoming references
|
|
50
|
+
- **`resolve`** [method] — 15 incoming references
|
|
51
|
+
- **`reviewPr`** [function] — 7 incoming references
|
|
31
52
|
- **`resolveLinksWithStats`** [function] — 5 incoming references
|
|
32
53
|
- **`loadAliases`** [function] — 4 incoming references
|
|
33
|
-
- **`analyze`** [function] — 4 incoming references
|
|
34
54
|
|
|
35
55
|
## Dependencies
|
|
36
|
-
- **parser**: `langForFile`, `getParser`, `loadLanguage`, `extractFromTree`, `clearQueryCache`, `extractVueScript`, `extractVueTemplateRefs
|
|
56
|
+
- **parser**: `langForFile`, `supportedExtensions`, `getParser`, `loadLanguage`, `extractFromTree`, `clearQueryCache`, `extractVueScript`, `extractVueTemplateRefs` (+6 more)
|
|
37
57
|
- **root**: `isTestFile`, `CodeSymbol`, `ExtractionResult`, `RawImport`, `RawCall`, `RawHeritage`, `RawReExport`, `RawTypeBinding` (+8 more)
|
|
38
|
-
- **store**: `Database`, `TfIdfProvider`, `EmbeddingStore`, `buildEmbeddingText`, `get`, `
|
|
58
|
+
- **store**: `Database`, `TfIdfProvider`, `EmbeddingStore`, `buildEmbeddingText`, `get`, `clearFiles`, `clear`, `isFileUpToDate` (+23 more)
|
|
59
|
+
- **test**: `parser`, `lang`
|
|
39
60
|
|
|
40
61
|
## Used By
|
|
41
62
|
- **root**: `loadAliases`, `analyze`, `resolve`, `clear`
|
|
63
|
+
- **orchestrator**: `reviewPr`, `ReviewResult`, `SymbolRisk`
|
|
42
64
|
- **server**: `reviewPr`, `resolve`, `find`
|
|
43
|
-
- **test**: `resolveLinks`, `resolveLinksWithStats`, `reviewSymbol`, `scanFiles`, `generateTestPlan`, `findCoverageGaps
|
|
65
|
+
- **test**: `enrichMetadata`, `resolveLinks`, `resolveLinksWithStats`, `reviewSymbol`, `reviewPr`, `scanFiles`, `generateTestPlan`, `findCoverageGaps` (+5 more)
|
|
44
66
|
- **scripts**: `resolve`
|
|
45
67
|
- **parser**: `find`, `resolve`
|
|
46
68
|
- **store**: `find`, `resolve`
|
|
@@ -5,8 +5,28 @@ description: Code intelligence for the apps area — symbols, dependencies, and
|
|
|
5
5
|
|
|
6
6
|
# Apps
|
|
7
7
|
|
|
8
|
+
## Working with this area
|
|
9
|
+
When working with code in **apps/**, 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
|
+
|
|
8
28
|
## Overview
|
|
9
|
-
Contains
|
|
29
|
+
Contains 38 symbols (12 exported) across 10 files.
|
|
10
30
|
|
|
11
31
|
## Key Symbols
|
|
12
32
|
- **`Milens Desktop Dashboard`** [section] (apps/dashboard/README.md:1) — 0 refs
|
|
@@ -25,9 +45,13 @@ Contains 34 symbols (12 exported) across 10 files.
|
|
|
25
45
|
## Entry Points
|
|
26
46
|
- **`createWindow`** [function] — 1 incoming references
|
|
27
47
|
- **`__dirname`** [variable] — 1 incoming references
|
|
48
|
+
- **`checkRateLimit`** [function] — 1 incoming references
|
|
49
|
+
- **`getTier`** [function] — 1 incoming references
|
|
50
|
+
- **`runMilensAnalyze`** [function] — 1 incoming references
|
|
28
51
|
|
|
29
52
|
## Dependencies
|
|
30
53
|
- **store**: `remove`, `Database`, `getCodebaseSummary`, `close`
|
|
54
|
+
- **test**: `dbPath`
|
|
31
55
|
|
|
32
56
|
## Files
|
|
33
57
|
- apps/dashboard/README.md
|
|
@@ -5,8 +5,28 @@ description: Code intelligence for the docs area — symbols, dependencies, and
|
|
|
5
5
|
|
|
6
6
|
# Docs
|
|
7
7
|
|
|
8
|
+
## Working with this area
|
|
9
|
+
When working with code in **docs/**, 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
|
+
|
|
8
28
|
## Overview
|
|
9
|
-
Contains
|
|
29
|
+
Contains 129 symbols (109 exported) across 18 files.
|
|
10
30
|
|
|
11
31
|
## Key Symbols
|
|
12
32
|
- **`Adapter Packs`** [section] (docs/adapters.md:1) — 0 refs
|
|
@@ -22,25 +42,32 @@ Contains 266 symbols (253 exported) across 12 files.
|
|
|
22
42
|
- **`Automated Install`** [section] (docs/adapters.md:66) — 0 refs
|
|
23
43
|
- **`Profile Selection`** [section] (docs/adapters.md:74) — 0 refs
|
|
24
44
|
- **`MCP Config Reference`** [section] (docs/adapters.md:86) — 0 refs
|
|
25
|
-
- **`
|
|
26
|
-
- **`
|
|
45
|
+
- **`Milens Pricing`** [section] (docs/pricing.md:1) — 0 refs
|
|
46
|
+
- **`Why Pay?`** [section] (docs/pricing.md:7) — 0 refs
|
|
27
47
|
|
|
28
48
|
## Entry Points
|
|
29
49
|
- **`applyFilters`** [function] — 1 incoming references
|
|
50
|
+
- **`applyFilters`** [function] — 1 incoming references
|
|
30
51
|
|
|
31
52
|
## Dependencies
|
|
32
53
|
- **store**: `remove`
|
|
33
54
|
|
|
34
55
|
## Files
|
|
35
56
|
- docs/README.md
|
|
57
|
+
- docs/adapters.html
|
|
36
58
|
- docs/adapters.md
|
|
37
|
-
- docs/
|
|
38
|
-
- docs/
|
|
59
|
+
- docs/changelog.html
|
|
60
|
+
- docs/compare.html
|
|
61
|
+
- docs/github-app.html
|
|
39
62
|
- docs/index.html
|
|
63
|
+
- docs/learning.html
|
|
64
|
+
- docs/platforms.html
|
|
40
65
|
- docs/pricing.html
|
|
41
66
|
- docs/pricing.md
|
|
42
67
|
- docs/quickstart.md
|
|
68
|
+
- docs/scenarios.html
|
|
43
69
|
- docs/security-presets.md
|
|
44
70
|
- docs/security.html
|
|
45
71
|
- docs/skills.html
|
|
46
72
|
- docs/tools.md
|
|
73
|
+
- docs/vi-VN/README.md
|
|
@@ -4,9 +4,9 @@ description: Code intelligence MCP tools — symbol search, text grep, impact an
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- milens:start -->
|
|
7
|
-
# Milens —
|
|
7
|
+
# Milens — AI-DOS
|
|
8
8
|
|
|
9
|
-
This project is indexed by milens (
|
|
9
|
+
The Operating System for AI-Driven Development. This project is indexed by milens (1048 symbols, 1771 links, 129 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
|
|
|
@@ -77,6 +77,17 @@ When the user says... → do this FIRST:
|
|
|
77
77
|
| "start new session" | `mcp_milens_session_start({agent: "...", repo: "<workspaceRoot>"})` |
|
|
78
78
|
| "find code like `X`" | `mcp_milens_find_similar({name: "X", repo: "<workspaceRoot>"})` |
|
|
79
79
|
| "search for `concept`" | `mcp_milens_semantic_search({query: "concept", repo: "<workspaceRoot>"})` |
|
|
80
|
+
| "generate tests for `X`" | `mcp_milens_test_generate({symbol: "X", repo: "<workspaceRoot>"})` |
|
|
81
|
+
| "fix security issue in `X`" | `mcp_milens_fix_apply({ruleId, file, line, repo: "<workspaceRoot>"})` |
|
|
82
|
+
| "remove dead code" | `mcp_milens_find_dead_code()` then `dead_code_remove` prompt |
|
|
83
|
+
| "orchestrate/check changes" | `mcp_milens_orchestrate({repo: "<workspaceRoot>"})` |
|
|
84
|
+
| "compare impact of `X`" | `mcp_milens_compare_impact({name: "X", action: "snapshot"|"compare", repo: "<workspaceRoot>"})` |
|
|
85
|
+
| "check pre-commit" | `mcp_milens_pre_commit_check({repo: "<workspaceRoot>"})` |
|
|
86
|
+
| "save/restore context" | `mcp_milens_hook_preCompact()` / `mcp_milens_hook_postCompact()` |
|
|
87
|
+
| "scan security / audit security" | `mcp_milens_security_scan({repo: "<workspaceRoot>"})` — full audit across all 50+ rules |
|
|
88
|
+
| "end session" / "finish work" | `mcp_milens_session_end({session_id: "..."})` — record stats, trigger onSessionEnd hook |
|
|
89
|
+
| "what did session X do" | `mcp_milens_session_context({session_id: "..."})` — get annotations + tool calls |
|
|
90
|
+
| "file changed to X" | `mcp_milens_hook_onFileChange({files: ["path/to/file"], repo: "<workspaceRoot>"})` |
|
|
80
91
|
|
|
81
92
|
## Documentation Workflows
|
|
82
93
|
|
|
@@ -120,16 +131,16 @@ Milens indexes **Markdown files** (.md, .mdx) — headings become `section` symb
|
|
|
120
131
|
| `mcp_milens_get_file_symbols` | All symbols in a file |
|
|
121
132
|
| `mcp_milens_get_type_hierarchy` | Class inheritance tree |
|
|
122
133
|
| `mcp_milens_find_dead_code` | Unused exported symbols |
|
|
123
|
-
| `mcp_milens_status` | Index
|
|
134
|
+
| `mcp_milens_status` | Index stats for a repository: symbols, links, files, coverage %, staleness |
|
|
124
135
|
| `mcp_milens_edit_check` | Pre-edit safety: callers + export status + re-export chains + test coverage |
|
|
125
136
|
| `mcp_milens_trace` | Execution flow: call chains from entrypoints to a symbol |
|
|
126
137
|
| `mcp_milens_routes` | Detect framework routes/endpoints (Express, FastAPI, NestJS, etc.) |
|
|
127
138
|
| `mcp_milens_smart_context` | Intent-aware context: understand/edit/debug/test |
|
|
128
|
-
| `mcp_milens_overview` | Combined context + impact + grep in
|
|
139
|
+
| `mcp_milens_overview` | Combined context + impact + grep in ONE call. Preferred before editing/deleting/renaming a symbol. |
|
|
129
140
|
| `mcp_milens_domains` | Domain clusters: groups of files forming logical modules |
|
|
130
141
|
| `mcp_milens_repos` | List all indexed repositories with summary stats |
|
|
131
142
|
| `mcp_milens_ast_explore` | Explore raw AST structure of a code file |
|
|
132
|
-
| `mcp_milens_test_query` | Run
|
|
143
|
+
| `mcp_milens_test_query` | Run a tree-sitter query against a code snippet and return matched nodes with capture names |
|
|
133
144
|
| `mcp_milens_review_pr` | PR risk assessment: scores changed symbols by blast radius + test coverage |
|
|
134
145
|
| `mcp_milens_review_symbol` | Single symbol risk: role, heat, dependents, test status |
|
|
135
146
|
| `mcp_milens_test_plan` | Dependency-aware test plan: mocks, strategies, suggested tests |
|
|
@@ -143,10 +154,20 @@ Milens indexes **Markdown files** (.md, .mdx) — headings become `section` symb
|
|
|
143
154
|
| `mcp_milens_codebase_summary` | High-level bootstrapping context: domains, key symbols, coverage |
|
|
144
155
|
| `mcp_milens_semantic_search` | Hybrid FTS5 + vector search (requires --embeddings) |
|
|
145
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. |
|
|
146
167
|
|
|
147
168
|
### Keeping the Index Fresh
|
|
148
169
|
|
|
149
|
-
After significant code changes: `npx milens analyze -p . --force`
|
|
170
|
+
After significant code changes: `npx milens analyze -p . --force` (replace `.` with your project root if running from a different directory)
|
|
150
171
|
|
|
151
172
|
### Skills
|
|
152
173
|
|
|
@@ -160,9 +181,18 @@ After significant code changes: `npx milens analyze -p . --force`
|
|
|
160
181
|
| Work in the Test area | `.agents/skills/test/SKILL.md` |
|
|
161
182
|
| Work in the Scripts area | `.agents/skills/scripts/SKILL.md` |
|
|
162
183
|
| Work in the Analyzer area | `.agents/skills/analyzer/SKILL.md` |
|
|
184
|
+
| Work in the Orchestrator area | `.agents/skills/orchestrator/SKILL.md` |
|
|
163
185
|
| Work in the Parser area | `.agents/skills/parser/SKILL.md` |
|
|
164
186
|
| Work in the Security area | `.agents/skills/security/SKILL.md` |
|
|
165
187
|
| Work in the Server area | `.agents/skills/server/SKILL.md` |
|
|
166
188
|
| Work in the Store area | `.agents/skills/store/SKILL.md` |
|
|
189
|
+
| Execute milens-plan workflow | `.agents/skills/milens-plan/SKILL.md` |
|
|
190
|
+
| Execute milens-code-review workflow | `.agents/skills/milens-code-review/SKILL.md` |
|
|
191
|
+
| Execute milens-tdd workflow | `.agents/skills/milens-tdd/SKILL.md` |
|
|
192
|
+
| Execute milens-security-review workflow | `.agents/skills/milens-security-review/SKILL.md` |
|
|
193
|
+
| Execute milens-refactor-clean workflow | `.agents/skills/milens-refactor-clean/SKILL.md` |
|
|
194
|
+
| Execute milens-eval workflow | `.agents/skills/milens-eval/SKILL.md` |
|
|
195
|
+
| Execute milens-architect workflow | `.agents/skills/milens-architect/SKILL.md` |
|
|
196
|
+
| Execute milens-debugger workflow | `.agents/skills/milens-debugger/SKILL.md` |
|
|
167
197
|
|
|
168
198
|
<!-- milens:end -->
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: milens-architect
|
|
3
|
+
description: Architecture Analysis — domains, routes, coupling, class hierarchy, and refactoring suggestions with scorecard
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# milens-architect — Architecture Analysis
|
|
7
|
+
|
|
8
|
+
Analyze the architecture of the codebase: domain clusters, API routes, execution traces, class hierarchies, coupling hotspots, and produce a structured scorecard with refactoring suggestions.
|
|
9
|
+
|
|
10
|
+
## Tools Required
|
|
11
|
+
|
|
12
|
+
| Tool | Purpose |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `mcp_milens_codebase_summary` | High-level project overview |
|
|
15
|
+
| `mcp_milens_domains` | Module clusters with cohesion scores |
|
|
16
|
+
| `mcp_milens_routes` | API endpoints inventory |
|
|
17
|
+
| `mcp_milens_get_type_hierarchy` | Class/interface inheritance trees |
|
|
18
|
+
| `mcp_milens_trace` | Execution flow from entrypoints |
|
|
19
|
+
| `mcp_milens_explain_relationship` | Shortest path between two symbols |
|
|
20
|
+
| `mcp_milens_find_dead_code` | Unused exported symbols |
|
|
21
|
+
| `mcp_milens_review_symbol` | Deep-dive single symbol risk |
|
|
22
|
+
| `mcp_milens_impact` | Blast radius analysis |
|
|
23
|
+
|
|
24
|
+
> **CRITICAL:** All milens MCP tool calls MUST include the `repo` parameter set to the **absolute path of the workspace root**.
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
### Step 1: Codebase Overview
|
|
29
|
+
|
|
30
|
+
Get a high-level picture of the codebase structure.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
mcp_milens_codebase_summary({repo: "<workspaceRoot>"})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Step 2: Domain Map
|
|
37
|
+
|
|
38
|
+
Identify logical module groupings and cohesion.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
mcp_milens_domains({repo: "<workspaceRoot>"})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For each domain with > 5 files, note: file count, symbol count, and description.
|
|
45
|
+
|
|
46
|
+
### Step 3: Route Inventory
|
|
47
|
+
|
|
48
|
+
Map all API endpoints to handler functions.
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
mcp_milens_routes({repo: "<workspaceRoot>"})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Document: HTTP method, path, handler symbol, and domain.
|
|
55
|
+
|
|
56
|
+
### Step 4: Class Hierarchy
|
|
57
|
+
|
|
58
|
+
For each key class/interface in the codebase, trace inheritance chains.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
mcp_milens_get_type_hierarchy({name: "<BaseClass>", repo: "<workspaceRoot>"})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 5: Execution Traces
|
|
65
|
+
|
|
66
|
+
Trace critical execution paths from entrypoints.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
mcp_milens_trace({name: "<entrypoint>", direction: "from", repo: "<workspaceRoot>"})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 6: Coupling Analysis
|
|
73
|
+
|
|
74
|
+
For the top 5 hub symbols, analyze inter-domain coupling:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
mcp_milens_impact({target: "<hubSymbol>", depth: 3, repo: "<workspaceRoot>"})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
mcp_milens_explain_relationship({from: "<domain-a>", to: "<domain-b>", repo: "<workspaceRoot>"})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Step 7: Dead Code Detection
|
|
85
|
+
|
|
86
|
+
Find unused symbols that may indicate architectural drift.
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
mcp_milens_find_dead_code({limit: 30, repo: "<workspaceRoot>"})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 8: Architecture Scorecard
|
|
93
|
+
|
|
94
|
+
Produce a structured scorecard:
|
|
95
|
+
|
|
96
|
+
| Dimension | Score (1-10) | Notes |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| Domain Cohesion | | |
|
|
99
|
+
| Inter-domain Coupling | | |
|
|
100
|
+
| Route Coverage | | |
|
|
101
|
+
| Entry Point Clarity | | |
|
|
102
|
+
| Inheritance Depth | | |
|
|
103
|
+
| Dead Code Ratio | | |
|
|
104
|
+
|
|
105
|
+
List top 3 refactoring suggestions with risk levels and effort estimates.
|
|
106
|
+
|
|
107
|
+
## Quality Gate
|
|
108
|
+
|
|
109
|
+
### PASS if:
|
|
110
|
+
- [x] All domains documented with file/symbol counts
|
|
111
|
+
- [x] All API routes mapped to handlers
|
|
112
|
+
- [x] At least 5 class hierarchies traced
|
|
113
|
+
- [x] At least 3 execution traces analyzed
|
|
114
|
+
- [x] Coupling hotspots identified
|
|
115
|
+
- [x] Architecture scorecard completed with scores
|
|
116
|
+
- [x] Top 3 refactoring suggestions documented with risk levels
|
|
117
|
+
|
|
118
|
+
### FAIL if:
|
|
119
|
+
- [ ] Any step skipped without documented reason
|
|
120
|
+
- [ ] Scorecard incomplete or scored without evidence
|
|
121
|
+
- [ ] Refactoring suggestions lack risk assessment
|
|
122
|
+
|
|
123
|
+
## Never Skip
|
|
124
|
+
|
|
125
|
+
1. Always run `mcp_milens_codebase_summary` first — it provides the scaffolding for all other steps
|
|
126
|
+
2. Never skip coupling analysis — it's the most critical architecture insight
|
|
127
|
+
3. Always include risk levels and effort estimates in refactoring suggestions
|
|
128
|
+
4. Cross-reference findings with `mcp_milens_review_symbol` for CRITICAL hubs
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: milens-debugger
|
|
3
|
+
description: Root Cause Analysis — execution trace, blast radius, dependency paths, deep context, and ranked hypotheses with fix suggestions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# milens-debugger — Root Cause Analysis
|
|
7
|
+
|
|
8
|
+
Debug issues by tracing execution flow, analyzing blast radius, exploring dependency paths, and producing ranked root cause hypotheses with fix suggestions and regression risk assessment.
|
|
9
|
+
|
|
10
|
+
## Tools Required
|
|
11
|
+
|
|
12
|
+
| Tool | Purpose |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `mcp_milens_trace` | Execution flow from entrypoints to target (or reverse) |
|
|
15
|
+
| `mcp_milens_context` | 360° symbol view: incoming refs + outgoing deps |
|
|
16
|
+
| `mcp_milens_impact` | Blast radius: what breaks if target changes |
|
|
17
|
+
| `mcp_milens_explain_relationship` | Shortest path between two symbols |
|
|
18
|
+
| `mcp_milens_smart_context` | Intent-aware context for debug intent |
|
|
19
|
+
| `mcp_milens_overview` | Combined context + impact + grep in one call |
|
|
20
|
+
| `mcp_milens_grep` | Text search across all files (templates, configs, error messages) |
|
|
21
|
+
| `mcp_milens_review_symbol` | Deep-dive single symbol risk assessment |
|
|
22
|
+
| `mcp_milens_get_type_hierarchy` | Class inheritance chain |
|
|
23
|
+
|
|
24
|
+
> **CRITICAL:** All milens MCP tool calls MUST include the `repo` parameter set to the **absolute path of the workspace root**.
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
### Step 1: Understand the Target
|
|
29
|
+
|
|
30
|
+
Get deep context on the problematic symbol.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
mcp_milens_smart_context({name: "<targetSymbol>", intent: "debug", repo: "<workspaceRoot>"})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This returns execution paths, data flow, dependencies, and test coverage in one call.
|
|
37
|
+
|
|
38
|
+
### Step 2: Trace Execution
|
|
39
|
+
|
|
40
|
+
Map how code reaches the target from entrypoints.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
mcp_milens_trace({name: "<targetSymbol>", direction: "to", repo: "<workspaceRoot>"})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For downstream impact, trace forward:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
mcp_milens_trace({name: "<targetSymbol>", direction: "from", repo: "<workspaceRoot>"})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 3: Blast Radius
|
|
53
|
+
|
|
54
|
+
Understand what breaks if the target is modified.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
mcp_milens_impact({target: "<targetSymbol>", depth: 3, repo: "<workspaceRoot>"})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Pay special attention to depth-1 dependents — these WILL break.
|
|
61
|
+
|
|
62
|
+
### Step 4: Dependency Paths
|
|
63
|
+
|
|
64
|
+
For each suspect dependency, trace the exact connection path.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
mcp_milens_explain_relationship({from: "<suspect>", to: "<targetSymbol>", repo: "<workspaceRoot>"})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Step 5: Full Context View
|
|
71
|
+
|
|
72
|
+
Get a 360° view of the target and its immediate neighbors.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
mcp_milens_context({name: "<targetSymbol>", repo: "<workspaceRoot>"})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Check both incoming (who calls this) and outgoing (what this calls).
|
|
79
|
+
|
|
80
|
+
### Step 6: Text Search for Clues
|
|
81
|
+
|
|
82
|
+
Search for error messages, TODOs, or related patterns.
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
mcp_milens_grep({pattern: "<errorMessage or keyword>", repo: "<workspaceRoot>"})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Use `include` to narrow scope (e.g., `"**/*.ts"`, `"**/*.md"`).
|
|
89
|
+
|
|
90
|
+
### Step 7: Class Hierarchy
|
|
91
|
+
|
|
92
|
+
If the target is a class, check its inheritance chain.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
mcp_milens_get_type_hierarchy({name: "<ClassName>", repo: "<workspaceRoot>"})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Step 8: Risk Assessment
|
|
99
|
+
|
|
100
|
+
Deep-dive the target's risk profile.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
mcp_milens_review_symbol({name: "<targetSymbol>", repo: "<workspaceRoot>"})
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Step 9: Root Cause Hypotheses
|
|
107
|
+
|
|
108
|
+
Rank hypotheses by likelihood:
|
|
109
|
+
|
|
110
|
+
| # | Hypothesis | Evidence | Confidence | Suggested Fix | Regression Risk |
|
|
111
|
+
|---|---|---|---|---|---|
|
|
112
|
+
| 1 | | | HIGH/MEDIUM/LOW | | |
|
|
113
|
+
| 2 | | | | | |
|
|
114
|
+
| 3 | | | | | |
|
|
115
|
+
|
|
116
|
+
Each hypothesis MUST cite specific tools and their output as evidence.
|
|
117
|
+
|
|
118
|
+
## Quality Gate
|
|
119
|
+
|
|
120
|
+
### PASS if:
|
|
121
|
+
- [x] Execution trace complete (both directions)
|
|
122
|
+
- [x] Blast radius analyzed to depth 3
|
|
123
|
+
- [x] At least 3 dependency paths traced
|
|
124
|
+
- [x] Full 360° context captured
|
|
125
|
+
- [x] Text search performed for error messages/keywords
|
|
126
|
+
- [x] At least 3 ranked hypotheses with evidence citations
|
|
127
|
+
- [x] Fix suggestions include regression risk assessment
|
|
128
|
+
|
|
129
|
+
### FAIL if:
|
|
130
|
+
- [ ] Any step skipped without documented reason
|
|
131
|
+
- [ ] Hypotheses lack tool evidence citations
|
|
132
|
+
- [ ] Fix suggestions have no regression risk assessment
|
|
133
|
+
- [ ] Only one hypothesis considered (lack of thoroughness)
|
|
134
|
+
|
|
135
|
+
## Never Skip
|
|
136
|
+
|
|
137
|
+
1. Always run `mcp_milens_smart_context` first — it is the most efficient starting point for debugging
|
|
138
|
+
2. Never skip blast radius analysis — a fix that introduces new breakage is not a fix
|
|
139
|
+
3. Always cite specific tool outputs as evidence for each hypothesis
|
|
140
|
+
4. Always include regression risk in fix suggestions
|
|
141
|
+
5. If dead code is suspected, run `mcp_milens_find_dead_code` to check for unused symbols in the trace path
|
|
@@ -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
|