moai-tool-ast-grep

Search, refactor, and scan code using Abstract Syntax Tree analysis.

3|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/rodmena-limited/trust5 --skill moai-tool-ast-grep-rodmena-limited
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-tool-ast-grep
Source: https://github.com/rodmena-limited/trust5/tree/main/trust5/assets/claude/skills/moai-tool-ast-grep
Command: npx skills add https://github.com/rodmena-limited/trust5 --skill moai-tool-ast-grep-rodmena-limited

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ast-grep, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides powerful code search, refactoring, and security scanning capabilities using AST-Grep, enabling developers to quickly find and modify code patterns, identify security vulnerabilities, and enforce coding standards.

Core Features & Use Cases

  • AST-Based Code Search: Perform precise structural code search across multiple programming languages.
  • Code Refactoring: Refactor code with semantic awareness, including renaming functions, converting callbacks to promises, and more.
  • Security Scanning: Detect common security vulnerabilities like SQL injection, XSS, and command injection.
  • Use Case: Imagine you need to find all instances of a specific function call across your codebase and refactor it. This Skill can scan your code, apply the changes, and validate the results.

Quick Start

Use the 'moai-tool-ast-grep' skill to search for the pattern 'console.log' in your codebase and refactor it to 'log' with semantic awareness.

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 across multiple programming languages?

Structural code search uses Abstract Syntax Tree analysis to find precise code patterns across multiple languages. This approach parses code structure rather than plain text, enabling accurate pattern matching for codebase analysis and transformations.

Can I refactor code by converting callbacks to promises using AST analysis?

Yes, AST analysis refactors code with semantic awareness, including converting callbacks to promises and renaming functions. It scans your code, applies structural changes, and validates the results across large codebases.

Does ast-grep support security scanning for vulnerabilities like SQL injection and XSS?

Ast-grep supports security scanning to detect common vulnerabilities like SQL injection, XSS, and command injection. It identifies these risks by matching structural patterns in the syntax tree rather than relying on simple text matching.

What is the best way to find and replace specific function calls across a large codebase?

The best way to find and replace function calls across a large codebase is using AST-based structural search. It applies semantic awareness to scan, locate specific call patterns, apply modifications, and validate the refactoring results.

Do I need ast-grep installed to run structural pattern matching on my code?

Yes, you need ast-grep installed as a dependency for AST parsing and pattern matching. The Skill requires this external tool to handle structural code analysis, refactoring, and security scanning operations.

How do I enforce coding standards by detecting console log statements in my codebase?

Enforce coding standards by using AST-based code search to detect console log statements with semantic awareness. You can scan the codebase for specific patterns and refactor them to standard logging functions.