iterative-retrieval

Refine codebase context for subagents through a four-phase retrieval loop.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/mbadoz/mbadoz-skills --skill iterative-retrieval-mbadoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/mbadoz/mbadoz-skills/tree/main/plugins/built-planner/skills/built-planner/references/skills/iterative-retrieval
Command: npx skills add https://github.com/mbadoz/mbadoz-skills --skill iterative-retrieval-mbadoz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pattern for progressively refining context retrieval to solve the subagent context problem.

Core Features & Use Cases

  • Progressive 4-phase loop (DISPATCH, EVALUATE, REFINE, LOOP) to fetch and refine codebase context for subagents.
  • Handles "context too large" or "missing context" failures in multi-agent workflows.
  • Useful in designing RAG-like retrieval pipelines for code exploration and token-efficient orchestration.

Quick Start

Implement an iterative retrieval loop to progressively gather and refine codebase context for a given task.

Frequently Asked Questions about iterative-retrieval

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refine subagent context when the codebase context is too large for multi-agent workflows?

You refine subagent context by implementing an iterative retrieval loop that progressively fetches and filters codebase context. This pattern handles context window limits by evaluating relevance and refining context across bounded cycles to improve task accuracy.

What is the iterative retrieval pattern for token-efficient code exploration?

The iterative retrieval pattern is a 4-phase loop consisting of DISPATCH, EVALUATE, REFINE, and LOOP. It progressively gathers codebase context for subagents, using relevance scoring to filter information and ensure token-efficient orchestration.

How do I handle missing context failures in multi-agent codebase workflows?

You handle missing context failures by applying an iterative retrieval pipeline that evaluates and refines context across multiple cycles. If the initial context is insufficient, the loop dispatches further retrievals to progressively gather the missing codebase information.

When do I need a progressive retrieval pipeline for codebase subagents?

You need a progressive retrieval pipeline when working with multi-agent workflows where context windows are limited. It is specifically designed for scenarios where context must be revealed gradually to solve complex code exploration tasks accurately.

Does iterative retrieval work for designing RAG-like pipelines for codebase exploration?

Yes, iterative retrieval is useful for designing RAG-like retrieval pipelines for code exploration. It provides a structured 4-phase loop to fetch, evaluate, and refine codebase context, ensuring subagents receive accurate, token-efficient information.

What are the limitations of using a 4-phase retrieval loop for subagent context?

The primary limitation of this 4-phase retrieval loop is that it requires bounded cycles to prevent infinite loops. While it effectively manages context window limits by refining codebase context, the iterative nature may increase retrieval latency before subagent dispatch.