Frontend React Router Best Practices
React Router data-loading, action, and route-organization rules with code examples for performance and architecture.
- CCM score
- 52 of 100
- skills.sh installs
- 406
- GitHub stars
- 92
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers 55 rules across 11 categories: data loading, middleware, forms, streaming, and route organization
- Includes loader patterns such as
Promise.allparallel fetches, per-request API caching, anduseRevalidatorpolling, each with before-and-after code - Enforces loader-only data fetching and validates URL params with zod before queries run
- Designed for developers writing React Router loaders, actions, and forms in TypeScript applications
Install
$ npx -y skills add sergiodxa/agent-skills --skill frontend-react-router-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React Router Best Practices
Performance optimization and architecture patterns for React Router applications. Contains 55 rules across 11 categories focused on data loading, actions, forms, streaming, and route organization.
When to Apply
Reference these guidelines when:
- Writing new React Router routes (loaders, actions)
- Handling forms and mutations
- Implementing streaming with Single Fetch
- Organizing route files and colocating queries
- Setting up authentication patterns
- Adding SEO/meta tags
Rules Summary
Data Loading (CRITICAL)
loader-avoid-waterfalls - @rules/loader-avoid-waterfalls.md
All data fetching happens in loaders. Never fetch in components with useEffect.
// BAD: fetching in component
function Profile() {
const [user, setUser] = useState(null);
useEffect(() => {
fetch("/api/user")
.then((r) => r.json())
.then(setUser);
}, []);
if (!user) return <Spinner />;
return <div>{user.name}</div>;
}
// GOOD: fetch in loader
export async function loader({ request }: Route.LoaderArgs) {
let user = await getUser(request);
return data({ user });
}
Details
- Repository
- github.com/sergiodxa/agent-skills
- Category
- Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the frontend-react-router-best-practices skill do?
frontend-react-router-best-practices gives performance and architecture patterns for React Router applications. It covers writing loaders and actions, handling forms, streaming with Single Fetch, and organizing route files and colocated queries.
How do I install the frontend-react-router-best-practices skill?
Run npx -y skills add sergiodxa/agent-skills --skill frontend-react-router-best-practices -y in your project. After that, frontend-react-router-best-practices lets the agent apply React Router loader, action and routing rules when you write data fetching code.
Where does frontend-react-router-best-practices stand in the Frontend & UI Code category?
frontend-react-router-best-practices sits in the Frontend & UI Code category on Claude Marketplaces, next to vercel-react-best-practices and web-design-guidelines. Unlike those, it focuses on React Router data loading, form handling and route organization.
When should I use frontend-react-router-best-practices?
Use frontend-react-router-best-practices when you write new React Router routes, loaders, actions or forms. It also helps when you set up authentication patterns or add SEO and meta tags in a React Router app.
More from sergiodxa/agent-skills
All 10- Frontend Js Best Practices341
- Ruby On Rails Best Practices283
- Frontend Async Best Practices228
- Frontend Internationalization Best Practices195
- Frontend Testing Best Practices2.3K
- Owasp Security Check1.8K
- Frontend React Best Practices1.2K
- Frontend Accessibility Best Practices929
- Frontend Tailwind Best Practices472
Similar to Frontend React Router Best Practices
More Frontend & UI Codefrontend-async-best-practicessergiodxa/agent-skills228 installsAsync and Promise optimization rules that eliminate request waterfalls and maximize parallel fetching in loaders and actions.
react-router-v7existential-birds/beagle580 installsPractical React Router v7 guidance covering data-driven routing, loaders, actions, and mutation choices.
react-router-data-moderemix-run/agent-skills942 installsReference-driven React Router data mode guide covering loaders, actions, fetchers, and optimistic UI without the Vite plugin.
react-router-framework-moderemix-run/agent-skills3.8K installsSkill guide for React Router framework mode covering file-based routing, data loading, mutations, and rendering strategies.
nextjs-best-practicesdavila7/claude-code-templates635 installsNext.js App Router principles covering Server Components, data fetching, routing, caching, and server actions.
frontend-react-best-practicessergiodxa/agent-skills1.2K installsReact performance rules and composition patterns covering re-renders, bundle size, and hydration pitfalls.