Skip to main content
skill CX Codex

react-router-code-review — Claude Code skill: what it does

react-router-code-review is a Claude Code skill that checks React Router v6.4+ code for loaders, actions, error boundaries, and navigation. It reviews routing changes.

Apache-2.0 202 installs ★ 89 updated 2026-09-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add existential-birds/beagle --skill react-router-code-review -a claude-code
Open on GitHub

What react-router-code-review does

The skill reads route modules built on React Router v6.4 or newer. A checklist drives the pass: fetching through loader rather than useEffect, params validated before use, mutations sent with <Form> or useFetcher, errorElement set on routes, <Link> preferred over navigate(), pending state surfaced through useNavigation() or fetcher.state.

Some findings only count in context. Browser-only data like localStorage or window size still belongs in useEffect, since loaders run on the server, and navigate() inside a handler is correct usage. Both sit on a valid-patterns list, so the report stays free of noise.

Four reference files carry the detail: data-loading.md, mutations.md, error-handling.md, navigation.md. The skill pulls the one matching the code under review. Gates run before any finding is written down, and the last of them follows the protocol in a neighbouring skill at ../review-verification-protocol/SKILL.md. Miss that one and the final gate has nothing to check against.

What it helps with

  • catch a useEffect that fetches data where a loader belongs
  • spot a route with no errorElement and no parent boundary
  • drop false findings using the valid-patterns list
  • confirm mutations go through <Form> or useFetcher
  • tell navigate() in a handler from a missed <Link>

Example prompts for the agent

  • Review app/routes/dashboard.tsx: the data comes in through useEffect, check what's wrong with the loaders.
  • Go over routes.ts for actions and error handling.
  • Check navigation in src/routes/orders.tsx — which calls should be <Link> instead of navigate().

How to install react-router-code-review

1Skills CLI (Vercel)

npx skills add existential-birds/beagle --skill react-router-code-review -a claude-code

2Manually: put the files in place

~/.claude/skills/react-router-code-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/react-router-code-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about react-router-code-review

How do I install react-router-code-review in Claude Code?

Run npx skills add existential-birds/beagle --skill react-router-code-review -a claude-code. The skill lands at ~/.claude/skills/react-router-code-review/SKILL.md.

What does react-router-code-review do?

It reviews React Router v6.4+ code against a checklist covering loaders, mutations, errorElement and navigation. Every finding needs a file path and line reference.

What does the last verification gate need?

It loads a sibling skill at ../review-verification-protocol/SKILL.md. Install that one alongside, otherwise the pre-report check stays unfinished.

Source text

SKILL.md · Apache-2.0
---
name: react-router-code-review
description: Reviews React Router code for proper data loading, mutations, error handling, and navigation patterns. Use when reviewing React Router v6.4+ code, loaders, actions, or navigation logic.
---

# React Router Code Review

## Quick Reference

| Issue Type | Reference |
|------------|-----------|
| useEffect for data, missing loaders, params | [references/data-loading.md](references/data-loading.md) |
| Form vs useFetcher, action patterns | [references/mutations.md](references/mutations.md) |
| Missing error boundaries, errorElement | [references/error-handling.md](references/error-handling.md) |
| navigate() vs Link, pending states | [references/navigation.md](references/navigation.md) |

## Review Checklist

- [ ] Data loaded via `loader` not `useEffect`
- [ ] Route params accessed type-safely with validation
- [ ] Using `defer()` for parallel data fetching when appropriate
- [ ] Mutations use `<Form>` or `useFetcher` not manual fetch
- [ ] Actions handle both success and error cases
- [ ] Error boundaries with `errorElement` on routes
- [ ] Using `isRouteErrorResponse()` to check error types
- [ ] Navigation uses `<Link>` over `navigate()` where possible
- [ ] Pending states shown via `useNavigation()` or `fetcher.state`
- [ ] No navigation in render (only in effects or handlers)

## Valid Patterns (Do NOT Flag)

These patterns are correct React Router usage - do not report as issues:

