home / skills / hoangnguyen0403 / agent-skills-standard / android-navigation
This skill helps implement Android navigation with Jetpack Compose, enforcing type-safe routes, deep links, and validated arguments.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill android-navigationReview the files below or copy the command above to add this skill to your agents.
---
name: Android Navigation
description: Navigation for Android using Jetpack Compose Navigation and App Links.
metadata:
labels: [android, compose, navigation, deep-linking, app-links]
triggers:
files: ['**/*Screen.kt', '**/*Activity.kt', '**/NavGraph.kt']
keywords: [NavController, NavHost, composable, navArgument, deepLinks]
---
# Android Navigation (Jetpack Compose)
## **Priority: P2 (OPTIONAL)**
Navigation and deep linking using Jetpack Compose Navigation.
## Guidelines
- **Library**: Use `androidx.navigation:navigation-compose`.
- **Type Safety**: Use sealed classes for routes, never raw strings.
- **Deep Links**: Configure `intent-filter` in Manifest and `deepLinks` in NavHost.
- **Validation**: Validate arguments (e.g., proper IDs) before loading content.
[Patterns & Examples](references/navigation-patterns.md)
## Anti-Patterns
- **No String Routes**: Use `Screen.Product.route` instead of `"product/$id"`.
- **No Unvalidated Deep Links**: Check resource existence before rendering.
- **No Missing Manifest**: Deep links require `autoVerify=true` intent filters.
## Related Topics
android-design-system | android-notifications | mobile-ux-core
This skill documents best practices for Android navigation using Jetpack Compose Navigation and App Links. It focuses on type-safe routing, reliable deep linking, and validation patterns that reduce runtime errors and improve user experience. The guidance is framework-focused and geared toward Compose apps using androidx.navigation:navigation-compose.
The skill recommends using the navigation-compose library to define navigation graphs and destinations. Routes are modeled as sealed classes to enforce type safety and avoid raw string routes. Deep links are handled by combining Manifest intent-filters with NavHost deepLinks and validating incoming arguments before rendering screens.
Why use sealed classes instead of string routes?
Sealed classes provide compile-time guarantees, reduce typos, and make route refactoring safer than raw strings.
How do I handle invalid deep link arguments?
Validate IDs and parameter formats before loading content; navigate to an error or fallback screen if validation fails.