Ripgrep search
Skill MauricioPerera/agent-skills-pack/skills/ripgrep-search
A curated pack of 7 practical agent-skills demonstrating real-world patterns: HTTP, GitHub CLI, ripgrep, file ops, JSON processing, encoding. Each SKILL.md validated against the v0.1 spec.
npx -y skills add MauricioPerera/agent-skills-pack --skill ripgrep-searchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Recursively searches files in a directory for a regex pattern using ripgrep. Returns matching lines with file:line:column prefixes. Respects .gitignore by default. Sandboxed banks (SPEC §2.11) restrict the search root to the declared `filesystem` allowlist plus `$AGENT_SCRATCH`.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.6 KB, as published. Nobody here has run it
Search code with ripgrep
Wraps ripgrep (rg) as a deterministic, agent-friendly search tool.
Why ripgrep over grep
- Faster on large codebases (parallelism + SIMD).
- Respects
.gitignoreautomatically (use-uuuto disable; intentionally not exposed here to keep the skill focused). - Default UTF-8 handling.
- Cleaner output format (
file:line:col:match).
Output format
src/handler.ts:42:3: handleRequest(req);
src/router.ts:18:5: routeHandler.dispatch(...)
Each line is <file>:<line>:<column>:<matching content>. The agent can parse this with awk -F: or pipe through jq after rg --json.
Safety: pattern position vs path position
- The
patternarg is single-quoted by the bank — regex special characters survive intact. - The
patharg's regex strictly forbids;,|,&,$, backticks, newlines — defense in depth even though single-quoting would already neutralize most injection attempts. - The
--max-countflag prevents unbounded output from pathological matches.
Caveats
--hiddenis enabled by default — searches dotfiles (.gitignore,.env, etc.). Be careful in directories that may contain secrets..gitignoreis respected; files innode_modules/dist/.gitare skipped automatically. Use-uuuif you genuinely need to search them.- Very long lines (>10MB) are skipped by ripgrep's defaults.
- The pattern uses ripgrep's default regex flavor (Rust
regexcrate). For PCRE2 features (lookarounds, backreferences), the skill could be extended with a--pcre2flag. - If the pattern is potentially shell-metacharacter-heavy (e.g., contains
*,[,(,)), the bank's single-quoting protects it; no manual escaping needed by the agent.
Pairing with read-file
A common agent flow:
ripgrep-searchto find candidate files.- Parse the output to extract file paths.
read-fileto load full content of each match for context.
This avoids loading every file in the repo into context — only the relevant ones, after the regex narrows them down.