affaan-m/ECC

iterative-retrieval

サブエージェントのコンテキスト問題を解決するために、コンテキスト取得を段階的に洗練するパターン

73Collecting
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/iterative-retrieval"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn iterative-retrieval's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。

npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/iterative-retrieval"
Check the pinned source

Best fit

  • サブエージェントのコンテキスト問題を解決するために、コンテキスト取得を段階的に洗練するパターン

Bring this context

  • A concrete task that matches the documented purpose of iterative-retrieval.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned iterative-retrieval instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read iterative-retrieval through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

問題

サブエージェントは限定的なコンテキストで起動されます。以下を知りません: - どのファイルに関連するコードが含まれているか - コードベースにどのようなパターンが存在するか - プロジェクトがどのような用語を使用しているか

SKILL.md · 問題
どのファイルに関連するコードが含まれているかコードベースにどのようなパターンが存在するかプロジェクトがどのような用語を使用しているか
02

解決策: 反復検索

コンテキストを段階的に洗練する4フェーズのループ:

SKILL.md · 解決策: 反復検索
高(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.

SKILL.md · フェーズ1: DISPATCH
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): 関連なし、除外

SKILL.md · フェーズ2: EVALUATE
高(0.8-1.0): ターゲット機能を直接実装中(0.5-0.7): 関連するパターンや型を含む低(0.2-0.4): 間接的に関連
05

フェーズ3: REFINE

Review the “フェーズ3: REFINE” section in the pinned source before continuing.

SKILL.md · フェーズ3: REFINE
Review and apply the “フェーズ3: REFINE” source section.

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use iterative-retrieval to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned iterative-retrieval source to [task]. Pay particular attention to these source sections: “問題”, “解決策: 反復検索”, “フェーズ1: DISPATCH”, “フェーズ2: EVALUATE”, “フェーズ3: REFINE”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current iterative-retrieval result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “問題” has been checked.

The source section “解決策: 反復検索” has been checked.

The source section “フェーズ1: DISPATCH” has been checked.

The source section “フェーズ2: EVALUATE” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does iterative-retrieval do?

マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。

How do I start using iterative-retrieval?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/iterative-retrieval". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
73/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

73/100
Documentation22/30
Specificity18/25
Maintenance18/20
Trust signals15/25
View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 1 min

反復検索パターン

マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。

問題

サブエージェントは限定的なコンテキストで起動されます。以下を知りません:

  • どのファイルに関連するコードが含まれているか
  • コードベースにどのようなパターンが存在するか
  • プロジェクトがどのような用語を使用しているか

標準的なアプローチは失敗します:

  • すべてを送信: コンテキスト制限を超える
  • 何も送信しない: エージェントに重要な情報が不足
  • 必要なものを推測: しばしば間違い

解決策: 反復検索

コンテキストを段階的に洗練する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以上のファイルを返す

ベストプラクティス

  1. 広く開始し、段階的に絞る - 初期クエリで過度に指定しない
  2. コードベースの用語を学ぶ - 最初のサイクルでしばしば命名規則が明らかになる
  3. 不足しているものを追跡 - 明示的なギャップ識別が洗練を促進
  4. 「十分に良い」で停止 - 3つの高関連性ファイルは10個の平凡なファイルより優れている
  5. 確信を持って除外 - 低関連性ファイルは関連性を持つようにならない

関連項目

  • The Longform Guide - サブエージェントオーケストレーションセクション
  • continuous-learningスキル - 時間とともに改善するパターン用
  • ~/.claude/agents/内のエージェント定義
Source repo
affaan-m/ECC
Skill path
docs/ja-JP/skills/iterative-retrieval/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected