This skill should be used when agents need to search codebases for text patterns or structural code patterns. Provides fast search using ripgrep for text and ast-grep for syntax-aware code search.
The file-search skill is designed to help developers quickly and efficiently search through large codebases, utilizing two powerful tools: ripgrep and ast-grep. This skill solves the problem of slow, ineffective searches by providing fast, regex-based text search and syntax-aware code pattern search, making it easier to navigate, analyze, and refactor complex code. It allows users to find specific code constructs, identify potential issues, and understand the structure of a codebase without being bogged down by manual inspection or basic search tools.
Ripgrep is optimized for fast text-based searches using regular expressions, making it ideal for locating strings, variables, and comments. Ast-grep, on the other hand, is designed for syntax-aware code searches, allowing for more complex queries based on code structure, such as class definitions or function signatures.
Both ripgrep and ast-grep support specific languages, with ripgrep offering general text searches and ast-grep enabling structural searches in supported languages like Python, JavaScript, and others. However, for effective usage, you should filter by language and file types as needed.
Ripgrep and ast-grep are significantly faster than traditional tools like `grep` and `find`, especially when dealing with large codebases. Ripgrep uses highly optimized algorithms for text searching, while ast-grep leverages abstract syntax trees for efficient, structural searches, both of which improve search speed and accuracy.
Quick Setup:
.claude/skills/Repository
massgen/MassGen