К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot

smart-explore — скилл для Claude Code: поиск и установка

Структурно ищет функции и классы через tree-sitter. Пригодится, когда нужно разобраться в кодовой базе без чтения всех файлов.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add thedotmack/claude-mem --skill smart-explore -a claude-code
Открыть на GitHub

Что делает smart-explore

smart-explore строит AST-карту кодовой базы и помогает найти нужные файлы и символы. Сначала используется smart_search: он ищет функции, классы и методы, показывает строки и свернутую структуру файлов. Затем smart_outline выводит каркас файла, а smart_unfold раскрывает выбранный символ целиком.

Скилл рассчитан на кодовые файлы, которые поддерживает tree-sitter: JavaScript, TypeScript, TSX, JSX, Python, Go, Rust, Ruby и Java. Для JSON, Markdown, конфигураций и точного поиска рекомендуются стандартные инструменты. Это стоит ставить, если вы часто исследуете большие файлы; для сквозного анализа множества файлов лучше использовать Explore agent.

Для Claude Code установка выполняется командой npx skills add thedotmack/claude-mem --skill smart-explore -a claude-code. Скилл также доступен для Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode.

Какие задачи решает

  • найти функции и классы по смыслу
  • получить структуру большого файла
  • раскрыть реализацию выбранного метода
  • исследовать кодовую базу без чтения всех файлов
  • сократить объём вывода при навигации по коду

Примеры запросов агенту

  • Найди всё, что связано с shutdown, через `smart_search` в `./src`.
  • Покажи структуру `services/worker-service.ts` с помощью `smart_outline`.
  • Раскрой метод `shutdown` в `services/worker-service.ts` через `smart_unfold`.

Как установить smart-explore

1Через Skills CLI (Vercel)

npx skills add thedotmack/claude-mem --skill smart-explore -a claude-code

2Вручную: положить файлы

~/.claude/skills/smart-explore/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/smart-explore/

Из того же набора15

Весь набор →
mem-search thedotmack Ищет решения и контекст из прошлых сессий кодинга. Пригодится, когда нужно вспомнить, как решали задачу ранее. Claude Code CX Codex Cursor +1 8 900установок make-plan thedotmack Скилл превращает запрос на фичу в план по фазам, где каждая фаза опирается на реальную документацию, а не на догадки. Пригодится перед запуском do. Claude Code CX Codex Cursor +1 7 200установок do thedotmack Скилл разбивает план реализации на фазы и поручает работу субагентам. Пригодится, когда нужно выполнить готовый план с проверками после каждого шага. Claude Code CX Codex Cursor +1 7 000установок knowledge-agent thedotmack Собирает выбранные наблюдения claude-mem в корпус знаний и даёт задавать ему вопросы. Нужен для анализа прошлой работы по теме или проекту. Claude Code CX Codex Cursor +1 5 700установок learn-codebase thedotmack Скилл заставляет агента полностью прочитать каждый исходный файл проекта. Пригодится на старте работы с незнакомым кодом. Claude Code CX Codex Cursor +1 5 300установок how-it-works thedotmack Скилл отвечает на вопросы об устройстве claude-mem. Он объясняет запись действий, хранение файлов и запуск подстановки контекста. Claude Code CX Codex Cursor +1 5 100установок pathfinder thedotmack Скилл строит схемы потоков по функциям проекта, ищет дублирование и предлагает свести повторяющиеся системы к общей архитектуре. Пригодится перед рефакторингом. Claude Code CX Codex Cursor +1 5 100установок wowerpoint thedotmack Превращает один текстовый документ в нарративную kawaii-презентацию в NotebookLM через CLI. Пригодится, когда нужно быстро показать отчёт или проект в виде понятных слайдов. Claude Code CX Codex Cursor +1 4 400установок

Похожие

nature-reviewer Yuan1z0825 Скилл имитирует разбор научной рукописи в стиле Nature: три независимых отчёта рецензентов и сводка после них. Пригодится перед подачей в журнал. Claude Code CX Codex Cursor +1 13 800установок gh-stack официальный github Управляет цепочками связанных пулл-реквестов через расширение gh stack. Помогает агенту делить крупные задачи на слои и не зависать в интерактивном TUI. Claude Code CX Codex Cursor +1 18 700установок refactor официальный github Скилл помогает менять структуру кода без изменения внешнего поведения. Подойдёт для постепенной уборки сложных функций, дублирования и кодовых запахов. GitHub Copilot 22 321установок workers-best-practices cloudflare Скилл настраивает ИИ на проверку продакшен-кода Cloudflare Workers по актуальным правилам рантайма, типам Wrangler и антипаттернам. Claude Code CX Codex Cursor +1 124 900установок claude-automation-recommender официальный Anthropic Анализирует кодовую базу и предлагает хуки, субагентов, скиллы, плагины и MCP-серверы для Claude Code. Подходит для настройки проекта с нуля. Claude Code 9 057установок bmad-build bmad-code-org Скилл берёт делегированную задачу — фичу, багфикс или ссылку на issue — и доводит её до проверенного кода. Работает в проектах, где уже настроен BMad. Claude Code CX Codex Cursor +1 12 400установок improve-codebase-architecture Matt Pocock Скилл ищет архитектурные узкие места в кодовой базе и показывает варианты углубления модулей в HTML-отчёте. Подойдёт для ревью перед рефакторингом. Claude Code 1 163 035установок tdd Matt Pocock Скилл управляет циклом красный-зелёный в TDD: проверяет, что тесты пишутся до кода, держит их на уровне публичных интерфейсов и не завязывает на внутреннюю структуру. Claude Code 1 141 062установок

