routing-navigation-design

Design secure route navigation contracts for changed URLs with guards and redirects.

4|Updated May 16, 2026
One-click install
npx skills add https://github.com/machenjie/rd-skills --skill routing-navigation-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-navigation-design
Source: https://github.com/machenjie/rd-skills/tree/main/src/foundation/capabilities/routing-navigation-design
Command: npx skills add https://github.com/machenjie/rd-skills --skill routing-navigation-design

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents broken or insecure navigation flows by specifying route guards, redirect rules, deep-link loading states, and browser history behavior for every changed URL.

Core Features & Use Cases

  • Guard classification contract: Defines unauthenticated vs unauthorized vs unavailable vs not-found outcomes with explicit resource-existence disclosure policy.
  • Loop-free redirect and returnTo safety: Limits redirect depth, preserves return destinations across auth flows, and requires same-origin validation to mitigate open redirects.
  • Deep-link state recovery: Ensures direct-entry URLs implement loading, success, permission-denied, deleted/archived recovery, and never-existed 404 handling.
  • Route-table parameter validation: Requires strict, routing-layer validation for path parameters before any data fetch begins.
  • History discipline for back-button resilience: Specifies push vs replace semantics to avoid resubmission traps and dead-state wizard navigation.
  • Route-level error boundary scope: Contains failures within affected subtrees so partial 404s or nested errors do not collapse the entire app.

Quick Start

Ask routing-navigation-design to produce a complete route-table, redirect map, guard classification, deep-link state plan, validation rules, and route-level tests for the specific route changes you are implementing.

Frequently Asked Questions about routing-navigation-design

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

FAQPage Schema
How do I design secure route guards for redirecting unauthenticated vs unauthorized users?

Secure route navigation contracts classify unauthenticated, unauthorized, unavailable, and not-found outcomes explicitly. They enforce a resource-existence disclosure policy to prevent leaking sensitive resource existence while ensuring distinct behaviors for each guard state.

How do I prevent open redirect vulnerabilities when preserving returnTo destinations across auth flows?

Prevent open redirect vulnerabilities by enforcing same-origin validation for returnTo destinations. Route navigation contracts limit redirect depth to a maximum of 2, ensuring loop-free redirects while preserving safe return destinations across authentication flows.

What is the best way to handle deep-link loading states for deleted or archived resources?

Deep-link state recovery requires direct-entry URLs to implement loading, success, permission-denied, deleted or archived recovery, and never-existed 404 handling. This ensures direct-entry URLs handle stale or removed resources gracefully without breaking the navigation flow.

How do I validate path parameters before fetching data in a routing-layer architecture?

Routing-layer parameter validation requires strict validation of path parameters before any data fetch begins. This contract ensures invalid parameters are rejected early by the routing layer, preventing unnecessary data fetches and maintaining application stability.

When should I use push vs replace semantics to avoid resubmission traps in browser history?

Use push vs replace history semantics to avoid resubmission traps and dead-state wizard navigation. History discipline specifies exact push vs replace behavior for changed URLs, ensuring back-button resilience and preventing users from resubmitting forms or hitting dead states.

How do I contain route-level errors so partial 404s do not collapse the entire application?

Route-level error boundary scope contains failures within affected subtrees so partial 404s or nested errors do not collapse the entire app. This approach isolates route failures, maintaining overall application stability when specific routes encounter errors.