moai-tool-ast-grep

Search, scan, and refactor code using AST patterns via ast-grep CLI.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides advanced, AST-based code analysis for precise structural searching, automated refactoring, and security scanning across numerous programming languages, going beyond simple text-based tools.

Core Features & Use Cases

  • Structural Code Search: Find code patterns based on syntax, not just text.
  • Automated Refactoring: Perform complex code transformations and codemods semantically.
  • Security Scanning: Identify vulnerabilities and enforce coding standards with 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 perform structural code search instead of plain text matching?

Structural code search analyzes the abstract syntax tree to match code patterns based on syntax rather than text. This Skill uses the ast-grep CLI to perform AST-based structural code search across 40+ programming languages.

What's the best way to automate refactoring a deprecated API across an entire codebase?

Automated refactoring of deprecated APIs is best handled through codemod operations. This Skill performs semantic code transformations using ast-grep to automatically refactor all instances of a pattern across your codebase.

Can I use ast-grep for security scanning and vulnerability detection?

Yes, ast-grep supports syntax-aware security scanning. This Skill identifies vulnerabilities like SQL injection and enforces coding standards by applying custom AST rules to detect security flaws.

Does structural code search work with multiple programming languages?

Structural code search with ast-grep works across 40+ programming languages. It provides syntax-aware pattern matching for numerous languages beyond simple text-based tools.

Do I need to install any dependencies to run AST-based code analysis?

Yes, you need to install the ast-grep CLI. This Skill requires the ast-grep CLI installation and an understanding of AST pattern syntax to execute structural searches and codemod operations.

Why use AST-based code search over standard text search tools?

AST-based code search goes beyond simple text matching by understanding syntax structure. It prevents false positives from text in comments or strings, enabling precise semantic code transformations and security scanning.