Agent skill

React Router V7

by Mindrally in Mindrally/skills

React Router v7 framework mode conventions for route modules, data loaders, actions, and progressive enhancement.

Apache-2.0Auto-check passed

Install React Router V7

skills CLI
$ npx skills add Mindrally/skills --skill react-router-v7 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mindrally/skills react-router-v7 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mindrally/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/react-router-v7 .claude/skills/react-router-v7 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
react-router-v7
GitHub stars
267
Token cost
~2k tokens
SKILL.md length
760 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
Apache-2.0

At a glance

React Router v7 framework mode conventions for route modules, data loaders, actions, and progressive enhancement.

  • Works in 7 steps: Create the route file — Add a file under… → Export a loader — Fetch the data the… → Export a component — Read loader data… → …
  • Building file-based routes with loaders/actions
  • SKILL.md covers Workflow for Building a Route…, Route Modules, Data Loading and Mutations, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

React Router V7 is an agent skill from Mindrally/skills. React Router v7 framework mode conventions for route modules, data loaders, actions, and progressive enhancement. Use when building file-based routes with loaders/actions, handling form submissions with Form/useFetcher/useSubmit, adding route ErrorBoundary components, revalidating data after mutations, or migrating Remix-style route modules to React Router v7.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with React Router. The repository describes itself as: 255+ Claude Code skills converted from Cursor rules. Expert coding guidelines for every major framework and language. The licence is Apache-2.0.

When your agent uses it

  • Building file-based routes with loaders/actions
  • Handling form submissions with Form/useFetcher/useSubmit
  • Adding route ErrorBoundary components
  • Revalidating data after mutations

Example prompts

  • “/react-router-v7”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Create the route file — Add a file under app/routes/ (or your configured routes directory) for the URL segment, using nested folders/files…
  2. Export a loader — Fetch the data the route needs before render; validate route params and search params at the top of the loader.
  3. Export a component — Read loader data via useLoaderData() and render UI; keep the component focused on presentation.
  4. Export an action — Handle POST/PUT/DELETE submissions from or useFetcher`; return typed data (including validation errors) instead of…
  5. Export an ErrorBoundary — Handle thrown errors (400s, 500s, unexpected exceptions) locally so one route's failure doesn't take down the…
  6. Wire up navigation — Use , useFetcher, and useSubmit` for mutations so the app works with JavaScript disabled and gets optimistic UI when…
  7. Test the module — Write tests for the loader, action, validation failures, and error boundary independently of the rendered component tree.

What it can do on your machine

Read from SKILL.md and the folder at commit 9718410. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

React Router V7 loads about 2k tokens when it runs. Until then it costs about 95 tokens; SKILL.md has 760 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Mindrally/skills at commit 9718410, republished under its Apache-2.0 licence (© Mindrally). 760 words, ~1,970 tokens.

Download SKILL.mdSave it as .claude/skills/react-router-v7/SKILL.md (or your agent's skills folder).
name
react-router-v7
description
React Router v7 framework mode conventions for route modules, data loaders, actions, and progressive enhancement. Use when building file-based routes with loaders/actions, handling form submissions with Form/useFetcher/useSubmit, adding route ErrorBoundary components, revalidating data after mutations, or migrating Remix-style route modules to React Router v7.

React Router v7

React Router v7 framework mode unifies routing, data loading, and mutations into route modules, each exporting a loader, action, default component, and ErrorBoundary for a single URL segment.

Workflow for Building a Route Module

  1. Create the route file — Add a file under app/routes/ (or your configured routes directory) for the URL segment, using nested folders/files for layouts and dynamic segments.
  2. Export a loader — Fetch the data the route needs before render; validate route params and search params at the top of the loader.
  3. Export a component — Read loader data via useLoaderData() and render UI; keep the component focused on presentation.
  4. Export an action — Handle POST/PUT/DELETE submissions from <Form> or useFetcher; return typed data (including validation errors) instead of throwing for expected failures.
  5. Export an ErrorBoundary — Handle thrown errors (400s, 500s, unexpected exceptions) locally so one route's failure doesn't take down the whole app.
  6. Wire up navigation — Use <Form>, useFetcher, and useSubmit for mutations so the app works with JavaScript disabled and gets optimistic UI when it's enabled.
  7. Test the module — Write tests for the loader, action, validation failures, and error boundary independently of the rendered component tree.

Route Modules

  • Use route modules as the boundary for route UI, loader data, actions, metadata, and error boundaries — a route module is the unit of code splitting and data loading.
  • Keep route modules small; move shared UI to app/components/ and reusable data access to a services layer (e.g. app/services/posts.server.ts).
  • Prefer file-based routing in framework mode when the project is configured for it; use the explicit routes.ts config for advanced/dynamic route trees.
  • Use nested routes for shared layouts and progressive disclosure — a parent route's <Outlet /> renders the matched child.
  • Export route-specific ErrorBoundary components for recoverable route failures instead of relying on a single app-wide boundary.
tsx
// app/routes/posts.$postId.tsx
import { Form, useLoaderData, useNavigation } from "react-router";
import type { Route } from "./+types/posts.$postId";
import { getPost, updatePost } from "~/services/posts.server";

export async function loader({ params }: Route.LoaderArgs) {
  const post = await getPost(params.postId);
  if (!post) {
    throw new Response("Not Found", { status: 404 });
  }
  return { post };
}

export async function action({ request, params }: Route.ActionArgs) {
  const formData = await request.formData();
  const title = String(formData.get("title") ?? "");

  if (title.trim().length === 0) {
    return { ok: false as const, errors: { title: "Title is required" } };
  }

  await updatePost(params.postId, { title });
  return { ok: true as const, errors: null };
}

export default function PostDetail() {
  const { post } = useLoaderData<typeof loader>();
  const navigation = useNavigation();
  const isSubmitting = navigation.state === "submitting";

  return (
    <Form method="post">
      <input name="title" defaultValue={post.title} />
      <button type="submit" disabled={isSubmitting}>
        {isSubmitting ? "Saving..." : "Save"}
      </button>
    </Form>
  );
}

export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
  if (error instanceof Response && error.status === 404) {
    return <p>Post not found.</p>;
  }
  return <p>Something went wrong loading this post.</p>;
}

