eko24ive/pi-config/pi-ast-grep
Claude Code and agent skill by eko24ive/pi-config
- community
Checking that the SKILL.md file is still in the repository.
Use for structural code work with pi-ast-grep: finding calls/imports/declarations/classes/methods/blocks, outlining large source files, scanning ast-grep rules, reviewing changed symbols, fetching exact code ranges, or previewing safe structural rewrites. Prefer plain-text alternatives only for literal strings, comments, logs, prose, or config keys.
Install
npx vskill@latest install eko24ive/pi-config/pi-ast-grepSKILL.md
pi-ast-grep workflow
Use these tools to avoid reading huge files when a structural query can find the relevant code.
Prefer AST tools over grep-like tools when the user asks for code shape: calls to a function, imports from a module, declarations, classes, methods, control blocks, exports, or JSX-like elements. Use an available plain-text alternative for literal strings, comments, logs, config keys, prose, or when you cannot form a syntax-shaped query.
Preferred flow:
For vague exploration, first locate candidate files if needed, then switch to ast_outline / ast_search once the target is structural.
Tool roles
ast_outline: compact structure map for files/scoped paths; use before reading large source files when symbols matter.ast_search: structural search using ast-grep patterns or node kinds; prefer over text grep for calls/imports/declarations/classes/methods/blocks.ast_scan: native ast-grep YAML rule/config scanning fromrule,inlineRules, explicitconfig, or cwdsgconfig.ymldiscovery.ast_fetch: bounded raw code for result ids or explicit file/range targets;include: ["ancestors"]adds a concise best-effort outline chain when available.ast_change_index: local/staged/branch changed-code index grouped by files/symbols where possible; use it to choose what to inspect, not to read patch diffs.ast_diff_file: bounded git diff for exactly one concrete file; use only after choosing a specific file. It rejects directories, globs, and project-root paths.ast_rewrite: structural rewrite; dry-run first, apply only withexpectedMatches.
Pattern examples
Calls:
Imports:
Functions/classes:
Blocks:
Use selector and strictness only as pattern modifiers, not with kind. Example: pattern: "foo($$$ARGS)", selector: "call_expression", strictness: "ast" to keep a call-shaped match focused.
Use beforeLines / afterLines for compact one-sided context in ast_search; use ast_fetch when editable code is needed.
JSX-like syntax is just syntax, not a React-specific workflow. Use only when the target language/files support it.
Language support
Language support depends on the local ast-grep installed for the session.
The extension normalizes common aliases and infers common file extensions when a single file language is clear. Explicit language is still useful for directory searches, ambiguous extensions, mixed-language paths, and parse errors.
Unknown or unsupported file types are passed through to ast-grep; zero-match results and failures should be treated cautiously because they can mean a language/inference problem rather than true absence.
Fallback rules
- Unknown file type: ast-grep sees it; use an available alternative or targeted
readif results look suspicious. - Pattern parse error: simplify the pattern and specify
language. - Zero matches: do not assume absence; check language, path/globs, inference, and whether this is actually text search.
- Stale id: re-run the source ast tool or pass explicit file/range to
ast_fetch. - Large changed-code result: narrow
ast_change_indexwithpaths,symbolKinds,maxFiles, ormaxItems; do not switch to broadgit diffor raise limits to read the whole patch. - Large result: use
nextCursorforast_search/ast_scan/ast_outlineresult pagination, or narrow paths/globs/query. Cursor calls may include only paging/output params and return fresh fetchable ids. Cursors do not recover output truncated bymaxBytes.
Safe rewrite workflow
- Run
ast_searchfirst if unsure about match shape. - Run
ast_rewritewithapply: false. - Inspect the diff.
- Apply only with exact
expectedMatches. - Validate with tests/typecheck/formatting as appropriate.
Never assume ast_rewrite is type-aware. It is syntax-aware only.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagent/extensions/pi-ast-grep/skills/pi-ast-grep/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/eko24ive/pi-config/pi-ast-grep)