moai-tool-ast-grep

Find code patterns by syntax structure using ast-grep rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you search, scan, and rewrite code based on syntax structure instead of brittle text matching, making large-scale code changes and security checks more accurate.

Core Features & Use Cases

  • Structural Code Search: Match functions, classes, imports, calls, and other AST patterns across many languages.
  • Safe Refactoring: Perform codemods and API migrations with rewrite rules that preserve code shape.
  • Security Scanning: Detect risky patterns such as SQL injection, XSS, command injection, and hardcoded secrets.
  • Practical Use Case: Use it to locate every console.log, modernize old syntax, or audit a codebase for unsafe string-built queries.

Quick Start

Use the ast-grep skill to find a specific code pattern in your repository and rewrite it safely if needed.

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 search and refactor code using syntax structure instead of text matching?

Syntax-aware structural search uses AST patterns to match functions, classes, and calls across languages, enabling accurate large-scale refactoring and codemods without brittle text matching.

Can I perform security scanning for SQL injection and XSS using structural code search?

Yes, security scanning with structural search detects risky patterns like SQL injection, XSS, command injection, and hardcoded secrets by matching syntax structure across large repositories accurately.

How do I write ast-grep rules for cross-language codebase exploration and API migrations?

Writing ast-grep rules involves defining AST patterns for structural search and CLI-based scanning workflows to match, transform, and validate code accurately during cross-language API migrations.

What is the best way to modernize old syntax and locate console.log calls in a repository?

The best way to modernize old syntax is using structural code search with rewrite rules to locate every console.log call and perform safe codemods that preserve code shape.

Does structural code search work for large repositories with multiple programming languages?

Yes, structural code search applies to cross-language refactoring, security audits, and codebase exploration tasks in large repositories by matching AST patterns across many supported languages.