Data Loading

  • Use loaders for route data that should be available before render — this avoids loading spinners for data the page can't function without.
  • Keep loaders deterministic and side-effect free; a loader should read data, not write it.
  • Validate params and search params at the loader boundary (e.g. parse and range-check a page query param) rather than trusting them downstream.
  • Return typed data and consume it through useLoaderData<typeof loader>() rather than duplicating fetch logic in the component.
  • Use deferred or streaming patterns (defer, or returning promises for <Await>) only when they measurably improve perceived performance — not by default.
Show full SKILL.md (361 more words)Show less

Mutations

  • Use actions for route mutations and form submissions; an action runs on POST/PUT/PATCH/DELETE navigations and fetcher submissions to that route.
  • Prefer <Form>, useFetcher, and useSubmit for progressive enhancement — these work without client-side JavaScript and layer on optimistic UI when it's available.
  • Revalidate affected loader data after mutations; React Router automatically revalidates loaders on the current route tree after an action completes, so avoid manually refetching in useEffect.
  • Handle validation errors as typed action data (return { errors }) instead of throwing generic exceptions — reserve thrown Responses for actual HTTP-status failures (404, 401, 500).
  • Keep server-only secrets and privileged operations (API keys, direct DB writes) out of client actions — perform them in .server.ts modules that are stripped from the client bundle.
tsx
// Optimistic UI with useFetcher
function LikeButton({ postId, liked }: { postId: string; liked: boolean }) {
  const fetcher = useFetcher();
  const optimisticLiked = fetcher.formData
    ? fetcher.formData.get("liked") === "true"
    : liked;

  return (
    <fetcher.Form method="post" action={`/posts/${postId}/like`}>
      <input type="hidden" name="liked" value={String(!optimisticLiked)} />
      <button type="submit">{optimisticLiked ? "Unlike" : "Like"}</button>
    </fetcher.Form>
  );
}

Navigation and State

  • Store shareable state in URL params or search params (filters, pagination, selected tab) so links and reloads reproduce the same view.
  • Keep ephemeral UI state (open/closed dropdown, hover state) local to components with useState.
  • Use pending navigation state (useNavigation(), fetcher.state) to show optimistic or loading UI instead of a separate global spinner store.
  • Avoid global state (Redux/Zustand/Context) for data that belongs to route loaders — it duplicates the router's own cache and goes stale.

