ast-grep
Use this skill when the user wants to search code structurally using AST patterns, perform linting, or rewrite code automatically across multiple files.
от javimosch★ 58 звёзд на GitHub
Установить ast-grep в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
ast-grep Plugin
AST-based code structural search, lint, and rewriting.
Commands
Search
ast-grep search run— Search using AST pattern
Rewrite
ast-grep rewrite run— Rewrite code using pattern and replacement
Lint
ast-grep lint run— Run linting rulesast-grep scan run— Scan directory with rules
Usage Examples
- "Find all usages of $A && $A() pattern in TypeScript"
- "Replace null coalescing patterns"
- "Lint the codebase for specific patterns"
- "Scan src directory for violations"
Installation
npm install --global @ast-grep/cli
# or
cargo install ast-grep
# or
brew install ast-grep
Examples
# Search for AST pattern
ast-grep --pattern 'const $X = $Y' --lang ts
# Rewrite code
ast-grep --pattern '$A && $A()' --lang ts --rewrite '$A?.()'
# Run lint
ast-grep lint
# Scan directory
ast-grep scan src/
Key Features
- Pattern looks like real code
- Supports JS, TS, Python, Rust, Go, Java, etc.
- Use
$VARas wildcard for AST nodes - YAML-based lint rules -批量 code rewriting
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ast-grep?
Use this skill when the user wants to search code structurally using AST patterns, perform linting, or rewrite code automatically across multiple files.
Как установить скилл ast-grep?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ast-grep запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…