Skip to content

Cover Android custom-UI APIs in navigation AGENTS.md - #89

Open
mattpodwysocki wants to merge 1 commit into
mainfrom
add-nav-android-agents
Open

mattpodwysocki wants to merge 1 commit into
mainfrom
add-nav-android-agents

Conversation

@mattpodwysocki

Copy link
Copy Markdown
Contributor

Split out of #80.

Why

README.md:801 tells users to curl a skill's AGENTS.md into their project root for Codex and Copilot — it ships standalone. This one was silent on four Android Navigation SDK areas that references/ covers in detail.

Silence in a condensed file is not neutral. Asked about them, the model filled the gaps by inventing APIs:

  • named upcomingRouteAlerts instead of RouteProgress.upcomingRoadObjects
  • inverted addUpcomingManeuverArrow and updateUpcomingManeuverArrow
  • said calling MapboxAudioGuidance.create() directly is wrong, when it is the correct call if you manage the instance lifecycle yourself

What was added

Compact coverage of each, drawn from references/android-navigation-sdk.md and references/android-performance-antipatterns.md — 60 lines, no new guidance:

  • Route line via MapboxRouteLineApi/MapboxRouteLineView, with getAlternativeMetadataFor and the cancel() teardown neither object performs on its own
  • Maneuver arrows as a separate API/View pair, recomputed on every progress update rather than drawn once
  • MapboxAudioGuidance.getRegisteredInstance(), which self-registers with the MapboxNavigationApp lifecycle, and when create() is right instead
  • RouteProgress.upcomingRoadObjects — already filtered and ordered — versus re-filtering NavigationRoute.upcomingRoadObjects by position
  • Observer registration through onAttached/onDetached, since an inline lambda with no stored reference can never be unregistered
  • Why reading route data under nativeRouteObject(true) is expensive

Measured

Agents surface at --repeats=5. The four affected evals were at 0/9, 5/12, 6/12 and 8/12; the skill moved from 82% to 97%.

Test plan

  • npm run check passes
  • mapbox-navigation-patterns re-run at --repeats=5 on both surfaces

🤖 Generated with Claude Code

AGENTS.md ships standalone — README.md tells users to curl it into a
project root — and it was silent on four Android Navigation SDK areas that
references/ covers in detail. Silence in a condensed file is not neutral:
asked about them, the model filled the gaps by inventing APIs.

It named `upcomingRouteAlerts` instead of `RouteProgress.upcomingRoadObjects`,
inverted `addUpcomingManeuverArrow` and `updateUpcomingManeuverArrow`, and
said calling `MapboxAudioGuidance.create()` directly is wrong when it is
the correct call if you manage the instance lifecycle yourself.

Added compact coverage of each, drawn from
references/android-navigation-sdk.md and
references/android-performance-antipatterns.md:

- Route line via MapboxRouteLineApi/View, with getAlternativeMetadataFor
  and the cancel() teardown neither object does on its own
- Maneuver arrows as a separate API/View pair, recomputed per progress
  update rather than drawn once
- MapboxAudioGuidance.getRegisteredInstance(), which self-registers with
  the MapboxNavigationApp lifecycle, and when create() is right instead
- RouteProgress.upcomingRoadObjects, already filtered and ordered, versus
  re-filtering NavigationRoute.upcomingRoadObjects by position
- Observer registration through onAttached/onDetached, since an inline
  lambda with no stored reference can never be unregistered
- Why reading route data under nativeRouteObject(true) is expensive

On the agents surface at n=5, the four affected evals moved from 0/9,
5/12, 6/12 and 8/12; the skill went 82% to 97%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant