agentleFS
opengeosopengeos/geoai-skills/skills/inspect-geo/SKILL.md

inspect-geo

Skill31 starsChanged 8 months agoMITView on GitHub

Inspect any raster or vector geospatial file. Returns CRS, bounds, bands, resolution, dtype, attribute summaries, and band statistics. Supports GeoTIFF, Shapefile, GeoJSON, GeoPackage, GeoParquet, and more.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these steps in order, stopping and reporting clearly if any step fails.

    line 16
  2. Very specific:

    If $0 looks like an absolute path, use it directly.

    line 20
  3. Distinctive:

    If the extension is ambiguous, try raster first, then vector.

    line 37
  4. Very specific:

    If STATE_DIR is set, update it with the inspected file info:

    line 101
  5. Distinctive:

    If no state directory exists yet, skip this step silently.

    line 122
  6. Distinctive:

    After reporting, briefly mention:

    line 126
  7. Distinctive:

    Keep suggestions brief and show them only once.

    line 131
  8. Very specific:

    If python3 is not found or import geoai fails, delegate to /geoai-skills:install-geoai.

    line 135
  9. Distinctive:

    If rasterio or geopandas fails to read the file, try the GDAL/OGR fallback:

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

You are helping the user inspect a geospatial data file.

Filename given: $0 Question: ${1:-describe the data}

Follow these steps in order, stopping and reporting clearly if any step fails.

Step 1 -- Resolve the file path

If $0 looks like an absolute path, use it directly. Otherwise search for it:

find "$PWD" -name "$0" -not -path '*/.git/*' 2>/dev/null
  • Zero results -> tell the user the file was not found and stop.
  • More than one result -> list all matches, ask the user to re-run with a fuller path, and stop.
  • Exactly one result -> use that full path as RESOLVED_PATH.

Step 2 -- Classify the file type

Determine whether the file is raster or vector based on its extension:

  • Raster: .tif, .tiff, .img, .jp2, .vrt, .nc, .hdf
  • Vector: .geojson, .json, .shp, .gpkg, .parquet, .geoparquet, .fgb, .kml

If the extension is ambiguous, try raster first, then vector.

Step 3 -- Run the appropriate inspection

Raster files

python3 -c "
import geoai

info = geoai.get_raster_info('RESOLVED_PATH')
for k, v in info.items():
    print(f'{k}: {v}')

print('---')
print('Band Statistics:')
stats = geoai.get_raster_stats('RESOLVED_PATH')
for k, v in stats.items():
    print(f'{k}: {v}')
"

Vector files

python3 -c "
import geoai

info = geoai.get_vector_info('RESOLVED_PATH')
for k, v in info.items():
    print(f'{k}: {v}')
"

Replace RESOLVED_PATH with the actual absolute path before running.

Step 4 -- Answer the user's question

Using the metadata retrieved in Step 3, answer:

${1:-describe the data: summarize the file type, CRS, extent, and any notable properties.}

For vector files, if the question references a specific attribute, run an additional analysis:

python3 -c "
import geoai
result = geoai.analyze_vector_attributes('RESOLVED_PATH')
print(result)
"

Step 5 -- Update state

Resolve the state directory:

STATE_DIR=""
test -f .geoai-skills/state.json && STATE_DIR=".geoai-skills"
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")"
PROJECT_ID="$(echo "$PROJECT_ROOT" | tr '/' '-')"
test -f "$HOME/.geoai-skills/$PROJECT_ID/state.json" && STATE_DIR="$HOME/.geoai-skills/$PROJECT_ID"

If STATE_DIR is set, update it with the inspected file info:

python3 -c "
import json, os
state_file = 'STATE_DIR/state.json'
state = {}
if os.path.exists(state_file):
    with open(state_file) as f:
        state = json.load(f)
state['last_inspected'] = {
    'path': 'RESOLVED_PATH',
    'type': 'TYPE',
}
with open(state_file, 'w') as f:
    json.dump(state, f, indent=2)
"

Replace STATE_DIR, RESOLVED_PATH, and TYPE (raster or vector) with actual values.

If no state directory exists yet, skip this step silently.

Step 6 -- Suggest next steps

After reporting, briefly mention:

  • For raster files: "To process this raster (clip, mosaic, stack bands), use /geoai-skills:process-raster. To run AI detection on it, use /geoai-skills:detect-objects."
  • For vector files: "To download more vector data for this area, use /geoai-skills:overture-data."

Keep suggestions brief and show them only once.

Error handling

  • If python3 is not found or import geoai fails, delegate to /geoai-skills:install-geoai.
  • If rasterio or geopandas fails to read the file, try the GDAL/OGR fallback:
python3 -c "
import geoai
info = geoai.get_raster_info_gdal('RESOLVED_PATH')
for k, v in info.items():
    print(f'{k}: {v}')
"

Or for vectors:

python3 -c "
import geoai
info = geoai.get_vector_info_ogr('RESOLVED_PATH')
for k, v in info.items():
    print(f'{k}: {v}')
"

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.