Skip to content

Commit 16c93d3

Browse files
committed
refactor(mcp)!: replace dev_explore with dev_inspect tool
- Renamed dev_explore to dev_inspect for clarity - Changed actions to specific verbs: compare, validate - Removed redundant pattern and relationships actions - Updated all documentation and tests - Added comprehensive migration guide BREAKING CHANGE: dev_explore tool has been replaced with dev_inspect. Use action 'compare' instead of 'similar', and 'validate' for pattern checks. The 'pattern' action is replaced by dev_search, and 'relationships' by dev_refs.
1 parent 78dbd52 commit 16c93d3

32 files changed

Lines changed: 1156 additions & 1290 deletions
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
"@lytics/dev-agent-mcp": patch
3+
"@lytics/dev-agent": patch
4+
"@lytics/dev-agent-cli": patch
5+
---
6+
7+
Refactor: Rename dev_explore → dev_inspect with focused actions
8+
9+
**BREAKING CHANGES:**
10+
11+
- `dev_explore` renamed to `dev_inspect`
12+
- Actions changed from `['pattern', 'similar', 'relationships']` to `['compare', 'validate']`
13+
- Removed `action: "pattern"` → Use `dev_search` instead
14+
- Removed `action: "relationships"` → Use `dev_refs` instead
15+
- Renamed `action: "similar"``action: "compare"`
16+
17+
**What's New:**
18+
19+
- `dev_inspect` with `action: "compare"` finds similar code implementations
20+
- `dev_inspect` with `action: "validate"` checks pattern consistency (placeholder for future)
21+
- Clearer tool boundaries: search vs. inspect vs. refs
22+
- File-focused analysis (always takes file path, not search query)
23+
24+
**Migration Guide:**
25+
26+
```typescript
27+
// Before
28+
dev_explore { action: "similar", query: "src/auth.ts" }
29+
dev_explore { action: "pattern", query: "error handling" }
30+
dev_explore { action: "relationships", query: "src/auth.ts" }
31+
32+
// After
33+
dev_inspect { action: "compare", query: "src/auth.ts" }
34+
dev_search { query: "error handling" }
35+
dev_refs { name: "authenticateUser" }
36+
```
37+
38+
**Why:**
39+
40+
- Eliminate tool duplication (`pattern` duplicated `dev_search`)
41+
- Clear single responsibility (file analysis only)
42+
- Better naming (`inspect` = deep file examination)
43+
- Reserve `dev_explore` for future external context (standards, examples, docs)
44+

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ MCP server with built-in adapters for AI tools.
191191
- **HistoryAdapter:** Semantic git commit search (`dev_history`)
192192
- **StatusAdapter:** Repository status (`dev_status`)
193193
- **PlanAdapter:** Context assembly for issues (`dev_plan`)
194-
- **ExploreAdapter:** Code exploration (`dev_explore`)
194+
- **InspectAdapter:** File analysis and pattern checking (`dev_inspect`)
195195
- **GitHubAdapter:** Issue/PR search (`dev_gh`)
196196
- **HealthAdapter:** Server health checks (`dev_health`)
197197

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- `dev_search` - Semantic code search with type-aware understanding
2020
- `dev_status` - Repository health and statistics
2121
- `dev_plan` - Implementation planning from GitHub issues
22-
- `dev_explore` - Code pattern discovery and relationship mapping
22+
- `dev_inspect` - File analysis (similarity + pattern checking)
2323
- `dev_gh` - GitHub issue/PR search with offline caching
2424
- **Multi-language Support** - TypeScript, JavaScript, Go, Python, Rust, Markdown
2525
- **Local-first Architecture** - All embeddings and indexing run locally

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Once installed, AI tools gain access to:
168168
- **`dev_map`** - Codebase structure with component counts and change frequency
169169
- **`dev_history`** - Semantic search over git commits (who changed what and why)
170170
- **`dev_plan`** - Assemble context for GitHub issues (code + history + patterns)
171-
- **`dev_explore`** - Find similar code, trace relationships
171+
- **`dev_inspect`** - Inspect files (compare similar implementations, check patterns)
172172
- **`dev_gh`** - Search GitHub issues/PRs semantically
173173
- **`dev_status`** - Repository indexing status
174174
- **`dev_health`** - Server health checks

