skills/flutter-navigation/SKILL.md
GoRouter navigation patterns for Flutter: routing, auth guards, deep links, shell routes, and redirect logic. Trigger: When adding routes, implementing auth guards, configuring deep links, or managing navigation in the mobile app.
npx skillsauth add 333-333-333/agents flutter-navigationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Full GoRouter configuration with public routes, auth redirect, and StatefulShellRoute for bottom navigation.
Example: See assets/app_router.dart
Redirect function that checks auth state and routes accordingly:
/login?redirect=.../home (or stored redirect)Example: See assets/auth_guard.dart
Four common patterns: simple route, path parameter, query parameter, and nested routes.
Examples: See assets/route_patterns.dart
StatefulShellRoute preserves state across tabs (each tab keeps its own navigation stack).
Example: See assets/main_shell.dart
Use context.go(), context.push(), and context.pop() for declarative navigation.
Example: See assets/navigation_commands.dart
Use MaterialApp.router with routerConfig from a Riverpod provider.
Example: See assets/app_entry.dart
| Feature | Routes |
|---------|--------|
| Auth | /login, /register, /forgot-password |
| Home | /home |
| Booking | /bookings, /bookings/:id, /bookings/new |
| Pet | /pet/:petId, /pet/:petId/edit, /pet/:petId/medical |
| Caregiver | /caregivers, /caregivers/:id |
| Profile | /profile, /profile/edit |
| Chat | /chat, /chat/:chatId |
| Element | Pattern | Example |
|---------|---------|---------|
| Route path | kebab-case | /forgot-password |
| Path parameter | camelCase | :petId, :chatId |
| Query parameter | camelCase | ?serviceType=walk |
| Router provider | routerProvider | Single global instance |
| ❌ Don't | ✅ Do |
|----------|-------|
| Navigator.push (old API) | context.go() or context.push() |
| Hardcode auth check in every page | Use global redirect in GoRouter |
| Create router outside Riverpod | Use Provider<GoRouter> for reactivity |
| Deep nest routes beyond 3 levels | Flatten with path parameters |
| Pass complex objects via route | Pass IDs, fetch data in the page via provider |
| Forget to handle redirect param on login | Store and restore redirect after auth |
testing
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.