agentleFS
spignottispignotti/opencode-workflow-kit/skills/geospatial/SKILL.md

geospatial

Skill0 starsChanged 3 months agoMITView on GitHub

Base guardrail for all geospatial work — CRS, units, geometry/raster validity, Nodata, alignment, provenance, and a task-signal routing table to specialized references. Load when doing anything spatial, remote sensing, spatial statistics, geocoding, or DL on EO data.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When opening a new spatial dataset, always verify:

    line 28
  2. Very specific:

    Use references/tools.md for curated library/tool selection, references/data-sources.md for dataset/source selection, and …

    line 38
  3. Distinctive:

    If you discover CRS mismatch, missing projection, invalid geometry, or unhandled Nodata — surface it as a Major finding.

    line 104

≈ “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

Geospatial

Base guardrail for all spatial work. Every spatial operation must pass these checks before methodology or tool-specific guidance applies.

Non-Negotiable Guardrails

These prevent silent corruption of spatial results. Check before any spatial operation.

  1. CRS is mandatory — every geometry needs an explicit CRS (SRID). Without it, all spatial operations are meaningless.
  2. No metric calculations on WGS84 — EPSG:4326 uses angular units (degrees). Always transform to an appropriate projected CRS before distance, area, or buffer calculations.
  3. Use spatial index for joins — sindex (R-tree) on GeoDataFrames. Without it, spatial joins are O(n²).
  4. Coordinate precision — 6–7 decimal places suffice for sub-meter accuracy. Beyond that is noise.
  5. Ring orientation — exterior rings CCW, interior rings (holes) CW. Use shapely.geometry.polygon.orient() to normalize.
  6. Axis order — GeoJSON is (lon, lat); Shapely is (x, y). Do not confuse them.
  7. Null ≠ empty — None vs Point() have different semantics. None means unknown; empty means known but nothing there.
  8. Common CRS before any operation — reproject all datasets to the same CRS before spatial joins, intersections, or any multi-dataset operation.
  9. Nodata handling — raster Nodata values must be explicitly set and masked. Never treat Nodata as zero.
  10. Alignment before raster math — rasters must share CRS, resolution, extent, and rotation before element-wise operations. Use rasterio.warp.reproject or xr.reproject.
  11. Provenance — document data source, access date, processing steps, and CRS for every derived dataset.

Pre-Operation Checklist

When opening a new spatial dataset, always verify:

  • CRS present and correct?
  • Null or empty geometries? (filter or flag)
  • Invalid geometries? (self-intersections, ring orientation — use geopandas.GeoSeries.is_valid)
  • CRS mismatches across datasets?
  • For rasters: Nodata value, band count, dtype, resolution?

Tool Selection

Use references/tools.md for curated library/tool selection, references/data-sources.md for dataset/source selection, and references/mcp-servers.md for MCP server selection. Load this skill for guardrails and routing; load the catalogs when choosing libraries, data sources, or MCP servers.

Format Decision Tree

Data type?
├── Vector (points, lines, polygons)
│   ├── Production / exchange → GeoPackage
│   ├── Cloud-native analytics → GeoParquet
│   └── Web tiles / quick sharing → PMTiles
├── Raster (2D grids)
│   ├── Single scene, web-ready → Cloud Optimized GeoTIFF (COG)
│   ├── Deep time series / datacube → Zarr / GeoZarr
│   └── Stitched large mosaic → COG with overviews
├── Point cloud (LiDAR, photogrammetry)
│   └── Cloud access → COPC (LAZ + embedded octree)
└── Metadata layer over any format
    └── STAC (SpatioTemporal Asset Catalog)

Task-Signal → Reference Routing

Load references on demand as the task requires. Use Context7 or official docs for any library API at use time — not this skill.

SignalReferenceWhen
Tool/library selection, STAC, NAIP, Overture, GEE, geedim, xee, geemapreferences/tools.mdChoosing or using a geo library or tool
Dataset/source selection, data acquisition, EO/land-cover/climate/public-statistics discoveryreferences/data-sources.mdChoosing a geo dataset or data source
MCP server selection, agent-driven geo workflowsreferences/mcp-servers.mdChoosing a geo MCP server for LLM/agent-driven access
Spectral indices, cloud masking, compositing, time series, change detectionreferences/remote-sensing.mdWorking with Sentinel-2, Landsat, MODIS, NAIP
Spatial autocorrelation, regression, point patterns, interpolation, hotspot detectionreferences/spatial-statistics.mdAnalyzing spatial distributions, testing clustering
Spatial joins, zonal stats, distance features, H3 binning, spatial CV, feature engineeringreferences/spatial-features.mdPreparing geodata for ML models
Spatial train/test split, cross-validation, leakage preventionreferences/spatial-validation.mdAny ML with spatial data
DL model loading, fine-tuning, STAC-to-GPU streaming, inference patternsreferences/geospatial-dl.mdTraining or deploying DL on EO imagery
PostGIS, DuckDB Spatial, spatial SQL, schema designreferences/spatial-databases.mdWriting spatial SQL or choosing a spatial DB
Address-to-coordinate conversion, batch geocoding, rate limitingreferences/geocoding.mdGeocoding addresses or reverse-geocoding
Building footprints, morphometrics, street network centrality, LCZ classificationreferences/urban-morphology.mdAnalyzing urban form

Tool selection and method reference may both be needed — load both when appropriate.

Cloud-Native Streaming Pattern

EO / ML pipelines should stream data instead of generating intermediate files:

STAC Catalog
  → pystac-client (discovery: bbox × time × cloud cover)
  → odc-stac / stackstac (lazy array: metadata only, no pixels loaded)
  → Dask (distributed: cloud masking, compositing, reprojection)
  → xbatcher (N‑dim batches → PyTorch/TF DataLoader)
  → GPU training

When to Use GEE vs Local Processing

FactorGEELocal (Python)
Data volumePetabyte-scale, unlimitedRAM-limited
ComputeServer-side, quota-limitedFull local resources
ReproducibilityBlack box, catalog changesFull control
ML integrationExport requiredDirect PyTorch/TF connection
CostFree (with quotas)Compute + storage
Best forQuick prototyping, global-scale compositesProduction pipelines, custom algorithms

When the Guardrails Are Violated

If you discover CRS mismatch, missing projection, invalid geometry, or unhandled Nodata — surface it as a Major finding. Do not proceed with analysis on spatially invalid data without explicitly noting the gap and its impact on result trustworthiness.

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.