error-loading-not-found
Installation
SKILL.md
Instructions
When to Use
- Use for
error.tsx,not-found,loading,global-errorUX. - Prefer
next-server-patternsfor data/error boundary placement. - Prefer
observability-handbookfor logging inside error UI.
Design App Router UX for failures and slow routes: error.tsx, not-found, loading.tsx, global-error.tsx.
error.tsx: client boundary - must reset viareset()pattern; log server-side in Route Handlers or server actions, not onlyconsole.errorin production without a sink.not-found: usenotFound()from server code; ensure marketing URLs return 404 not 200 empty shell.loading.tsx: skeletons that match final layout dimensions to reduce CLS; avoid fake progress bars unless truthful.global-error.tsx: minimal HTML shell when root layout throws; keep copy short and support link.- Nested layouts: errors bubble to nearest
error.tsx; document which segments need their own file vs inherited.
Outcomes
- File tree (
app/.../error.tsxetc.) + when each runs + logging hook suggestion.