PLAN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Dev-agent provides semantic code search, codebase intelligence, and GitHub integ
4444
| Adapter framework | ✅ Done | `@lytics/dev-agent-mcp` |
4545
| `dev_search` - Semantic code search | ✅ Done | MCP adapter |
4646
| `dev_status` - Repository status | ✅ Done | MCP adapter |
47-
| `dev_explore` - Code exploration | ✅ Done | MCP adapter |
47+
| `dev_inspect` - File analysis | ✅ Done | MCP adapter |
4848
| `dev_plan` - Issue planning | ✅ Done | MCP adapter |
4949
| `dev_gh` - GitHub search | ✅ Done | MCP adapter |
5050
| `dev_health` - Health checks | ✅ Done | MCP adapter |
@@ -219,8 +219,8 @@ Git history is valuable context that LLMs can't easily access. We add intelligen
219219
| Phase | Tool | Status |
220220
|-------|------|--------|
221221
| 1 (v0.4.4) | `dev_search` | ✅ Done |
222-
| 2 | `dev_refs`, `dev_explore` | 🔲 Todo |
223-
| 3 | `dev_map`, `dev_status` | 🔲 Todo |
222+
| 2 | `dev_refs`, `dev_inspect` | ✅ Done |
223+
| 3 | `dev_map`, `dev_status` | ✅ Done |
224224

225225
**Implementation (Phase 1):**
226226
- After search results, check filesystem for test siblings
@@ -234,7 +234,7 @@ Git history is valuable context that LLMs can't easily access. We add intelligen
234234
|------|--------|
235235
| Improved dev_search description ("USE THIS FIRST") | ✅ Done |
236236
| Improved dev_map description (vs list_dir) | ✅ Done |
237-
| Improved dev_explore description (workflow hints) | ✅ Done |
237+
| Improved dev_inspect description (file analysis) | ✅ Done |
238238
| Improved dev_refs description (specific symbols) | ✅ Done |
239239
| All 9 adapters registered in CLI | ✅ Done |
240240

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dev-agent indexes your codebase and provides 9 MCP tools to AI assistants. Inste
1515
- `dev_map` — Codebase structure with change frequency
1616
- `dev_history` — Semantic search over git commits
1717
- `dev_plan` — Assemble context for GitHub issues
18-
- `dev_explore`Find similar code, trace relationships
18+
- `dev_inspect`Inspect files (compare similar code, check patterns)
1919
- `dev_gh` — Search GitHub issues/PRs semantically
2020
- `dev_status` / `dev_health` — Monitoring
2121

@@ -157,12 +157,12 @@ Assemble context for issue #42
157157

158158
**Note:** This tool no longer generates task breakdowns. It provides comprehensive context so the AI assistant can create better plans.
159159

160-
### `dev_explore` - Code Exploration
161-
Discover patterns, find similar code, analyze relationships.
160+
### `dev_inspect` - File Analysis
161+
Inspect specific files, compare implementations, validate patterns.
162162

163163
```
164-
Find code similar to src/auth/middleware.ts
165-
Search for error handling patterns
164+
Compare src/auth/middleware.ts with similar implementations
165+
Validate pattern consistency in src/hooks/useAuth.ts
166166
```
167167

168168
### `dev_status` - Repository Status

TROUBLESHOOTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ dev github index
456456
**Expected:**
457457
- `dev_search`: 100-500ms
458458
- `dev_status`: 50-100ms
459-
- `dev_explore`: 200-800ms
459+
- `dev_inspect`: 200-800ms
460460
- `dev_plan`: 5-15 seconds
461461
- `dev_gh`: 100-300ms
462462

@@ -546,7 +546,7 @@ dev github index
546546
**Solution:**
547547
Check the tool's input schema:
548548
- `dev_search`: Requires `query` (string)
549-
- `dev_explore`: Requires `action` and `query`
549+
- `dev_inspect`: Requires `action` and `query` (file path)
550550
- `dev_plan`: Requires `issue` (number)
551551
- `dev_gh`: Requires `action`
552552

