# ast-grep-outline

Generates a compact syntax map of code files, imports, and exports with line numbers before reading raw source files.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2400 installs · ★ 896
- Author: ast-grep
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ast-grep/agent-skill/tree/HEAD/ast-grep/skills/outline/SKILL.md
- Updated: 2026-09-13
- HTML: https://affpapa.org/en/nevibecode/skills/ast-grep-outline

## What it does

The skill runs `ast-grep outline` to output a structural map of source code with exact line numbers. When pointed at a file, it surfaces declarations like functions, structs, and inner members. For entire directories, it summarizes exported symbols. This saves model context.

Flags shape the output detail. The `--view` argument ranges from minimal symbol names to expanded members with lines, while `--items` isolates imports, exports, or local declarations. Top-level entries can also be filtered using `--match` with case-sensitive Rust regular expressions.

It reads local syntax trees only. The command cannot resolve cross-file references, infer types, or construct call graphs, so deep semantic checks still require compiler tooling.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ast-grep/agent-skill --skill ast-grep-outline -a claude-code
```
```bash
npx skills add ast-grep/agent-skill --skill outline -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/outline/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/outline/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ast-grep/agent-skill --skill outline -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/outline/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ast-grep/agent-skill --skill outline -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/outline/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ast-grep/agent-skill outline
```

2. **Manually: put the files in place**
- File: `.github/skills/outline/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ast-grep/agent-skill --skill outline -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ast-grep/agent-skill --path ast-grep/skills/outline
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/outline/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ast-grep/agent-skill --skill outline -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ast-grep/agent-skill/tree/HEAD/ast-grep/skills/outline/SKILL.md

## When to use it
- map public exports across an unfamiliar directory
- list class members with exact line numbers before editing
- trace module imports across a folder
- inspect structural changes in modified git files

## Example prompts
- Outline the exported symbols in directory src with ast-grep outline
- Show members and line numbers for UserService in user.ts
- Trace imports across the api directory using ast-grep outline

## Similar
- [ast-grep-find](https://affpapa.org/en/nevibecode/skills/ast-grep-find.md) — skill · 518 installs
- [codegraph-ast-grep](https://affpapa.org/en/nevibecode/skills/codegraph-ast-grep.md) — skill · 2700 installs
- [ast-grep](https://affpapa.org/en/nevibecode/skills/pproenca-ast-grep.md) — skill · 332 installs
- [search-router](https://affpapa.org/en/nevibecode/skills/search-router.md) — skill · 485 installs
- [codebase-search](https://affpapa.org/en/nevibecode/skills/codebase-search.md) — skill · 392 installs
- [file-search](https://affpapa.org/en/nevibecode/skills/file-search.md) — skill · 521 installs

From the same set: [ast-grep/agent-skill](https://affpapa.org/en/nevibecode/by/ast-grep/agent-skill.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
