Openclaw-skills code-navigate

Navigate code structure using grep-based heuristics — find definitions, references, call hierarchy, and symbol overviews. Use when tracing function calls, finding all usages of a symbol, understanding type hierarchies, or navigating unfamiliar codebases. Triggers on "go to definition", "find references", "where is this used", "what calls this", "trace this function", "understand this code".

install
source · Clone the upstream repo
git clone https://github.com/EasyJoy-Technologies/openclaw-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/code-navigate" ~/.claude/skills/easyjoy-technologies-openclaw-skills-code-navigate && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/code-navigate" ~/.openclaw/skills/easyjoy-technologies-openclaw-skills-code-navigate && rm -rf "$T"
manifest: skills/code-navigate/SKILL.md
source content

Code Navigate — Grep-Based Code Intelligence

Navigate code structure using ripgrep patterns. No LSP server required.

Find Definition

# Function/class/type definition
rg -n "(?:export\s+)?(?:function|class|const|let|var|type|interface|enum)\s+SYMBOL" <dir> --type ts

# Trace an import to its source
rg -n "import.*SYMBOL.*from\s+['\"](.+)['\"]" <dir> --type ts

Find References

# All usages (exclude type definitions)
rg -n "\bSYMBOL\b" <dir> --type ts -g "!*.d.ts" -g "!node_modules"

# Function call sites only
rg -n "\bSYMBOL\s*\(" <dir> --type ts -g "!*.test.*"

Call Hierarchy

# Incoming: who calls this function
rg -n "\bFUNC_NAME\s*\(" <dir> --type ts -g "!*.test.*" -g "!*.spec.*"

# Outgoing: find the function body, then read it to see what it calls
rg -n "function\s+FUNC_NAME" <dir> --type ts

Symbol Overview

# All exports in a file
rg -n "export\s+(function|class|const|type|interface|enum|default)" <file>

# All functions in a directory
rg -n "(?:export\s+)?(?:async\s+)?function\s+\w+" <dir> --type ts | head -50

Type Information

# Find type/interface definition
rg -n "(?:type|interface)\s+TYPE_NAME" <dir> --type ts

# Where a type is used
rg -n ":\s*TYPE_NAME\b" <dir> --type ts

Workflow: "Understand This Code"

  1. Entry:
    rg -n "export.*SYMBOL" <dir> --type ts
  2. Read the file, note imports
  3. Callers:
    rg -l "\bSYMBOL\b" <dir> --type ts -g "!*.test.*" | head -10
  4. Types:
    rg -n "(?:type|interface)\s+\w+" <dir>/types --type ts
  5. Tests:
    find <dir> -name "*.test.ts" -o -name "*.spec.ts" | xargs rg -l "SYMBOL" 2>/dev/null

Language Variants

LanguageDefinition patternImport pattern
TypeScript
(?:export\s+)?(?:function|class|const)
import.*from
Python
(?:def|class)\s+NAME
(?:from|import).*NAME
Go
func\s+(?:\(.*\)\s+)?NAME
import.*NAME
Rust
(?:pub\s+)?(?:fn|struct|enum|trait)\s+NAME
use.*NAME