mcpField
F
file-search

file-search

github.com/0xdarkmatter開発79244 回インストール5 日前に更新
リポジトリ

file-search について

file-searchは、fd、rg、fzfを使ってファイルや内容を検索する開発者向けスキルです。対話的な選択やプレビューに加え、発展的なワークフローの参考資料も扱います。

主な機能

  1. 01名前、拡張子、種類で検索
  2. 02パターンによるファイル内容の検索
  3. 03fzfによる対話的な選択
  4. 04一致ファイルのプレビューと表示
  5. 05発展的なワークフロー資料

活用シーン

  1. 01種類を指定してソースファイルを探す
  2. 02コード内のTODOやエラーを探す
  3. 03検索結果を選んでファイルを開く

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/0xdarkmatter/claude-mods --skill file-search

インストール後、Claude Code で/file-searchを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

assets/
.gitkeep
references/
advanced-workflows.md
scripts/
.gitkeep

詳細

ファイル検索

最新のファイルおよびコンテンツ検索です。

fd - ファイルを検索

# Find by name
fd config                    # Files containing "config"
fd -e py                     # Python files

# By type
fd -t f config               # Files only
fd -t d src                  # Directories only

# Exclude
fd -E node_modules           # Exclude directory
fd -E "*.min.js"             # Exclude pattern

# Execute command
fd -e py -x wc -l            # Line count per file

rg - コンテンツを検索

# Simple search
rg "TODO"                    # Find TODO
rg -i "error"                # Case-insensitive

# By file type
rg -t py "import"            # Python files only
rg -t js -t ts "async"       # JS and TS

# Context
rg -C 3 "function"           # 3 lines before/after

# Output modes
rg -l "TODO"                 # File names only
rg -c "TODO"                 # Count per file

fzf - インタラクティブに選択

# Find and select
fd | fzf

# With preview
fd | fzf --preview 'bat --color=always {}'

# Multi-select
fd -e ts | fzf -m | xargs code

複合パターン

# Find files, search content
fd -e py -x rg "async def" {}

# Search, select, open
rg -l "pattern" | fzf --preview 'rg -C 3 "pattern" {}' | xargs vim

クイックリファレンス

タスクコマンド
TS ファイルを検索fd -e ts
src 内を検索fd -e ts src/
パターンを検索rg "pattern"
指定した種類のファイル内を検索rg -t py "import"
一致するファイルrg -l "pattern"
一致数をカウントrg -c "pattern"
インタラクティブに選択fd | fzf
プレビュー付きfd | fzf --preview 'bat {}'

パフォーマンスのヒント

ヒント理由
どちらも .gitignore を尊重しますnode_modules、dist を自動的にスキップします
-g より -t を使用します種類指定フラグのほうが高速です
パスを絞り込みますrg pattern src/ のほうが高速です
リテラルには -F を使用します正規表現のオーバーヘッドを回避できます

追加リソース

詳しいパターンについては、次を読み込んでください:

  • ./references/advanced-workflows.md - Git 統合、シェル関数、高度なワークフロー

コメント