router-core

Define framework-agnostic, type-safe route structures for web applications.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/guillempuche/engranatge --skill router-core-guillempuche
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core
Source: https://github.com/guillempuche/engranatge/tree/main/docs/repos/tanstack-router/packages/router-core/skills/router-core
Command: npx skills add https://github.com/guillempuche/engranatge --skill router-core-guillempuche

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers need a unified, type‑safe routing foundation that works across different UI frameworks while keeping loaders, navigation, and route matching client‑first.

Core Features & Use Cases

  • Route Tree & Creation: Define hierarchical routes with createRouter, createRoute, createRootRoute, and createRootRouteWithContext.
  • Type Registration: Declare a global Register interface so all router hooks infer correct types automatically.
  • Matching & Sorting: Precise route matching, automatic route sorting, and file‑based naming conventions to keep large apps organized.
  • Use Case: Build a single router that powers both a React and a Solid application without rewriting routing logic.

Quick Start

Use the router core to declare a route tree, register it, and instantiate a router with createRouter.

Frequently Asked Questions about router-core

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

FAQPage Schema
How do I set up type-safe routing that works across multiple UI frameworks?

Type-safe routing across UI frameworks is achieved by defining a framework-agnostic route tree using createRouter and createRoute, then declaring a global Register interface so TypeScript infers correct types automatically across React, Solid, or other clients.

Can I share the same router logic between React and Solid applications?

You can share routing logic between React and Solid by building a single client-first router with createRootRoute, which handles route matching and navigation independently of the UI layer, eliminating the need to rewrite routing logic per framework.

Do I need TanStack Router and TypeScript to get full type inference for my routes?

Full type inference requires TanStack Router version 1.166.2 and TypeScript, as the type registration system relies on declaring a global Register interface to automatically infer correct types across all router hooks and route structures.

What's the best way to organize hierarchical routes in a large client-first web application?

Organize hierarchical routes using createRoute and createRootRouteWithContext with file-based naming conventions, which provides precise route matching, automatic route sorting, and keeps large applications structured and maintainable.

Does framework-agnostic routing handle data loading and route matching on the client side?

Framework-agnostic routing handles data loading and route matching client-side by using type-safe loaders and precise matching logic within the route tree, ensuring navigation and data fetching stay client-first across any UI framework.

Why does my TanStack Router setup lose type inference when I add new routes to the tree?

Type inference is lost when the global Register interface is not properly declared or updated, as this interface is what allows all router hooks to automatically infer correct types from the route tree defined via createRouter and createRoute.