feat(mcp): Phase 1 tools improvement — Parts 1.1–1.4#14
Merged
Conversation
Extract import style, error handling, and type coverage analysis from private class methods into exported pure functions. Class methods now delegate to these, keeping all existing behavior identical. Adds 13 unit tests for the pure extractors — no file I/O needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add getDocsByFilePath to VectorStorage and analyzeFileFromIndex to PatternAnalysisService. When vectorStorage is available, comparePatterns reads signatures from the Antfly index instead of re-scanning with ts-morph. Falls back to scanner for tests/offline. Wire VectorStorage through InspectAdapter so dev_patterns uses the fast path in production. Add scratchpad tracking the 5k doc cap as a known limitation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rewrite analyzeFileWithDocs to use pure extractors directly - Delete 3 now-redundant private wrapper methods - Remove githubStatePath, checkGitHubIndex, githubIndex from health adapter - Clean up health adapter tests (remove 5 GitHub-specific tests) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d JSON - Merge dev_health into dev_status (section="health") — 6 tools → 5 - Delete HealthAdapter, its tests, and schema - Rename dev_patterns `query` → `filePath` to prevent LLM misuse - Add `format: "json"` to dev_patterns for token-efficient agent workflows - Add negative guidance to dev_patterns description (NOT for search/refs) - Add `suggestion` field to all adapter error responses for agent recovery - Update regression test to expect 5 adapters Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sweep all docs for stale dev_health references and 6-tool counts: - CLAUDE.md, README.md, PLAN.md, TROUBLESHOOTING.md, examples/README.md - Website: homepage, tools index, dev-health (→ redirect), dev-patterns (query→filePath, add json format), troubleshooting - CLI help text and CURSOR_SETUP.md - packages/dev-agent/README.md - Add changeset for v0.10.4, release notes, update latest-version.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev_patternsis 10-30x faster — reads from Antfly index instead of re-scanning with ts-morphdev_healthmerged intodev_status(section="health") — 6 tools reduced to 5dev_patternsparameter renamed fromquerytofilePathto prevent LLM misuseformat: "json"ondev_patternsfor token-efficient agent workflowssuggestionfield on errors for agent recovery guidanceChanges by Part
1.1: Extract pure pattern analyzers
extractImportStyleFromContent,extractErrorHandlingFromContent,extractTypeCoverageFromSignatures1.2: Index-based pattern analysis
getDocsByFilePathon VectorStorage (client-side exact path filter, capped at 5k docs)analyzeFileFromIndexon PatternAnalysisService (reads signatures from index, content from disk)comparePatternshas fast path (vectorStorage) and fallback (ts-morph scan)1.3: Cleanup
1.4: Agent usability overhaul
query→filePathin dev_patterns schema + adapter + testsformat: "json"enum value to InspectArgsSchemasuggestionto error responses in search, refs, map, status, inspect adaptersDocs sweep
Test plan
Generated with Claude Code