agentleFS
EasyJoy-TechnologiesEasyJoy-Technologies/openclaw-skills/skills/code-search/SKILL.md

code-search

Skill1 starsChanged 8 months agoMITView on GitHub

Fast codebase search combining glob file matching and ripgrep content search. Find files by pattern, search code by regex, explore project structure. Use when needing to find files, search for patterns in code, understand codebase structure, or explore unfamiliar projects. Triggers on "find files", "search code", "grep for", "where is", "find all uses of", "explore this codebase", "project structure".

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use rg -F "literal" for exact strings with special chars

    line 49
  2. Very specific:

    Use rg -l first (files only), then rg -n -C 2 for detail

    line 50

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Search — Fast Codebase Exploration

Efficient file and content search. Always prefer rg over raw grep.

File Search

find <dir> -type f -name "*.ts" | head -50           # by extension
find <dir> -type f -name "*.ts" -mtime -7 | head -30  # recently modified
find <dir> -path "*/services/*.ts" -type f             # by path pattern

Content Search (ripgrep)

rg -l "pattern" <dir>                                  # file list only
rg -n -C 2 "pattern" <dir>                             # with context
rg -n "pattern" --type ts <dir>                        # filter by type
rg -n "TODO" -g "*.ts" -g "!node_modules" <dir>       # glob filter
rg -c "pattern" <dir>                                  # count per file
rg -n -U "interface\s*\{[^}]*\}" <dir> --type ts      # multiline

Project Structure Discovery

  1. find <dir> -maxdepth 2 -type d | sort | head -50
  2. find <dir> -maxdepth 2 \( -name "package.json" -o -name "tsconfig.json" -o -name "Makefile" -o -name "*.toml" \) | sort
  3. rg -l "main\(|export default|app\." <dir> --type ts --type js | head -20
  4. find <dir> -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -15

Common Patterns

TaskCommand
Where is X defined?rg -n "(?:function|class|const|type|interface)\s+X" <dir> --type ts
What calls X?rg -n "X\(" <dir> --type ts -g "!*.test.*"
What changed recently?git log --oneline -20 / git diff --stat HEAD~5
API surfacerg -n "export\s+(function|class|const|type)" <dir>/src --type ts | head -40

Tips

  • Exclude node_modules, .git, dist, build: use -g "!node_modules"
  • Pipe through head -N to avoid flooding context
  • Use rg -F "literal" for exact strings with special chars
  • Use rg -l first (files only), then rg -n -C 2 for detail
  • Fallback: grep -rn --include="*.ts" if rg unavailable

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.