@@ -655,7 +655,7 @@ dev mcp start --verbose
655655
# In another terminal, send test message
656656
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | dev mcp start
657657

658-
# Should list all 9 tools: dev_search, dev_refs, dev_map, dev_history, dev_status, dev_plan, dev_explore, dev_gh, dev_health
658+
# Should list all 9 tools: dev_search, dev_refs, dev_map, dev_history, dev_status, dev_plan, dev_inspect, dev_gh, dev_health
659659
```
660660

661661
### Inspect storage
@@ -875,7 +875,7 @@ dev_health
875875
**Solution:**
876876
- Index at monorepo root
877877
- Search works across all projects
878-
- Use `dev_explore` to find related code
878+
- Use `dev_inspect` to analyze specific files
879879

880880
### Non-git repositories
881881

@@ -890,7 +890,7 @@ dev_health
890890
dev index .
891891

892892
# Skip GitHub indexing
893-
# Just use dev_search, dev_status, dev_explore, dev_plan
893+
# Just use dev_search, dev_status, dev_inspect, dev_plan
894894
```
895895

896896
### Very large files (>10MB)

examples/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,20 @@ dev github index
200200

201201
---
202202

203-
### `dev_explore` - Code Exploration
203+
### `dev_inspect` - File Analysis
204204

205-
Find patterns and similar code:
205+
Inspect files and compare implementations:
206206

207207
```
208-
# Find patterns
209-
dev_explore:
210-
action: "pattern"
211-
query: "error handling middleware"
212-
213-
# Find similar code
214-
dev_explore:
215-
action: "similar"
216-
path: "src/utils/retry.ts"
208+
# Compare similar implementations
209+
dev_inspect:
210+
action: "compare"
211+
query: "src/utils/retry.ts"
212+
213+
# Validate pattern consistency (coming soon)
214+
dev_inspect:
215+
action: "validate"
216+
query: "src/hooks/useAuth.ts"
217217
```
218218

219219
---
@@ -294,9 +294,9 @@ dev_health:
294294
dev_plan: { issue: 123 }
295295
```
296296

297-
2. **Explore relevant patterns:**
297+
2. **Search for relevant patterns:**
298298
```
299-
dev_explore: { action: "pattern", query: "feature type from issue" }
299+
dev_search: { query: "feature type from issue" }
300300
```
301301

302302
### Code Review Prep

packages/cli/src/commands/mcp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Setup:
6161
3. Restart Cursor to activate
6262
6363
Available Tools (9):
64-
dev_search, dev_status, dev_plan, dev_explore, dev_gh,
64+
dev_search, dev_status, dev_plan, dev_inspect, dev_gh,
6565
dev_health, dev_refs, dev_map, dev_history
6666
`
6767
)
@@ -251,7 +251,7 @@ Available Tools (9):
251251

252252
logger.info(chalk.green('MCP server started successfully!'));
253253
logger.info(
254-
'Available tools: dev_search, dev_status, dev_plan, dev_explore, dev_gh, dev_health, dev_refs, dev_map, dev_history'
254+
'Available tools: dev_search, dev_status, dev_plan, dev_inspect, dev_gh, dev_health, dev_refs, dev_map, dev_history'
255255
);
256256

257257
if (options.transport === 'stdio') {

packages/core/src/observability/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Track parent-child relationships:
126126

127127
```typescript
128128
const parent = tracker.startRequest('dev_plan', { issue: 42 });
129-
const child = tracker.startRequest('dev_explore', { action: 'pattern' }, parent.requestId);
129+
const child = tracker.startRequest('dev_inspect', { action: 'compare' }, parent.requestId);
130130
// child.parentId === parent.requestId
131131
```
132132

@@ -144,7 +144,7 @@ const metrics = tracker.getMetrics();
144144
// p99Duration: 890,
145145
// byTool: {
146146
// 'dev_search': { count: 500, avgDuration: 100 },
147-
// 'dev_explore': { count: 300, avgDuration: 200 },
147+
// 'dev_inspect': { count: 300, avgDuration: 200 },
148148
// 'dev_plan': { count: 200, avgDuration: 180 }
149149
// }
150150
// }

0 commit comments

Comments
 (0)