nuqs
Originally frompproenca/dot-skills
SKILL.md
nuqs Best Practices
Type-safe URL query state management with nuqs 2.x. Contains rules across 8 categories, prioritized by impact.
Rule Categories
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Parser Configuration | CRITICAL | parser- |
| 2 | Adapter & Setup | CRITICAL | setup- |
| 3 | State Management | HIGH | state- |
| 4 | Server Integration | HIGH | server- |
| 5 | Performance | MEDIUM | perf- |
| 6 | History & Navigation | MEDIUM | history- |
| 7 | Debugging & Testing | LOW-MEDIUM | debug- |
| 8 | Advanced Patterns | LOW | advanced- |
Quick Reference
1. Parser Configuration (CRITICAL)
parser-typed— Use typed parsers for non-string valuesparser-with-default— Use withDefault for non-nullable stateparser-enum-literals— Use literal/enum parsers for constrained valuesparser-array-format— Choose correct array parser formatparser-json-validation— Validate JSON parser with Standard Schemaparser-date-format— Select appropriate date parserparser-index-offset— Use parseAsIndex for 1-based URL displayparser-hex-colors— Use parseAsHex for color valuesparser-custom— Create custom parsers for complex types
2. Adapter & Setup (CRITICAL)
setup-adapter— Wrap app with correct NuqsAdaptersetup-client-hooks— Add 'use client' for hookssetup-server-imports— Import server utilities from nuqs/serversetup-shared-parsers— Define shared parsers in a dedicated file
3. State Management (HIGH)
state-use-query-states— Use useQueryStates for related parametersstate-functional-updates— Use functional updates for derived statestate-clear-with-null— Clear URL parameters with nullstate-controlled-inputs— Handle controlled input value properlystate-avoid-derived— Avoid derived state from URL parametersstate-options-inheritance— Use withOptions for parser-level configstate-setter-return— Use setter return value for URL access
4. Server Integration (HIGH)
server-create-loader— Use createLoader for page-level server parsingserver-search-params-cache— Use createSearchParamsCache for nested RSC accessserver-shallow-false— Use shallow:false to trigger server re-rendersserver-use-transition— Integrate useTransition for loading statesserver-share-parsers— Share parsers between client and serverserver-next15-async— Handle async searchParams in Next.js 15+
5. Performance (MEDIUM)
perf-limit-url-updates— Throttle/debounce URL updatesperf-clear-on-default— Use clearOnDefault for clean URLsperf-avoid-rerender— Memoize components using URL stateperf-serialize-utility— Use createSerializer for link URLs
6. History & Navigation (MEDIUM)
history-push-navigation— Use history:push for navigation-like statehistory-replace-ephemeral— Use history:replace for ephemeral statehistory-scroll-behavior— Control scroll behavior on URL changeshistory-back-sync— Handle browser back/forward navigation
7. Debugging & Testing (LOW-MEDIUM)
debug-enable-logging— Enable debug logging for troubleshootingdebug-common-errors— Diagnose common nuqs errorsdebug-testing— Test components and hooks with URL state
8. Advanced Patterns (LOW)
advanced-url-keys— Use urlKeys for shorter URL param namesadvanced-eq-function— Implement eq function for object parsersadvanced-adapter-props— Configure NuqsAdapter global defaults and URL middlewareadvanced-standard-schema— Use createStandardSchemaV1 and inferParserTypeadvanced-optimistic-search-params— useOptimisticSearchParams for Remix/React Router
Weekly Installs
16
Repository
fellipeutaka/leonGitHub Stars
3
First Seen
Feb 18, 2026
Security Audits
Installed on
opencode16
github-copilot16
codex16
kimi-cli16
gemini-cli16
amp16