No slash command · from flutter-plugin
Adds and manages navigation in Flutter apps using go_router, auto_route, or Navigator 1.0. Handles typed routes, nested navigation with shell routes, auth guards, deep links, and parameter passing.
Ships in flutter-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
| Signal | Router |
|---|---|
go_router (+ go_router_builder → typed @TypedGoRoute) | go_router — the Flutter team's package, most common |
auto_route (+ auto_route_generator) | auto_route — @RoutePage() + generated AppRouter |
neither, MaterialApp(routes: / onGenerateRoute: | Navigator 1.0 named or anonymous routes |
MaterialApp.router with a custom RouterDelegate | hand-rolled Router API — follow it carefully |
Find the router definition (GoRouter( / class AppRouter / routes:) and add new routes next to related ones. Never introduce a second router.
final router = GoRouter(
initialLocation: '/orders',
refreshListenable: authNotifier, // re-run redirect when auth changes
redirect: (context, state) {
final loggedIn = authNotifier.isLoggedIn;
final loggingIn = state.matchedLocation == '/login';
if (!loggedIn) return loggingIn ? null : '/login?from=${Uri.encodeComponent(state.uri.toString())}';
if (loggingIn) return '/orders';
return null;
},
routes: [
GoRoute(path: '/login', builder: (_, __) => const LoginScreen()),
StatefulShellRoute.indexedStack(
builder: (context, state, shell) => HomeShell(shell: shell),
branches: [
StatefulShellBranch(routes: [
GoRoute(
path: '/orders',
builder: (_, __) => const OrdersScreen(),
routes: [
GoRoute(
path: ':orderId', // → /orders/42
builder: (_, state) => OrderDetailsScreen(orderId: state.pathParameters['orderId']!),
),
],
),
]),
StatefulShellBranch(routes: [GoRoute(path: '/profile', builder: (_, __) => const ProfileScreen())]),
],
),
],
);
context.go('/orders/42') replaces the stack to match the URL (use for tab switches, deep links, post-login). context.push('/orders/42') pushes on top (use for drill-down where back should return). Follow how neighbours navigate.name: + context.goNamed('order', pathParameters: {'orderId': id}) if the project names routes.go_router_builder): define @TypedGoRoute<OrderRoute>(path: '/orders/:orderId') class OrderRoute extends GoRouteData { … }, regenerate, navigate with OrderRoute(orderId: id).go(context). Never mix string paths into a typed-route codebase.extra — extra is lost on web refresh and deep links. Load the object from the state layer by ID.final picked = await context.push<Address>('/addresses/pick'); and context.pop(address) in the picked screen.StatefulShellRoute.indexedStack keeps each tab's stack alive; switch tabs with shell.goBranch(index, initialLocation: index == shell.currentIndex).onEnter guard (returns Allow / Block). If the project already uses it, put auth checks there; do not mix it with a redirect doing the same job.errorBuilder (or onException) showing a not-found screen with a way home.@RoutePage(), add AutoRoute(page: OrderDetailsRoute.page, path: '/orders/:orderId') to the router's routes, regenerate with build_runner.context.router.push(OrderDetailsRoute(orderId: id)).AutoRouteGuard.onNavigation and attach via guards: [...].routes: / onGenerateRoute and navigate with Navigator.of(context).pushNamed('/orders/details', arguments: OrderDetailsArgs(id)); parse settings.arguments with a type check.Navigator.of(context).push(MaterialPageRoute(builder: (_) => OrderDetailsScreen(orderId: id))).redirect / guard — not by each screen hiding itself.Listenable (Riverpod: a provider exposed as a Listenable, Bloc: a stream wrapped in a ChangeNotifier) and the router has refreshListenable so logout immediately leaves protected routes.from query param) only if it is a relative path inside the app — never redirect to an arbitrary URL from a query parameter.Inbound links are untrusted input.
state.pathParameters / state.uri.queryParameters must be validated (format, length, allowed values) before use.intent-filter with android:autoVerify="true", https scheme and the host in AndroidManifest.xml; /.well-known/assetlinks.json on the domain with the release signing certificate fingerprint.applinks:your.domain in Runner.entitlements (Associated Domains); /.well-known/apple-app-site-association on the domain.myapp://) are claimable by any app — never carry auth codes or tokens on them; prefer verified https links.flutter_deeplinking_enabled in the manifest/Info.plist; if the project uses app_links/uni_links manually instead, follow that path.usePathUrlStrategy() (from flutter_web_plugins) before runApp if the project wants clean URLs instead of #/; the hosting must then rewrite all paths to index.html.PopScope(canPop: false, onPopInvokedWithResult: (didPop, _) { … }) to confirm discarding unsaved changes (replaces deprecated WillPopScope).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aratkruglik/claude-sdlc --plugin flutter-plugin4 skills in this plugin
/flutter-conventionsFlutter project structure and widget conventions: app vs package detection, feature-first vs layer-first layout, widget composition and const discipline, StatelessWidget vs StatefulWidget lifecycle, BuildContext rules, keys, theming with ThemeData/ColorScheme/ThemeExtension, responsive and adaptive layout, accessibility (Semantics, text scaling, tap targets), localization with gen-l10n, assets and fonts, flavors, platform channels, secure storage, performance.
Use this skill to:
- Build screens from small, const, testable widgets.
- Manage widget lifecycle (controllers, subscriptions, animations) without leaks.
- Read styling from the theme and keep screens responsive and accessible.
- Add strings, assets, permissions and platform code the way the project already does.
Do NOT use this skill for:
- State management choice and patterns (see flutter-state-management).
- Routing and deep links (see flutter-navigation).
- Testing (see flutter-testing).
- Plain Dart idioms (see dart-foundation:dart-conventions).
/flutter-state-managementState management in Flutter apps: detecting the installed approach and following it — Riverpod 2/3 (Notifier/AsyncNotifier, code-gen @riverpod, ref.watch/read/listen, overrides), Bloc/Cubit (events, sealed states, BlocBuilder/BlocListener/BlocSelector, hydrated_bloc), Provider (ChangeNotifier), and plain ValueNotifier/ChangeNotifier. Modelling loading/empty/error/data states, repository boundaries, side effects, dependency injection.
Use this skill to:
- Pick the right primitive inside the library the project already uses.
- Model async screen state so loading, error and empty are never forgotten.
- Keep business logic out of widgets and testable without Flutter.
- Trigger one-off effects (snackbars, navigation) without rebuild bugs.
Do NOT use this skill for:
- Ephemeral widget state like text controllers (see flutter-conventions — StatefulWidget).
- Navigation (see flutter-navigation).
- Testing notifiers and blocs (see flutter-testing).
/flutter-testingTesting Flutter apps: unit tests for notifiers/blocs/repositories, widget tests with testWidgets/pumpWidget/finders, a shared pumpApp helper with theme/localization/router, Riverpod overrides and ProviderContainer, bloc_test, mocktail for dependencies, accessibility guideline checks, golden tests, integration_test, coverage. Builds on dart-foundation:dart-testing for package:test basics.
Use this skill to:
- Test widgets in the same scaffolding they run in (theme, l10n, providers).
- Test Riverpod providers and Blocs without widgets.
- Find widgets robustly and pump frames deterministically.
- Decide when goldens and integration tests are worth it.
Do NOT use this skill for:
- Pure Dart unit-test basics (see dart-foundation:dart-testing).
- Widget implementation (see flutter-conventions).
Other plugins' skills for the same job