Ast Grep

Codex built-in skill for structural code search with ast-grep when queries depend on AST shapes, call patterns, decorators, scopes, or required child nodes.

Rycen7822 Updated

File contents

ast-grep

When to Use

Use when the task needs AST-aware structural search instead of plain text grep, such as finding function definitions, call shapes, imports, decorators, or missing child nodes.

Do Not Use When

Do not use for ordinary keyword, filename, documentation, or broad repository text search.

Required Inputs

Target language, structural pattern, repository path, and a small validation snippet when possible.

Workflow

  1. Narrow the candidate files if the repository is large.
  2. Write an ast-grep pattern or rule.
  3. Run ast-grep on a small target.
  4. Expand only after validating the match shape.

Rycen7822/skill-retrieval-mcp/tree/main/tests/fixtures/retrieval_quality/skills/codex-builtins/ast-grep commit a1b6eb5b18

Frequently asked questions

npx skillmds@latest add rycen7822/ast-grep