iterative-retrieval/SKILL.md
Pattern for progressively refining context retrieval in multi-agent workflows.
npx skillsauth add lidge-jun/cli-jaw-skills iterative-retrievalInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Solves the "context problem" in multi-agent workflows where sub-agents cannot predict what context they need until they start working.
Sub-agents are spawned with limited context. They lack knowledge of which files are relevant, what patterns exist, or what terminology the project uses.
Standard approaches fail:
A 4-phase loop that progressively refines context (max 3 cycles):
┌───────────────────────────────────────┐
│ DISPATCH → EVALUATE → REFINE → LOOP │
│ ▲ │ │
│ └────────────────────┘ │
│ Max 3 cycles, then proceed │
└───────────────────────────────────────┘
Broad initial query to gather candidate files:
src/**/*.ts)authentication, user, session)Score each retrieved file for relevance (0–1):
Update search criteria based on evaluation:
Repeat with refined criteria. Stop when:
Task: "Fix the authentication token expiry bug"
Cycle 1:
DISPATCH: Search for "token", "auth", "expiry" in src/**
EVALUATE: Found auth.ts (0.9), tokens.ts (0.8), user.ts (0.3)
REFINE: Add "refresh", "jwt" keywords; exclude user.ts
Cycle 2:
DISPATCH: Search refined terms
EVALUATE: Found session-manager.ts (0.95), jwt-utils.ts (0.85)
→ Sufficient context (4 high-relevance files)
Task: "Add rate limiting to API endpoints"
Cycle 1:
DISPATCH: Search "rate", "limit", "api" in routes/**
EVALUATE: No matches — codebase uses "throttle" terminology
REFINE: Add "throttle", "middleware" keywords
Cycle 2:
DISPATCH: Search refined terms
EVALUATE: Found throttle.ts (0.9), middleware/index.ts (0.7)
REFINE: Need router patterns
Cycle 3:
DISPATCH: Search "router", "express" patterns
EVALUATE: Found router-setup.ts (0.8)
→ Sufficient context
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 — for patterns that improve over timetools
Use only on the Codex CLI for native image generation or image editing without an API key. Save final PNG files under ~/.cli-jaw/uploads, report web-ready absolute-path markdown, and send to Telegram or Discord only when explicitly requested.
tools
Ranked repository structure map via `cli-jaw map`. Use for codebase overview, structure map, symbol overview, unfamiliar codebase exploration, architecture orientation. Triggers: repo map, structure map, codebase overview, 와꾸, project structure, unfamiliar code.
tools
cli-jaw Design workspace: create, preview, run, and export design pages from the right sidebar. Covers panel UX, direct-write workflow, artifact lifecycle, wireframe generation, design system, and Open Design adapter.
development
MUST USE for infrastructure and delivery work — container builds, deploy pipelines, Kubernetes, Infrastructure as Code, SRE foundations, edge/serverless, ML infrastructure. Triggers: Dockerfile, K8s manifests, CI/CD pipeline, Terraform/IaC, release/deploy, devops/infra/deploy or release_cd task_tags.