diff --git a/.claude/agents/context-search-agent.md b/.claude/agents/context-search-agent.md index 740006f1..71214908 100644 --- a/.claude/agents/context-search-agent.md +++ b/.claude/agents/context-search-agent.md @@ -44,19 +44,19 @@ You are a context discovery specialist focused on gathering relevant project inf **Use**: Unfamiliar APIs/libraries/patterns ### 3. Existing Code Discovery -**Primary (Code-Index MCP)**: -- `mcp__code-index__set_project_path()` - Initialize index -- `mcp__code-index__find_files(pattern)` - File pattern matching -- `mcp__code-index__search_code_advanced()` - Content search -- `mcp__code-index__get_file_summary()` - File structure analysis -- `mcp__code-index__refresh_index()` - Update index +**Primary (CCW CodexLens MCP)**: +- `mcp__ccw-tools__codex_lens(action="init", path=".")` - Initialize index +- `mcp__ccw-tools__codex_lens(action="search", query="pattern")` - Content search +- `mcp__ccw-tools__codex_lens(action="search_files", query="pattern")` - File search (paths only) +- `mcp__ccw-tools__codex_lens(action="symbol", file="path")` - File structure analysis +- `mcp__ccw-tools__codex_lens(action="update", files=[...])` - Update specific files **Fallback (CLI)**: - `rg` (ripgrep) - Fast content search - `find` - File discovery - `Grep` - Pattern matching -**Priority**: Code-Index MCP > ripgrep > find > grep +**Priority**: CodexLens MCP > ripgrep > find > grep ## Simplified Execution Process (3 Phases) @@ -77,9 +77,8 @@ if (file_exists(contextPackagePath)) { **1.2 Foundation Setup**: ```javascript -// 1. Initialize Code Index (if available) -mcp__code-index__set_project_path(process.cwd()) -mcp__code-index__refresh_index() +// 1. Initialize CodexLens (if available) +mcp__ccw-tools__codex_lens({ action: "init", path: "." }) // 2. Project Structure bash(ccw tool exec get_modules_by_depth '{}') @@ -212,18 +211,18 @@ mcp__exa__web_search_exa({ **Layer 1: File Pattern Discovery** ```javascript -// Primary: Code-Index MCP -const files = mcp__code-index__find_files("*{keyword}*") +// Primary: CodexLens MCP +const files = mcp__ccw-tools__codex_lens({ action: "search_files", query: "*{keyword}*" }) // Fallback: find . -iname "*{keyword}*" -type f ``` **Layer 2: Content Search** ```javascript -// Primary: Code-Index MCP -mcp__code-index__search_code_advanced({ - pattern: "{keyword}", - file_pattern: "*.ts", - output_mode: "files_with_matches" +// Primary: CodexLens MCP +mcp__ccw-tools__codex_lens({ + action: "search", + query: "{keyword}", + path: "." }) // Fallback: rg "{keyword}" -t ts --files-with-matches ``` @@ -231,11 +230,10 @@ mcp__code-index__search_code_advanced({ **Layer 3: Semantic Patterns** ```javascript // Find definitions (class, interface, function) -mcp__code-index__search_code_advanced({ - pattern: "^(export )?(class|interface|type|function) .*{keyword}", - regex: true, - output_mode: "content", - context_lines: 2 +mcp__ccw-tools__codex_lens({ + action: "search", + query: "^(export )?(class|interface|type|function) .*{keyword}", + path: "." }) ``` @@ -243,21 +241,22 @@ mcp__code-index__search_code_advanced({ ```javascript // Get file summaries for imports/exports for (const file of discovered_files) { - const summary = mcp__code-index__get_file_summary(file) - // summary: {imports, functions, classes, line_count} + const summary = mcp__ccw-tools__codex_lens({ action: "symbol", file: file }) + // summary: {symbols: [{name, type, line}]} } ``` **Layer 5: Config & Tests** ```javascript // Config files -mcp__code-index__find_files("*.config.*") -mcp__code-index__find_files("package.json") +mcp__ccw-tools__codex_lens({ action: "search_files", query: "*.config.*" }) +mcp__ccw-tools__codex_lens({ action: "search_files", query: "package.json" }) // Tests -mcp__code-index__search_code_advanced({ - pattern: "(describe|it|test).*{keyword}", - file_pattern: "*.{test,spec}.*" +mcp__ccw-tools__codex_lens({ + action: "search", + query: "(describe|it|test).*{keyword}", + path: "." }) ``` @@ -560,14 +559,14 @@ Output: .workflow/session/{session}/.process/context-package.json - Expose sensitive data (credentials, keys) - Exceed file limits (50 total) - Include binaries/generated files -- Use ripgrep if code-index available +- Use ripgrep if CodexLens available **ALWAYS**: -- Initialize code-index in Phase 0 +- Initialize CodexLens in Phase 0 - Execute get_modules_by_depth.sh - Load CLAUDE.md/README.md (unless in memory) - Execute all 3 discovery tracks -- Use code-index MCP as primary +- Use CodexLens MCP as primary - Fallback to ripgrep only when needed - Use Exa for unfamiliar APIs - Apply multi-factor scoring diff --git a/.claude/agents/test-context-search-agent.md b/.claude/agents/test-context-search-agent.md index 6da3f521..aebb514d 100644 --- a/.claude/agents/test-context-search-agent.md +++ b/.claude/agents/test-context-search-agent.md @@ -36,10 +36,10 @@ You are a test context discovery specialist focused on gathering test coverage i **Use**: Phase 1 source context loading ### 2. Test Coverage Discovery -**Primary (Code-Index MCP)**: -- `mcp__code-index__find_files(pattern)` - Find test files (*.test.*, *.spec.*) -- `mcp__code-index__search_code_advanced()` - Search test patterns -- `mcp__code-index__get_file_summary()` - Analyze test structure +**Primary (CCW CodexLens MCP)**: +- `mcp__ccw-tools__codex_lens(action="search_files", query="*.test.*")` - Find test files +- `mcp__ccw-tools__codex_lens(action="search", query="pattern")` - Search test patterns +- `mcp__ccw-tools__codex_lens(action="symbol", file="path")` - Analyze test structure **Fallback (CLI)**: - `rg` (ripgrep) - Fast test pattern search @@ -120,9 +120,10 @@ for (const summary_path of summaries) { **2.1 Existing Test Discovery**: ```javascript -// Method 1: Code-Index MCP (preferred) -const test_files = mcp__code-index__find_files({ - patterns: ["*.test.*", "*.spec.*", "*test_*.py", "*_test.go"] +// Method 1: CodexLens MCP (preferred) +const test_files = mcp__ccw-tools__codex_lens({ + action: "search_files", + query: "*.test.* OR *.spec.* OR test_*.py OR *_test.go" }); // Method 2: Fallback CLI diff --git a/.claude/commands/memory/load.md b/.claude/commands/memory/load.md index be1be51f..e04e252b 100644 --- a/.claude/commands/memory/load.md +++ b/.claude/commands/memory/load.md @@ -39,7 +39,7 @@ The command fully delegates to **universal-executor agent**, which autonomously: 1. **Analyzes Project Structure**: Executes `get_modules_by_depth.sh` to understand architecture 2. **Loads Documentation**: Reads CLAUDE.md, README.md and other key docs 3. **Extracts Keywords**: Derives core keywords from task description -4. **Discovers Files**: Uses MCP code-index or rg/find to locate relevant files +4. **Discovers Files**: Uses CodexLens MCP or rg/find to locate relevant files 5. **CLI Deep Analysis**: Executes Gemini/Qwen CLI for deep context analysis 6. **Generates Content Package**: Returns structured JSON core content package diff --git a/.claude/commands/workflow/tools/context-gather.md b/.claude/commands/workflow/tools/context-gather.md index 238522df..d9f24860 100644 --- a/.claude/commands/workflow/tools/context-gather.md +++ b/.claude/commands/workflow/tools/context-gather.md @@ -237,7 +237,7 @@ Execute complete context-search-agent workflow for implementation planning: ### Phase 1: Initialization & Pre-Analysis 1. **Project State Loading**: Read and parse `.workflow/project.json`. Use its `overview` section as the foundational `project_context`. This is your primary source for architecture, tech stack, and key components. If file doesn't exist, proceed with fresh analysis. 2. **Detection**: Check for existing context-package (early exit if valid) -3. **Foundation**: Initialize code-index, get project structure, load docs +3. **Foundation**: Initialize CodexLens, get project structure, load docs 4. **Analysis**: Extract keywords, determine scope, classify complexity based on task description and project state ### Phase 2: Multi-Source Context Discovery diff --git a/.claude/commands/workflow/tools/task-generate-tdd.md b/.claude/commands/workflow/tools/task-generate-tdd.md index 177eae6c..832a3eb7 100644 --- a/.claude/commands/workflow/tools/task-generate-tdd.md +++ b/.claude/commands/workflow/tools/task-generate-tdd.md @@ -113,7 +113,7 @@ Phase 2: Agent Execution (Document Generation) // Existing test patterns and coverage analysis }, "mcp_capabilities": { - "code_index": true, + "codex_lens": true, "exa_code": true, "exa_web": true } @@ -338,7 +338,7 @@ Generate all three documents and report completion status: - TDD cycles configured: N cycles with quantified test cases - Artifacts integrated: synthesis-spec, guidance-specification, N role analyses - Test context integrated: existing patterns and coverage -- MCP enhancements: code-index, exa-research +- MCP enhancements: CodexLens, exa-research - Session ready for TDD execution: /workflow:execute ` ) diff --git a/.claude/skills/command-guide/reference/agents/context-search-agent.md b/.claude/skills/command-guide/reference/agents/context-search-agent.md index 740006f1..71214908 100644 --- a/.claude/skills/command-guide/reference/agents/context-search-agent.md +++ b/.claude/skills/command-guide/reference/agents/context-search-agent.md @@ -44,19 +44,19 @@ You are a context discovery specialist focused on gathering relevant project inf **Use**: Unfamiliar APIs/libraries/patterns ### 3. Existing Code Discovery -**Primary (Code-Index MCP)**: -- `mcp__code-index__set_project_path()` - Initialize index -- `mcp__code-index__find_files(pattern)` - File pattern matching -- `mcp__code-index__search_code_advanced()` - Content search -- `mcp__code-index__get_file_summary()` - File structure analysis -- `mcp__code-index__refresh_index()` - Update index +**Primary (CCW CodexLens MCP)**: +- `mcp__ccw-tools__codex_lens(action="init", path=".")` - Initialize index +- `mcp__ccw-tools__codex_lens(action="search", query="pattern")` - Content search +- `mcp__ccw-tools__codex_lens(action="search_files", query="pattern")` - File search (paths only) +- `mcp__ccw-tools__codex_lens(action="symbol", file="path")` - File structure analysis +- `mcp__ccw-tools__codex_lens(action="update", files=[...])` - Update specific files **Fallback (CLI)**: - `rg` (ripgrep) - Fast content search - `find` - File discovery - `Grep` - Pattern matching -**Priority**: Code-Index MCP > ripgrep > find > grep +**Priority**: CodexLens MCP > ripgrep > find > grep ## Simplified Execution Process (3 Phases) @@ -77,9 +77,8 @@ if (file_exists(contextPackagePath)) { **1.2 Foundation Setup**: ```javascript -// 1. Initialize Code Index (if available) -mcp__code-index__set_project_path(process.cwd()) -mcp__code-index__refresh_index() +// 1. Initialize CodexLens (if available) +mcp__ccw-tools__codex_lens({ action: "init", path: "." }) // 2. Project Structure bash(ccw tool exec get_modules_by_depth '{}') @@ -212,18 +211,18 @@ mcp__exa__web_search_exa({ **Layer 1: File Pattern Discovery** ```javascript -// Primary: Code-Index MCP -const files = mcp__code-index__find_files("*{keyword}*") +// Primary: CodexLens MCP +const files = mcp__ccw-tools__codex_lens({ action: "search_files", query: "*{keyword}*" }) // Fallback: find . -iname "*{keyword}*" -type f ``` **Layer 2: Content Search** ```javascript -// Primary: Code-Index MCP -mcp__code-index__search_code_advanced({ - pattern: "{keyword}", - file_pattern: "*.ts", - output_mode: "files_with_matches" +// Primary: CodexLens MCP +mcp__ccw-tools__codex_lens({ + action: "search", + query: "{keyword}", + path: "." }) // Fallback: rg "{keyword}" -t ts --files-with-matches ``` @@ -231,11 +230,10 @@ mcp__code-index__search_code_advanced({ **Layer 3: Semantic Patterns** ```javascript // Find definitions (class, interface, function) -mcp__code-index__search_code_advanced({ - pattern: "^(export )?(class|interface|type|function) .*{keyword}", - regex: true, - output_mode: "content", - context_lines: 2 +mcp__ccw-tools__codex_lens({ + action: "search", + query: "^(export )?(class|interface|type|function) .*{keyword}", + path: "." }) ``` @@ -243,21 +241,22 @@ mcp__code-index__search_code_advanced({ ```javascript // Get file summaries for imports/exports for (const file of discovered_files) { - const summary = mcp__code-index__get_file_summary(file) - // summary: {imports, functions, classes, line_count} + const summary = mcp__ccw-tools__codex_lens({ action: "symbol", file: file }) + // summary: {symbols: [{name, type, line}]} } ``` **Layer 5: Config & Tests** ```javascript // Config files -mcp__code-index__find_files("*.config.*") -mcp__code-index__find_files("package.json") +mcp__ccw-tools__codex_lens({ action: "search_files", query: "*.config.*" }) +mcp__ccw-tools__codex_lens({ action: "search_files", query: "package.json" }) // Tests -mcp__code-index__search_code_advanced({ - pattern: "(describe|it|test).*{keyword}", - file_pattern: "*.{test,spec}.*" +mcp__ccw-tools__codex_lens({ + action: "search", + query: "(describe|it|test).*{keyword}", + path: "." }) ``` @@ -560,14 +559,14 @@ Output: .workflow/session/{session}/.process/context-package.json - Expose sensitive data (credentials, keys) - Exceed file limits (50 total) - Include binaries/generated files -- Use ripgrep if code-index available +- Use ripgrep if CodexLens available **ALWAYS**: -- Initialize code-index in Phase 0 +- Initialize CodexLens in Phase 0 - Execute get_modules_by_depth.sh - Load CLAUDE.md/README.md (unless in memory) - Execute all 3 discovery tracks -- Use code-index MCP as primary +- Use CodexLens MCP as primary - Fallback to ripgrep only when needed - Use Exa for unfamiliar APIs - Apply multi-factor scoring diff --git a/.claude/skills/command-guide/reference/agents/test-context-search-agent.md b/.claude/skills/command-guide/reference/agents/test-context-search-agent.md index 6da3f521..b93134e2 100644 --- a/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +++ b/.claude/skills/command-guide/reference/agents/test-context-search-agent.md @@ -36,17 +36,17 @@ You are a test context discovery specialist focused on gathering test coverage i **Use**: Phase 1 source context loading ### 2. Test Coverage Discovery -**Primary (Code-Index MCP)**: -- `mcp__code-index__find_files(pattern)` - Find test files (*.test.*, *.spec.*) -- `mcp__code-index__search_code_advanced()` - Search test patterns -- `mcp__code-index__get_file_summary()` - Analyze test structure +**Primary (CCW CodexLens MCP)**: +- `mcp__ccw-tools__codex_lens(action="search_files", query="*.test.*")` - Find test files +- `mcp__ccw-tools__codex_lens(action="search", query="pattern")` - Search test patterns +- `mcp__ccw-tools__codex_lens(action="symbol", file="path")` - Analyze test structure **Fallback (CLI)**: - `rg` (ripgrep) - Fast test pattern search - `find` - Test file discovery - `Grep` - Framework detection -**Priority**: Code-Index MCP > ripgrep > find > grep +**Priority**: CodexLens MCP > ripgrep > find > grep ### 3. Framework & Convention Analysis **Tools**: @@ -120,9 +120,10 @@ for (const summary_path of summaries) { **2.1 Existing Test Discovery**: ```javascript -// Method 1: Code-Index MCP (preferred) -const test_files = mcp__code-index__find_files({ - patterns: ["*.test.*", "*.spec.*", "*test_*.py", "*_test.go"] +// Method 1: CodexLens MCP (preferred) +const test_files = mcp__ccw-tools__codex_lens({ + action: "search_files", + query: "*.test.* OR *.spec.* OR test_*.py OR *_test.go" }); // Method 2: Fallback CLI diff --git a/.claude/skills/command-guide/reference/commands/memory/load.md b/.claude/skills/command-guide/reference/commands/memory/load.md index be1be51f..e04e252b 100644 --- a/.claude/skills/command-guide/reference/commands/memory/load.md +++ b/.claude/skills/command-guide/reference/commands/memory/load.md @@ -39,7 +39,7 @@ The command fully delegates to **universal-executor agent**, which autonomously: 1. **Analyzes Project Structure**: Executes `get_modules_by_depth.sh` to understand architecture 2. **Loads Documentation**: Reads CLAUDE.md, README.md and other key docs 3. **Extracts Keywords**: Derives core keywords from task description -4. **Discovers Files**: Uses MCP code-index or rg/find to locate relevant files +4. **Discovers Files**: Uses CodexLens MCP or rg/find to locate relevant files 5. **CLI Deep Analysis**: Executes Gemini/Qwen CLI for deep context analysis 6. **Generates Content Package**: Returns structured JSON core content package diff --git a/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md b/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md index 238522df..d9f24860 100644 --- a/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +++ b/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md @@ -237,7 +237,7 @@ Execute complete context-search-agent workflow for implementation planning: ### Phase 1: Initialization & Pre-Analysis 1. **Project State Loading**: Read and parse `.workflow/project.json`. Use its `overview` section as the foundational `project_context`. This is your primary source for architecture, tech stack, and key components. If file doesn't exist, proceed with fresh analysis. 2. **Detection**: Check for existing context-package (early exit if valid) -3. **Foundation**: Initialize code-index, get project structure, load docs +3. **Foundation**: Initialize CodexLens, get project structure, load docs 4. **Analysis**: Extract keywords, determine scope, classify complexity based on task description and project state ### Phase 2: Multi-Source Context Discovery diff --git a/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md b/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md index 177eae6c..832a3eb7 100644 --- a/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +++ b/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md @@ -113,7 +113,7 @@ Phase 2: Agent Execution (Document Generation) // Existing test patterns and coverage analysis }, "mcp_capabilities": { - "code_index": true, + "codex_lens": true, "exa_code": true, "exa_web": true } @@ -338,7 +338,7 @@ Generate all three documents and report completion status: - TDD cycles configured: N cycles with quantified test cases - Artifacts integrated: synthesis-spec, guidance-specification, N role analyses - Test context integrated: existing patterns and coverage -- MCP enhancements: code-index, exa-research +- MCP enhancements: CodexLens, exa-research - Session ready for TDD execution: /workflow:execute ` ) diff --git a/INSTALL.md b/INSTALL.md index 2ea6a823..64daa3d9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -171,9 +171,10 @@ MCP (Model Context Protocol) tools provide advanced codebase analysis. **Recomme | MCP Server | Purpose | Installation Guide | |------------|---------|-------------------| | **Exa MCP** | External API patterns & best practices | [Install Guide](https://smithery.ai/server/exa) | -| **Code Index MCP** | Advanced internal code search | [Install Guide](https://github.com/johnhuang316/code-index-mcp) | | **Chrome DevTools MCP** | ⚠️ **Required for UI workflows** - URL mode design extraction | [Install Guide](https://github.com/ChromeDevTools/chrome-devtools-mcp) | +> **Note**: Code Index MCP has been replaced by CCW's built-in **CodexLens** (`mcp__ccw-tools__codex_lens`). No additional installation required for code indexing. + ⚠️ **Note**: Some workflows expect MCP tools to be available. Without them, you may experience: - Slower code analysis and search operations - Reduced context quality in some scenarios diff --git a/INSTALL_CN.md b/INSTALL_CN.md index b30f8d19..db67fbc6 100644 --- a/INSTALL_CN.md +++ b/INSTALL_CN.md @@ -201,9 +201,10 @@ MCP 工具从外部来源提供高级上下文检索,增强 AI 的理解能力 | 工具 | 用途 | 官方源码 | |---|---|---| | **Exa MCP** | 用于搜索代码和网络。 | [exa-labs/exa-mcp-server](https://github.com/exa-labs/exa-mcp-server) | -| **Code Index MCP** | 用于索引和搜索本地代码库。 |[johnhuang316/code-index-mcp](https://github.com/johnhuang316/code-index-mcp) | | **Chrome DevTools MCP** | 用于与网页交互以提取布局和样式信息。 | [ChromeDevTools/chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp) | +> **注意**: Code Index MCP 已被 CCW 内置的 **CodexLens** (`mcp__ccw-tools__codex_lens`) 替代。无需额外安装代码索引工具。 + - **先决条件**: Node.js 和 npm (或兼容的 JavaScript 运行时)。 - **验证**: 安装后,检查服务器是否可以启动 (具体请查阅 MCP 文档)。