refactor: remove MCP code-index dependency, replace with ripgrep/find

Replace all mcp__code-index__ calls with native ripgrep and find commands
across workflow and command files for better performance and portability.

Changes:
- Remove 41 mcp__code-index__ function calls from 12 files
- Replace with ripgrep (rg) for content search
- Replace with find for file discovery
- Remove index refresh dependencies (no longer needed)

Modified files:
- workflow/tools: context-gather, test-context-gather, task-generate-agent,
  task-generate, test-task-generate (core workflow tools)
- workflow: review (security scanning)
- memory: load, update-related, docs (memory management)
- cli/mode: plan, bug-index, code-analysis (CLI modes)

Documentation updates:
- Simplify mcp-tool-strategy.md to only Exa usage (5 lines)
- Streamline context-search-strategy.md to 69 lines
- Standardize codebase-retrieval syntax per intelligent-tools-strategy.md

Benefits:
- Faster search with ripgrep (no index overhead)
- Better cross-platform compatibility
- Simpler configuration (fewer MCP dependencies)
- -232 lines of code removed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-10-24 15:45:26 +08:00
parent 3068c2ca83
commit da908d8db4
14 changed files with 124 additions and 356 deletions

View File

@@ -138,7 +138,7 @@ RULES: $(cat ~/.claude/prompt-templates/bug-fix.md) | Bug: token validation fail
```bash
# 1. Find bug-related files
rg "error_keyword" --files-with-matches
mcp__code-index__search_code_advanced(pattern="error|exception", file_pattern="*.ts")
rg "error|exception" -g "*.ts"
# 2. Execute bug analysis with focused context (analysis only, no code changes)
/cli:mode:bug-index --cd "src/module" "specific error description"

View File

@@ -141,7 +141,7 @@ RULES: $(cat ~/.claude/prompt-templates/code-analysis.md) | Focus on security
```bash
# 1. Find entry points and related files
rg "function.*authenticate|class.*AuthService" --files-with-matches
mcp__code-index__search_code_advanced(pattern="authenticate|login", file_pattern="*.ts")
rg "authenticate|login" -g "*.ts"
# 2. Build call graph understanding
# entry → middleware → service → repository

View File

@@ -139,7 +139,7 @@ RULES: $(cat ~/.claude/prompt-templates/plan.md) | Maintain backward compatibili
```bash
# 1. Discover project structure
~/.claude/scripts/get_modules_by_depth.sh
mcp__code-index__find_files(pattern="*.ts")
find . -name "*.ts" -type f
# 2. Gather existing architecture info
rg "architecture|design" --files-with-matches