domains / software-engineering / file-search / file-search

file-search

Skill card

combined

The two skills cover the same core task (fast file search) but rely on different primary tools and workflows. The first skill (LeoYeAI) uses `fd` for filename search and `rg` for content search, while the second skill (aipoch) uses `rg --files` for both filename and content search. The second skill also includes extensive boilerplate for validation, safety, and output contracts that the first lacks. Because the first skill provides a distinct and often preferred tool (`fd`) for filename operations that the second omits, and the second provides a self-contained `rg`-only workflow, crowning one would hide a valid alternative approach. They are complementary rather than one being a strict reproduction of the other.

Repositories

RepositoryPath
LeoYeAI/openclaw-master-skillsskills/file-search/SKILL.md
aipoch/medical-research-skillsscientific-skills/Other/file-search/SKILL.md

Other copies

RoleRepositoryPath
peerLeoYeAI/openclaw-master-skillsskills/file-search/SKILL.md
peeraipoch/medical-research-skillsscientific-skills/Other/file-search/SKILL.md

Combined skill

---
name: file-search
description: "Fast file-name and content search using `fd` and `rg` (ripgrep)."
---

# File Search Skill

Fast file-name and content search using `fd` and `rg` (ripgrep).

## Dependencies

- `fd` (fd-find) for filename search.
- `rg` (ripgrep) for content search.

Install if missing:
```bash
# DNF
sudo dnf install fd-find ripgrep
# Or use your preferred package manager
```

## Find Files by Name

Prefer `fd` for filename searches as it is optimized for this task.

Search for files matching a pattern:
```bash
fd "\.rs$" /path/to/projects
```

Find files by exact name:
```bash
fd -g "Cargo.toml" /path/to/projects
```

*Alternative using only `rg` if `fd` is not available:*
```bash
rg --files --glob "*.rs" /path/to/projects
```

## Search File Contents

Use `rg` for content searches.

Search for a regex pattern across files:
```bash
rg "TODO|FIXME" /path/to/projects
```

Search with context lines:
```bash
rg -C 3 "fn main" /path/to/projects --type rust
```

## Workflow

1. **Pre-check**: Ensure `fd` and `rg` are installed (`fd --version`, `rg --version`).
2. **Filename Search**: Use `fd` with glob or regex patterns.
3. **Content Search**: Use `rg` with regex patterns, adding `-C` for context and `--type` for filtering.
4. **Validation**: Verify results match the intended scope.