/mindrally-skills:react-router-v7from Mindrally Skills Collection
Covers React Router v7 framework mode conventions: route modules with loaders, actions, ErrorBoundary, file-based routing, form mutations via Form/useFetcher/useSubmit, and data revalidation.
Ships in Mindrally Skills Collection. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
app/routes/ (or your configured routes directory) for the URL segment, using nested folders/files for layouts and dynamic segments.useLoaderData() and render UI; keep the component focused on presentation.POST/PUT/DELETE submissions from <Form> or useFetcher; return typed data (including validation errors) instead of throwing for expected failures.<Form>, useFetcher, and useSubmit for mutations so the app works with JavaScript disabled and gets optimistic UI when it's enabled.app/components/ and reusable data access to a services layer (e.g. app/services/posts.server.ts).routes.ts config for advanced/dynamic route trees.<Outlet /> renders the matched child.ErrorBoundary components for recoverable route failures instead of relying on a single app-wide boundary.// 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>;
}
page query param) rather than trusting them downstream.useLoaderData<typeof loader>() rather than duplicating fetch logic in the component.defer, or returning promises for <Await>) only when they measurably improve perceived performance — not by default.POST/PUT/PATCH/DELETE navigations and fetcher submissions to that route.<Form>, useFetcher, and useSubmit for progressive enhancement — these work without client-side JavaScript and layer on optimistic UI when it's available.useEffect.return { errors }) instead of throwing generic exceptions — reserve thrown Responses for actual HTTP-status failures (404, 401, 500)..server.ts modules that are stripped from the client bundle.// 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>
);
}
useState.useNavigation(), fetcher.state) to show optimistic or loading UI instead of a separate global spinner store.Route.LoaderArgs/Route.ActionArgs types (from ./+types/<route>) for full inference of params and return types.app/services/*.server.ts) rather than mocking fetch deep inside components.useEffect — this causes a loading waterfall and defeats the purpose of route-level data loading.ErrorBoundary instead of route-scoped boundaries that preserve navigation and layout.useEffect) when the underlying loader data is protected — check and redirect inside the loader itself so no protected data is ever fetched or flashed.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mindrally/skills --plugin mindrally-skills265 skills in this plugin
/accessibility-a11yImplement web accessibility (a11y) best practices following WCAG guidelines to create inclusive, accessible user interfaces./alpine-jsAlpine.js development guidelines for lightweight reactive interactions with Tailwind CSS and various backend frameworks./analytics-data-analysisBest practices for analytics, data analysis, and visualization using Python, pandas, matplotlib, seaborn, and Jupyter notebooks. Use when performing exploratory data analysis, building data pipelines, creating statistical visualizations, writing Jupyter notebooks, cleaning and transforming datasets, or implementing analytics dashboards.Other plugins' skills for the same job