AST-Grep Structural Code Analysis
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.