error-pages
Create custom 404 and 500 error pages with brand styling. Use at project end before release. Triggers on "404", "error pages", "not found", "500 error".
When & Why to Use This Skill
This Claude skill automates the creation of professional, branded 404 (Not Found) and 500 (Internal Server Error) pages specifically for Next.js applications. It streamlines the final stages of web development by generating boilerplate code that integrates brand-consistent styling and internationalization (i18n) support, ensuring a polished and user-friendly experience even when errors occur.
Use Cases
- Project Finalization: Quickly generate and deploy custom error pages before a production release to replace generic browser defaults.
- Brand Identity Maintenance: Automatically apply global CSS styles and brand themes to error states to maintain visual consistency across the entire site.
- Global Localization: Implement multilingual error messages using the provided i18n structure to support international users.
- UX Optimization: Improve user retention by providing clear 'Return to Home' or 'Retry' actions on error pages, preventing dead ends for visitors.
| name | error-pages |
|---|---|
| description | Create custom 404 and 500 error pages with brand styling. Use at project end before release. Triggers on "404", "error pages", "not found", "500 error". |
Error Pages
Create branded 404 and 500 error pages.
Workflow
- Create app/not-found.tsx (404)
- Create app/error.tsx (500)
- Match brand styling from globals.css
- Add i18n support
404 Page (not-found.tsx)
Create at app/not-found.tsx:
import Link from 'next/link'
export default function NotFound() {
return (
<div className="min-h-svh flex items-center justify-center bg-background">
<div className="container text-center">
<h1 className="mb-4">404</h1>
<p className="text-muted-foreground mb-8">
Diese Seite wurde nicht gefunden.
</p>
<Link href="/" className="btn btn-primary">
Zurück zur Startseite
</Link>
</div>
</div>
)
}
500 Page (error.tsx)
Create at app/error.tsx:
'use client'
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
return (
<div className="min-h-svh flex items-center justify-center bg-background">
<div className="container text-center">
<h1 className="mb-4">Fehler</h1>
<p className="text-muted-foreground mb-8">
Ein unerwarteter Fehler ist aufgetreten.
</p>
<button onClick={reset} className="btn btn-primary">
Erneut versuchen
</button>
</div>
</div>
)
}
i18n Support
Add to messages/de.json and messages/en.json:
{
"error": {
"404": {
"title": "404",
"message": "Diese Seite wurde nicht gefunden.",
"cta": "Zurück zur Startseite"
},
"500": {
"title": "Fehler",
"message": "Ein unerwarteter Fehler ist aufgetreten.",
"cta": "Erneut versuchen"
}
}
}
Checklist
- app/not-found.tsx created
- app/error.tsx created
- Brand styling applied
- i18n text added
- 404 page tested (visit /nonexistent-page)