- **useEffect for client-only data** - Loaders run server-side; localStorage, window dimensions, and browser APIs must use useEffect
- **navigate() in event handlers** - Link is for declarative navigation; navigate() is correct for imperative navigation in callbacks/handlers
- **Type annotation on loader data** - `useLoaderData<typeof loader>()` is a type annotation, not a type assertion
- **Empty errorElement at route level** - Route may intentionally rely on parent error boundary
- **Form without action prop** - Posts to current URL by convention; explicit action is optional
- **loader returning null** - Valid when data may not exist; null is a legitimate loader return value
- **Using fetcher.data without checking fetcher.state** - May be intentional when stale data is acceptable during revalidation

## Context-Sensitive Rules

Only flag these issues when the specific context applies:

| Issue | Flag ONLY IF |
|-------|--------------|
| Missing loader | Data is available server-side (not client-only) |
| useEffect for data fetching | Data is NOT client-only (localStorage, browser APIs, window size) |
| Missing errorElement | No parent route in the hierarchy has an error boundary |
| navigate() instead of Link | Navigation is NOT triggered by an event handler or conditional logic |

## Gates (before reporting any finding)

Run in order. **Pass each gate with evidence** (paths, line refs, or a one-line quote from code)—not intuition alone.

### Gate 1 — Scope the route surface

**Pass when:** You have repo path(s) to the route module, `routes` config entry, or layout that owns the behavior under review (write them in your notes before flagging).

### Gate 2 — Context-sensitive match

**Pass when:** For every issue that maps to **Context-Sensitive Rules**, the **Flag ONLY IF** condition is satisfied with a one-line rationale tied to the code; for other checklist items, you have a concrete code citation (path + line or short excerpt).

### Gate 3 — Non-issue patterns

**Pass when:** The behavior is not covered by **Valid Patterns (Do NOT Flag)** for that category.

### Gate 4 — Verification protocol

Load and follow [review-verification-protocol](../review-verification-protocol/SKILL.md). **Pass when:** Its pre-report checklist (and any issue-type subsection that applies) is complete for each finding you will output.

## When to Load References

- Reviewing data fetching code → data-loading.md
- Reviewing forms or mutations → mutations.md
- Reviewing error handling → error-handling.md
- Reviewing navigation logic → navigation.md

## Review Questions

1. Is data loaded in loaders instead of effects?
2. Are mutations using Form/action patterns?
3. Are there error boundaries at appropriate route levels?
4. Is navigation declarative with Link components?
5. Are pending states properly handled?

© existential-birds · Apache-2.0 · existential-birds/beagle

Similar skills

All skills for Code review and refactoring →

From the same set68

The whole set →
pydantic-ai-agent-creation The pydantic-ai-agent-creation skill guides PydanticAI agent setup with typed dependencies, validated outputs, and model configuration. Use it when building agents or chat systems. CX Codex +1 219installs ai-elements A skill for Claude Code, Codex, Cursor, Copilot, Gemini CLI and OpenCode: helps build chat interfaces, job queues, tool execution displays and approval workflows. Triggers on ai-elements, Queue, Tool, Confirmation, Message, PromptInput. CX Codex +1 211installs go-code-review go-code-review — a Go review skill that reads go.mod first, then checks errors, goroutines, interfaces and cleanup, ranking each finding by severity. CX Codex +1 206installs shadcn-code-review shadcn-code-review audits React components built with shadcn/ui, Radix primitives, and Tailwind CSS. Catches CVA mistakes, broken asChild slots, and missing accessibility states. CX Codex +1 206installs swift-testing-code-review swift-testing-code-review reviews Swift Testing code for macro usage, parameterized and async tests, and suite structure. Use it when checking .swift files. CX Codex +1 196installs docs-style docs-style enforces technical documentation style rules, Diataxis framework alignment, active voice, and clear structures for both readers and LLMs. CX Codex +1 180installs deepagents-architecture deepagents-architecture guides architectural decisions for Deep Agents, covering framework comparisons, storage backend routing, subagent topologies, and middleware order. CX Codex +1 162installs pydantic-ai-tool-system pydantic-ai-tool-system guides coding agents to implement PydanticAI tools with correct decorator signatures, type annotations, and docstrings. CX Codex +1 161installs

Project sponsors

Companies that keep this analytics open