Skip to content

NetFabric/NetFabric.Numerics / .agents/skills/ripgrep

ripgrep

Flagged

Search files and code with ripgrep (`rg`) after preferring available code-indexing tools. Use when: finding literal text or regex matches; listing searchable files; filtering by glob or file type; checking whether `rg` is installed; installing ripgrep on macOS, Linux, or Windows; replacing legacy text-search commands in agent workflows. ALWAYS prefer an available fresh code index for symbols, references, call paths, architecture, and impact analysis, then use `rg` for text search. NEVER use `grep`. DO NOT USE FOR: structural code questions already answered by an available index; modifying matched files; searching binary formats without a text preprocessor.

FileKindSize
SKILL.mdskill md3.2 KB
references/installation.mdmarkdown1.7 KB
references/usage.mdmarkdown2.8 KB

references/usage.md

View on GitHub
# Usage

## Core Searches

| Goal | Command |
| --- | --- |
| Regex in current tree | `rg 'class\s+Widget'` |
| Literal punctuation | `rg -F 'CreateChecked<T>(' src` |
| Multiple patterns | `rg -e 'first' -e 'second'` |
| Invert matches | `rg -v 'pattern'` |
| Whole line | `rg -x 'exact line'` |
| Match only | `rg -o 'pattern'` |
| Count matching lines | `rg -c 'pattern'` |
| Multiline match | `rg -U 'first\nsecond'` |
| PCRE2 features | `rg -P '(?<=prefix)value'` |

Use `-F` when the input is literal. Ripgrep patterns use regular expressions by default; PCRE2 look-around and backreferences require a build with PCRE2 support and `-P` or `--engine pcre2`.

## Scope and Filtering

```bash
rg 'pattern' src tests
rg 'pattern' -g '*.cs' -g '!**/obj/**'
rg 'pattern' -tcs -Tjson
rg --files -g '*.md'
rg --type-list
```

Later glob rules override earlier rules. Quote every glob. Use `-t<type>` to include a built-in type and `-T<type>` to exclude one.

## Ignore Behavior

By default, recursive searches respect `.gitignore`, `.ignore`, and `.rgignore`; skip hidden files and directories; skip binary files; and do not follow symbolic links.

| Need | Flag |
| --- | --- |
| Include hidden paths | `--hidden` |
| Ignore ignore-files | `--no-ignore` |
| Follow symbolic links | `--follow` |
| Treat binary as text | `--text` |
| Disable all filtering progressively | `-u`, `-uu`, `-uuu` |
| Diagnose filtering | `--debug` |

Use the narrowest override. Avoid `-uuu` unless ignored, hidden, and binary content are all intentionally in scope.

## Output for Humans and Tools

| Need | Command |
| --- | --- |
| Line and column | `rg -n --column 'pattern'` |
| Before / after context | `rg -B 2 -A 3 'pattern'` |
| Stable path ordering | `rg --sort path 'pattern'` |
| Null-delimited paths | `rg -l -0 'pattern'` |
| Structured event stream | `rg --json 'pattern'` |
| Cap long output lines | `rg -M 200 'pattern'` |

Sorting disables parallelism and may be slower. Prefer `--json` for programmatic consumers and null-delimited paths when filenames may contain whitespace or newlines.

## Exit Status

| Code | Meaning |
| --- | --- |
| `0` | At least one match found |
| `1` | No matches found |
| `2` | Error occurred |

Treat exit code `1` as a valid empty result, not a command failure.

## Diagnostics

1. Run `rg --debug 'pattern' path` when expected files are skipped.
2. Check shell quoting and use `-F` if regex metacharacters should be literal.
3. Add one narrow filter override such as `--hidden` or `--no-ignore`.
4. Run `rg --no-config ...` if `RIPGREP_CONFIG_PATH` may be changing behavior.
5. Run `rg --help` for the installed version's authoritative option list.

## Sources

- [Official ripgrep user guide](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md)
- [Official ripgrep command reference](https://github.com/BurntSushi/ripgrep/blob/master/doc/rg.1.txt)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall