# url-state-patterns

The url-state-patterns Claude Code skill keeps React state in sync with URL query parameters using nuqs. It activates for shareable filters, search, and dialogs opened through a link.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 110 installs · ★ 23 repo stars
- Author: andrelandgraf
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/andrelandgraf/fullstackrecipes/tree/HEAD/skills/url-state-patterns/SKILL.md
- Updated: 2026-06-08
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/url-state-patterns

## What it does

The skill shows how to put React component state into query parameters with nuqs. For search and filters, it replaces `useState` with `useQueryState` and parsers for strings, booleans, and arrays. Setting a value to `null` removes its parameter; `.withDefault()` supplies a fallback without adding it to the URL.

Components that use `useSearchParams` need a `Suspense` boundary. The skill wraps an internal client component so consumers can use the public component directly. It applies the same structure to dialogs controlled by a URL parameter, whose state survives browser back and forward navigation. Complete the `URL State with nuqs` recipe first, and use the `nuqs` library.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add andrelandgraf/fullstackrecipes --skill url-state-patterns -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/url-state-patterns/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/url-state-patterns/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add andrelandgraf/fullstackrecipes --skill url-state-patterns -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/url-state-patterns/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add andrelandgraf/fullstackrecipes --skill url-state-patterns -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/url-state-patterns/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install andrelandgraf/fullstackrecipes skills/url-state-patterns
```

2. **Manually: put the files in place**
- File: `.github/skills/url-state-patterns/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add andrelandgraf/fullstackrecipes --skill url-state-patterns -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/andrelandgraf/fullstackrecipes --path skills/url-state-patterns
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/url-state-patterns/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add andrelandgraf/fullstackrecipes --skill url-state-patterns -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/andrelandgraf/fullstackrecipes/tree/HEAD/skills/url-state-patterns/SKILL.md

## When to use it
- keep a search field in sync with the URL
- store filters in query parameters
- remove cleared values from the address
- open a dialog from a shared link

## Example prompts
- Connect the React search field to a URL parameter with `nuqs`.
- Add tag and archived-item filters whose state lives in the URL.
- Build a delete dialog that opens from a link and closes on browser back.

## Similar
- [nuqs](https://affpapa.org/en/nevibecode/skills/nuqs.md) — skill · 2400 installs
- [nuqs-scaffolder](https://affpapa.org/en/nevibecode/skills/nuqs-scaffolder.md) — skill · 145 installs
- [react-state-management](https://affpapa.org/en/nevibecode/skills/react-state-management.md) — skill · 15286 installs
- [zustand-state-management](https://affpapa.org/en/nevibecode/skills/zustand-state-management.md) — skill · 1000 installs
- [state-management](https://affpapa.org/en/nevibecode/skills/state-management.md) — skill · 849 installs
- [legend-state-best-practices](https://affpapa.org/en/nevibecode/skills/legend-state-best-practices.md) — skill · 490 installs

From the same set: [andrelandgraf/fullstackrecipes](https://affpapa.org/en/nevibecode/by/andrelandgraf/fullstackrecipes.md) — 9 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
