moai-tool-ast-grep

Perform AST-based structural code search, security scanning, and refactoring across multiple languages.

Updated Feb 19, 2026
One-click install
npx skills add https://github.com/taewook486/real-estate-mcp --skill moai-tool-ast-grep-taewook486
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-tool-ast-grep
Source: https://github.com/taewook486/real-estate-mcp/tree/main/.claude/skills/moai-tool-ast-grep
Command: npx skills add https://github.com/taewook486/real-estate-mcp --skill moai-tool-ast-grep-taewook486

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates complex code analysis, security scanning, and refactoring tasks that are difficult or impossible with traditional text-based tools.

Core Features & Use Cases

  • Structural Code Search: Find code patterns based on Abstract Syntax Tree (AST) structure, not just text.
  • Automated Refactoring: Perform semantic code transformations and codemods across your codebase.
  • Security Scanning: Detect vulnerabilities and enforce coding standards using predefined or custom rules.
  • Use Case: Automatically refactor all instances of a deprecated API call across your entire project, or scan your codebase for common security vulnerabilities like SQL injection.

Quick Start

Use the moai-tool-ast-grep skill to find all instances of console.log in the src directory.

Frequently Asked Questions about moai-tool-ast-grep

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does AST-based structural code search differ from regular text search?

AST-based structural code search matches code patterns based on Abstract Syntax Tree structure rather than raw text. This enables precise semantic matching, allowing you to find function calls or variable assignments regardless of formatting or variable names.

How do I automate API migration and refactor deprecated calls across a codebase?

Automate API migration and refactor deprecated calls by running codemod operations and semantic code transformations. This applies structural pattern matching to automatically update all instances of an outdated API call across your entire project.

Can I use structural code search for security scanning and vulnerability detection?

Yes, you can use structural code search for security scanning and vulnerability detection. It identifies risks like SQL injection by applying predefined or custom rules to parse and analyze code patterns across your codebase.

What is the best way to find all console.log statements in a project directory?

The best way to find all console.log statements is to perform structural code search within the target directory. By matching the AST node structure of the function call, you can accurately locate every instance without false positives from comments.

Does ast-grep support multiple programming languages for CI/CD pipeline integration?

Yes, ast-grep supports over 40 programming languages for CI/CD pipeline integration. It enforces coding standards and executes codemods across polyglot codebases by applying language-specific Abstract Syntax Tree parsing rules.

When should I not use AST structural search for code quality enforcement?

You should not use AST structural search when simple text matching suffices, as setting up custom rules for trivial pattern matching adds unnecessary overhead. It is designed for complex semantic analysis, API migration, and deep refactoring tasks.