axiom-swiftui-nav-diag

charleswiltgen/axiom · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/charleswiltgen/axiom --skill axiom-swiftui-nav-diag
0 commentsdiscussion
summary

Core principle 85% of navigation problems stem from path state management errors, view identity issues, or placement mistakes—not SwiftUI defects.

skill.md

SwiftUI Navigation Diagnostics

Overview

Core principle 85% of navigation problems stem from path state management errors, view identity issues, or placement mistakes—not SwiftUI defects.

SwiftUI's navigation system is used by millions of apps and handles complex navigation patterns reliably. If your navigation is failing, not responding, or behaving unexpectedly, the issue is almost always in how you're managing navigation state, not the framework itself.

This skill provides systematic diagnostics to identify root causes in minutes, not hours.

Red Flags — Suspect Navigation Issue

If you see ANY of these, suspect a code issue, not framework breakage:

  • Navigation tap does nothing (link present but doesn't push)

  • Back button pops to wrong screen or root

  • Deep link opens app but shows wrong screen

  • Navigation state lost when switching tabs

  • Navigation state lost when app backgrounds

  • Same NavigationLink pushes twice

  • Navigation animation stuck or janky

  • Crash with navigationDestination in stack trace

  • FORBIDDEN "SwiftUI navigation is broken, let's wrap UINavigationController"

    • NavigationStack is used by Apple's own apps
    • Wrapping UIKit adds complexity and loses SwiftUI state management benefits
    • UIKit interop has its own edge cases you'll spend weeks discovering
    • Your issue is almost certainly path management, not framework defect

Critical distinction NavigationStack behavior is deterministic. If it's not working, you're modifying state incorrectly, have view identity issues, or navigationDestination is misplaced.

Mandatory First Steps

ALWAYS run these checks FIRST (before changing code):

// 1. Add NavigationPath logging
NavigationStack(path: $path) {
    RootView()
        .onChange(of: path.count) { oldCount, newCount in
            print("📍 Path changed: \(oldCount)\(newCount)")
            // If this never fires, link isn't modifying path
            // If it fires unexpectedly, something else modifies path
        }
}

// 2. Check navigationDestination is visible
// Put temporary print in destination closure
.navigationDestination(for: Recipe.self) { recipe in
    let _ = print("🔗 Destination for Recipe: \(recipe.name)")
    RecipeDetail(recipe: recipe)
}
// If this never prints, destination isn't being evaluated

// 3. Check NavigationLink is inside NavigationStack
// Visual inspection: Trace from NavigationLink up view hierarchy
// Must hit NavigationStack, not another container first

// 4. Check path state location
// @State must be in stable view (not recreated each render)
// Must be @State, @StateObject, or @Observable — not local variable

// 5. Test basic case in isolation
// Create minimal reproduction
NavigationStack {
    NavigationLink("Test", value: "test")
        .navigationDestination(for: String.self) { str in
            Text("Pushed: \(str)")
        }
}
// If this works, problem is in your specific setup

What this tells you

Observation Diagnosis Next Step
onChange never fires on tap NavigationLink not in NavigationStack hierarchy Pattern 1a
onChange fires but view doesn't push navigationDestination not found/loaded Pattern 1b
onChange fires, view pushes, then immediate pop View identity issue or path modification Pattern 2a
Path changes unexpectedly (not from tap) External code modifying path Pattern 2b
Deep link path.append() doesn't navigate Timing issue or wrong thread Pattern 3b
State lost on tab switch NavigationStack shared across tabs Pattern 4a
Works first time, fails on return View recreation issue Pattern 5a

MANDATORY INTERPRETATION

Before changing ANY code, identify ONE of these:

  1. If link tap does nothing AND no onChange → Link outside NavigationStack (check hierarchy)
  2. If onChange fires but nothing pushes → navigationDestination not in scope (check placement)
  3. If pushes then immediately pops → View identity change or path reset (check @State location)
  4. If deep link fails → Timing or MainActor issue (check thread)
  5. If crash → Force unwrap on path decode or missing type registration

If diagnostics are contradictory or unclear

  • STOP. Do NOT proceed to patterns yet
  • Add print statements at every path modification point
  • Create minimal reproduction case
  • Test with String values first (simplest case)

Decision Tree

Use this to reach the correct diagnostic pattern in 2 minutes:

Navigation problem?
├─ Navigation tap does nothing?
│  ├─ NavigationLink inside NavigationStack?
│  │  ├─ No → Pattern 1a (Link outside Stack)
│  │  └─ Yes → Check navigationDestination
│  │
│  ├─ navigationDestination registered?
│  │  ├─ Inside lazy container? → Pattern 1b (Lazy Loading)
│  │  ├─ Type mismatch? → Pattern 1c (Type Registration)
│  │  └─ Blocked by sheet/popover? → Pattern 1d (Modal Blocking)
│  │
│  └─ Using view-based link?
│     └─ → Pattern 1e (Deprecated API)
├─ Unexpected pop back?
│  ├─ Immediate pop after push?
│  │  ├─ View body recreating path? → Pattern 2a (Path Recreation)
│  │  ├─ @State in wrong view? → Pattern 2a (State Location)
│  │  └─ ForEach id changing? → Pattern 2c (Identity Change)
│  │
│  ├─ Pop when shouldn't?
│  │  ├─ External code calling removeLast? → Pattern 2b (Unexpected Modification)
│  │  ├─ Task cancelled? → Pattern 2b (Async Cancellation)
│  │  └─ MainActor issue? → Pattern 2d (Threading)
│  │
│  └─ Back button behavior wrong?
│     └─ → Pattern 2e (Stack Corruption)
├─ Deep link not working?
│  ├─ URL not received?
│  │  ├─ onOpenURL not called? → Check URL scheme in Info.plist
│  │  └─ Universal Links issue? → Check apple-app-site-association
│  │
│  ├─ URL received, path not updated?
│  │  ├─ path.append not on MainActor? → Pattern 3a (Threading)
│  │  ├─ Timing issue (app not ready)? → Pattern 3b (Initialization)
│  │  └─ NavigationStack not created yet? → Pattern 3b (Lifecycle)
│  │
│  └─ Path updated, wrong screen shown?
│     ├─ Wrong path order? → Pattern 3c (Path Construction)
│     ├─ Wrong type appended? → Pattern 3c (Type Mismatch)
│     └─ Item not found? → Pattern 3d (Data Resolution)
├─ State lost?
│  ├─ Lost on tab switch?
│  │  ├─ Shared NavigationStack? → Pattern 4a (Shared State)
│  │  └─ Tab recreation? → Pattern 4a (Tab Identity)
│  │
│  ├─ Lost on background/foreground?
│  │  ├─ No SceneStorage? → Pattern 4b (No Persistence)
│  │  └─ Decode failure? → Pattern 4c (Decode Error)
│  │
│  └─ Lost on rotation/size change?
│     └─ → Pattern 4d (Layout Recreation)
├─ NavigationSplitView issue?
│  ├─ Sidebar not visible on iPad?
│  │  ├─ columnVisibility not set? → Pattern 6a (Column Visibility)
│  │  └─ Compact size class? → Pattern 6a (Automatic Adaptation)
│  │
│  ├─ Detail shows blank on iPad?
│  │  ├─ No default detail view? → Pattern 6b (Missing Detail)
│  │  └─ Selection binding nil? → Pattern 6b (Selection State)
│  │
│  └─ Works on iPhone, broken on iPad?
│     └─ → Pattern 6c (Platform Adaptation)
└─ Crash?
   ├─ EXC_BAD_ACCESS in navigation code?
   │  └─ → Pattern 5a (Memory Issue)
   ├─ Fatal error: type not registered?
   │  └─ → Pattern 5b (Missing Destination)
   └─ Decode failure on restore?
      └─ → Pattern 5c (Restoration Crash)

Pattern Selection Rules (MANDATORY)

Before proceeding to a pattern:

  1. Navigation tap does nothing → Add onChange logging FIRST, then Pattern 1
  2. Unexpected pop → Find WHAT is modifying path (logging), then Pattern 2
  3. Deep link fails → Verify URL received (print in onOpenURL), then Pattern 3
  4. State lost → Identify WHEN lost (tab switch vs background), then Pattern 4
  5. Crash → Get full stack trace, then Pattern 5

Apply ONE pattern at a time

  • Implement the fix from one pattern
  • Test thoroughly
  • Only if issue persists, try next pattern
  • DO NOT apply multiple patterns simultaneously (can't isolate cause)

FORBIDDEN

  • Guessing at solutions without diagnostics
  • Changing multiple things at once
  • Wrapping with UINavigationController "because SwiftUI is broken"
  • Adding delays/DispatchQueue.main.async without understanding why
  • Switching to view-based NavigationLink "to avoid path issues"

Diagnostic Patterns

Pattern 1a: NavigationLink Outside NavigationStack

Time cost 5-10 minutes

Symptom

  • Tapping NavigationLink does nothing
  • No navigation occurs, no errors
  • onChange(of: path) never fires

Diagnosis

// Check view hierarchy — NavigationLink must be INSIDE NavigationStack

// ❌ WRONG — Link outside stack
struct ContentView: View {
    var body: some View {
        VStack {
            NavigationLink("Go", value: "test")  // Outside stack!
            NavigationStack {
                Text("Root")
            }
        }
    }
}

// Check: Add background color to NavigationStack
NavigationStack {
    Color.red  // If link is on red, it's inside
}

Fix

// ✅ CORRECT — Link inside stack
struct ContentView: View {
    var body: some View {
        NavigationStack {
            VStack {
                NavigationLink("Go", value: "test")  // Inside stack
                Text("Root")
            }
            .navigationDestination(for: String.self) { str in
                Text("Pushed: \(str)")
            }
        }
    }
}

Verification

  • Tap link, navigation occurs
  • onChange(of: path) fires when tapped

Pattern 1b: navigationDestination in Lazy Container

Time cost 10-15 minutes

Symptom

  • NavigationLink tap does nothing OR works intermittently
  • onChange fires (path updated) but view doesn't push
  • Console may show: "A navigationDestination for [Type] was not found"

Diagnosis

// ❌ WRONG — Destination inside lazy container (may not be loaded)
ScrollView {
    LazyVStack {
how to use axiom-swiftui-nav-diag

How to use axiom-swiftui-nav-diag on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add axiom-swiftui-nav-diag
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/charleswiltgen/axiom --skill axiom-swiftui-nav-diag

The skills CLI fetches axiom-swiftui-nav-diag from GitHub repository charleswiltgen/axiom and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/axiom-swiftui-nav-diag

Reload or restart Cursor to activate axiom-swiftui-nav-diag. Access the skill through slash commands (e.g., /axiom-swiftui-nav-diag) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.528 reviews
  • Chaitanya Patil· Dec 20, 2024

    Solid pick for teams standardizing on skills: axiom-swiftui-nav-diag is focused, and the summary matches what you get after install.

  • Yuki Ghosh· Dec 12, 2024

    axiom-swiftui-nav-diag is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Piyush G· Nov 11, 2024

    We added axiom-swiftui-nav-diag from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Rahul Santra· Nov 7, 2024

    I recommend axiom-swiftui-nav-diag for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Layla Reddy· Nov 3, 2024

    axiom-swiftui-nav-diag reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Pratham Ware· Oct 26, 2024

    Useful defaults in axiom-swiftui-nav-diag — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Yuki Torres· Oct 22, 2024

    Registry listing for axiom-swiftui-nav-diag matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Shikha Mishra· Oct 2, 2024

    axiom-swiftui-nav-diag fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Fatima Okafor· Sep 21, 2024

    axiom-swiftui-nav-diag is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Yusuf Okafor· Aug 12, 2024

    Keeps context tight: axiom-swiftui-nav-diag is the kind of skill you can hand to a new teammate without a long onboarding doc.

showing 1-10 of 28

1 / 3