Loading...
Loading...
Scaffolds URL-state filters for a Next.js page — typed `searchParams.ts` parser map and a `<Filters />` client component backed by `useQueryStates`. From a single JSON spec, generates four files in lockstep — client parser map, server loader/cache/serializer, client component, and Vitest test — all sharing the same parser definitions per the nuqs Standard Schema pattern. Trigger even when the user only says "add filters to /search" or "I need a typed query string for this page" — both are exactly this skill's job.
npx skill4agent add pproenca/dot-skills nuqs-scaffolderuseStatesearchParams.server.tsnuqs-codemod-runnerassets/templates/spec.template.jsonnamemoduleparamsconfig.json/*= ... =*/{
"name": "Search", // PascalCase — drives the exported symbol names
"module": "search", // kebab-case — drives file paths and the "module" folder
"params": {
"q": { "type": "string", "default": "" },
"page": { "type": "integer", "default": 1 },
"limit": { "type": "integer", "default": 10 },
"categories": { "type": "array-of-string-native", "default": [] },
"sort": { "type": "string-literal", "values": ["asc","desc"], "default": "asc" },
"minPrice": { "type": "float", "default": null },
"lastSeen": { "type": "iso-date", "default": null }
}
}type | Parser used | Notes |
|---|---|---|
| | |
| | |
| | |
| | |
| | Date-only |
| | Date + time |
| | ms since epoch |
| | Numeric value, hex URL form |
| | 0-based in code, 1-based in URL |
| | |
| | |
| | Requires |
| | Requires |
| | Generates a Zod schema stub; mark |
defaultnull.withDefault(...)| Template | Renders to (default) | Loaded when |
|---|---|---|
| | Always |
| | Always |
| | Always |
| | If |
| Anywhere — starter for the user | First-run prompt |
.template.templateconfig.json| Placeholder | Source | Example |
|---|---|---|
| | |
| camelCase form of | |
| | |
| Iterate | see template |
| Iterate | see template |
| Iterate | see template |
| Add | conditional |
| For | conditional |
/*= ... =*//*= =*/references/conventions.mdapp/config.json{
"lib_dir": "lib",
"components_dir": "components",
"generate_tests": true,
"test_runner": "vitest"
}AskUserQuestionnuqsnuqs-codemod-runnergotchas.md