codebase-exploration
コードベース全体から特定のパターンや実装、機能などを素早く見つけ出し、コードの構造を理解するのに役立つSkill。
📜 元の英語説明(参考)
Deep contextual grep for codebases. Expert at finding patterns, architectures, implementations, and answering "Where is X?", "Which file has Y?", and "Find code that does Z" questions. Use when exploring unfamiliar codebases, finding specific implementations, understanding code organization, discovering patterns across multiple files, or locating functionality in a project. Supports three thoroughness levels quick, medium, very thorough.
🇯🇵 日本人クリエイター向け解説
コードベース全体から特定のパターンや実装、機能などを素早く見つけ出し、コードの構造を理解するのに役立つSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
コードベース探索
目的
体系的なコードベースの探索と発見に特化しています。高度な検索技術、パターン認識、コード分析を用いて、不慣れなコードを迅速に理解し、特定の実装箇所を特定し、アーキテクチャパターンをマッピングし、コードに関する場所ベースの質問に答えます。
使用する場面
- 不慣れなコードベースを初めて探索する場合
- 特定の機能がどこに実装されているかを見つける必要がある場合
- コードベース全体でパターンの例を探している場合
- コンポーネントがどのように相互作用するかを理解する場合
- 特定のAPIまたはパターンのすべての使用箇所を特定する場合
- アーキテクチャの構成をマッピングする場合
- プロジェクト全体で類似のコードを見つける場合
- 「Xはどこにありますか?」「Yがあるファイルはどれですか?」「Zを行うコードを見つけてください」といった質問
クイックスタート
このスキルを呼び出す場合:
- 不慣れなコードベースを初めて探索する場合
- 特定の機能がどこに実装されているかを見つける必要がある場合
- コードベース全体でパターンの例を探している場合
- コンポーネントがどのように相互作用するかを理解する場合
- 「Xはどこにありますか?」「Yがあるファイルはどれですか?」「Zを行うコードを見つけてください」といった質問
呼び出さない場合:
- 既知のバグをデバッグしている場合(debugger-skillを使用してください)
- コードをリファクタリングしている場合(refactoring-specialist-skillを使用してください)
- コード品質をレビューしている場合(code-reviewer-skillを使用してください)
- 新しいコードをゼロから書いている場合(適切な開発者スキルを使用してください)
徹底レベル
クイック(高速、大まかな概要)
- ファイル構造の概要
- 高レベルのパターンマッチング
- ディレクトリ構成
- 主要なエントリポイント
- 約30秒
ミディアム(バランスの取れた深さ)
- 詳細なファイル検査
- ファイル間のパターン発見
- アーキテクチャマッピング
- 一般的なパターン分析
- 約2〜3分
非常に徹底的(詳細な調査)
- 網羅的なコード分析
- 複雑なパターンマッチング
- 依存関係の追跡
- エッジケースの発見
- 約5〜10分
意思決定フレームワーク
検索戦略の選択
| 質問の種類 | 検索戦略 |
|---|---|
| 「ユーザー認証はどこにありますか?」 | 認証キーワード + ログインパターンを検索 |
| 「データの流れはどのように機能しますか?」 | モデル、サービス、コントローラーのパターンを見つける |
| 「X APIを処理するファイルはどれですか?」 | エンドポイント + ルート定義を検索 |
| 「すべてのデータベースクエリを見つけてください」 | ORMパターン、SQLキーワードを検索 |
| 「エラー処理を特定してください」 | try-catch、エラークラスを見つける |
ツールの選択
| ツール | 最適な用途 | 例 |
|---|---|---|
grep/rg |
テキストパターンマッチング | rg "function handleAuth" |
find/fd |
ファイル名/パスのマッチング | fd -e ts auth |
ast-grep |
コード構造のマッチング | ast-grep --pattern "class $NAME" |
| LSPツール | シンボルと参照の検索 | lsp_find_references |
git log |
履歴コンテキスト | git log --name-only |
質問の種類によるアプローチ
「Xはどこに実装されていますか?」
- 名前でXを検索:
rg "X|x" - 関連用語を検索:
rg "related|terms" - 明らかな場所を確認:
ls src/X/ - テストを確認:
rg "X" tests/
「Yはどのように機能しますか?」
- Yの定義を見つける
- Yの使用箇所を見つける
- 流れを追跡する
- 依存関係を理解する
「Zを使用しているファイルはどれですか?」
- Zのインポートを検索する
- LSPの参照検索機能を使用する
- Zのメソッドが呼び出されている箇所を検索する
コア機能
検索戦略
パターンベース検索
- 命名規則による検索
- コードパターンによる特定
- アーキテクチャマーカーによる発見
- ファイル構成による識別
コンテキスト認識検索
- コードの関係性を理解する
- 依存関係をマッピングする
- 実行フローを追跡する
- 関連コンポーネントを見つける
多角的な発見
- 機能による検索
- 構造による検索
- 命名による検索
- パターンによる検索
探索ワークフロー
ステップ1:方向付け
- 何を探しているのか?
- なぜそれが必要なのか?
- どの程度の詳細が必要か?
- どの徹底レベルが適切か?
ステップ2:構造のマッピング
- トップレベルの構成を特定する
- 主要なマーカー(エントリポイント、設定ファイル)を見つける
- ディレクトリの命名パターンをメモする
ステップ3:検索の実行
- 適切なツールを選択する
- 複数の検索角度を使用する
- 発見事項を文書化する
ステップ4:分析と統合
- 点と点をつなぐ
- パターンを特定する
- 発見事項に優先順位を付ける
ベストプラクティス
広くから狭く
- まず: 全体像を把握する(
tree -L 2、ls -la src/) - 次に: パターンを特定する(
fd -e ts、rg -c "class|function") - 最後に: 特定の領域をターゲットにする
複数の検索角度を使用する
- 名前で検索:
fd auth - 内容で検索:
rg "authentication" - 構造で検索:
ast-grep --pattern "class $NAME" - シンボルで検索:
lsp_workspace_symbols
パンくずリストをたどる
- 依存関係を見つけるためにインポートを確認する
- 参照を見つけるためにLSPを使用する
- アーキテクチャの手がかりのためにファイルの場所を見る
- コンテキストのためにgit履歴を確認する
進行中に文書化する
# 認証フロー
1. エントリ: src/middleware/auth.ts
2. トークン検証: src/services/jwt.service.ts
3. ユーザー検索: src/repositories/user.repository.ts
4. ガード: src/guards/auth.guard.ts
アンチパターン
- コンテキストなしで検索しない: まず何を探しているのかを理解してください
- ファイル構造を無視しない: 常にディレクトリ構成を確認してください
- 単一の検索方法に頼らない: 複数のアプローチを使用してください
- テストを忘れない: 実際の使用例についてはテストファイルを検索してください
- 設定ファイルをスキップしない: 早めに設定ファイルを確認してください
関連スキル
- 探索でバグが見つかった場合は[[debugger-skill]]を使用してください
- 発見されたパターンを評価するには[[architect-reviewer-skill]]を使用してください
- 見つかったコードを改善するには[[refactoring-specialist-skill]]を使用してください
- 複雑なアーキテクチャの質問には[[technical-advisory-skill]]を使用してください
追加リソース
- 詳細な技術リファレンス: REFERENCE.mdを参照してください
- コード例とパターン: EXAMPLES.mdを参照してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Codebase Exploration
Purpose
Specializes in systematic codebase exploration and discovery. Uses advanced search techniques, pattern recognition, and code analysis to quickly understand unfamiliar code, locate specific implementations, map architectural patterns, and answer location-based questions about code.
When to Use
- Exploring an unfamiliar codebase for the first time
- Need to find where specific functionality is implemented
- Looking for examples of a pattern across the codebase
- Understanding how components interact
- Locating all usages of a particular API or pattern
- Mapping architectural organization
- Finding similar code across the project
- Questions like "Where is X?", "Which file has Y?", "Find code that does Z"
Quick Start
Invoke this skill when:
- Exploring an unfamiliar codebase for the first time
- Need to find where specific functionality is implemented
- Looking for examples of a pattern across the codebase
- Understanding how components interact
- Questions like "Where is X?", "Which file has Y?", "Find code that does Z"
Do NOT invoke when:
- Debugging a known bug (use debugger-skill)
- Refactoring code (use refactoring-specialist-skill)
- Reviewing code quality (use code-reviewer-skill)
- Writing new code from scratch (use appropriate developer skill)
Thoroughness Levels
Quick (Fast, broad strokes)
- File structure overview
- High-level pattern matching
- Directory organization
- Main entry points
- ~30 seconds
Medium (Balanced depth)
- Detailed file examination
- Cross-file pattern discovery
- Architectural mapping
- Common patterns analysis
- ~2-3 minutes
Very Thorough (Deep dive)
- Exhaustive code analysis
- Complex pattern matching
- Dependency tracing
- Edge case discovery
- ~5-10 minutes
Decision Framework
Search Strategy Selection
| Question Type | Search Strategy |
|---|---|
| "Where is user authentication?" | Search for auth keywords + login patterns |
| "How does data flow work?" | Find models, services, controllers pattern |
| "Which file handles X API?" | Search endpoints + route definitions |
| "Find all database queries" | Search ORM patterns, SQL keywords |
| "Locate error handling" | Find try-catch, error classes |
Tool Selection
| Tool | Best For | Example |
|---|---|---|
grep/rg |
Text pattern matching | rg "function handleAuth" |
find/fd |
File name/path matching | fd -e ts auth |
ast-grep |
Code structure matching | ast-grep --pattern "class $NAME" |
| LSP tools | Symbol and reference finding | lsp_find_references |
git log |
Historical context | git log --name-only |
Approach by Question Type
"Where is X implemented?"
- Search for X by name:
rg "X|x" - Search for related terms:
rg "related|terms" - Check obvious locations:
ls src/X/ - Look in tests:
rg "X" tests/
"How does Y work?"
- Find Y's definition
- Find Y's usage
- Trace the flow
- Understand dependencies
"Which files use Z?"
- Search for imports of Z
- Use LSP find-references
- Search for Z's methods being called
Core Capabilities
Search Strategies
Pattern-Based Search
- Find by naming conventions
- Locate by code patterns
- Discover by architectural markers
- Identify by file organization
Context-Aware Search
- Understand code relationships
- Map dependencies
- Trace execution flows
- Find related components
Multi-Angle Discovery
- Search by functionality
- Search by structure
- Search by naming
- Search by patterns
Exploration Workflow
Step 1: Orient
- What are we looking for?
- Why do we need it?
- What level of detail is needed?
- Which thoroughness level is appropriate?
Step 2: Map Structure
- Identify top-level organization
- Find key markers (entry points, config files)
- Note directory naming patterns
Step 3: Execute Search
- Choose appropriate tools
- Use multiple search angles
- Document findings
Step 4: Analyze & Synthesize
- Connect the dots
- Identify patterns
- Prioritize findings
Best Practices
Start Broad, Then Narrow
- First: Get the lay of the land (
tree -L 2,ls -la src/) - Second: Identify patterns (
fd -e ts,rg -c "class|function") - Third: Target specific areas
Use Multiple Search Angles
- Search by name:
fd auth - Search by content:
rg "authentication" - Search by structure:
ast-grep --pattern "class $NAME" - Search by symbols:
lsp_workspace_symbols
Follow the Breadcrumbs
- Check imports to find dependencies
- Use LSP to find references
- Look at file location for architectural clues
- Check git history for context
Document as You Go
# Authentication Flow
1. Entry: src/middleware/auth.ts
2. Token validation: src/services/jwt.service.ts
3. User lookup: src/repositories/user.repository.ts
4. Guards: src/guards/auth.guard.ts
Anti-Patterns
- Don't Search Without Context: Understand what you're looking for first
- Don't Ignore File Structure: Always check directory organization
- Don't Rely on Single Search Method: Use multiple approaches
- Don't Forget About Tests: Search test files for real usage
- Don't Skip Configuration Files: Check config early
Related Skills
- Use [[debugger-skill]] when exploration reveals bugs
- Use [[architect-reviewer-skill]] to evaluate discovered patterns
- Use [[refactoring-specialist-skill]] to improve found code
- Use [[technical-advisory-skill]] for complex architectural questions
Additional Resources
- Detailed Technical Reference: See REFERENCE.md
- Code Examples & Patterns: See EXAMPLES.md