moai-tool-ast-grep

Search, scan, and refactor code across 40+ languages using ast-grep CLI.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/soo-kate-yeon/shadowoo --skill moai-tool-ast-grep-soo-kate-yeon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-tool-ast-grep
Source: https://github.com/soo-kate-yeon/shadowoo/tree/main/.agents/skills/moai-tool-ast-grep
Command: npx skills add https://github.com/soo-kate-yeon/shadowoo --skill moai-tool-ast-grep-soo-kate-yeon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the need for precise, syntax-aware code analysis, enabling developers to perform complex structural searches, automated refactoring, and security scanning across a wide range of programming languages.

Core Features & Use Cases

  • Structural Code Search: Find code patterns that regex cannot capture, based on Abstract Syntax Trees (AST).
  • Automated Refactoring: Perform semantic code transformations and codemod operations.
  • Security Scanning: Identify vulnerability patterns like SQL injection and XSS.
  • Use Case: Automatically refactor all instances of a deprecated API call across your entire codebase, ensuring consistency and preventing errors.

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 perform structural code search instead of using regex?

Structural code search uses Abstract Syntax Trees (AST) to find code patterns that regex cannot capture. This enables syntax-aware analysis and pattern matching across 40+ programming languages for precise codebase exploration.

Can I use ast-grep for automated refactoring and codemod operations across multiple languages?

Yes, ast-grep performs automated refactoring and codemod operations across 40+ languages. It executes semantic code transformations, allowing you to update deprecated API calls consistently while preventing syntax errors.

How does AST-based security scanning identify vulnerabilities like SQL injection?

AST-based security scanning analyzes syntax trees to identify vulnerability patterns like SQL injection and XSS. By understanding code structure rather than just text, it accurately detects insecure code patterns for security auditing.

What is the best way to find and replace deprecated API calls in a large codebase?

The best way to replace deprecated API calls is using structural code transformation via ast-grep. It applies syntax-aware codemod operations across your entire codebase, ensuring consistent refactoring and preventing errors.

Does ast-grep support code quality enforcement and linting for specific file directories?

Yes, ast-grep supports syntax-aware linting and code quality enforcement. You can target specific directories, such as scanning JavaScript files within the src directory, to find patterns like console.log and enforce coding standards.