react-router-app-architecture

Enforces layered architecture, route boundaries, and UI conventions for React Router Vite apps.

2|Updated May 3, 2023
One-click install
npx skills add https://github.com/anaregdesign/lantern --skill react-router-app-architecture-anaregdesign
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-router-app-architecture
Source: https://github.com/anaregdesign/lantern/tree/main/.github/skills/react-router-app-architecture
Command: npx skills add https://github.com/anaregdesign/lantern --skill react-router-app-architecture-anaregdesign

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React Router single-page apps often drift into tangled code: routes calling databases directly, components owning async state, and ORM imports leaking into the domain layer. This Skill provides a canonical directory layout, dependency-direction rules, and verification workflow so app code stays maintainable from bootstrap through ongoing feature work. ## Core Features & Use Cases - Canonical Layered Layout: Defines exact placement for routes, feature components, client use cases, server use cases, infrastructure, and domain modules, with a mandatory placement preflight before writing code. - Boundary and Contract Rules: Enforces inward dependency direction, repository ports in the domain layer, validation ownership per layer, and explicit DTO mapping across the client-server boundary. - UI and Verification Guardrails: Standardizes Fluent UI React v9, CSS Modules, responsive design, chart guidance, and Playwright-based UI verification before pushing. - Use Case: When adding a new feature like an order management screen, use this Skill to decide exactly where each file lives, wire the FlatRoute route module to a server use case through a repository port, and verify the rendered result in Playwright. ## Quick Start Ask the assistant to apply the react-router-app-architecture skill when scaffolding a new React Router app or adding a feature, starting with the layout and module placement reference.

Frequently Asked Questions about react-router-app-architecture

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

FAQPage Schema
How do I structure a React Router app with clean architecture?

Use the canonical layout: routes for HTTP composition, components for presentational UI, client and server use cases for orchestration, domain for invariants, and server infrastructure for ORM and SDK clients. Run a placement preflight assigning every new file an exact target path before coding.

Where should data access code live in a React Router app?

Keep ORM clients, query builders, and SDK code inside app/lib/server/infrastructure/. Server use cases and the domain layer talk to repository port interfaces defined in app/lib/domain/repositories/, never to concrete data clients.

Does this architecture require a specific ORM or database?

No, the skill is persistence-agnostic. It defines where the data access layer lives and how repository ports work, but the choice of Drizzle, Prisma, Kysely, or any other stack stays with the project and is confined to server infrastructure.

Can I use a component library other than Fluent UI?

Yes, if the repository already has an established design system, follow it instead of layering Fluent UI on top. The rule prohibits mixing two general-purpose component libraries in the same app, and deviations should be documented.

When should I not use this architecture skill?

Do not use it for spec planning, cloud platform setup, app registration, auth contract design, release delivery, or choosing a specific ORM or database engine. Those concerns belong to companion hosting or workflow skills.