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…
от j4flmao★ 47 звёзд на GitHub
Установить frontend-remix-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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({
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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
Что делает скилл 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 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).
Как установить скилл frontend-remix-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-remix-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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…