mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
feat: add semantic graph design for static code analysis
- Introduced a comprehensive design document for a Code Semantic Graph aimed at enhancing static analysis capabilities. - Defined the architecture, core components, and implementation steps for analyzing function calls, data flow, and dependencies. - Included detailed specifications for nodes and edges in the graph, along with database schema for storage. - Outlined phases for implementation, technical challenges, success metrics, and application scenarios.
This commit is contained in:
@@ -45,3 +45,49 @@
|
||||
**Use semantic search** for exploratory tasks
|
||||
**Use indexed search** for large, stable codebases
|
||||
**Use Exa** for external/public knowledge
|
||||
|
||||
## ⚡ Core Search Tools
|
||||
|
||||
**rg (ripgrep)**: Fast content search with regex support
|
||||
**find**: File/directory location by name patterns
|
||||
**grep**: Built-in pattern matching (fallback when rg unavailable)
|
||||
**get_modules_by_depth**: Program architecture analysis (MANDATORY before planning)
|
||||
|
||||
|
||||
## 🔧 Quick Command Reference
|
||||
|
||||
```bash
|
||||
# Semantic File Discovery (codebase-retrieval via CCW)
|
||||
ccw cli exec "
|
||||
PURPOSE: Discover files relevant to task/feature
|
||||
TASK: • List all files related to [task/feature description]
|
||||
MODE: analysis
|
||||
CONTEXT: @**/*
|
||||
EXPECTED: Relevant file paths with relevance explanation
|
||||
RULES: Focus on direct relevance to task requirements | analysis=READ-ONLY
|
||||
" --tool gemini --cd [directory]
|
||||
|
||||
# Program Architecture (MANDATORY before planning)
|
||||
ccw tool exec get_modules_by_depth '{}'
|
||||
|
||||
# Content Search (rg preferred)
|
||||
rg "pattern" --type js -n # Search JS files with line numbers
|
||||
rg -i "case-insensitive" # Ignore case
|
||||
rg -C 3 "context" # Show 3 lines before/after
|
||||
|
||||
# File Search
|
||||
find . -name "*.ts" -type f # Find TypeScript files
|
||||
find . -path "*/node_modules" -prune -o -name "*.js" -print
|
||||
|
||||
# Workflow Examples
|
||||
rg "IMPL-\d+" .workflow/ --type json # Find task IDs
|
||||
find .workflow/ -name "*.json" -path "*/.task/*" # Locate task files
|
||||
rg "status.*pending" .workflow/.task/ # Find pending tasks
|
||||
```
|
||||
|
||||
## ⚡ Performance Tips
|
||||
|
||||
- **rg > grep** for content search
|
||||
- **Use --type filters** to limit file types
|
||||
- **Exclude dirs**: `--glob '!node_modules'`
|
||||
- **Use -F** for literal strings (no regex)
|
||||
|
||||
Reference in New Issue
Block a user