---
name: "nuqs-type-safe-search-params"
description: "Synchronize React state with URL query parameters with strict parser types and shallow routing."
metadata:
  author: "François Best"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "use nuqs search params nextjs"
  - "type safe url state nuqs"
  - "debounce query param nuqs"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# nuqs Type-Safe URL Search Parameters for Next.js

Implements nuqs (formerly next-usequerystate): parseAsString, parseAsInteger, parseAsArrayOf, parseAsJson, shallow navigation, debounced URL updates, and sharing state across components via URL.

## When to Invoke
Invoke this skill whenever you need to:
- use nuqs search params nextjs
- type safe url state nuqs
- debounce query param nuqs

## Execution SOP & Rules
1. Import parser: import { useQueryState, parseAsString, parseAsInteger } from 'nuqs'.
2. Initialize state: const [search, setSearch] = useQueryState('q', parseAsString.withDefault(''));
3. Configure shallow routing and history options: setSearch('val', { shallow: true, history: 'replace' }).
4. Wrap root layout with NuqsAdapter when using Next.js 15 App Router.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
