compose-navigation-architecture

Installation
SKILL.md

Compose Navigation Architecture Governance

This skill centralizes all architectural mandates for Jetpack Compose Navigation to ensure consistency, testability, and decoupled UI layers across all Android projects.

1. The AppState Pattern Mandate

The application MUST govern its navigation and global state via the AppState pattern. This prevents the root @Composable from becoming bloated with logic and isolates lifecycle and navigation boundaries.

  • Encapsulation: Create an AppState class (e.g., <AppName>AppState) that holds the NavHostController, global SnackbarHostState, and CoroutineScope.
  • Window Size Classes: The AppState MUST observe and expose WindowSizeClass or orientation states to drive adaptive layouts passively.
  • Factory Function: Provide a @Composable fun remember<AppName>AppState(...) to instantiate and remember this state across recompositions.

See AppState & Type-Safe Destinations for full implementation templates.

2. Destinations & Type-Safe Navigation

Navigation routes MUST be strongly typed. String-based navigation (Navigation 1.0/2.0) is forbidden.

Installs
1
First Seen
7 days ago