agentleFS
MicrosoftKnown publishermicrosoft/haste/.github/skills/imagery-provider-adaptation/SKILL.md

imagery-provider-adaptation

Skill110 starsChanged 3 months agoMITView on GitHub

Imagery provider adaptation skill for HASTE. Encapsulates provider-specific logic for satellite imagery sources (Planet, Vantor, Airbus, etc.). Use when: 'new imagery provider', 'add source type', 'satellite provider', 'Planet', 'Vantor', 'Airbus', 'Pleiades', 'WorldView', 'SkySat', 'imagery ingestion', 'provider adapter'.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add to the source type configuration in hastegeo.core.models:

    line 45
  2. Very specific:

    Update ImageryPreProcessor to route to the new handler based on source type.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Imagery Provider Adaptation

Overview

Structured process for adding new satellite imagery providers to HASTE. Each provider has different data formats, coordinate systems, APIs, band configurations, and delivery methods. This skill encapsulates the provider-specific logic needed to adapt a new source.

Key Concepts

Current Providers

ProviderSatellitesFormatBandsDelivery
VantorWorldView-2/3/4, GeoEye-1GeoTIFF4-8 bands (BGRN + extras)S3, STAC, Direct URL
PlanetPlanetScope, SkySatGeoTIFF, COG4 bands (BGRN)Planet API, S3
AirbusPleiades, Pleiades Neo, SPOTGeoTIFF, DIMAP4 bands (BGRN)OneAtlas, S3

Provider Adapter Components

Each new provider requires:

  1. Source Type Definition — Model configuration in hastegeo.core.models
  2. Download Handler — Provider-specific authentication and download logic
  3. Band Mapping — Map provider bands to HASTE's expected band order
  4. Metadata Parser — Extract spatial metadata from provider-specific formats
  5. Preprocessing Rules — Resolution normalization, radiometric correction
  6. Tests — Integration tests with sample provider data

Patterns & Techniques

Adding a New Provider: Step-by-Step

Step 1: Define source type Add to the source type configuration in hastegeo.core.models:

# New source type with provider-specific configuration
class NewProviderConfig(BaseModel):
    provider_name: str
    api_url: str
    band_order: list[str]  # e.g., ["B", "G", "R", "NIR"]
    default_crs: str  # e.g., "EPSG:4326"
    tile_size: int  # e.g., 256

Step 2: Implement download handler In hastegeo.core.processors.imagery:

# Handle provider-specific authentication and URL patterns
# Use requests with proper auth (API key, OAuth, etc.)
# Stream large files to avoid memory issues
# Validate downloaded file integrity

Step 3: Implement band mapping

# Map provider bands to HASTE standard order
# HASTE expects: [Blue, Green, Red, NIR] for 4-band
# Handle extra bands (e.g., coastal, red-edge, SWIR)
# Handle missing bands (e.g., panchromatic only)

Step 4: Implement preprocessing

# 1. Validate CRS — reproject if needed
# 2. Normalize resolution — resample to target GSD
# 3. Apply radiometric correction if needed
# 4. Generate COG with internal tiling and overviews
# 5. Validate output with rasterio

Step 5: Add to imagery processor Update ImageryPreProcessor to route to the new handler based on source type.

Step 6: Write tests

# Test with real sample data (small AOI, public data preferred)
# Verify CRS preservation
# Verify band order mapping
# Verify COG compliance
# Verify metadata extraction

Provider-Specific Gotchas

ProviderGotchaMitigation
VantorMultiple UTM zones in a single orderCheck CRS per file, reproject to consistent zone
PlanetUDM2 quality masks delivered separatelyDownload and apply quality mask before processing
AirbusDIMAP format metadataParse XML metadata alongside GeoTIFF
AllDifferent nodata conventionsStandardize nodata to 0 or NaN during preprocessing

Decision Framework

ScenarioApproach
Provider uses standard GeoTIFFMinimal adapter — mostly URL/auth handling
Provider uses proprietary formatFull adapter — format conversion + metadata extraction
Provider delivers via STACUse existing STAC client, add provider-specific auth
Provider requires API keyStore in Config, never hardcode
Provider delivers in tilesImplement tile stitching before COG generation

Quick Reference: COG Output Standard

Format: Cloud Optimized GeoTIFF
Tiling: 256x256 or 512x512 internal tiles
Overviews: Nearest power of 2, down to 256px
Compression: LZW or DEFLATE
CRS: Preserve source CRS (typically UTM or EPSG:4326)
Nodata: 0 for uint8/uint16, NaN for float
Bands: Blue, Green, Red, NIR (minimum)

Common Pitfalls

  • Assuming all providers use the same band order — Always check and map explicitly
  • Hardcoding provider URLs/keys — Use Config class
  • Ignoring quality masks — Bad pixels contaminate training data
  • Not testing with edge cases — Antimeridian crossing, polar regions, dateline
  • Downloading entire scenes when only a small AOI is needed — Use provider APIs to clip

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.