react-router-code-review — скилл для Claude Code: ревью React Router
Скилл react-router-code-review для Claude Code проверяет код роутинга в React Router v6.4 и новее: лоадеры, экшены, границы ошибок и навигацию.
Apache-2.0 202 установок ★ 89 обновлён 2026-09-15
npx skills add existential-birds/beagle --skill react-router-code-review -a claude-codeЧто делает react-router-code-review
Скилл разбирает модули маршрутов на React Router v6.4 и новее. В основе чек-лист: данные приходят из loader, а не из useEffect; параметры маршрута проверяются до использования; мутации отправляются через <Form> или useFetcher; на маршруте стоит errorElement; переходы делаются через <Link>, а состояние загрузки видно по useNavigation() или fetcher.state.
Часть проверок зависит от контекста. Данные из localStorage или от window остаются в useEffect, потому что лоадеры выполняются на сервере. navigate() внутри обработчика — обычная практика. Такие случаи вынесены в список валидных паттернов, чтобы не попадать в отчёт как замечания.
Разбор по темам лежит в четырёх файлах: data-loading.md, mutations.md, error-handling.md, navigation.md. Нужный подгружается по типу кода. Перед выводом находок проходят четыре гейта, и последний требует скилл review-verification-protocol по пути ../review-verification-protocol/SKILL.md. Нет его рядом — финальная проверка остаётся незакрытой, а каждая находка должна нести путь и строку из кода.
Какие задачи решает
- найти
useEffect, который тянет данные вместоloader - поймать маршрут без
errorElementи без родительской границы ошибок - отсеять ложные замечания по списку валидных паттернов
- проверить, что мутации идут через
<Form>илиuseFetcher - разобрать навигацию: где
<Link>, а гдеnavigate()
Примеры запросов агенту
- Проверь
app/routes/dashboard.tsx: данные грузятся черезuseEffect, посмотри, что тут не так с лоадерами. - Сделай ревью
routes.ts— экшены, обработка ошибок и pending-состояния. - Прогони навигацию в
src/routes/orders.tsx: где стоитnavigate(), а где хватит<Link>.
Как установить react-router-code-review
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill react-router-code-review -a claude-code2Вручную: положить файлы
~/.claude/skills/react-router-code-review/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/react-router-code-review/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill react-router-code-review -a codex2Вручную: положить файлы
.agents/skills/react-router-code-review/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill react-router-code-review -a cursor2Вручную: положить файлы
.cursor/skills/react-router-code-review/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install existential-birds/beagle plugins/beagle-react/skills/react-router-code-review2Вручную: положить файлы
.github/skills/react-router-code-review/SKILL.md1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill react-router-code-review -a gemini-cli2Командой платформы
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-react/skills/react-router-code-reviewВручную: положить файлы
.devin/skills/react-router-code-review/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill react-router-code-review -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о react-router-code-review
Как установить react-router-code-review в Claude Code?
Выполните npx skills add existential-birds/beagle --skill react-router-code-review -a claude-code. Скилл появится по пути ~/.claude/skills/react-router-code-review/SKILL.md.
Что делает react-router-code-review?
Проверяет код на React Router v6.4+ по чек-листу: лоадеры, мутации, errorElement, навигация. Каждая находка подкрепляется путём и строкой из кода.
Что нужно, чтобы скилл дошёл до отчёта?
Четвёртый гейт ссылается на скилл review-verification-protocol по пути ../review-verification-protocol/SKILL.md. Без него протокол проверки перед отчётом не выполнить.
Исходный текст
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