Tanstack Router Migration
Automates TanStack Router v1 to v2 migration, minimizing disruption and ensuring seamless application updates.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add tanstack-router-migration npx -- -y @trustedskills/tanstack-router-migration
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"tanstack-router-migration": {
"command": "npx",
"args": [
"-y",
"@trustedskills/tanstack-router-migration"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill automates the migration of React applications from React Router to Tanstack Router, facilitating a smoother transition and minimizing disruption during application updates. It provides a structured process for both incremental and complete migrations, leveraging file-based routing within your project's src/routes directory. The tool generates code and configuration files to streamline this process while maintaining type safety and ensuring compatibility.
When to use it
- You are upgrading an existing React application that currently uses React Router.
- You want to adopt Tanstack Router’s file-based routing approach for improved organization and maintainability.
- You need a structured guide to migrate your application, including considerations for route guards and custom components.
- Your project utilizes TypeScript and you require type safety during the migration process.
Key capabilities
- Automated generation of router configuration files (
routeTree.gen.ts). - Support for incremental or complete migrations.
- File-based routing within a designated
src/routesdirectory. - TypeScript integration with the use of the
fromparameter in hooks and Zod schema validation. - Configuration plugins for build tools like Rspack, Rsbuild, and Vite.
Example prompts
- "Migrate my React Router v6 application to Tanstack Router."
- "Generate a router configuration file for my project using the
@tanstack/router-pluginwith Rspack." - "Show me how to configure linting rules specifically for files within my
src/routesdirectory."
Tips & gotchas
- Build Tool Configuration is Crucial: Properly configuring your build tool plugin (Rspack, Rsbuild or Vite) before creating routes is essential. Refer to the provided documentation (
references/build-configuration.md) for detailed instructions. - Avoid Manual Editing: Do not directly edit the auto-generated
routeTree.gen.tsfile, as changes will be overwritten during subsequent migrations. - Type Safety Matters: Always use the
fromparameter in hooks to ensure type safety during the migration process.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.