What problem does it solve?
Client view-state (tabs, filters, search, sort, pagination, selected entities) often ends up managed inconsistently — read manually via useSearchParams, mutated with hand-built query strings, duplicated into stores, or trapped in local useState — breaking shareability and creating sync bugs. This Skill audits a scope of code for these anti-patterns and optionally applies fixes.
Core Features & Use Cases
- Anti-pattern detection: Finds manual useSearchParams reads, hand-built query mutations, history.replaceState misuse, URL state mirrored into stores, objects serialized into the URL, and missing Suspense boundaries.
- Convention-driven fixes: Migrates state to nuqs useQueryState/useQueryStates backed by a co-located search-params.ts, wiring sort via createSortParams + useUrlSort and debounced search via useDebouncedSearchSetter.
- Decision framework: Routes each piece of state to the correct home — URL for shareable view-state, React Query for remote data, Zustand for high-frequency/socket-synced state, useState for purely local UI.
- Use Case: Point it at a PR diff or a directory like app/workspace/[workspaceId]/tables/ to audit URL-state usage and automatically refactor violations before merge.
Quick Start
Ask the assistant to analyze the current diff for URL-state anti-patterns and apply fixes using the you-might-not-need-url-state skill.