compose-navigation

Enforce type-safe navigation with @Serializable routes in Android Jetpack Compose apps.

14|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/piyushverma0/android-agent-skills --skill compose-navigation-piyushverma0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-navigation
Source: https://github.com/piyushverma0/android-agent-skills/tree/main/skills/compose-navigation
Command: npx skills add https://github.com/piyushverma0/android-agent-skills --skill compose-navigation-piyushverma0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type-safe navigation management is critical for scalable Android apps built with Jetpack Compose, reducing runtime routing errors and boilerplate across complex flows.

Core Features & Use Cases

  • Type-safe routes with @Serializable: All destinations defined as serializable routes to ensure compile-time correctness.
  • Complete NavHost with nested graphs: Provides a robust navigation setup including modular graphs and deep-link support.
  • Shared ViewModels and transitions: Demonstrates sharing state across destinations and custom navigation transitions.
  • Deep linking and result passing: Supports type-safe deep links and passing results between screens via SavedStateHandle.

Quick Start

Create a new navigation flow by defining all routes as @Serializable objects, wiring them into a NavHost, and navigating between screens using those type-safe routes.

Frequently Asked Questions about compose-navigation

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

FAQPage Schema
How do I set up type-safe navigation in Jetpack Compose?

Type-safe navigation in Jetpack Compose requires defining all destinations as @Serializable routes and wiring them into a NavHost to ensure compile-time correctness and reduce runtime routing errors.

What is the best way to pass results between Compose navigation destinations?

Passing results between Compose navigation destinations is handled type-safely via SavedStateHandle, allowing screens to retrieve data without boilerplate or runtime casting errors.

Can I use deep links with type-safe Compose NavHost setups?

Yes, type-safe deep linking is fully supported within the NavHost setup, enabling robust and predictable routing directly to specific Compose destinations from external intents.

How do I share ViewModels across nested Compose navigation graphs?

You can share ViewModels across nested Compose navigation graphs by scoping them to the NavController or shared navigation graph, ensuring state is maintained across multiple destinations.

Why does my Compose navigation flow have runtime routing errors?

Runtime routing errors in Compose navigation often occur when routes are not defined as @Serializable objects, which prevents compile-time validation and leads to invalid navigation paths.