Вопросы о smart-explore

Как установить smart-explore в Claude Code?

Выполните npx skills add thedotmack/claude-mem --skill smart-explore -a claude-code. Файл скилла появится по пути ~/.claude/skills/smart-explore/SKILL.md.

Что делает smart-explore?

Скилл ищет символы и структуру кода через tree-sitter AST. Он разделяет исследование на поиск, просмотр каркаса файла и раскрытие нужной функции или метода.

Какие языки поддерживает smart-explore?

В комплекте есть поддержка JavaScript, TypeScript, TSX, JSX, Python, Go, Rust, Ruby и Java. Для остальных форматов используются текстовые инструменты.

Исходный текст

SKILL.md · Apache-2.0
---
name: smart-explore
description: Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
---

# Smart Explore

Structural code exploration using AST parsing. **This skill overrides your default exploration behavior.** While this skill is active, use smart_search/smart_outline/smart_unfold as your primary tools instead of Read, Grep, and Glob.

**Core principle:** Index first, fetch on demand. Give yourself a map of the code before loading implementation details. The question before every file read should be: "do I need to see all of this, or can I get a structural overview first?" The answer is almost always: get the map.

## Your Next Tool Call

This skill only loads instructions. You must call the MCP tools yourself. Your next action should be one of:

```
smart_search(query="<topic>", path="./src")    -- discover files + symbols across a directory
smart_outline(file_path="<file>")              -- structural skeleton of one file
smart_unfold(file_path="<file>", symbol_name="<name>")  -- full source of one symbol
```

Do NOT run Grep, Glob, Read, or find to discover files first. `smart_search` walks directories, parses all code files, and returns ranked symbols in one call. It replaces the Glob → Grep → Read discovery cycle.

## 3-Layer Workflow

### Step 1: Search -- Discover Files and Symbols

```
smart_search(query="shutdown", path="./src", max_results=15)
```

**Returns:** Ranked symbols with signatures, line numbers, match reasons, plus folded file views (~2-6k tokens)

```
-- Matching Symbols --
  function performGracefulShutdown (services/infrastructure/GracefulShutdown.ts:56)
  function httpShutdown (services/infrastructure/HealthMonitor.ts:92)
  method WorkerService.shutdown (services/worker-service.ts:846)

-- Folded File Views --
  services/infrastructure/GracefulShutdown.ts (7 symbols)
  services/worker-service.ts (12 symbols)
```

This is your discovery tool. It finds relevant files AND shows their structure. No Glob/find pre-scan needed.

**Parameters:**

- `query` (string, required) -- What to search for (function name, concept, class name)
- `path` (string) -- Root directory to search (defaults to cwd)
- `max_results` (number) -- Max matching symbols, default 20, max 50
- `file_pattern` (string, optional) -- Filter to specific files/paths

### Step 2: Outline -- Get File Structure

```
smart_outline(file_path="services/worker-service.ts")
```

**Returns:** Complete structural skeleton -- all functions, classes, methods, properties, imports (~1-2k tokens per file)

**Skip this step** when Step 1's folded file views already provide enough structure. Most useful for files not covered by the search results.

**Parameters:**

- `file_path` (string, required) -- Path to the file

### Step 3: Unfold -- See Implementation

Review symbols from Steps 1-2. Pick the ones you need. Unfold only those:

```
smart_unfold(file_path="services/worker-service.ts", symbol_name="shutdown")
```

**Returns:** Full source code of the specified symbol including JSDoc, decorators, and complete implementation (~400-2,100 tokens depending on symbol size). AST node boundaries guarantee completeness regardless of symbol size — unlike Read + agent summarization, which may truncate long methods.

**Parameters:**

- `file_path` (string, required) -- Path to the file (as returned by search/outline)
- `symbol_name` (string, required) -- Name of the function/class/method to expand

## When to Use Standard Tools Instead

