virtual-file-routes

Build programmatic route trees for TanStack Router with virtual file routes.

6|1|Updated Jun 1, 2025
One-click install
npx skills add https://github.com/rezics/rezics --skill virtual-file-routes-rezics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: virtual-file-routes
Source: https://github.com/rezics/rezics/tree/main/.agents/skills/tanstack/router/virtual-file-routes
Command: npx skills add https://github.com/rezics/rezics --skill virtual-file-routes-rezics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Builds programmatic route trees for TanStack Router using virtual file routes. Useful when you want explicit control over route structure, need to mix virtual and physical routes, or want to define route subtrees within file-based routing directories.

Core Features & Use Cases

  • rootRoute, index, route, layout, physical, and defineVirtualSubtreeConfig to compose a full routing tree.
  • Integrates with TanStack Router plugin for frameworks (react/solid/vue) and supports both file-based and programmatic definitions.
  • Useful in projects needing dynamic routing, hybrid routing, or modular route subtrees within existing apps.

Quick Start

Create a routes.ts using rootRoute and route to define a simple /home and /dashboard structure.

Frequently Asked Questions about virtual-file-routes

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

FAQPage Schema
How do I build programmatic route trees in TanStack Router?

To build programmatic route trees in TanStack Router, you can use virtual file routes to explicitly define and control your application's route structure programmatically rather than relying solely on file conventions.

Can I mix file-based routing with virtual routes in TanStack Router?

Yes, you can mix file-based routing with virtual routes in TanStack Router. This approach allows you to define modular route subtrees within existing file-based routing directories while maintaining explicit control over the structure.

What TanStack Router APIs are used to define virtual file routes?

Defining virtual file routes utilizes core API elements including rootRoute, index, route, layout, physical, and defineVirtualSubtreeConfig to compose a complete routing tree with TypeScript typings.

Does the TanStack Router plugin support virtual file routes for frontend frameworks?

Yes, the TanStack Router plugin supports virtual file routes across frontend frameworks including React, Solid, and Vue, enabling seamless integration of programmatic route definitions into your application.

When should I use virtual file routes instead of standard file-based routing?

Use virtual file routes when you need explicit control over the route structure, want to define dynamic routing programmatically, or need to create modular route subtrees within an existing file-based routing architecture.

How do I set up a basic routes.ts file using virtual file routes?

To set up a basic routes.ts file, use the rootRoute and route APIs to programmatically define a simple structure such as /home and /dashboard, establishing your application's foundational routing tree.