ワンクリックで
iterative-retrieval
Protocol for iteratively refining sub-agent queries through follow-up questions to ensure sufficient context
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Protocol for iteratively refining sub-agent queries through follow-up questions to ensure sufficient context
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Dispatch and collect the finding-verifier fleet at stage_23_verify_findings (PLN-722). Reads verify_manifest.json (written by stage_22b_verify_prepare), spawns one falsify-oriented verifier Task per to_verify[] entry with mode-specific Task scheduling (GitHub mode dispatches verifiers synchronously; local mode uses parallel background + blocking TaskOutput), skips cache_hits[], and collects outputs without retry — missing outputs degrade to pending_verification[] (and, in GitHub mode, a missing BLOCKING/HIGH verifier raises a coverage-gap signal). Invoke when the walker reaches stage_23_verify_findings. Do NOT use for the reviewer fleet (stage_20 — see the spawn-reviewers skill) or the PLN-725 singletons (stage_11/stage_15 — see the singleton-dispatch skill).
Spawn and collect the reviewer fleet at stage_20_spawn_reviewers. Consumes spawn.json.spec (the authoritative spawn spec from derive-spawn-spec / derive-static-spec), resolves GRAPH_PROJECT, builds per-agent prompts from the per-agent template + role suffixes (Bug Hunter A/B, Unified Auditor, Domain Critics, Impact Analyzer), handles the standard, fast-path, all-cached-BHA, and gated-by-verify cases, and runs the spawn/collection contract and agent-failure recovery. Falls back to the static reviewer table when spawn.json marks arbitrate_status:"fallback". Invoke when stage_20_spawn_reviewers is reached (both MODE=local and MODE=github). Do NOT use for the verifier fleet (stage_23 — see the verify-findings skill) or the PLN-725 singletons (stage_11/stage_15 — see the singleton-dispatch skill).
PLN-725 single-agent dispatch for stage_11_extract_signals and stage_15_coverage_critic. After each prepare stage writes its manifest, this skill reads the status field (cache_hit / skipped / needs_agent) and, only on needs_agent, spawns one synchronous singleton Task that writes the by-convention pln725_*.json output the sibling consolidate stage consumes. Invoke from walker-contract step 6 immediately after stage_11_extract_signals or stage_15_coverage_critic finishes. Do NOT use for the reviewer fleet (stage_20 — see the spawn-reviewers skill) or the verifier fleet (stage_23 — see the verify-findings skill).
Verify and fix BLOCKING/HIGH code review findings from a prior review session via category-dispatch, then run project verification.
Render the operator-facing local-mode code review results at stage_29_present. Covers BLOCKING/HIGH/MEDIUM section templates, Justified Findings (PLN-721), Dismissed Findings (PLN-722), Verifier Stats footer (PLN-773), operator-flag descriptions, override precedence rule for stage_22b, Validation Summary, and final Summary. Invoke when MODE=local AND stage_29_present is reached. Do NOT use for GitHub mode — see prompts/github-review.md. Do NOT use for Gate A hygiene-only early-exit — that path is mode-agnostic and remains in start.md alongside the Gate A definition.
Use when the user wants a code-grounded decision table for current behavior, wants to compare current behavior against a plan or work item, or needs a control-flow artifact for recovery, retry, finalization, validation, state-machine, or review-heavy edge cases.
| name | iterative-retrieval |
| description | Protocol for iteratively refining sub-agent queries through follow-up questions to ensure sufficient context |
This skill enables orchestrators to iteratively refine sub-agent queries through follow-up questions, ensuring sub-agents gather sufficient context before the orchestrator accepts their output. This addresses the problem where orchestrators have semantic context that sub-agents lack, leading to incomplete summaries.
This skill is designed for the /code orchestrator only (code.md slash command). Sub-agents do not use this skill - they simply respond to queries. The orchestrator is responsible for evaluating responses and deciding whether to resume with follow-ups.
Note: Sub-agents do NOT see this skill documentation in their context. Only the orchestrator can invoke and follow the protocol. Sub-agents are unaware they're part of an iterative retrieval loop - they just respond to queries and follow-ups as normal requests.
This skill is optional and opt-in. Not every sub-agent call benefits from iterative refinement - simple lookups or well-defined queries don't need it. Invoke this skill when you anticipate that a sub-agent may return incomplete context due to semantic gaps.
This protocol provides a structured approach to iterative context gathering. All 4 phases represent the recommended workflow, but phases 2-4 are optional if the initial response is sufficient. Exercise judgment - if Phase 2 evaluation shows context is sufficient on first pass, phases 3-4 aren't needed.
Define and dispatch the initial query with full context:
agent_id returned from the Task(...) call for potential continuation via SendMessageEvaluate whether the sub-agent's response provides sufficient context using the checklist below. If context is sufficient, skip to output (phases 3-4 not needed). If gaps exist, proceed to Phase 3.
Ask yourself these 4 questions:
If you answer "no" to question 1 or 4, OR "yes" to questions 2 or 3, the context is likely insufficient - proceed to Phase 3.
Continue the sub-agent with targeted follow-up questions using SendMessage:
SendMessage(to=<stored_agent_id>, summary=<5-10 word summary>, message=<prompt>) to continue the subagent; completed subagents auto-resume from transcript in the background with full prior context intactAsync flow: SendMessage returns immediately with a queued acknowledgment. The subagent then runs in the background and you will receive a <task-notification> when it finishes. Do not proceed to the next step until that notification arrives.
Fallback: If no agent_id is in memory (cross-session resume after a previous Claude Code session ended) or SendMessage returns an actual error, fall back to a fresh Task(...) launch with a self-contained prompt that includes all prior context needed.
Repeat Phases 2-3 until one of these conditions is met:
The recommended maximum is 3 refinement cycles (initial dispatch + 2 follow-ups). This balances thoroughness against cost and latency.
Important: This is a recommendation, not an enforced limit. As guidance documentation, this skill cannot enforce limits - the orchestrator has final judgment. However, exceeding 3 cycles often indicates:
When iterative retrieval completes, report:
Example:
Iterative Retrieval Summary:
- Cycles used: 2 (initial + 1 follow-up)
- Additional context gathered: Error handling patterns, retry logic implementation, timeout configuration
- Agent ID: agent-abc123 (available for future continuation via SendMessage)
For detailed usage examples, see references/examples.md (if available).