Skip to content
Skillpedia
General coding6.2k · #14387

code-search

What it does

This skill helps an agent search code quickly with ripgrep and Git instead of reading whole files. It is for developers who need to find where a function is defined or used.

When to use it

  • ✓When you need to find where a function, class or symbol is defined.
  • ✓When you want every place a name is used in a project.
  • ✓When you need to find out when or why a line of code changed.

Skill link

https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/code-search/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/code-search/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Find every place the function calculateTax is defined or called in this project.”

5 new skills a week. 1 minute to read.

How it works

The skill uses ripgrep for regular-expression searches, filtered by file type, and uses Git history commands to trace when a string was added or who changed a line. It keeps results narrow so the output stays small.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Code Search

The built-in grep tool matches LITERAL text only. For real regular-expression search and history-aware lookups, drive ripgrep and git through execute.

Ripgrep (regex)

  • Symbol definition: rg -n "fn\s+\w+\(" src/, rg -n --type java "class \w+Service".
  • Usages of a name: rg -n "\bmyFunction\b".
  • Limit by file type: rg -n --type ts "useEffect\(".
  • List files only: rg -l "TODO"; find files by name: rg --files | rg <name> or use glob.

Git history search

  • When a string was introduced/removed: git log -S "<string>" --oneline.
  • Who/why a line changed: git blame -L <start>,<end> <file>.
  • Search tracked files: git grep -n "<regex>".

Tips

  • Prefer a targeted regex over reading whole files when locating symbols or call sites.
  • Escape regex metacharacters when you want a literal match, or pass -F to ripgrep.
  • Narrow scope with a path argument to keep output small (tool output is truncated).
FAQ

Does it need ripgrep?

Yes, the skill uses ripgrep for regular-expression searches.

Can it search Git history?

Yes, it can find when a string was added or removed and who changed a line.

Why not read whole files?

Targeted searches keep the results short and easier to work with.

Details

Original description by the author

Search a codebase efficiently with ripgrep regular expressions, file globs, and git history search. Use to locate symbols, usages, and definitions instead of reading whole files.

repo: agentscope-ai/agentscope-java

Popularity

GitHub stars
6.2k
Ranking position
#14387
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills