moai-tool-ast-grep

Perform AST-based code search, transformation, and security scanning with ast-grep.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/jinwoonghong/MESAsim --skill moai-tool-ast-grep-jinwoonghong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-tool-ast-grep
Source: https://github.com/jinwoonghong/MESAsim/tree/main/.claude/skills/moai-tool-ast-grep
Command: npx skills add https://github.com/jinwoonghong/MESAsim --skill moai-tool-ast-grep-jinwoonghong

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates complex code analysis, search, and transformation tasks that go beyond simple text matching, ensuring code quality, security, and maintainability across numerous programming languages.

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 codemod operations.
  • 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 codebase, or scan for common security vulnerabilities like SQL injection.

Quick Start

Use the moai-tool-ast-grep skill to find all instances of console.log in JavaScript files within 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 do I refactor deprecated API calls across an entire codebase?

Structural code search finds code patterns using Abstract Syntax Tree (AST) structure rather than plain text matching. This syntax-aware approach prevents false positives that commonly occur with standard regular expression searches.

Can I use ast-grep for security vulnerability detection in multiple languages?

Yes, this approach supports codemod operations and automated refactoring across 40+ programming languages. It leverages Abstract Syntax Tree pattern matching to perform syntax-aware code transformations regardless of the target language.

What is the best way to find all instances of a specific function call in a project?

Structural code search finds code patterns using Abstract Syntax Tree (AST) structure rather than plain text matching. This syntax-aware approach prevents false positives that commonly occur with standard regular expression searches.

Does structural code search work without writing complex regular expressions?

Yes, this approach supports codemod operations and automated refactoring across 40+ programming languages. It leverages Abstract Syntax Tree pattern matching to perform syntax-aware code transformations regardless of the target language.

Can I write custom rules to enforce internal coding standards?

Security scanning detects vulnerabilities and enforces coding standards using predefined or custom rules across 40+ programming languages. It identifies syntax patterns associated with issues like SQL injection by leveraging AST pattern matching.

What are the limitations of using regular expressions for large scale code refactoring?

Automated refactoring across an entire codebase is achieved by performing semantic code transformations using codemod operations. This approach matches syntax structure instead of plain text to safely update deprecated API calls.