# code-navigate

Adopt this skill: https://proskills.md/skills/other/easyjoy-technologies-openclaw-skills-skills-code-navigate

Page: https://proskills.md/skills/other/easyjoy-technologies-openclaw-skills-skills-code-navigate
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/code-navigate/SKILL.md
size: 2495
upstream: https://github.com/easyjoy-technologies/openclaw-skills/blob/main/skills/code-navigate/SKILL.md

````text
---
name: code-navigate
description: 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".
---

# Code Navigate — Grep-Based Code Intelligence

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

## Find Definition

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

| Language | Definition pattern | Import 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` |
````

## File: README.md
upstream: https://github.com/easyjoy-technologies/openclaw-skills/blob/main/README.md

````text
# OpenClaw Skills — Development Optimization Pack

A collection of skills that enhance [OpenClaw](https://github.com/openclaw/openclaw) for software development workflows. Inspired by capabilities found in modern AI coding assistants.

## Skills

| Skill | Description |
|-------|-------------|
| **code-simplify** | Three-way parallel code review: reuse, quality, and efficiency checks on your git diff |
| **code-search** | Fast codebase search using ripgrep + glob patterns |
| **code-navigate** | Grep-based code navigation — definitions, references, call hierarchy, symbol overview |
| **memory-extract** | Extract durable facts and decisions from conversations into persistent memory files |
| **memory-organizer** | Audit memory files for duplicates, outdated entries, and bloat |
| **session-summary** | Structured session progress capture — decisions, changes, open items |
| **magic-docs** | Self-maintaining documentation via `# MAGIC DOC:` headers |

## Requirements

- [OpenClaw](https://github.com/openclaw/openclaw) installed and running
- `ripgrep` (`rg`) recommended for code-search and code-navigate

```bash
# Debian/Ubuntu
apt-get install -y ripgrep

# macOS
brew install ripgrep
```

## Installation

### Install all skills

```bash
git clone https://github.com/EasyJoy-Technologies/openclaw-skills.git
cd openclaw-skills
./install.sh
```

### Install a single skill

```bash
cp -r skills/<skill-name> ~/.openclaw/skills/<skill-name>
```

### Verify

```bash
openclaw skills check
```

All installed skills should appear as `📦` (eligible).

## Uninstall

```bash
# Remove a single skill
rm -rf ~/.openclaw/skills/<skill-name>

# Remove all skills from this pack
for d in skills/*/; do rm -rf ~/.openclaw/skills/$(basename "$d"); done
```

## Recommended: Automatic Behaviors

For maximum value, add these rules to your agent's `AGENTS.md` (under `## Automatic Behaviors`):

```markdown
### Memory Extract (on task completion)
- **After completing a complex multi-step task**: write outcome, decisions, and new rules to memory.
- Do NOT extract trivial Q&A or information already in memory.

### Code Quality Review (on code changes)
- **After making code changes**: before committing, review the diff — check for duplicated logic, quality issues, and efficiency problems.

### Magic Docs (on relevant discovery)
- When reading a file that starts with `# MAGIC DOC:`, remember it.
- If new relevant information is discovered later, update the document.

### Code Search (prefer structured search)
- Prefer `rg` (ripgrep) over raw `grep`. Exclude `node_modules`, `.git`, `dist`, `build`.
```

## How Skills Work

Skills are prompt-based modules. OpenClaw reads the `SKILL.md` frontmatter (`name` + `description`) to decide when to activate a skill. The body is loaded only when triggered.

- Skills live in `~/.openclaw/skills/<name>/`
- Each skill has a `SKILL.md` with YAML frontmatter
- OpenClaw upgrades do not affect user skills (they're outside the install directory)

## Contributing

1. Fork this repo
2. Add or improve a skill under `skills/<name>/SKILL.md`
3. Follow the [OpenClaw skill spec](https://docs.openclaw.ai)
4. Submit a PR

## License

MIT
````
