707
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill massgen/massgen --skill file-search- SKILL.md8.1 KB
Overview
This skill provides fast, practical file search for agents using ripgrep for text searches and ast-grep for syntax-aware structural searches. It helps agents explore codebases, locate usages, and identify code patterns quickly so downstream reasoning and edits are precise and efficient.
How this skill works
The skill runs ripgrep (rg) for ultra-fast regex and fixed-string text matches across many files and directories. For structural queries that understand code syntax, it runs ast-grep (sg) to match patterns against the abstract syntax tree using metavariables. Both tools are invoked via shell execution and support language and path filters to limit scope.
When to use it
- Discover entry points, key classes, and architecture while onboarding a codebase
- Find all usages of functions, classes, or variables before refactoring
- Locate security issues like hardcoded credentials or suspicious eval calls
- Search for TODOs, FIXMEs, or audit comments across the repository
- Perform syntax-aware queries for specific code constructs or patterns
Best practices
- Start narrow: restrict directories and file types before broadening the search
- Count matches first (e.g., --count or pipe to head) to avoid overwhelming results
- Prefer rg for plain text and sg for structural, syntax-aware patterns
- Use language/file filters (--type or --lang) and exclude common noise (node_modules, venv, .git)
- Iteratively refine patterns—make them more specific to reduce false positives
Example use cases
- Use rg to find all authentication-related imports: rg "auth|login|session" --type py src/
- Use sg to locate class definitions with specific inheritance: sg --pattern 'class $NAME extends UserService { $$$ }' --lang js
- Count occurrences of error handling before investigating: rg "error" --count --type py
- Search for possible secrets: rg -i "password\s*=\s*['"]" --type py
- Inspect async functions in a directory: sg --pattern 'async function $NAME($$$) { $$$ }' --lang js src/services/
FAQ
Use ripgrep (rg) for fast text or regex searches. Use ast-grep (sg) when you need syntax-aware, structural matches that understand code semantics.
What if my search returns thousands of results?
Narrow by file type (--type / --lang), target directories, add context to the pattern, exclude noise with --glob, and preview with head or --count before retrieving full output.