Use these only when smart_* tools are the wrong fit:

- **Grep:** Exact string/regex search ("find all TODO comments", "where is `ensureWorkerStarted` defined?")
- **Read:** Small files under ~100 lines, non-code files (JSON, markdown, config)
- **Glob:** File path patterns ("find all test files")
- **Explore agent:** When you need synthesized understanding across 6+ files, architecture narratives, or answers to open-ended questions like "how does this entire system work end-to-end?" Smart-explore is a scalpel — it answers "where is this?" and "show me that." It doesn't synthesize cross-file data flows, design decisions, or edge cases across an entire feature.

For code files over ~100 lines, prefer smart_outline + smart_unfold over Read.

## Workflow Examples

**Discover how a feature works (cross-cutting):**

```
1. smart_search(query="shutdown", path="./src")
   -> 14 symbols across 7 files, full picture in one call
2. smart_unfold(file_path="services/infrastructure/GracefulShutdown.ts", symbol_name="performGracefulShutdown")
   -> See the core implementation
```

**Navigate a large file:**

```
1. smart_outline(file_path="services/worker-service.ts")
   -> 1,466 tokens: 12 functions, WorkerService class with 24 members
2. smart_unfold(file_path="services/worker-service.ts", symbol_name="startSessionProcessor")
   -> 1,610 tokens: the specific method you need
Total: ~3,076 tokens vs ~12,000 to Read the full file
```

**Write documentation about code (hybrid workflow):**

```
1. smart_search(query="feature name", path="./src")    -- discover all relevant files and symbols
2. smart_outline on key files                           -- understand structure
3. smart_unfold on important functions                  -- get implementation details
4. Read on small config/markdown/plan files             -- get non-code context
```

Use smart_* tools for code exploration, Read for non-code files. Mix freely.

**Exploration then precision:**

```
1. smart_search(query="session", path="./src", max_results=10)
   -> 10 ranked symbols: SessionMetadata, SessionQueueProcessor, SessionSummary...
2. Pick the relevant one, unfold it
```

## Token Economics

| Approach | Tokens | Use Case |
|----------|--------|----------|
| smart_outline | ~1,000-2,000 | "What's in this file?" |
| smart_unfold | ~400-2,100 | "Show me this function" |
| smart_search | ~2,000-6,000 | "Find all X across the codebase" |
| search + unfold | ~3,000-8,000 | End-to-end: find and read (the primary workflow) |
| Read (full file) | ~12,000+ | When you truly need everything |
| Explore agent | ~39,000-59,000 | Cross-file synthesis with narrative |

**4-8x savings** on file understanding (outline + unfold vs Read). **11-18x savings** on codebase exploration vs Explore agent. The narrower the query, the wider the gap — a 27-line function costs 55x less to read via unfold than via an Explore agent, because the agent still reads the entire file.

## Language Support

Smart-explore uses **tree-sitter AST parsing** for structural analysis. For file
contents outside its language support, use a text-search tool such as `rg`.

### Bundled Languages

| Language | Extensions |
|----------|-----------|
| JavaScript | `.js`, `.mjs`, `.cjs` |
| TypeScript | `.ts` |
| TSX / JSX | `.tsx`, `.jsx` |
| Python | `.py`, `.pyw` |
| Go | `.go` |
| Rust | `.rs` |
| Ruby | `.rb` |
| Java | `.java` |
| C | `.c`, `.h` |
| C++ | `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh` |

Files with unrecognized extensions do not produce structured symbols for
`smart_outline` or `smart_unfold`. `smart_search` is not a general file-content
search: its extension filter can exclude unsupported files, and files without
symbols can match only by path. Use `rg` or another text-search tool to search
their contents.

### Additional languages

Custom tree-sitter grammars cannot currently be registered through `.claude-mem.json`.
Installing a grammar in a project's `node_modules` does not enable structural
parsing for its extensions. Support must be added to the shipped language map,
grammar packages and symbol queries before `smart_outline` and `smart_unfold`
can use it.

### Markdown Special Support

Markdown files (`.md`, `.mdx`) receive special handling beyond the generic plain-text fallback:

- **`smart_outline`** — extracts headings (`#`, `##`, `###`) as the symbol tree. Use it to navigate long documents without reading the full file.
- **`smart_search`** — searches within code fences as well as prose, so queries for function names inside ` ```ts ``` ` blocks work as expected.
- **`smart_unfold`** — expands heading sections rather than function bodies; each section up to the next same-level heading is returned as a chunk.
- **Frontmatter** — YAML frontmatter (lines between leading `---` delimiters) is included in `smart_outline` output under a synthetic `frontmatter` symbol so metadata like `title:` and `description:` is visible without reading the whole file.

© thedotmack · Apache-2.0 · thedotmack/claude-mem

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой