navigation-and-routing

navigation-and-routing is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 175 tokens per session (2,360 once invoked), scanned A, original, MIT.

A set of rules for one app-wide GoRouter setup in Flutter. GoRouter connects screens to URLs, so pages can be opened directly through links.

In plain words
What is it for?
Use it to define routes, URL path parameters, redirects, not-found pages, deep links, and navigation shells that preserve tab state.
Why use it?
It keeps navigation history, deep links, authentication checks, and back-button behavior consistent across the app.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter plugin — 40 skills shipped together

Good fit Use it to define routes, URL path parameters, redirects, not-found pages, deep links, and navigation shells that preserve tab state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/navigation-and-routing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zakariaf/Flutter-Skills --skill navigation-and-routing
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for navigation-and-routing

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/navigation-and-routing/github.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/navigation-and-routing)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/navigation-and-routing"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/navigation-and-routing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for navigation-and-routing

Your own site · 80×15
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/navigation-and-routing"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/navigation-and-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 175 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,360 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00175 $0.02360
Opus 5 $0.00088 $0.01180
Sonnet 5 $0.00035 $0.00472
Haiku 4.5 $0.00017 $0.00236

Measured 12d ago against content hash 9cc763e3c1f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

navigation-and-routing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check_routing.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/navigation-and-routing/SKILL.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.

This skill owns app navigation with go_router. There is exactly ONE GoRouter for the app, defined in lib/routing/, and every screen is reachable by a URL. Navigation is a data structure (routes + a pure redirect), not a pile of imperative Navigator.push calls.

Read the reference for the task at hand:

  • references/go-router-config.md — the single router, context.go vs context.push, path params vs state.extra, typed route helpers, errorBuilder/404.
  • references/guards-and-redirects.md — pure redirect functions, the Riverpod refreshListenable, auth + onboarding gates, avoiding redirect loops.
  • references/shells-and-deep-links.mdStatefulShellRoute.indexedStack for bottom-nav/rail shells, CustomTransitionPage, PopScope, and notification-payload → location mapping.

Run scripts/check_routing.sh before a PR.

Non-negotiable rules

  1. Exactly ONE GoRouter, built in lib/routing/, wired once via MaterialApp.router in app.dart. Multiple routers fragment history, deep links, and back-button behaviour. The router is created behind a provider so guards can watch app state.
  2. Deep-linkable identity lives in PATH PARAMS, never in state.extra. extra is a live Dart object: it is null on a cold start from a deep link and after process death / restoration. A screen that needs an id to rebuild must read it from state.pathParameters so the URL alone fully reconstructs the screen.
  3. state.extra is ONLY an optional non-identity optimisation (a pre-fetched object to avoid a reload flash). The screen must still work — refetch by id — when extra is null.
  4. Use context.go to replace the stack (declarative destinations, tabs, post-login home); use context.push to stack a screen you expect to pop back from (a detail, a modal flow). Mixing them wrong breaks the back button. Know which one every call site needs.
  5. Guards are PURE redirect functions. redirect returns a new location String? (or null to allow) from GoRouterState + a snapshot of app state. No I/O, no navigation calls, no side effects inside redirect — it runs on every navigation and can run repeatedly.
  6. Reactive guards use a refreshListenable, not polling. Bridge the Riverpod auth/onboarding provider to a Listenable; the router re-evaluates redirect whenever it fires. See state-management-riverpod.
  7. Redirects must be loop-free. Always allow the destination the guard sends you TO (e.g. never redirect /sign-in back to /sign-in). Guard against A→B→A by checking the current location before redirecting.
  8. Tab/branch shells use StatefulShellRoute.indexedStack. It preserves each branch's navigation stack and state across tab switches; a plain ShellRoute with an IndexedStack you wire by hand does not survive router rebuilds as cleanly. Switch branches with navigationShell.goBranch(index).
  9. Custom transitions go through CustomTransitionPage and respect reduced motion. When the platform requests reduced motion, collapse to a no-op/fade. Read the flag from MediaQuery, resolve motion via the design system — see accessibility-as-code and design-system-structure.
  10. Intercept back / unsaved changes with PopScope, not WillPopScope (removed). Set canPop: false and handle in onPopInvokedWithResult(bool didPop, T? result); only navigate away after the user confirms.
  11. Provide an errorBuilder and a real 404/error route. An unmatched deep link must land on a designed error screen, never a red error box.
  12. Never hold a BuildContext across an await before navigating. Capture GoRouter.of(context) (or the router) before the await, or guard with context.mounted after. See async-safety.
  13. A feature does not build its own router. scaffold-feature-module registers a feature's GoRoute INTO this router's route list; features never instantiate GoRouter.

Read the full file on GitHub · 158 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 158 lines · 175 tokens per session scan A 9cc763e3c1f8

Subscribe to this mod's changes

navigation-and-routing is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 14d ago), licensed MIT. It adds 175 tokens to every session and 2,360 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

animations

Best practices for Flutter animations using the built-in animation framework, covering implicit animations, explicit AnimationController animations, page transitions, and Material 3 motion tokens. Use when creating, modifying, or reviewing animations, transitions, motion, or animated widgets, and also for custom route…

VeryGoodOpenSource/vgv-ai-flutter-plugin · 105 tokens

android-compose-migration

Migrate an Android XML View to Jetpack Compose following a structured 10-step workflow. Use when converting XML layouts to Compose, setting up Compose in an existing View-based project, or incrementally adopting Compose.

HoangNguyen0403/agent-skills-standard · 47 tokens

android-compose

Build high-performance declarative UI with Jetpack Compose. Use when writing Composable functions, optimizing recomposition, hoisting state, or working with LazyColumn and side effects; defer deep-link and navigation routing to android-navigation.

HoangNguyen0403/agent-skills-standard · 48 tokens

flutter-navigation

Implement navigation patterns with gorouter, deep linking, and named routes in Flutter. Use when building navigation, deep linking, or routing.

HoangNguyen0403/agent-skills-standard · 30 tokens

android-xml-views

Implement ViewBinding, RecyclerView, and XML layouts correctly on Android. Use when changing XML view binding or RecyclerView behavior, including its item animations and layout managers; defer standalone animation or layout-manager questions unrelated to RecyclerView.

HoangNguyen0403/agent-skills-standard · 51 tokens

maptiler

Expert coding skill for the full MapTiler platform — Cloud REST APIs, MapTiler SDK JS (built on MapLibre GL JS), native mobile SDKs, on-premise infrastructure, and vector tile schemas. USE WHEN the user wants to add a map to a web or mobile app, show locations or routes, display geographic data, build a store locator…

maptiler/maptiler-skills · 294 tokens