Claude
Skills
Sign in
Back

android-navigation-type-safe

Included with Lifetime
$97 forever

Implement type-safe Jetpack Navigation Compose routes using Kotlin serialization. Use when defining navigation graphs with type-safe destinations in Jetpack Compose.

General

What this skill does

# Android Navigation Standards

## **Priority: P0**

## Implementation Guidelines

### Type-Safe Navigation

- **Library**: Navigation Compose 2.8.0+.
- **Routes**: Use `@Serializable` objects/classes instead of String routes.
- **Arguments**: No manual bundle parsing. Use `.toRoute<T>()`.

### Structure

- **Graphs**: Split large apps into nested navigation graphs (`navigation` extension functions).
- **Hoisting**: Hoist navigation events out of Screens. Composable screens should accept callbacks (`onNavigateToX`).

## Anti-Patterns

- **No String Routes**: Use @Serializable typed objects/classes for destinations.
- **No NavController in Composables**: Hoist navigation events to screen-level callbacks.

## References

- [Route Definitions](references/implementation.md)

Related in General