spa-routes

Maintain consistent SPA route architecture across web and Electron builds.

1|Updated May 20, 2026
One-click install
npx skills add https://github.com/mDevsLabs/mAI --skill spa-routes-mdevslabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spa-routes
Source: https://github.com/mDevsLabs/mAI/tree/main/.agents/skills/spa-routes
Command: npx skills add https://github.com/mDevsLabs/mAI --skill spa-routes-mdevslabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SPA routing drift and parity issues across web/electron builds; this guide helps teams maintain consistent route structure and clear ownership.

Core Features & Use Cases

  • Defines where routes live, how to split with roots vs features, how to add new components and route files without drift, and how to align desktop/mobile/popup router configs.
  • Helps ensure desktopRouter.config.tsx and desktopRouter.config.desktop.tsx stay in sync to prevent blank screens or misrouting.

Quick Start

Create a new route under src/routes following the roots convention and mirror it in both desktopRouter.config.tsx and desktopRouter.config.desktop.tsx.

Frequently Asked Questions about spa-routes

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

FAQPage Schema
How do I prevent SPA routing drift between web and Electron desktop builds?

To prevent SPA routing drift between web and Electron builds, maintain consistent route architecture by mirroring route configurations in both desktopRouter.config.tsx and desktopRouter.config.desktop.tsx. This prevents blank screens and misrouting.

What is the best way to structure SPA route files for scalability?

The best way to structure scalable SPA route files is following a roots convention under src/routes, keeping route files thin, and splitting routes logically between roots and features to ensure clear ownership and prevent architectural drift.

How do I add a new route to an SPA without breaking desktop router parity?

To add a new route without breaking desktop router parity, create the route under src/routes following the roots convention, then immediately mirror the addition in both dynamic and static import variants of the desktop router configuration files.

Why does my SPA show blank screens or misrouting after adding new components?

Blank screens or misrouting in an SPA often occur when desktopRouter.config.tsx and desktopRouter.config.desktop.tsx are out of sync. Ensuring mirrored configurations across desktop, mobile, and web router setups prevents this issue.

Does this routing approach support both dynamic and static imports for Electron?

Yes, the routing approach supports Electron builds by maintaining mirrored desktop router configurations in both dynamic and static import variants, ensuring parity and preventing routing drift across different build targets.

When do I need to refactor my SPA route tree architecture?

You need to refactor your SPA route tree architecture when adding new components causes routing drift, or when desktop, mobile, and web router configurations lose parity, requiring a clear folder structure and thin route files to maintain consistency.