brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
This skill should be used when the user asks to "find a class", "search for symbol", "find usages", "find implementations", "search codebase", "find file", "class hierarchy", "find callers", "module dependencies", "unused dependencies", "project map", "project conventions",
Claude Code
$ npx -y skills add defendend/Claude-ast-index-search --skill ast-index --agent claude-code
Codex
$ npx skills add defendend/Claude-ast-index-search --skill ast-index -a codex -y
Cursor
$ npx skills add defendend/Claude-ast-index-search --skill ast-index -a cursor -y
Gemini CLI
$ npx skills add defendend/Claude-ast-index-search --skill ast-index -a gemini-cli -y
GitHub Copilot
$ npx skills add defendend/Claude-ast-index-search --skill ast-index -a github-copilot -y
OpenCode
$ npx skills add defendend/Claude-ast-index-search --skill ast-index -a opencode -y
Windsurf
$ npx skills add defendend/Claude-ast-index-search --skill ast-index -a windsurf -y
name: ast-index description: This skill should be used when the user asks to "find a class", "search for symbol", "find usages", "find implementations", "search codebase", "find file", "class hierarchy", "find callers", "module dependencies", "unused dependencies", "project map", "project conventions", "project structure", "what frameworks", "what architecture", "find Perl subs", "Perl exports", "find Python class", "Go struct", "Go interface", "find React component", "find TypeScript interface", "find Rust struct", "find Ruby class", "find C# controller", "find Dart class", "find Flutter widget", "find mixin", "find Scala trait", "find case class", "find object", "find PHP class", "find Laravel model", "find PHP trait", or needs fast code search in Android/Kotlin/Java, iOS/Swift/ObjC, Dart/Flutter, TypeScript/JavaScript, Rust, Ruby, C#, Scala, PHP, Perl, Python, Go, C++, or Protocol Buffers projects. Also triggered by mentions of "ast-index" CLI tool. user-invocable: false
Fast native Rust CLI for structural code search in Android/Kotlin/Java, iOS/Swift/ObjC, Dart/Flutter, TypeScript/JavaScript, Rust, Ruby, C#, Scala, PHP, Perl, Python, Go, C++, and Proto projects using SQLite + FTS5 index.
**ALWAYS use ast-index FIRST for any code search task.** These rules are mandatory:
1. **ast-index is the PRIMARY search tool** — use it before grep, ripgrep, or Search tool 2. **Pick the command by what you know:**
3. **DO NOT duplicate results** — if ast-index found usages/implementations, that IS the complete answer 4. **DO NOT run grep "for completeness"** after ast-index returns results 5. **DO NOT re-read bodies returned by `--with-content`** — a successful result replaces the usual `sed` / `awk` / `grep` / `rg` or file-read step. Use those tools only when the body is truncated or unavailable, or when you need text outside the returned definition. 6. **Use grep/Search ONLY when:**
`refs` skip names inside strings and comments
**Why:** ast-index is 17-69x faster than grep (1-10ms vs 200ms-3s) and returns structured, accurate results.
Install the CLI before use:
brew tap defendend/ast-index brew install ast-index
Initialize index in project root:
cd /path/to/project ast-index rebuild
The index is stored at `~/Library/Caches/ast-index/<project-hash>/index.db` (macOS) or `~/.cache/ast-index/<project-hash>/index.db` (Linux). Rebuild builds a fresh index and swaps it in; named subtrees and the collected Git history (`hotspots --collect`) are carried over.
| Platform | Languages | Module System | |----------|-----------|---------------| | Android/Java | Kotlin, Java | Gradle (build.gradle.kts), Maven (pom.xml) | | iOS | Swift, Objective-C | SPM (Package.swift) | | Web | TypeScript, JavaScript, React, Vue, Svelte | package.json | | Rust | Rust | Cargo.toml | | Ruby | Ruby, Rails, RSpec | Gemfile | | .NET | C#, ASP.NET, Unity | *.csproj | | Dart/Flutter | Dart | pubspec.yaml | | Scala | Scala | Bazel (WORKSPACE, BUILD) | | PHP | PHP | composer.json | | Perl | Perl | Makefile.PL, Build.PL | | Python | Python | None (*.py files) | | Go | Go | None (*.go files) | | Proto | Protocol Buffers (proto2/proto3) | None (*.proto files) | | WSDL | WSDL, XSD | None (*.wsdl, *.xsd files) | | C/C++ | C, C++ (JNI, uservices) | None (*.cpp, *.h, *.hpp files) | | Godot | GDScript | project.godot | | Mixed | All above | All |
Project type is auto-detected by marker files (build.gradle.kts, Package.swift, Makefile.PL, etc.). Python, Go, Proto, WSDL, and C++ files are indexed alongside main project type.
Minified JavaScript/CSS is never indexed or searched: `.js`/`.mjs`/`.cjs`/`.css` files named `*.min.*` or `*-min.*`, or whose first 64 KiB is minifier output (lines averaging 1000+ bytes of code, not one long string). Grep-based commands skip them too, and `outline`/`imports` on such a file print `Skipped: minified file` instead of parsing it. `AST_INDEX_SKIP_MINIFIED=0` turns the filter off.
**`explore`** - Rank the symbols most relevant to a query, show the best files — an outline with line ranges for a type or module (the definitions inside it, the chosen one marked `→`), the source (read fresh from disk) for a function — list graph neighbours (callers/subclasses), and locate tests by path convention — in a single call. Prefer this over a search + read loop when you want to understand an area; read the slice an outline row points at next. Language-agnostic and vendor-aware (`node_modules` `.d.ts` and cross-stack matches are down-ranked, never deleted).
ast-index explore applicant merge MergeService # bag of symbol/file names ast-index explore "how does auth session work" # natural-language question ast-index explore PaymentService --rwr # --rwr: re-rank via call/inheritance graph ast-index explore Repository --max-files 8 # cap source files shown (default 6) ast-index explore Session request --rwr --format json
Structural, AST-aware code navigation CLI for large, multi-language repositories.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.