ワンクリックで
iterative-retrieval
Pattern for progressively refining context retrieval to solve the subagent context problem in multi-agent workflows.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Pattern for progressively refining context retrieval to solve the subagent context problem in multi-agent workflows.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | iterative-retrieval |
| description | Pattern for progressively refining context retrieval to solve the subagent context problem in multi-agent workflows. |
Solves the "context problem" in multi-agent workflows where subagents don't know what context they need until they start working.
Subagents are spawned with limited context. They don't know:
Standard approaches fail:
A 4-phase loop that progressively refines context:
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISPATCH │─────▶│ EVALUATE │ │
│ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ LOOP │◀─────│ REFINE │ │
│ └──────────┘ └──────────┘ │
│ │
│ Max 3 cycles, then proceed │
└─────────────────────────────────────────────┘
Initial broad query to gather candidate files:
Start with high-level intent:
patterns: ['**/*.cs', 'ContosoUniversity.Core/**/*.cs']
keywords: ['Student', 'Enrollment', 'Repository']
excludes: ['*Tests*.cs', 'Migrations/*.cs']
Dispatch to retrieval agent to find candidate files.
Assess retrieved content for relevance:
For each file, score relevance:
path: file path
relevance: 0.0 - 1.0 score against the task
reason: why this file matters
missingContext: what gaps remain
Scoring criteria:
Update search criteria based on evaluation:
Refine the query:
- Add new patterns discovered in high-relevance files
- Add terminology found in the codebase (e.g., discovered "SchoolContext" instead of "DbContext")
- Exclude confirmed irrelevant paths (relevance < 0.2)
- Target specific gaps identified in Phase 2
Repeat with refined criteria (max 3 cycles):
For up to 3 cycles:
1. Retrieve files matching refined query
2. Evaluate relevance of each candidate
3. If 3+ files score >= 0.7 and no critical gaps remain → done
4. Otherwise, refine query and repeat
5. After 3 cycles, return best context collected so far
Task: "Fix the enrollment date validation bug"
Cycle 1:
DISPATCH: Search for "Enrollment", "Date", "Validation" in **/*.cs
EVALUATE: Found Enrollment.cs (0.9), StudentController.cs (0.8), Student.cs (0.3)
REFINE: Add "DataAnnotations", "ModelState" keywords; exclude Student.cs
Cycle 2:
DISPATCH: Search refined terms
EVALUATE: Found CreateStudentDto.cs (0.95), ValidationHelper.cs (0.85)
REFINE: Sufficient context (2 high-relevance files)
Result: Enrollment.cs, StudentController.cs, CreateStudentDto.cs, ValidationHelper.cs
Task: "Add pagination to the Students index page"
Cycle 1:
DISPATCH: Search "Student", "Index", "List" in Controllers/ and Views/
EVALUATE: Found StudentsController.cs (0.9), Index.cshtml (0.7)
REFINE: Need PaginatedList helper
Cycle 2:
DISPATCH: Search "Paginate", "PageSize", "PageIndex"
EVALUATE: Found PaginatedList.cs (0.95), found PageSize in appsettings (0.6)
REFINE: Sufficient context
Result: StudentsController.cs, Index.cshtml, PaginatedList.cs
Use in agent prompts:
When retrieving context for this task:
1. Start with broad keyword search
2. Evaluate each file's relevance (0-1 scale)
3. Identify what context is still missing
4. Refine search criteria and repeat (max 3 cycles)
5. Return files with relevance >= 0.7
continuous-learning skill - For patterns that improve over time.github/agents/Automatically extract reusable patterns from coding sessions and save them as learned skills for future use.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
Universal coding standards, best practices, and patterns for C#, ASP.NET Core, and Entity Framework Core development.
Formal evaluation framework for coding sessions implementing eval-driven development (EDD) principles.
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.