codebase-analyzer-mcp 2.0.5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/CLAUDE.md +6 -10
- package/README.md +29 -16
- package/agents/analysis/architecture-analyzer.md +1 -1
- package/agents/analysis/dataflow-tracer.md +1 -1
- package/agents/analysis/pattern-detective.md +1 -1
- package/agents/research/codebase-explorer.md +18 -10
- package/commands/analyze.md +8 -8
- package/dist/cli/index.js +530 -54
- package/dist/mcp/server.js +482 -45
- package/package.json +6 -9
- package/skills/codebase-analysis/SKILL.md +27 -94
- package/skills/codebase-analysis/references/api-reference.md +68 -1
- package/commands/compare.md +0 -66
- package/commands/explore.md +0 -64
- package/commands/patterns.md +0 -75
- package/commands/trace.md +0 -65
- package/skills/add-mcp-tool/SKILL.md +0 -209
- package/skills/debugging-analysis/SKILL.md +0 -213
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Multi-layer codebase analysis tools",
|
|
9
|
-
"version": "2.0
|
|
9
|
+
"version": "2.1.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "codebase-analyzer",
|
|
14
|
-
"description": "Multi-layer codebase analysis with Gemini AI. 4 agents,
|
|
15
|
-
"version": "2.0
|
|
14
|
+
"description": "Multi-layer codebase analysis with Gemini AI. 4 agents, 1 command, 1 skill for architecture analysis, pattern detection, and dataflow tracing.",
|
|
15
|
+
"version": "2.1.0",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "Jake Correa",
|
|
18
18
|
"url": "https://github.com/jaykaycodes"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebase-analyzer",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "Multi-layer codebase analysis with Gemini AI. 4 agents,
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Multi-layer codebase analysis with Gemini AI. 4 agents, 1 command, 1 skill for architecture analysis, pattern detection, and dataflow tracing.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jake Correa",
|
|
7
7
|
"url": "https://github.com/jaykaycodes"
|
package/CLAUDE.md
CHANGED
|
@@ -23,8 +23,8 @@ pnpm install && pnpm build
|
|
|
23
23
|
| Component | Count | Purpose |
|
|
24
24
|
|-----------|-------|---------|
|
|
25
25
|
| Agents | 4 | Specialized analysis tasks |
|
|
26
|
-
| Commands |
|
|
27
|
-
| Skills |
|
|
26
|
+
| Commands | 1 | User-invocable actions |
|
|
27
|
+
| Skills | 1 | Context-loaded guidance |
|
|
28
28
|
| MCP Server | 1 | Tool interface for Claude |
|
|
29
29
|
|
|
30
30
|
### Agents
|
|
@@ -40,19 +40,13 @@ pnpm install && pnpm build
|
|
|
40
40
|
|
|
41
41
|
| Command | Usage |
|
|
42
42
|
|---------|-------|
|
|
43
|
-
| `/analyze` | Analyze a codebase |
|
|
44
|
-
| `/patterns` | Find design patterns |
|
|
45
|
-
| `/trace` | Trace data flow |
|
|
46
|
-
| `/explore` | Quick exploration |
|
|
47
|
-
| `/compare` | Compare repositories |
|
|
43
|
+
| `/cba:analyze` | Analyze a codebase |
|
|
48
44
|
|
|
49
45
|
### Skills
|
|
50
46
|
|
|
51
47
|
| Skill | Purpose |
|
|
52
48
|
|-------|---------|
|
|
53
|
-
| `codebase-analysis` | How to use the MCP tools |
|
|
54
|
-
| `add-mcp-tool` | Guide for adding new tools |
|
|
55
|
-
| `debugging-analysis` | Troubleshooting analysis issues |
|
|
49
|
+
| `cba:codebase-analysis` | How to use the MCP tools |
|
|
56
50
|
|
|
57
51
|
## Architecture
|
|
58
52
|
|
|
@@ -77,7 +71,9 @@ See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for system design.
|
|
|
77
71
|
| Tool | Purpose | Cost |
|
|
78
72
|
|------|---------|------|
|
|
79
73
|
| `analyze_repo` | Full analysis with expandable sections | Varies |
|
|
74
|
+
| `query_repo` | Ask questions about a codebase | Medium |
|
|
80
75
|
| `expand_section` | Drill into specific sections | Low |
|
|
76
|
+
| `read_files` | Read source files from cached analysis | None |
|
|
81
77
|
| `find_patterns` | Pattern detection | Medium |
|
|
82
78
|
| `trace_dataflow` | Data flow tracing | Medium |
|
|
83
79
|
| `get_analysis_capabilities` | List capabilities | None |
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Analyze any codebase with Gemini AI. Progressive disclosure keeps costs low - st
|
|
|
13
13
|
claude /plugin install https://github.com/jaykaycodes/codebase-analyzer-mcp
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Then use `/analyze
|
|
16
|
+
Then use `/cba:analyze` to analyze a codebase, or just ask questions naturally.
|
|
17
17
|
|
|
18
18
|
### MCP Server
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@ Add to `~/.mcp.json` (create if it doesn't exist):
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Restart Claude Code, then use the `analyze_repo
|
|
33
|
+
Restart Claude Code, then use the `analyze_repo` or `query_repo` tools.
|
|
34
34
|
|
|
35
35
|
**Optional:** For semantic analysis with Gemini AI, get an API key at https://aistudio.google.com/apikey and add it:
|
|
36
36
|
|
|
@@ -51,11 +51,12 @@ Restart Claude Code, then use the `analyze_repo`, `find_patterns`, or `trace_dat
|
|
|
51
51
|
### CLI
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
npx codebase-analyzer-mcp analyze .
|
|
55
|
-
npx codebase-analyzer-mcp analyze . -d surface
|
|
56
|
-
npx codebase-analyzer-mcp analyze . -d deep -s
|
|
57
|
-
npx codebase-analyzer-mcp
|
|
58
|
-
npx codebase-analyzer-mcp
|
|
54
|
+
npx codebase-analyzer-mcp analyze . # Standard analysis
|
|
55
|
+
npx codebase-analyzer-mcp analyze . -d surface # Fast, free overview
|
|
56
|
+
npx codebase-analyzer-mcp analyze . -d deep -s # Full semantic analysis
|
|
57
|
+
npx codebase-analyzer-mcp query . "how is auth handled?" # Ask a question
|
|
58
|
+
npx codebase-analyzer-mcp patterns . # Find design patterns
|
|
59
|
+
npx codebase-analyzer-mcp dataflow . "user login" # Trace data flow
|
|
59
60
|
```
|
|
60
61
|
|
|
61
62
|
## What It Does
|
|
@@ -73,19 +74,31 @@ Analysis results include expandable sections - you only pay for what you drill i
|
|
|
73
74
|
| Tool | Description |
|
|
74
75
|
|------|-------------|
|
|
75
76
|
| `analyze_repo` | Full analysis with progressive disclosure |
|
|
77
|
+
| `query_repo` | Ask questions about a codebase |
|
|
76
78
|
| `expand_section` | Drill into specific sections |
|
|
79
|
+
| `read_files` | Read source files from a cached analysis |
|
|
77
80
|
| `find_patterns` | Detect design/architecture patterns |
|
|
78
81
|
| `trace_dataflow` | Trace data flow through the system |
|
|
82
|
+
| `get_analysis_capabilities` | List supported languages and analysis options |
|
|
79
83
|
|
|
80
|
-
## Plugin
|
|
84
|
+
## Plugin
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
### Command
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
/cba:analyze [source] [--depth surface|standard|deep] [--focus <paths>]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Agents
|
|
93
|
+
|
|
94
|
+
| Agent | Purpose |
|
|
95
|
+
|-------|---------|
|
|
96
|
+
| `architecture-analyzer` | Full codebase architecture analysis |
|
|
97
|
+
| `pattern-detective` | Design/anti-pattern detection |
|
|
98
|
+
| `dataflow-tracer` | Data flow tracing through systems |
|
|
99
|
+
| `codebase-explorer` | Quick exploration and Q&A |
|
|
100
|
+
|
|
101
|
+
Agents are routed automatically based on your question — just ask naturally.
|
|
89
102
|
|
|
90
103
|
---
|
|
91
104
|
|
|
@@ -105,7 +118,7 @@ git clone https://github.com/jaykaycodes/codebase-analyzer-mcp.git
|
|
|
105
118
|
cd codebase-analyzer-mcp
|
|
106
119
|
bun install
|
|
107
120
|
bun run dev # Watch mode
|
|
108
|
-
bun run build
|
|
121
|
+
bun run build # Build
|
|
109
122
|
bun run cba analyze . # Test CLI
|
|
110
123
|
```
|
|
111
124
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: architecture-analyzer
|
|
2
|
+
name: cba:architecture-analyzer
|
|
3
3
|
description: "Use this agent when you need to understand a codebase's architecture, identify patterns, and get a high-level overview. This agent uses the codebase-analyzer MCP to perform multi-layer analysis with progressive disclosure - starting cheap and drilling down as needed.\n\n<example>Context: User wants to understand a new codebase.\nuser: \"Help me understand the architecture of this repo\"\nassistant: \"I'll use the architecture-analyzer agent to analyze the codebase structure and patterns.\"\n<commentary>Since the user wants architectural understanding, use architecture-analyzer to run progressive analysis.</commentary></example>\n\n<example>Context: User is evaluating a library.\nuser: \"What patterns does this library use?\"\nassistant: \"Let me use the architecture-analyzer agent to detect patterns in this codebase.\"\n<commentary>Pattern detection is a core capability of architecture-analyzer.</commentary></example>"
|
|
4
4
|
model: haiku
|
|
5
5
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: dataflow-tracer
|
|
2
|
+
name: cba:dataflow-tracer
|
|
3
3
|
description: "Use this agent when you need to understand how data flows through a system - from entry points through transformations to outputs. Essential for debugging, security analysis, and understanding complex systems.\n\n<example>Context: User debugging data issue.\nuser: \"How does user input flow through the checkout process?\"\nassistant: \"I'll use the dataflow-tracer agent to trace the data path.\"\n<commentary>Tracing data from entry point through system is dataflow-tracer's specialty.</commentary></example>\n\n<example>Context: Security review.\nuser: \"Where does this API input go? I want to check for injection risks.\"\nassistant: \"Let me trace the dataflow from that API endpoint.\"\n<commentary>Security-focused dataflow tracing.</commentary></example>"
|
|
4
4
|
model: haiku
|
|
5
5
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: pattern-detective
|
|
2
|
+
name: cba:pattern-detective
|
|
3
3
|
description: "Use this agent when you need to find specific design patterns, anti-patterns, or architectural patterns in a codebase. Specializes in pattern detection with confidence levels and location mapping.\n\n<example>Context: User suspects anti-patterns in code.\nuser: \"Are there any anti-patterns in this codebase?\"\nassistant: \"I'll use the pattern-detective agent to scan for anti-patterns.\"\n<commentary>Pattern detection with focus on anti-patterns is pattern-detective's specialty.</commentary></example>\n\n<example>Context: User wants to understand design decisions.\nuser: \"What design patterns are used in this authentication system?\"\nassistant: \"Let me use the pattern-detective agent to analyze patterns in the auth code.\"\n<commentary>Focused pattern analysis with area filtering.</commentary></example>"
|
|
4
4
|
model: haiku
|
|
5
5
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: codebase-explorer
|
|
2
|
+
name: cba:codebase-explorer
|
|
3
3
|
description: "Use this agent for open-ended codebase exploration - understanding structure, finding relevant files, and answering questions about how things work. Lighter weight than full architecture analysis.\n\n<example>Context: User exploring new codebase.\nuser: \"What's in this repo?\"\nassistant: \"I'll use the codebase-explorer agent to give you a quick overview.\"\n<commentary>Quick exploration, not deep analysis.</commentary></example>\n\n<example>Context: User looking for specific functionality.\nuser: \"Where is the email sending logic?\"\nassistant: \"Let me explore the codebase to find email-related code.\"\n<commentary>Targeted exploration for specific functionality.</commentary></example>"
|
|
4
4
|
model: haiku
|
|
5
5
|
---
|
|
@@ -24,10 +24,9 @@ Extract:
|
|
|
24
24
|
|
|
25
25
|
### Targeted Search
|
|
26
26
|
|
|
27
|
-
For "where is X?" questions:
|
|
27
|
+
For "where is X?" or "how does X work?" questions:
|
|
28
28
|
|
|
29
|
-
1. **
|
|
30
|
-
2. **Query the repo** for specific questions:
|
|
29
|
+
1. **Query the repo** for AI-powered answers:
|
|
31
30
|
|
|
32
31
|
```
|
|
33
32
|
mcp__codebase-analyzer__query_repo(
|
|
@@ -36,14 +35,21 @@ mcp__codebase-analyzer__query_repo(
|
|
|
36
35
|
)
|
|
37
36
|
```
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
2. **Read relevant files** using the analysisId from the response:
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
```
|
|
41
|
+
mcp__codebase-analyzer__read_files(
|
|
42
|
+
analysisId: "<from query_repo result>",
|
|
43
|
+
paths: ["src/services/email.ts", "src/templates/"]
|
|
44
|
+
)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
3. **Expand sections** for deeper module understanding:
|
|
42
48
|
|
|
43
49
|
```
|
|
44
|
-
mcp__codebase-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
mcp__codebase-analyzer__expand_section(
|
|
51
|
+
analysisId: "<from query_repo result>",
|
|
52
|
+
sectionId: "module_src_services"
|
|
47
53
|
)
|
|
48
54
|
```
|
|
49
55
|
|
|
@@ -95,7 +101,9 @@ mcp__codebase-analyzer__compare_repos(
|
|
|
95
101
|
## Guidelines
|
|
96
102
|
|
|
97
103
|
**DO:**
|
|
98
|
-
- Start with
|
|
104
|
+
- Start with `query_repo` for targeted questions (fast, reuses cache)
|
|
105
|
+
- Use `analyze_repo` with surface depth for overviews
|
|
106
|
+
- Follow up with `read_files` to examine specific code
|
|
99
107
|
- Give actionable summaries, not data dumps
|
|
100
108
|
- Point to specific files and line numbers
|
|
101
109
|
- Suggest what to explore next
|
package/commands/analyze.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: analyze
|
|
2
|
+
name: cba:analyze
|
|
3
3
|
description: Analyze a codebase with progressive disclosure
|
|
4
4
|
user-invocable: true
|
|
5
5
|
---
|
|
@@ -11,7 +11,7 @@ Analyze a repository using multi-layer progressive disclosure.
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
/analyze [source] [options]
|
|
14
|
+
/cba:analyze [source] [options]
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
**Arguments:**
|
|
@@ -26,19 +26,19 @@ Analyze a repository using multi-layer progressive disclosure.
|
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
# Analyze current directory
|
|
29
|
-
/analyze
|
|
29
|
+
/cba:analyze
|
|
30
30
|
|
|
31
31
|
# Analyze with surface depth (fast)
|
|
32
|
-
/analyze --depth surface
|
|
32
|
+
/cba:analyze --depth surface
|
|
33
33
|
|
|
34
34
|
# Analyze specific GitHub repo
|
|
35
|
-
/analyze https://github.com/user/repo
|
|
35
|
+
/cba:analyze https://github.com/user/repo
|
|
36
36
|
|
|
37
37
|
# Focus on specific module
|
|
38
|
-
/analyze --focus src/api
|
|
38
|
+
/cba:analyze --focus src/api
|
|
39
39
|
|
|
40
40
|
# Deep analysis with semantics
|
|
41
|
-
/analyze --depth deep --semantics
|
|
41
|
+
/cba:analyze --depth deep --semantics
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## Workflow
|
|
@@ -58,7 +58,7 @@ const focus = args.focus;
|
|
|
58
58
|
const semantics = args.semantics || false;
|
|
59
59
|
|
|
60
60
|
// Use architecture-analyzer agent
|
|
61
|
-
Task("architecture-analyzer", {
|
|
61
|
+
Task("cba:architecture-analyzer", {
|
|
62
62
|
prompt: `Analyze ${source} at ${depth} depth${focus ? `, focusing on ${focus}` : ""}${semantics ? " with semantic analysis" : ""}`
|
|
63
63
|
});
|
|
64
64
|
```
|