frontend-remix-patterns
Use when the user asks about Remix form validation with Zod, optimistic UI with useFetcher, route error boundaries, meta/SEO exports, Cache-Control headers or…
by j4flmao★ 47 GitHub stars
Install frontend-remix-patterns in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Remix Patterns
Purpose
Apply production-grade patterns to Remix applications: server validation, error boundaries per route, SEO metadata, caching, optimistic UI, and PWA support.
Version Note (2026)
Remix v2 continues as React Router v7 framework mode: same loaders, actions, <Form>, useFetcher and nested routes, but imports come from react-router / @react-router/* instead of @remix-run/*, and json()/defer() are no longer needed (return plain objects). New projects start with npx create-react-router@latest; existing Remix v2 apps upgrade via the future flags and the official "Upgrading from Remix" guide. "Remix 3" is a separate, non-React framework and is not the upgrade path. Examples below use Remix v2 imports; map them as described when the project uses React Router v7.
Agent Protocol
Trigger
Exact user phrases: "Remix pattern", "Remix form validation", "Remix optimistic UI", "Remix error boundary", "Remix SEO", "Remix caching", "Remix PWA".
Input Context
Before activating, verify:
- Remix v2 (@remix-run/*) or React Router v7 framework-mode project and its routing structure.
- Whether Zod is already installed for validation.
- Existing meta/SEO setup.
- Target deployment platform for caching strategy.
Output Artifact
No file output. Produces code patterns for validation, error handling, SEO, caching, optimistic updates, and PWA.
Response Format
Code examples only. Show action/loader with validation, error boundary, meta export, cache headers.
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Form validation uses Zod schema in action, returns field errors as JSON.
- Client-side enhancement shows errors inline from useActionData.
- ErrorBoundary per route with root fallback.
- meta function per route with og, twitter, canonical.
- Cache-Control headers set on loader responses.
- Optimistic updates use useFetcher with local state + rollback.
- Service worker registered from public dir with offline fallback.
Max Response Length
Code: 15 lines per example. Unlimited patterns.
Component Architecture / Decision Trees
Architecture Options
| Approach | Trade-off | When to Use |
|---|---|---|
| Server-side validation only | Simpler, no JS needed for form to work | Basic forms, login, signup |
| Server + client validation with useActionData | Better UX, instant feedback | Forms with many fields |
| Optimistic UI with useFetcher | Instant feedback, rollback on error | Likes, stars, add to cart |
| Route ErrorBoundary | Scoped error handling | Per-route error recovery |
| Root ErrorBoundary | Global fallback | Unexpected errors, network failures |
| Meta per route | SEO per page | Blog posts, product pages |
| Resource route sitemap | Dynamic sitemap generation | Sites with dynamic content |
Decision Tree: Form Validation
Is the form simple (email + password)?
├── Yes -> Server validation with Zod
└── No (many fields, complex rules) ->
├── Server validation (required)
└── + Client enhancement with useActionData
Decision Tree: Optimistic UI
Does the mutation need instant feedback?
├── No -> Standard <Form> with pending state
└── Yes -> useFetcher + local state
├── Can you easily rollback? -> Optimistic update
└── Risk of race conditions? -> Use useFetcher data for confirmation
Decision Tree: Error Boundary Placement
Is this an expected error (404, 403)?
├── Yes -> throw Response in loader, use CatchBoundary (v1) or ErrorBoundary (v2)
└── No -> ErrorBoundary for unexpected errors
├── Route-level -> Scoped error recovery
└── Root-level -> Global fallback in root.tsx
Decision Tree: Caching Strategy
Is the data user-specific?
├── Yes -> private, no-store (never cache)
└── No -> Is it frequently updated?
├── Yes -> max-age=60, s-maxage=300
└── No -> max-age=3600, s-maxage=86400
Decision Tree: PWA vs Standard
Does the app need offline support?
├── No -> Skip service worker, standard web app
└── Yes -> Service worker with cache-first strategy
├── Full offline -> Cache all routes on first visit
└── Partial offline -> Cache static assets only
Component Design Patterns
Multi-Intent Action
export async function action({ request }: ActionFunctionArgs) {
const formData = await request.formData()
const intent = formData.get('intent')
switch (intent) {
case 'create': {
const result = createSchema.safeParse(Object.fromEntries(formData))
if (!result.success) return json({ errors: result.error.flatten().fieldErrors, intent }, { status: 400 })
await db.post.create({ data: result.data })
return redirect('/posts')
}
case 'delete': {
const id = formData.get('id')
await db.post.delete({
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- references/remix-data-patterns.md
- references/remix-error-boundaries.md
- references/remix-form-patterns.md
- references/remix-forms.md
- references/remix-optimistic-ui.md
- references/remix-routing.md
- references/remix-seo.md
- references/remix-validation.md
FAQ
What does the frontend-remix-patterns skill do?
Use when the user asks about Remix form validation with Zod, optimistic UI with useFetcher, route error boundaries, meta/SEO exports, Cache-Control headers or PWA support in Remix / React Router v7. Produces production patterns for an existing Remix app. Not for routing and deployment setup (use frontend-remix-architecture).
How do I install the frontend-remix-patterns skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the frontend-remix-patterns skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…