spa-routes

Enforces SPA route organization and mirrored desktop router config updates.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/kingheu0818-sketch/lobehub_yu --skill spa-routes-kingheu0818-sketch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spa-routes
Source: https://github.com/kingheu0818-sketch/lobehub_yu/tree/main/.agents/skills/spa-routes
Command: npx skills add https://github.com/kingheu0818-sketch/lobehub_yu --skill spa-routes-kingheu0818-sketch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents broken navigation and blank screens by enforcing a consistent, “roots vs features” structure and requiring mirrored updates across the desktop router pair when changing SPA route trees.

Core Features & Use Cases

  • Correct file placement (roots vs features): Ensures src/routes/ stays thin (segment entry/layout wrappers) while real UI/business logic lives in src/features/ by domain.
  • Desktop router parity guardrail: Forces route-tree changes to be applied to both desktopRouter.config.tsx and desktopRouter.config.desktop.tsx together to avoid registration drift.
  • Safer route refactors & migrations: Guides how to add new routes, move route logic into features, and progressively migrate existing segments without reintroducing logic into src/routes/.

Quick Start

Use the spa-routes skill when you add or refactor any files under src/routes/, and update both desktop router config files in the same change whenever the route tree structure changes.

Frequently Asked Questions about spa-routes

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

FAQPage Schema
Why does my SPA show a blank screen after adding a new React route?

A blank screen in your SPA often stems from route-registration drift, where updates aren't mirrored across the desktop router config pair, causing navigation failures. You must apply identical RouteObject structure changes to both config files to prevent this.

How do I organize React routing files to separate routes from feature logic?

To organize React routing correctly, keep the src/routes/ layer thin by limiting it to segment entry and layout wrappers. All real UI and domain business logic must be implemented under the src/features/ directory.

What is the best way to refactor SPA route segments without breaking navigation?

The best way to refactor SPA route segments safely is to progressively migrate logic into src/features/ by domain while ensuring src/routes/ remains a thin wrapper. Any route tree structure change must be mirrored across the desktop router config pair.

How do I handle desktop and mobile router differences during React SPA development?

Handle desktop and mobile router differences by mirroring identical RouteObject structures across the desktop router config pair. This prevents registration drift and ensures consistent navigation behavior when modifying the SPA route tree.

Can I put domain business logic directly inside my React route files?

No, you should not place domain business logic in React route files. The src/routes/ directory must remain a thin layer for segment entry and layout wrappers, while real UI and business logic resides under src/features/.

spa-routes: When should I update both desktop router config files?

You should update both desktop router config files whenever the SPA route tree structure changes. Mirroring the RouteObject structure across the config pair prevents registration drift and avoids blank-screen navigation failures.