TypeScript and Testing

  • Type loader and action return values; use the generated Route.LoaderArgs/Route.ActionArgs types (from ./+types/<route>) for full inference of params and return types.
  • Add tests for route loaders, actions, validation failures, and error boundaries as isolated units, independent of full component rendering.
  • Use integration tests (e.g. Playwright, Testing Library with a router harness) for critical form and navigation flows.
  • Mock network and persistence at the route-service boundary (app/services/*.server.ts) rather than mocking fetch deep inside components.

Common Mistakes

  • Duplicating loader fetches in useEffect — this causes a loading waterfall and defeats the purpose of route-level data loading.
  • Mutating data directly inside a loader — loaders can run multiple times (revalidation, prefetch) and must stay read-only.
  • Hiding route errors behind a single generic app-level catch-all ErrorBoundary instead of route-scoped boundaries that preserve navigation and layout.
  • Putting auth checks only in components (e.g. redirecting from a useEffect) when the underlying loader data is protected — check and redirect inside the loader itself so no protected data is ever fetched or flashed.

© Mindrally, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in react-router-v7 of Mindrally/skills.

Open the folder on GitHubat commit 9718410

Compare with similar skills

React Router V7 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

React Router V7 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React Router V7 this skillMindrally/skills267—~2kAutomated safety check: PassApache-2.0
React Router Developmentremix-run/react-router57k1 repos~1.5kAutomated safety check: PassMIT
React Router Release Notes Prepremix-run/react-router57k—~1.1kAutomated safety check: PassMIT
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
React Router PR Finish Lineremix-run/react-router57k—~1.4kAutomated safety check: PassMIT
React Router Data Modehalo-dev/upage5551 repos~927Automated safety check: PassMIT

Similar skills

  • React Router Development

    remix-run/react-router

    Guides work on React Router apps by first identifying whether the app uses Framework, Data or Declarative mode, then loading the matching reference and the installed package docs.

    57k GitHub starsUsed in 1 repo~1.5k tokens
    Frontend & DesignAuto-check passed
  • React Router Release Notes Prep

    remix-run/react-router

    Polishes pending React Router change files before the versioning scripts run, and decides whether a long-form What's Changed section is warranted.

    57k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • React Router PR Finish Line

    remix-run/react-router

    Takes a blocked community pull request in React Router and adds the missing tests, change file or docs so it can merge, working on the contributor's branch.

    57k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Build React applications using React Router's data mode with createBrowserRouter and RouterProvider.

    555 GitHub starsUsed in 1 repo~927 tokens
    Auto-check passed
  • React Router Bug Fix Workflow

    remix-run/react-router

    Fixes a React Router bug reported in a GitHub issue end to end: fetching the issue, validating the reproduction, writing a failing test and implementing the fix on a new branch.

    57k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed

More from Mindrally/skills

All 34 skills in this repo
  • Analytics Data Analysis

    Mindrally/skills

    Best practices for analytics, data analysis, and visualization using Python, pandas, matplotlib, seaborn, and Jupyter notebooks.

    267 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Best practices for AutoML and hyperparameter search with Optuna, Ray Tune, and PyCaret, covering search-space design, validation splits, and leakage prevention.

    267 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Blender Python Addon

    Mindrally/skills

    Best practices for writing Blender Python add-ons using the bpy API, covering operators, panels, properties, registration, and API-safe scripting.

    267 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices.

    267 GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Clean Code

    Mindrally/skills

    Clean, maintainable, human-readable code principles combined with anti-over-engineering discipline: naming, single responsibility, DRY, and scoping changes to exactly what was requested.

    267 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Design Systems

    Mindrally/skills

    Comprehensive design system guidelines for building consistent, accessible, and scalable component libraries.

    267 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about React Router V7

What does React Router V7 do?

React Router v7 framework mode conventions for route modules, data loaders, actions, and progressive enhancement. React Router V7 is an agent skill from Mindrally/skills. React Router v7 framework mode conventions for route modules, data loaders, actions, and progressive enhancement.

When should I use React Router V7?

React Router V7 fits situations like: building file-based routes with loaders/actions; handling form submissions with Form/useFetcher/useSubmit; adding route ErrorBoundary components; revalidating data after mutations.

How do I install React Router V7 in Claude Code?

Run `npx skills add Mindrally/skills --skill react-router-v7 -a claude-code`. Or copy the skill folder (react-router-v7 in Mindrally/skills) into .claude/skills/react-router-v7 in your project. Claude Code loads it when a task matches its description.

How do I install React Router V7 in Codex?

Run `npx skills add Mindrally/skills --skill react-router-v7 -a codex`. Or copy the skill folder (react-router-v7 in Mindrally/skills) into .agents/skills/react-router-v7 in your project. Codex loads it when a task matches its description.

Can I use React Router V7 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mindrally/skills --skill react-router-v7 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/react-router-v7, .gemini/skills/react-router-v7, .github/skills/react-router-v7 and .opencode/skills/react-router-v7 in your project.

What does React Router V7 need to run?

SKILL.md names no scripts, command-line tools or credentials: React Router V7 is instructions for the agent only.

Does React Router V7 access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is React Router V7 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does React Router V7 use?

React Router V7 is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does React Router V7 use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to React Router V7?

Skills that share tags, products or a category with React Router V7: React Router Development (remix-run/react-router, 57k stars), React Router Release Notes Prep (remix-run/react-router, 57k stars), React Router Pull Request Creator (remix-run/react-router, 57k stars) and React Router PR Finish Line (remix-run/react-router, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React Router V7?

Mindrally (a GitHub organization) maintains it in Mindrally/skills, which has 267 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on September 3, 2026.

Source: Mindrally/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.