AST-Grep Structural Code Analysis

0•

Performs advanced AST-based code search, security scanning, and automated refactoring across 40+ programming languages.

The moai-tool-ast-grep skill integrates the powerful ast-grep (sg) CLI into Claude, enabling syntax-aware code exploration and transformation that goes far beyond simple regex. It allows developers to perform complex structural searches, identify security vulnerabilities like SQL injection, and execute large-scale codemods with high precision. By understanding the Abstract Syntax Tree (AST) of the codebase, it significantly reduces false positives in search results and ensures that refactoring operations maintain semantic integrity across polyglot projects, making it indispensable for codebase maintenance and security auditing.

Características Principales

01Automated code transformations and large-scale refactoring (codemods)
02Support for over 40 programming languages including Python, TS, and Rust
03Advanced relational rules for scoped search and complex logic matching
04Security vulnerability scanning for patterns like XSS and SQL injection
050 GitHub stars
06Structural code search using syntax-aware pattern matching

Casos de Uso

01Migrating deprecated APIs across a large multi-language codebase with high precision
02Exploring large repositories by searching for specific class hierarchies or React hook usages
03Identifying and fixing security anti-patterns within nested function calls or specific scopes