react-router-code-review
Skill91 starsChanged 4 days agoApache-2.0View on GitHub
Reviews React Router v7 (and v6.4+ Data Router) code for proper data loading, mutations, error handling, and navigation patterns. Use when reviewing React Router routes, loaders, actions, error boundaries, or navigation logic.
In this repository85 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- agent-architecture-analysisSkill
- app-intents-code-reviewSkill
- artifact-analysisSkill
- axum-code-reviewSkill
- brainstorm-beagleSkill
- bubbletea-code-reviewSkill
- cloudkit-code-reviewSkill
- elixir-performance-reviewSkill
- elixir-security-reviewSkill
- elixir-writing-docsSkill
- exdoc-configSkill
- exunit-code-reviewSkill
- fastapi-code-reviewSkill
- fetch-pr-feedbackSkill
- ffi-code-reviewSkill
- fix-llm-artifactsSkill
- fowler-refactoringSkill
- gen-test-planSkill
- go-architectSkill
- go-code-reviewSkill
- go-data-persistenceSkill
- go-testing-code-reviewSkill
- healthkit-code-reviewSkill
- humanize-beagleSkill
- improve-docSkill
- ios-animation-code-reviewSkill
- liveview-code-reviewSkill
- llm-artifacts-detectionSkill
- llm-judgeSkill
- macros-code-reviewSkill
- phoenix-code-reviewSkill
- postgres-code-reviewSkill
- prfaq-beagleSkill
- prometheus-go-code-reviewSkill
- pytest-code-reviewSkill
- quick-planSkill
- react-flow-code-reviewSkill
- react-flowSkill
- react-router-v7Skill
- receive-feedbackSkill
- refactor-repoSkill
- resolve-beagleSkill
- respond-pr-feedbackSkill
- review-ai-writingSkill
- review-elixirSkill
- review-frontendSkill
- review-goSkill
- review-iosSkill
- review-llm-artifactsSkill
- review-planSkill
- review-pythonSkill
- review-remix-v2Skill
- review-rustSkill
- review-skillSkill
- review-structureSkill
- review-tuiSkill
- review-verification-protocolSkill
- run-test-planSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
Only flag these issues when the specific context applies:
- Distinctive: line 55
Run in order. Pass each gate with evidence (paths, line refs, or a one-line quote from code)—not intuition alone.
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Router Code Review
Quick Reference
| Issue Type | Reference |
| useEffect for data, missing loaders, streaming, params | references/data-loading.md |
Form vs useFetcher, action patterns, data() status | references/mutations.md |
Missing error boundaries, ErrorBoundary / errorElement | references/error-handling.md |
| navigate() vs Link, pending states | references/navigation.md |
Review Checklist
- Data loaded via
loader(orclientLoaderin Framework Mode) notuseEffect - Route params accessed type-safely with validation
- Parallelizing independent fetches with
Promise.all, and streaming non-critical promises directly (v7) or viadefer()(v6.4+ legacy) - Mutations use
<Form>oruseFetchernot manual fetch - Actions handle both success (
redirect(...)) and error (data(..., { status: 400 })) cases - Error boundaries with
ErrorBoundary(Framework/Data Mode) orerrorElement(Data Mode) on routes - Using
isRouteErrorResponse()to check error types - Navigation uses
<Link>overnavigate()where possible - Pending states shown via
useNavigation()orfetcher.state - No navigation in render (only in effects, handlers, or loaders)
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 in Framework Mode; localStorage, window dimensions, and browser APIs belong in
useEffect(orclientLoader) - navigate() in event handlers - Link is for declarative navigation; navigate() is correct for imperative navigation in callbacks/handlers
- Type-safe loader data props/annotations -
{ loaderData }: Route.ComponentProps(Framework Mode) anduseLoaderData<typeof loader>()(Data Mode) are type annotations, not unsafe assertions - Empty
ErrorBoundary/errorElementat 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 at route entry (not post-mount interaction/subscription or browser-only state) |
| useEffect for data fetching | Data is NOT client-only (localStorage, browser APIs, window size) |
Missing ErrorBoundary / 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 the review-verification-protocol skill (review-verification-protocol when installed alongside sibling skills). 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 → references/data-loading.md
- Reviewing forms or mutations → references/mutations.md
- Reviewing error handling → references/error-handling.md
- Reviewing navigation logic → references/navigation.md
Review Questions
- Is data loaded in loaders instead of effects?
- Are mutations using Form/action patterns?
- Are there error boundaries (
ErrorBoundary/errorElement) at appropriate route levels? - Is navigation declarative with Link components?
- Are pending states properly handled?
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

