AST-Grep Code Search
CommunityStructural code search & refactoring, instantly.
Authorbiwsantang
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill overcomes the limitations of traditional regex for code search and refactoring. It understands code structure, allowing you to find and transform patterns across multiple lines and languages, ignoring formatting differences, which saves immense time on large-scale refactorings.
Core Features & Use Cases
- Structural Pattern Matching: Finds code patterns based on Abstract Syntax Tree (AST) structure, not just text, for precise results.
- Smart Refactoring: Replaces code patterns while preserving formatting and semantic integrity across your codebase.
- Use Case: Automatically migrate an old API call like
user.getName()touser.profile.nameacross an entire codebase, ensuring all instances are updated correctly and consistently without manual review.
Quick Start
Example: Find all console.log statements in JavaScript files
ast-grep --pattern 'console.log($$$)' --lang js
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: AST-Grep Code Search Download link: https://github.com/biwsantang/dotfiles/archive/main.zip#ast-grep-code-search Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.