Repository navigation
Add mapbox-cli-geospatial-patterns skill - #79
Open
mattpodwysocki wants to merge 2 commits into
Open
mattpodwysocki wants to merge 2 commits into
mattpodwysocki wants to merge 2 commits into
Conversation
Teaches an agent to chain the mapbox CLI's JSON output with local Turf.js scripts over a shell pipe, for the case mapbox-geospatial-operations doesn't cover: no MCP server available, just the CLI and a shell. - scripts/ ships six small, tested Turf.js helpers (buffer, distance, points-within-polygon, nearest-point, centroid, length), each reading GeoJSON from stdin and writing GeoJSON or a number to stdout - Five worked scenarios, each verified end to end against a real build of the CLI and real Mapbox responses, not just plausible-looking examples: store-locator containment, matrix pre-filtering by straight- line distance, search-along-route corridors, GPS trace length after map matching, and reverse-geocoding an area's centroid - Calls out turf-cli (npm) by name as a trap: it's a stale, single-maintainer package built against Turf 2.x, incompatible with the current @turf/turf 7.x the scripts here actually use - Cross-references mapbox-geospatial-operations for the shared tool-choice framework rather than duplicating it Structural validation, formatting, spellcheck and markdown lint all pass (npm run check). The eval suite is written (4 evals, targeting the CLI/shell-specific angle rather than repeating the existing MCP-tool skill's scenarios) but could not be run end to end in this environment: the available ANTHROPIC_API_KEY isn't valid for direct API calls here, so the delta this skill produces is not yet measured. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
mapbox-maps-flutter restructured into a monorepo (mapbox_maps_flutter, mapbox_maps_flutter_mobile, etc.); the example app moved from the repo root to mapbox_maps_flutter/example, and the old /tree/main/example URL now 404s. Caught by this PR's own link-check CI run, unrelated to the new skill it's otherwise adding. Verified the new URL resolves (200) before committing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
Member
|
Thanks for this!
After the release, please re-run the examples on the released binary and run the evals before asking for review again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new skill,
mapbox-cli-geospatial-patterns, teaching an agent how tochain the
mapboxCLI's JSON output with local Turf.js scripts over a shellpipe.
mapbox-geospatial-operationsalready covers this same offline-vs-routing decision framework, but for MCP tool calls; this is for the case
that skill doesn't reach, no MCP server available, just the CLI binary and
a shell (a script, a CI job, an agent without MCP access).
What's in it
scripts/: six small@turf/turfhelpers (buffer, distance,points-within-polygon, nearest-point, centroid, length), each reading
GeoJSON from stdin and writing GeoJSON or a number to stdout. Real
package.json/package-lock.json,npm installonce and they run.a real build of the CLI and real Mapbox responses before being written
down, not just plausible-looking snippets:
isochrone+search category+points-within-polygon)expensive
matrixcalldirections+buffer+points-within-polygon)map-matching+length)centroid+geocoder reverse)turf-clion npm by name as a trap: last published years agoagainst Turf 2.x, incompatible with the current
@turf/turf7.x thesescripts use. Verified this directly (
npm view turf-cli/@turf/turf)before writing the warning, not just going on reputation.
Verification
npm run checkpasses (format, spellcheck, markdown lint, skillsvalidation), and the pre-push hook ran all four again before this pushed.
Every command shown in the skill was actually run against a real
mapboxbuild first:
geocoder forward/reverse,search category,isochrone,directions, andmap-matching(the last three from their own not-yet-mergedfeature branches, since that's the CLI's near-term shape). The full
store-locator pipeline (isochrone → search → points-within-polygon) and the
directions→buffer and map-matching→length pipelines were each run for real,
not assumed from documentation.
Not checked: the eval suite (
evals/evals.json, 4 evals) is structurallyvalid and passed
validate:skills, but I couldn't get a real delta measurementin this environment. The
ANTHROPIC_API_KEYavailable here returned a 401 fordirect API calls. Worth running
npm run eval mapbox-cli-geospatial-patternswith a working key before merging, to confirm the +20pp target this repo asks
for.
🤖 Generated with Claude Code