🎉 init: 小龙的工作空间
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
---
|
||||
name: code-explorer
|
||||
description: Search and explore codebases with CodeGraph. Symbol lookup, caller/callee analysis, impact analysis, BFS graph traversal.
|
||||
metadata: { "openclaw": { "emoji": "🔍" } }
|
||||
---
|
||||
|
||||
# Code Explorer — CodeGraph Knowledge Graph
|
||||
|
||||
Query codebases through a pre-indexed SQLite knowledge graph with FTS5 full-text search and BFS graph traversal.
|
||||
|
||||
## When to Use
|
||||
|
||||
- **"Where is X defined?"** → `search`
|
||||
- **"Who calls X?"** → `callers`
|
||||
- **"What does X call?"** → `callees`
|
||||
- **"What's the impact of changing X?"** → `impact`
|
||||
- **"How does the codebase handle auth?"** → `search` + `callers`
|
||||
- **Before grep/glob** — CodeGraph is faster and more structured
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
# Index a codebase (only needed once, or after major changes)
|
||||
node src/codegraph/index.js index <project_dir>
|
||||
|
||||
# Force re-index
|
||||
node src/codegraph/index.js index . --force
|
||||
|
||||
# Check index stats
|
||||
node src/codegraph/index.js stats
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
### Search symbols
|
||||
|
||||
```bash
|
||||
node src/codegraph/index.js search "function_name"
|
||||
node src/codegraph/index.js search "auth" --limit 10
|
||||
```
|
||||
|
||||
### Caller/callee analysis
|
||||
|
||||
```bash
|
||||
node src/codegraph/index.js callers "login"
|
||||
node src/codegraph/index.js callees "main"
|
||||
```
|
||||
|
||||
### Impact analysis (BFS traversal)
|
||||
|
||||
```bash
|
||||
node src/codegraph/index.js impact "AuthService"
|
||||
```
|
||||
|
||||
### Deep exploration (search + BFS context)
|
||||
|
||||
```bash
|
||||
node src/codegraph/index.js explore "how to send HTTP requests"
|
||||
```
|
||||
|
||||
## Languages Supported
|
||||
|
||||
JavaScript/TypeScript, Python, Rust, Go, Java, Ruby, Shell, C/C++
|
||||
|
||||
Extraction via regex grammars (8 languages, 8+ node types: function/class/method/struct/enum/import/export)
|
||||
|
||||
## Database
|
||||
|
||||
SQLite at `.codegraph/codegraph.db` with:
|
||||
- `nodes` — symbols (name, kind, signature, location)
|
||||
- `edges` — relationships (calls, imports, extends, implements)
|
||||
- `files` — file metadata with hash-based incremental sync
|
||||
- `nodes_fts` — FTS5 full-text search index
|
||||
|
||||
## Integration Pattern
|
||||
|
||||
```
|
||||
Query codebase → codegraph search → symbol list → codegraph callers → call graph
|
||||
↓
|
||||
codegraph impact → affected files
|
||||
```
|
||||
|
||||
## File Path
|
||||
|
||||
- `src/codegraph/index.js` — main entry (index, search, callers, callees, impact, explore)
|
||||
- `src/codegraph/schema.sql` — SQLite schema
|
||||
Reference in New Issue
Block a user