Mobile and desktop apps · Skill

Add Compose Navigation 3

add-compose-nav-3

Adds Jetpack Navigation 3 to a Compose project with typed routes, a saveable back stack, and a scene for a dialog or a wide list-detail. Use when the user wants Navigation 3, a NavDisplay, or to leave string routes behind.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/raw' -o ~/'.claude/skills/add-compose-nav-3/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/files/LICENSE.txt' -o ~/'.claude/skills/add-compose-nav-3/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/files/NOTICE.txt' -o ~/'.claude/skills/add-compose-nav-3/NOTICE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/raw' -o '.cursor/skills/add-compose-nav-3/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/files/LICENSE.txt' -o '.cursor/skills/add-compose-nav-3/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/files/NOTICE.txt' -o '.cursor/skills/add-compose-nav-3/NOTICE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/raw' -o '.agents/skills/add-compose-nav-3/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/files/LICENSE.txt' -o '.agents/skills/add-compose-nav-3/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-compose-nav-3/files/NOTICE.txt' -o '.agents/skills/add-compose-nav-3/NOTICE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Navigation 3 uses a typed route per destination and a back stack you can save. String routes and a second graph for every dialog are the old shape.

When to use

  • The Compose project still moves between screens with string routes.
  • Each bottom destination should remember its own stack.
  • A dialog, a deep link, or a signed-out flow needs a real destination.

When not to use

  • Skip this when you are choosing a tab row or a rail. That choice is a separate skill.
  • Skip this when you are deciding columns or when a list sits beside a detail. That width choice is a separate skill. This skill only hosts the scene.
  • The project is React Native or SwiftUI. Do not rewrite it for this.

Steps

  1. Show destinations in a NavDisplay. Give each destination a typed route. Do not pass a raw string as the route.
  2. Store the back stack in a saveable holder so a rotation or process death does not forget the screen.
  3. Give each top-level destination its own stack. Switching destinations restores that stack instead of clearing it.
  4. A dialog or a sheet is a scene on the same stack. A list beside a detail on a wide screen is also a scene. Let the layout skill decide when the width counts as wide.
  5. Read arguments from the route when building a ViewModel. Send a result back to the previous entry as state or as an event.
  6. Keep a signed-out flow and a signed-in flow as separate graphs. Switch graphs when the condition changes, and do not leave a signed-in screen up after sign-out.

Gotchas

  • Do not include passwords, tokens, or private ids in sample routes or deep-link examples.
  • Mixing string routes with typed routes in the same stack makes the back stack lie. A migration error is leaving both in the graph.
  • A deep link should rebuild the stack beneath the opened screen, or Back dumps the person out of the product.
  • This is an independent how-to adapted from a Google LLC skill. It is not official Android documentation, and it was not run on a device for this library.

Portability

If you use Navigation 2, move that graph's routes to typed routes rather than running both stacks at once. If you use React Native, keep the React Navigation stack. A stack per destination still applies.

Done when

  • Destinations are typed routes shown in a NavDisplay.
  • Each top-level destination keeps its own saveable stack.
  • A dialog is a scene, and a deep link rebuilds the stack beneath it.

Example prompt

"Migrate this Compose graph off string routes onto Navigation 3. Use a NavDisplay, a saveable back stack, and a separate stack for each bottom destination."

---

Adapted from "navigation-3" by Google LLC in android/skills (Apache-2.0). The upstream licence leaves the copyright line unfilled. See LICENSE.txt and NOTICE.txt.

Bundled files

Licence

Adapted from Google LLC (android/skills, navigation/navigation-3) (Copyright line in upstream LICENSE.txt is the unfilled Apache template 'Copyright [yyyy] [name of copyright owner]'. Skill metadata.author at this commit is Google LLC. No NOTICE file in the repository.), Apache License 2.0. Modified by TheSkillVault on 2026-11-09: rewritten as a short Navigation 3 starter (typed keys, NavDisplay, saveable stack, per-section stacks, scenes, results); dropped the recipe index, Hilt and Koin catalogues, and animation recipes. Not the original file and not official Android documentation.

Licence: Apache License 2.0. Attribution when you reuse it: Based on work by Google LLC (android/skills, navigation/navigation-3) (Copyright line in upstream LICENSE.txt is the unfilled Apache template 'Copyright [yyyy] [name of copyright owner]'. Skill metadata.author at this commit is Google LLC. No NOTICE file in the repository., Apache License 2.0), https://github.com/android/skills/tree/6daa53ef27fa2aa87827d183a85c06cedceca833/navigation/navigation-3; adapted by TheSkillVault, https://theskillvault.ai