navigation-compose

Implements Jetpack Navigation Compose patterns with typed routes, deep links, and Hilt integration.

Updated May 9, 2026
One-click install
npx skills add https://github.com/Bumh3rr/solvyx-app --skill navigation-compose-bumh3rr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: navigation-compose
Source: https://github.com/Bumh3rr/solvyx-app/tree/main/.opencode/skill/navigation-compose
Command: npx skills add https://github.com/Bumh3rr/solvyx-app --skill navigation-compose-bumh3rr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires androidx.navigation:navigation-compose, androidx.hilt:hilt-navigation-compose.

What problem does it solve? Android developers often scatter navigation logic across magic strings, untyped arguments, and uncontrolled back stacks, causing crashes and unmaintainable code. This Skill provides project conventions for implementing Jetpack Navigation Compose with sealed-class routes, typed arguments, and Hilt-scoped ViewModels. ## Core Features & Use Cases - Sealed-class route definitions: Centralizes all routes in a Routes.kt sealed class with typed argument builders, eliminating magic strings. - Typed arguments and deep links: Configures navArgument with proper NavType mappings and registers custom-scheme and HTTPS deep links for notifications and external links. - Hilt and back stack integration: Wires hiltViewModel() per destination, shares ViewModels via parent back stack entries, and controls the back stack with popUpTo, launchSingleTop, and state saving. - Use Case: When adding a new lesson detail screen that receives a substance and slug parameter and must be reachable via a push notification deep link, apply this Skill to define the route, register the deep link, and inject the ViewModel correctly. ## Quick Start Apply the navigation-compose conventions to add a new screen with typed arguments and a deep link to the Solvyx NavHost.

Frequently Asked Questions about navigation-compose

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pass typed arguments between destinations in Navigation Compose?▼

Define the route with placeholders like "lecciones/{sustancia}/{slug}" and declare each parameter with navArgument and its NavType, such as NavType.StringType or NavType.LongType. Retrieve values in the destination from backStackEntry.arguments or in the ViewModel via SavedStateHandle.

How to set up deep links in Jetpack Navigation Compose?▼

Add navDeepLink entries with uriPattern to the composable destination, supporting both custom schemes like solvyx:// and HTTPS URLs. Compose handles the incoming intent automatically once the deep link is registered on the route.

How do I share a ViewModel between screens with Navigation Compose and Hilt?▼

Use hiltViewModel() with an explicit parent back stack entry obtained via navController.getBackStackEntry for the parent route. This scopes the shared ViewModel to the parent destination instead of the current screen.

How do I clear the back stack on logout in Navigation Compose?▼

Navigate to the target route with popUpTo(navController.graph.id) { inclusive = true } and launchSingleTop = true. This removes all destinations from the back stack so the user cannot return to authenticated screens.

Why should I avoid string routes in Navigation Compose?▼

Magic-string routes cause typos, runtime crashes, and hard refactors. A sealed class centralizes route definitions and provides type-safe builder functions for destinations with arguments, making navigation compile-time safe.