frontend-navigation

Centralize SSR-safe React navigation with route grouping and layout guards.

27|2|Updated Oct 10, 2023
One-click install
npx skills add https://github.com/aexol-studio/axolotl --skill frontend-navigation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-navigation
Source: https://github.com/aexol-studio/axolotl/tree/main/examples/new/.opencode/skills/frontend-navigation
Command: npx skills add https://github.com/aexol-studio/axolotl --skill frontend-navigation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams architect and implement consistent, SSR-safe navigation for React apps by centralizing route definitions, layouts, and guards.

Core Features & Use Cases

  • Classic Routes/Route usage with SSR-safe architecture via BrowserRouter and StaticRouter
  • Layout-based guards (ProtectedLayout and GuestLayout) to protect route groups
  • Nested layouts with AdminLayout and child routes to share UI
  • Route grouping by access level: guest/public/protected for clear separation
  • Declarative navigation using Link and Navigate; explicit active state via useLocation
  • SSR integration: separate entry points for client and server, with proper hydration and redirects
  • Central source of truth for routes in routes/index.tsx to ensure consistency

Quick Start

Create a new protected route under /app and confirm ProtectedLayout redirects unauthenticated users to the login page.

Frequently Asked Questions about frontend-navigation

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

FAQPage Schema
How do I structure React Router for SSR with protected routes?

Structure React Router for SSR by centralizing route definitions and applying layout guards like ProtectedLayout to protect route groups. Use StaticRouter for the server entry point and BrowserRouter for the client to ensure proper hydration and redirects.

What is the best way to group routes by access level in a React application?

The best way to group routes by access level is to separate them into guest, public, and protected sections within a central source of truth. You then wrap these route groups in specific layouts like AdminLayout or GuestLayout to enforce access rules declaratively.

How do I prevent nested layout UI from flashing during server-side rendering redirects?

Prevent nested layout UI from flashing during SSR redirects by using layout guards that check authentication state before rendering child routes. The architecture specifies separate SSR entry points to handle redirects server-side before sending HTML to the client.

Does this React Router navigation architecture support nested layouts for admin dashboards?

Yes, this React Router navigation architecture supports nested layouts for admin dashboards. You can use AdminLayout to share UI across child routes, grouping them under a protected access level to maintain consistent navigation and layout rendering.

How do I manage active navigation state declaratively with React Router?

Manage active navigation state declaratively by using the useLocation hook to track the current URL and applying explicit active states to your Link components. Centralizing routes ensures that navigation paths remain consistent across the application.