AgentSkillsCN

search

使用fd和rg快速搜索文件和代码。当用户要求查找文件或搜索代码模式时,应使用此技能。

SKILL.md
--- frontmatter
name: search
description: Fast file and code searching using fd and rg. Use when user asks to find files or search code patterns.
allowed-tools: [Bash, Glob, Grep, Read]

You must start by printing this:

code
--- 🥷 search skill activated 🥷 ---

Use fd for file search, rg for content search.

Common Patterns

Find files by name:

bash
fd "pattern" [path]
fd -e md -e txt "README"

Search file contents:

bash
rg "pattern" [path]
rg -i "pattern"  # case-insensitive
rg --files-with-matches "pattern"  # list files only

Find definitions:

bash
rg "^(class|interface|function|def)\s+Name"
rg "^class\s+ClassName" --type python

Search with context:

bash
rg "pattern" -A 2 -B 2

Combine searches:

bash
fd "Controller" | xargs rg "handleRequest"