staged-discovery

Add staged discovery routing with root and scoped traversal phases to infrastructure providers.

407|38|Updated Aug 16, 2022
One-click install
npx skills add https://github.com/mondoohq/mql --skill staged-discovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: staged-discovery
Source: https://github.com/mondoohq/mql/tree/main/.claude/skills/staged-discovery
Command: npx skills add https://github.com/mondoohq/mql --skill staged-discovery

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Staged discovery solves the problem of providers loading too much data and exhausting memory or slowing down discovery by splitting traversal into scoped phases.

Core Features & Use Cases

  • Phased asset traversal: Break discovery into a root stage and subsequent scoped stages so traversal happens one scope level at a time.
  • Memory optimization via cache isolation: Emit child scope assets without parent connection linkage to ensure the MQL resource cache is released when a scope closes.
  • API cache reuse where it matters: Use parent connection linkage for leaf resources within a scope to avoid redundant API calls.
  • Target-aware scanning control: Strip platform IDs from intermediate assets that are not part of the user’s discovery targets, while still emitting them so traversal can continue.

Quick Start

Ask the AI to add staged discovery support to your provider by introducing an OptionStagedDiscovery router in Discover(), implementing a root stage that emits child scope assets, and implementing one or more scoped stages that return leaf resources with correct connection config behavior and discovery-target platform ID filtering.

Frequently Asked Questions about staged-discovery

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

FAQPage Schema
How do I optimize memory usage during provider discovery for hierarchical resource trees?

Memory optimization during provider discovery is achieved by splitting traversal into a root stage and subsequent scoped stages, ensuring the MQL resource cache is released when a scope closes. This prevents loading too much data and exhausting memory.

What is phased asset traversal in infrastructure providers?

Phased asset traversal breaks discovery into a root stage and subsequent scoped stages so traversal happens one scope level at a time. This approach prevents providers from loading too much data and slowing down discovery.

How do I implement staged discovery routing in a Go infrastructure provider?

Implement staged discovery routing by introducing an OptionStagedDiscovery router in Discover(), creating a root stage that emits child scope assets, and implementing scoped stages that return leaf resources with correct connection config behavior and platform ID filtering.

Can I use staged discovery with AWS, GCP, Azure, or Kubernetes providers?

Staged discovery is designed for providers with hierarchical resource trees such as AWS, GCP, Azure, and Kubernetes. It optimizes traversal performance and memory usage by processing scoped phases one level at a time.

Why does single-pass Discover() need to be preserved when adding staged discovery?

Single-pass Discover() is preserved to maintain legacy compatibility while the new OptionStagedDiscovery router handles phased traversal. This ensures existing discovery flows remain unaffected when staged traversal is introduced.

How do I filter scannable assets in intermediate scopes during staged discovery?

Filter scannable assets by stripping platform IDs from non-targeted intermediate scopes while still emitting them so traversal can continue. This ensures only targeted leaf resources within a scope use parent connection linkage for API cache reuse.