file-search
Fast, syntax-aware codebase search using ripgrep for text patterns and ast-grep for structural code queries. Designed for efficient navigation, impact analysis, and security auditing.
Introduction
The file-search skill is a high-performance utility designed for developers and AI agents to efficiently navigate, audit, and analyze complex codebases. By providing a unified interface for both pattern-based text search and syntax-aware structural matching, it significantly reduces the time required to locate entry points, identify usage patterns, or detect security vulnerabilities. This skill is built on the performance-oriented engines ripgrep and ast-grep, which are optimized for rapid indexing and retrieval across large-scale projects, making them superior to standard grep or find commands.
-
Utilize ripgrep (rg) for lightning-fast text-based searching of variable names, strings, comments, and regex patterns across multiple files and directories.
-
Leverage ast-grep (sg) for advanced, syntax-aware structural searching, allowing for matching against abstract syntax trees to find function signatures, class definitions, or complex code blocks irrespective of formatting.
-
Enable rapid codebase discovery by finding TODOs, FIXMEs, specific API calls, or hardcoded credentials during security audits.
-
Enhance refactoring workflows by identifying all cross-references to a specific class, method, or dependency before making structural changes.
-
Support large-scale code analysis by filtering results using language-specific flags, glob patterns for excluding directories, and directory-specific scoping to maintain a high signal-to-noise ratio.
-
Implement professional search workflows, such as counting match occurrences, piping outputs to head for sampled inspection, and utilizing word boundaries for precise result matching.
-
Always start searches with targeted, narrow scopes to prevent overwhelming the context window and wasting tokens.
-
Recommended usage involves a progressive refinement approach: begin by identifying the general location, then narrow the scope by file type (e.g., --type py, --lang js) and directory before applying complex regex or structural patterns.
-
When performing complex refactoring, prioritize ast-grep's capability to understand code semantics over standard text-based tools to ensure that matches are functionally relevant rather than just string matches.
-
Always be mindful of token consumption; pipe large result sets to head or count them first to verify the search density before requesting full content access.
-
Ensure the environment remains isolated; this skill is specifically optimized for use within the MassGen execution framework, leveraging pre-configured binary tools available in the container environment.
Repository Stats
- Stars
- 966
- Forks
- 151
- Open Issues
- 6
- Language
- Python
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- Apr 28, 2026, 11:01 AM