원클릭으로
incremental-ranked-search
Pattern for searching across many items with ranked priority and early termination
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Pattern for searching across many items with ranked priority and early termination
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Investigate .NET CI failures using the hlx CLI tool via bash. USE FOR: checking Helix job status, searching build logs, downloading test results, AzDO build timeline analysis — when MCP tools aren't loaded, when the MCP server isn't configured or fails to start, or when scripting with JSON output and jq. DO NOT USE FOR: tasks where Helix/AzDO MCP tools are already available in context (prefer ci-analysis skill when MCP server is loaded). INVOKES: bash (hlx CLI commands with --json output).
{what this skill teaches agents}
Audit pattern for comparing WorkItemSummary (list API) fields against WorkItemDetails (per-item API) after a Helix.Client SDK bump
Domain-layer normalizer + JSON-stable cache key pattern for filter types with server-side defaults and case-insensitive fields.
Strict unknown-parameter rejection for MCP tools: Stage A (UnmappedMemberHandling.Disallow) + Stage B (did-you-mean CallToolFilter).
Audit MCP/CLI tool parameter surface against underlying REST API capabilities to find silently-dropped params.
| name | incremental-ranked-search |
| description | Pattern for searching across many items with ranked priority and early termination |
| domain | api-design |
| confidence | low |
| source | earned |
When building a tool that must search across many remote resources (logs, files, database records) where:
Use a three-phase pattern: cheap metadata → rank → incremental fetch with early exit.
Fetch lightweight metadata about ALL items in parallel. This gives you the information needed to rank without downloading content. Look for APIs that return counts, sizes, or status without payload.
Example: AzDO's GET builds/{id}/logs returns lineCount per log without content. Timeline returns result per task without log content.
Assign items to priority buckets based on metadata, then sort within buckets by a secondary signal (e.g., size descending = larger items more likely to contain matches).
Bucket 0: Known failures (highest priority)
Bucket 1: Items with warnings/issues
Bucket 2: Partial failures
Bucket 3: Normal items above minimum size threshold
Bucket 4: Orphans / unknowns
Filter items below a minimum threshold (e.g., skip files < 5 lines) to eliminate noise.
Process items sequentially from the ranked queue. Track remainingMatches and pass it to each search call as that call's own maxMatches. Stop when:
remainingMatches <= 0 (early exit — found enough)maxItemsToSearch limit reached (API call budget)remainingMatches = maxMatches
for item in rankedQueue[0..maxItems]:
if remainingMatches <= 0: break
result = search(item, maxMatches: remainingMatches)
remainingMatches -= result.matchCount
Start sequential. Parallel downloads complicate early termination (you may over-download). Add bounded parallelism (SemaphoreSlim) only when measured performance requires it.
All three should have reasonable defaults and be caller-overridable.
The result should include totalItems, itemsSearched, itemsSkipped, and stoppedEarly so the caller knows whether the search was exhaustive or partial. This is critical for AI consumers that need to know "did I miss something?"
Fetching all content up front wastes bandwidth and memory. The ranked approach typically finds matches in the first 3–5 items.
Launching N parallel downloads without a maxItemsToSearch cap can overwhelm the API and download far more data than needed.
Searching in arbitrary order (e.g., by ID) means you might download 30 boring logs before hitting the one that failed. Always rank by failure/error likelihood.