code-context-finder
コーディング中に、関連する知識グラフやコードの関係性から適切な文脈を自動で探し出し、作業効率を高めるSkill。
📜 元の英語説明(参考)
Automatically find relevant context from knowledge graph and code relationships while coding. Detects when context would be helpful (new files, unfamiliar code, architectural decisions) and surfaces related entities, prior decisions, and code dependencies.
🇯🇵 日本人クリエイター向け解説
コーディング中に、関連する知識グラフやコードの関係性から適切な文脈を自動で探し出し、作業効率を高めるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o code-context-finder.zip https://jpskill.com/download/6902.zip && unzip -o code-context-finder.zip && rm code-context-finder.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6902.zip -OutFile "$d\code-context-finder.zip"; Expand-Archive "$d\code-context-finder.zip" -DestinationPath $d -Force; ri "$d\code-context-finder.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
code-context-finder.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
code-context-finderフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 この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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] code-context-finder
コードコンテキストファインダー
概要
ナレッジグラフ検索とコード関係分析を組み合わせることで、コーディング中に適切なコンテキストを見つけて表示します。追加のコンテキストが役立つ状況をスマートに検出し、以下の情報を取得します。
- ナレッジグラフエンティティ: 以前の決定、プロジェクトのコンテキスト、関連する概念
- コード関係: 依存関係、インポート、関数呼び出し、クラス階層
使用するタイミング (スマート検出)
このスキルは、以下の状況を検出すると自動的に起動します。
| トリガー | 検索対象 |
|---|---|
| 不慣れなファイルを開く | ファイル/モジュールのコンテキストに関するナレッジグラフ、インポート/依存関係に関するコード |
| 新しい機能に取り組む | 以前の決定、関連する概念、類似の実装 |
| エラーのデバッグ | 関連する問題、エラーパターン、影響を受けるコンポーネント |
| コードのリファクタリング | 依存ファイル、呼び出し元/呼び出し先、テストカバレッジ |
| アーキテクチャ上の決定を行う | 過去のADR、関連する設計ドキュメント、確立されたパターン |
| 設定/インフラファイルに触れる | 関連するデプロイ、環境メモ、過去の問題 |
検出トリガーの参照については、references/detection_triggers.md を読み込んでください。
コアワークフロー
1. コンテキストの必要性を検出する
コンテキストが役立つことを示唆するトリガーを特定します。
監視するシグナル:
- 新しい/不慣れなファイルが開かれた
- 未知のコンポーネントに言及するエラーメッセージ
- 何かが「なぜ」または「どのように」機能するのかについての質問
- 共有/コアモジュールの変更
- アーキテクチャまたは設計に関する議論
2. ナレッジグラフを検索する
MCPメモリツールを使用して関連するエンティティを見つけます。
# 関連するコンテキストを検索する
mcp__memory__search_nodes(query="<topic>")
# 既知の場合、特定のエンティティを開く
mcp__memory__open_nodes(names=["entity1", "entity2"])
# 関係を表示する
mcp__memory__read_graph()
検索戦略:
- モジュール/ファイル名 → プロジェクトコンテキスト
- エラータイプ → 過去の問題、解決策
- 機能名 → 以前の決定、根拠
- 人名 → 所有権、専門知識
3. コード関係を分析する
コードレベルのコンテキストを見つけます。
# このモジュールをインポートしているものを検索する
grep -r "from module import" --include="*.py"
grep -r "import module" --include="*.py"
# 関数呼び出し元を検索する
grep -r "function_name(" --include="*.py"
# クラスの使用箇所を検索する
grep -r "ClassName" --include="*.py"
# テストカバレッジを検索する
find . -name "*test*.py" -exec grep -l "module_name" {} \;
一般的な検索パターンについては、references/search_patterns.md を読み込んでください。
4. コンテキストを統合する
見つかった情報を簡潔に提示します。
## 見つかったコンテキスト
**ナレッジグラフ:**
- [エンティティ]: 関連する観察
- [決定]: 以前のアーキテクチャ上の選択
**コード関係:**
- インポート元: file1.py, file2.py
- 依存先: module_a, module_b
- テスト: test_module.py (5テスト)
**推奨されるアクション:**
- 変更する前に[エンティティ]を確認する
- [依存ファイル]への影響を考慮する
クイックリファレンス
ナレッジグラフクエリ
| 意図 | クエリパターン |
|---|---|
| プロジェクトコンテキストを検索する | search_nodes("project-name") |
| 以前の決定を検索する | search_nodes("decision") または search_nodes("<feature>") |
| 関連する概念を検索する | search_nodes("<concept>") |
| 人/所有者を検索する | search_nodes("<person-name>") |
| すべてを閲覧する | read_graph() |
コード関係クエリ
| 意図 | コマンド |
|---|---|
| インポート元を検索する | grep -r "from X import\|import X" |
| 呼び出し元を検索する | grep -r "function(" |
| 実装を検索する | grep -r "def function\|class Class" |
| テストを検索する | find -name "*test*" -exec grep -l "X" |
| 設定を検索する | grep -r "X" *.json *.yaml *.toml |
コーディングワークフローとの統合
変更を加える前
- モジュール/機能のコンテキストについてナレッジグラフを確認します。
- ターゲットをインポート/依存しているすべてのファイルを検索します。
- 関連するテストを見つけます。
- アーキテクチャ上の決定であれば、以前の決定を確認します。
変更を加えた後
- 重要な決定がなされた場合は、ナレッジグラフを更新します。
- 新しいパターンや学習をメモします。
- 既存のエンティティに観察を追加します。
デバッグ時
- 類似のエラーについてナレッジグラフを検索します。
- 影響を受けるコンポーネントへのすべてのコードパスを検索します。
- 関連する問題/決定を確認します。
- 新しい解決策であれば、それを文書化します。
リソース
references/
detection_triggers.md- スマート検出の詳細なトリガーパターンsearch_patterns.md- コード関係の一般的な検索パターン
scripts/
find_code_relationships.py- インポート、依存関係、呼び出しグラフを分析します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Code Context Finder
Overview
Find and surface relevant context while coding by combining knowledge graph search with code relationship analysis. Uses smart detection to identify when additional context would be helpful, then retrieves:
- Knowledge graph entities: Prior decisions, project context, related concepts
- Code relationships: Dependencies, imports, function calls, class hierarchies
When to Use (Smart Detection)
This skill activates automatically when detecting:
| Trigger | What to Search |
|---|---|
| Opening unfamiliar file | Knowledge graph for file/module context, code for imports/dependencies |
| Working on new feature | Prior decisions, related concepts, similar implementations |
| Debugging errors | Related issues, error patterns, affected components |
| Refactoring code | Dependent files, callers/callees, test coverage |
| Making architectural decisions | Past ADRs, related design docs, established patterns |
| Touching config/infra files | Related deployments, environment notes, past issues |
For detection triggers reference, load references/detection_triggers.md.
Core Workflow
1. Detect Context Need
Identify triggers that suggest context would help:
Signals to watch:
- New/unfamiliar file opened
- Error messages mentioning unknown components
- Questions about "why" or "how" something works
- Changes to shared/core modules
- Architectural or design discussions
2. Search Knowledge Graph
Use MCP memory tools to find relevant entities:
# Search for related context
mcp__memory__search_nodes(query="<topic>")
# Open specific entities if known
mcp__memory__open_nodes(names=["entity1", "entity2"])
# View relationships
mcp__memory__read_graph()
Search strategies:
- Module/file names → project context
- Error types → past issues, solutions
- Feature names → prior decisions, rationale
- People names → ownership, expertise
3. Analyze Code Relationships
Find code-level context:
# Find what imports this module
grep -r "from module import" --include="*.py"
grep -r "import module" --include="*.py"
# Find function callers
grep -r "function_name(" --include="*.py"
# Find class usages
grep -r "ClassName" --include="*.py"
# Find test coverage
find . -name "*test*.py" -exec grep -l "module_name" {} \;
For common search patterns, load references/search_patterns.md.
4. Synthesize Context
Present findings concisely:
## Context Found
**Knowledge Graph:**
- [Entity]: Relevant observation
- [Decision]: Prior architectural choice
**Code Relationships:**
- Imported by: file1.py, file2.py
- Depends on: module_a, module_b
- Tests: test_module.py (5 tests)
**Suggested Actions:**
- Review [entity] before modifying
- Consider impact on [dependent files]
Quick Reference
Knowledge Graph Queries
| Intent | Query Pattern |
|---|---|
| Find project context | search_nodes("project-name") |
| Find prior decisions | search_nodes("decision") or search_nodes("<feature>") |
| Find related concepts | search_nodes("<concept>") |
| Find people/owners | search_nodes("<person-name>") |
| Browse all | read_graph() |
Code Relationship Queries
| Intent | Command |
|---|---|
| Find importers | grep -r "from X import\|import X" |
| Find callers | grep -r "function(" |
| Find implementations | grep -r "def function\|class Class" |
| Find tests | find -name "*test*" -exec grep -l "X" |
| Find configs | grep -r "X" *.json *.yaml *.toml |
Integration with Coding Workflow
Before Making Changes
- Check knowledge graph for context on module/feature
- Find all files that import/depend on target
- Locate relevant tests
- Review prior decisions if architectural
After Making Changes
- Update knowledge graph if significant decision made
- Note new patterns or learnings
- Add observations to existing entities
When Debugging
- Search knowledge graph for similar errors
- Find all code paths to affected component
- Check for related issues/decisions
- Document solution if novel
Resources
references/
detection_triggers.md- Detailed trigger patterns for smart detectionsearch_patterns.md- Common search patterns for code relationships
scripts/
find_code_relationships.py- Analyze imports, dependencies, and call graphs