| name | roto-rooter |
| description | Static analysis for React Router applications. Use when building or debugging React Router apps to verify routes, links, forms, loaders, params, hydration patterns, and database persistence operations. |
| allowed-tools | Bash(rr:*) |
React Router Static Analysis with roto-rooter
Quick start
rr
rr app/routes/dashboard.tsx
rr --fix
rr --dry-run
Example output:
[links] app/routes/dashboard.tsx:24:8
<Link to="/users">
[error] Link target "/users" does not match any route
[hydration] app/routes/dashboard.tsx:31:12
new Date()
[warning] new Date() without arguments returns the current time, which differs between server render and client hydration
-> Pass the current date from the loader to ensure server and client use the same value
1 error, 1 warning
Commands
rr [FILES...]
rr --check links,forms
rr --check all
rr --check defaults,drizzle
rr --format json
rr --root ./my-app
rr sql --drizzle
rr sql --drizzle --format json
Available checks
Default checks (run automatically):
- links - validates
<Link>, <NavLink>, redirect(), navigate(), and href props on any component exist as routes
- forms - validates Form action targets, field alignment between forms and actions, intent-based dispatch
- loader - detects loader data usage issues and
clientLoader/clientAction with server-only imports
- params - validates route params match definitions
- interactivity - detects disconnected dialogs ("Save" buttons that don't save, "Delete" buttons that don't delete, stub handlers)
- hydration - detects hydration mismatches (Date, Math.random, locale-dependent formatting, window access in render)
Optional checks (opt-in via --check):
- drizzle - validates database operations against Drizzle ORM schema (unknown tables/columns, missing required columns, null-to-notNull, invalid enum literals, type mismatches, auto-generated column writes, DELETE/UPDATE without WHERE,
sql<number> with aggregates)
Examples
rr app/routes/dashboard.tsx --check links
rr --fix
rr --format json
rr --check drizzle
rr --check drizzle --drizzle-schema src/db/schema.ts
rr sql --drizzle
rr sql --drizzle app/routes/users.tsx
rr sql --drizzle --format json