| name | ripgrep-patterns |
| description | Fast codebase search and file discovery with ripgrep (`rg`). Use when finding symbols, text patterns, TODOs, config keys, or candidate files before implementation. |
| allowed-tools | Read, Grep, Glob, Bash |
ripgrep Patterns
Use this skill when the task requires fast search, code discovery, or targeted filtering in large repos.
Core Rules
- Prefer
rg over grep for speed and better defaults.
- Start broad, then narrow with globs, file types, and line numbers.
- Use
--files for file discovery, -n for line references, and -C for quick context.
- Ignore generated or vendor directories unless explicitly needed.
- Use fixed-string mode (
-F) when regex is unnecessary.
High-Value Commands
rg -n "pattern" .
rg -n -i "pattern" .
rg -n -F "literal_text" .
rg -n "useEffect\\(" -t ts -t tsx .
rg -n "pattern" --hidden .
rg -n "pattern" . -g '!node_modules' -g '!.next' -g '!dist'
rg --files -g '**/*.{ts,tsx,js,jsx}'
rg -n -C 2 "pattern" .
Practical Workflow
- Discover candidates:
rg --files -g '**/*.{ts,tsx,js,jsx,json,md}'
- Locate behavior:
rg -n "keyword_or_symbol" .
- Narrow surface area:
add
-g filters, file types, or target subpaths.
- Confirm exact edits:
rerun with
-n -C 2 before editing.
Safety and Quality
- Never run destructive commands from search results.
- Treat matches as hints, not truth. Always open files and verify context.
- For refactors, run search before and after changes to confirm coverage.
- Prefer deterministic queries in commit/review notes.
For additional command recipes, see references/command-recipes.md.