Harden skills for production resilience (agent benchmark) - #72
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
| } | ||
| ``` | ||
|
|
||
| ## Survive setStyle (critical) |
There was a problem hiding this comment.
Seems not related to style patterns?
There was a problem hiding this comment.
Agreed — style-patterns is recipe/layer config, not map lifecycle. Moved the setStyle / style.load guidance into mapbox-web-integration-patterns as Mistake 8.
style-patterns is layer recipes; setStyle/style.load is runtime lifecycle. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for putting this together, and for including the grader numbers, that's a great way to show the impact of these changes. The anti-patterns you're targeting are real and worth documenting (token guard, error handling, style.load rebind, draw.create, data-driven extrusion height, INTERNET permission). This is good work for someone new to agent skills. Before we merge, a few things need fixing:
Can you run |
Scope the token example to Vite and point at token-management.md; fix 3d-extrusions heading/newline; correct racey→racy; allow ScatterplotLayer in cspell. Co-authored-by: Cursor <cursoragent@cursor.com>
Cross-skill relative links fail validate:skills; keep a same-skill table so agents still get one-bundler-at-a-time env patterns. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the fast turnaround, the token guard, heading fix, and spellcheck fixes all look correct, I verified them locally against your latest commits. CI just ran for the first time on this PR and it's failing on The new Directions example doesn't match Prettier's line wrapping: stats.textContent =
`Distance ${(route.distance / 1000).toFixed(2)} km · ` +
`Duration ${Math.round(route.duration / 60)} min`;Prettier wants that on one line given our 120 char width for markdown. Can you run |
CI format:check failed on the multi-line template concat in mapbox-geospatial-operations. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks... glad the token guard, heading, spellcheck, and Prettier wrap all checked out. This was fun, and I appreciate you getting back so quickly with concrete fixes. I'm relatively new to getting code reviewed (and to AI coding), so the feedback was really useful. I'm also hoping to move the AI map / skill-agent grading lab onto its own site: map-agent-arena.Live view Still a few days of work, but the idea is to run ~11 frontend map vendors' agents through the same map challenges and show the results side by side. Thanks again for the review. |
mattpodwysocki
left a comment
There was a problem hiding this comment.
Verified at HEAD 15926f4: token guard fix, heading/newline fix, spellcheck fixes, and the Prettier wrap all check out. Re-ran the full `npm run check` suite in an isolated worktree at this exact commit and it's clean. CI is green. Approving, thanks for the quick fixes.

Summary
I'm new to agent/AI coding and built a small Mapbox playground to learn how agents actually behave with mapbox-agent-skills — same four-pack idea as my MapTiler lab (no skill → skill → improved → upload). Great work getting the agent skills off the ground.
I graded the same 22 challenges three ways (harsh mode):
That run showed recurring failure modes. This PR hardens the skills below so agents get clearer guidance on those gaps.
Live grader: https://witcoskitech.com/mapbox-playground/agent-grader.html
Problems it fixes
MAPBOX_ACCESS_TOKENunset / placeholdermap.on('error')— silent style/tile/token failuresmap.remove()on SPA/page cleanupsetStyle()— nostyle.loadrebind (now under web-integration-patterns)route.distance/route.duration+esmvs stable UMD /MapboxOverlaydraw.create— toolbar present, handler missing/broken['get', 'height']Map { }with no annotation; Android missingINTERNETFiles
mapbox-token-securitymapbox-web-performance-patternsmapbox-search-patternsmapbox-geospatial-operationsmapbox-web-integration-patternsmapbox-data-visualization-patterns/references/3d-extrusions.mdmapbox-ios-patternsmapbox-android-patternsTest plan
new Map,map.on('error'),style.loadaftersetStyle