---
name: "remix-run-loader-action-routes"
description: "Eliminate client-side state fetching waterfalls with Remix loaders, actions, and optimistic forms."
metadata:
  author: "Remix"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write remix loader and action"
  - "optimistic mutation usefetcher remix"
  - "remix errorboundary"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Remix Run Loader & Action Fullstack Data Flow

Architects Remix (React Router v7) applications: loader functions for server data fetching, action functions for POST/PUT mutations, Form and useFetcher for optimistic mutations, and ErrorBoundary error handling.

## When to Invoke
Invoke this skill whenever you need to:
- write remix loader and action
- optimistic mutation usefetcher remix
- remix errorboundary

## Execution SOP & Rules
1. Export loader: export async function loader({ request, params }) { return json(await getPosts()); }.
2. Consume in component: const posts = useLoaderData<typeof loader>().
3. Export action: export async function action({ request }) { const form = await request.formData(); ... }.
4. Use <Form method='post'> for standard mutations or fetcher.Form for independent component widgets.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
