affaan-m/ECC/docs/ja-JP/skills/iterative-retrieval/SKILL.md
iterative-retrieval
Review iterative-retrieval's use cases, installation, workflow, and original source instructions.
- Source repository stars
- 234,327
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-07-27
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/iterative-retrieval"Inspect the Agent Skill "iterative-retrieval" from https://github.com/affaan-m/ECC/blob/4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38/docs/ja-JP/skills/iterative-retrieval/SKILL.md at commit 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
問題
サブエージェントは限定的なコンテキストで起動されます。以下を知りません: - どのファイルに関連するコードが含まれているか - コードベースにどのようなパターンが存在するか - プロジェクトがどのような用語を使用しているか
どのファイルに関連するコードが含まれているかコードベースにどのようなパターンが存在するかプロジェクトがどのような用語を使用しているか - 02
解決策: 反復検索
コンテキストを段階的に洗練する4フェーズのループ:
高(0.8-1.0): ターゲット機能を直接実装中(0.5-0.7): 関連するパターンや型を含む低(0.2-0.4): 間接的に関連 - 03
フェーズ1: DISPATCH
Review the “フェーズ1: DISPATCH” section in the pinned source before continuing.
Review and apply the “フェーズ1: DISPATCH” source section. - 04
フェーズ2: EVALUATE
スコアリング基準: - 高(0.8-1.0): ターゲット機能を直接実装 - 中(0.5-0.7): 関連するパターンや型を含む - 低(0.2-0.4): 間接的に関連 - なし(0-0.2): 関連なし、除外
高(0.8-1.0): ターゲット機能を直接実装中(0.5-0.7): 関連するパターンや型を含む低(0.2-0.4): 間接的に関連
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 73/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 234,327 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- affaan-m/ECC
- Skill path
- docs/ja-JP/skills/iterative-retrieval/SKILL.md
- Commit
- 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38
- License
- MIT
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.md
反復検索パターン
マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。
問題
サブエージェントは限定的なコンテキストで起動されます。以下を知りません:
- どのファイルに関連するコードが含まれているか
- コードベースにどのようなパターンが存在するか
- プロジェクトがどのような用語を使用しているか
標準的なアプローチは失敗します:
- すべてを送信: コンテキスト制限を超える
- 何も送信しない: エージェントに重要な情報が不足
- 必要なものを推測: しばしば間違い
解決策: 反復検索
コンテキストを段階的に洗練する4フェーズのループ:
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISPATCH │─────│ EVALUATE │ │
│ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ LOOP │─────│ REFINE │ │
│ └──────────┘ └──────────┘ │
│ │
│ 最大3サイクル、その後続行 │
└─────────────────────────────────────────────┘
フェーズ1: DISPATCH
候補ファイルを収集する初期の広範なクエリ:
// 高レベルの意図から開始
const initialQuery = {
patterns: ['src/**/*.ts', 'lib/**/*.ts'],
keywords: ['authentication', 'user', 'session'],
excludes: ['*.test.ts', '*.spec.ts']
};
// 検索エージェントにディスパッチ
const candidates = await retrieveFiles(initialQuery);
フェーズ2: EVALUATE
取得したコンテンツの関連性を評価:
function evaluateRelevance(files, task) {
return files.map(file => ({
path: file.path,
relevance: scoreRelevance(file.content, task),
reason: explainRelevance(file.content, task),
missingContext: identifyGaps(file.content, task)
}));
}
スコアリング基準:
- 高(0.8-1.0): ターゲット機能を直接実装
- 中(0.5-0.7): 関連するパターンや型を含む
- 低(0.2-0.4): 間接的に関連
- なし(0-0.2): 関連なし、除外
フェーズ3: REFINE
評価に基づいて検索基準を更新:
function refineQuery(evaluation, previousQuery) {
return {
// 高関連性ファイルで発見された新しいパターンを追加
patterns: [...previousQuery.patterns, ...extractPatterns(evaluation)],
// コードベースで見つかった用語を追加
keywords: [...previousQuery.keywords, ...extractKeywords(evaluation)],
// 確認された無関係なパスを除外
excludes: [...previousQuery.excludes, ...evaluation
.filter(e => e.relevance < 0.2)
.map(e => e.path)
],
// 特定のギャップをターゲット
focusAreas: evaluation
.flatMap(e => e.missingContext)
.filter(unique)
};
}
フェーズ4: LOOP
洗練された基準で繰り返す(最大3サイクル):
async function iterativeRetrieve(task, maxCycles = 3) {
let query = createInitialQuery(task);
let bestContext = [];
for (let cycle = 0; cycle < maxCycles; cycle++) {
const candidates = await retrieveFiles(query);
const evaluation = evaluateRelevance(candidates, task);
// 十分なコンテキストがあるか確認
const highRelevance = evaluation.filter(e => e.relevance >= 0.7);
if (highRelevance.length >= 3 && !hasCriticalGaps(evaluation)) {
return highRelevance;
}
// 洗練して続行
query = refineQuery(evaluation, query);
bestContext = mergeContext(bestContext, highRelevance);
}
return bestContext;
}
実践例
例1: バグ修正コンテキスト
タスク: "認証トークン期限切れバグを修正"
サイクル1:
DISPATCH: src/**で"token"、"auth"、"expiry"を検索
EVALUATE: auth.ts(0.9)、tokens.ts(0.8)、user.ts(0.3)を発見
REFINE: "refresh"、"jwt"キーワードを追加; user.tsを除外
サイクル2:
DISPATCH: 洗練された用語で検索
EVALUATE: session-manager.ts(0.95)、jwt-utils.ts(0.85)を発見
REFINE: 十分なコンテキスト(2つの高関連性ファイル)
結果: auth.ts、tokens.ts、session-manager.ts、jwt-utils.ts
例2: 機能実装
タスク: "APIエンドポイントにレート制限を追加"
サイクル1:
DISPATCH: routes/**で"rate"、"limit"、"api"を検索
EVALUATE: マッチなし - コードベースは"throttle"用語を使用
REFINE: "throttle"、"middleware"キーワードを追加
サイクル2:
DISPATCH: 洗練された用語で検索
EVALUATE: throttle.ts(0.9)、middleware/index.ts(0.7)を発見
REFINE: ルーターパターンが必要
サイクル3:
DISPATCH: "router"、"express"パターンを検索
EVALUATE: router-setup.ts(0.8)を発見
REFINE: 十分なコンテキスト
結果: throttle.ts、middleware/index.ts、router-setup.ts
エージェントとの統合
エージェントプロンプトで使用:
このタスクのコンテキストを取得する際:
1. 広範なキーワード検索から開始
2. 各ファイルの関連性を評価(0-1スケール)
3. まだ不足しているコンテキストを特定
4. 検索基準を洗練して繰り返す(最大3サイクル)
5. 関連性が0.7以上のファイルを返す
ベストプラクティス
- 広く開始し、段階的に絞る - 初期クエリで過度に指定しない
- コードベースの用語を学ぶ - 最初のサイクルでしばしば命名規則が明らかになる
- 不足しているものを追跡 - 明示的なギャップ識別が洗練を促進
- 「十分に良い」で停止 - 3つの高関連性ファイルは10個の平凡なファイルより優れている
- 確信を持って除外 - 低関連性ファイルは関連性を持つようにならない
関連項目
- The Longform Guide - サブエージェントオーケストレーションセクション
continuous-learningスキル - 時間とともに改善するパターン用~/.claude/agents/内のエージェント定義
Alternatives
Compare before choosing
affaan-m/ECC
iterative-retrieval
Pattern for progressively refining context retrieval to solve the subagent context problem
affaan-m/ECC
iterative-retrieval
Review iterative-retrieval's use cases, installation, workflow, and original source instructions.
affaan-m/ECC
iterative-retrieval
Pattern for progressively refining context retrieval to solve the subagent context problem
affaan-m/ECC
iterative-retrieval
Review iterative-retrieval's use cases, installation, workflow, and original source instructions.