spa-routes

Organize SPA routes in src/routes/ and features in src/features/.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a clear, organized structure for Single Page Application (SPA) routes and features, ensuring maintainability and scalability by defining where different types of code should reside.

Core Features & Use Cases

  • Route vs. Feature Separation: Clearly delineates responsibilities between src/routes/ (page segments) and src/features/ (business logic and UI by domain).
  • File Organization Guidelines: Offers specific rules for what belongs in route files versus feature files.
  • Adding New Routes: Guides users through the process of creating new SPA routes and integrating them with features.
  • Use Case: When developing a new section of the application, this Skill helps determine whether a new component should be a thin route wrapper or part of a larger, reusable feature module.

Quick Start

Follow the guidelines in this skill to add a new feature route to the application.

Frequently Asked Questions about spa-routes

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

FAQPage Schema
How do I organize React SPA routes and feature modules for better code structure?

Organize SPA routes and features by separating page segments in `src/routes/` from domain-oriented business logic and UI in `src/features/`. This architectural pattern ensures maintainability and scalability by defining clear file placement rules based on component responsibility.

What is the difference between a route file and a feature module in a single page application?

In a single page application, route files in `src/routes/` act as thin page segment wrappers, while feature files in `src/features/` contain domain-oriented business logic and UI. This separation dictates whether a component should be a route wrapper or a reusable feature module.

How do I add a new route to an existing SPA architecture?

To add a new route to your SPA architecture, create a new page segment file in `src/routes/` and integrate it with the necessary domain logic from `src/features/`. Follow the file organization guidelines to determine if the component is a thin wrapper or a feature module.

When should I place a new component in src/routes versus src/features?

Place a component in `src/routes/` if it serves as a thin page segment wrapper, or in `src/features/` if it contains reusable, domain-oriented business logic and UI. Deciding file placement depends entirely on the component's architectural responsibility.

Does this SPA routing pattern work without specific frontend dependencies?

Yes, this SPA routing pattern works without specific frontend dependencies as it defines a clear architectural pattern for organizing code organization rather than relying on external libraries. It provides structural guidelines for any single page application project.