deep-linking
Installation
SKILL.md
Deep Linking
Covers the non-obvious parts of URL-driven state: which history method to use, how to avoid re-render loops, handling defaults without polluting the URL, and keeping multiple independent state slices in sync. Skips basic routing setup — assumes a router exists.
Discovery
Before writing anything, answer:
- What state belongs in the URL? Filters, pagination, selected tab, open modal, sort order — or all of these?
- Framework/router: React Router, Next.js (App Router or Pages), Vue Router, vanilla
historyAPI? - Shareable vs navigable: Should back-button step through filter changes, or only page navigations?
- Default values: Should defaults appear in the URL (
?page=1) or be omitted (cleaner, but requires careful hydration)? - Conflicts: Does any state also live in a store (Zustand, Redux)? URL must be the source of truth, not both.