remix-v2-forms
Remix v2 form submissions and mutations. Use when implementing forms, optimistic UI, file uploads, or multi-action routes. Triggers on <Form>, useFetcher, useSubmit, useNavigation for pending state, unstable_parseMultipartFormData, fetcher.formData, intent-based actions, encType multipart.
What this skill does
# Remix v2 Forms & Mutations
Canonical mutation primitives for the `@remix-run/react@^2` route-module
framework. A correct Remix v2 mutation is: a `<Form method="post">` (or
`<fetcher.Form>`), an `action` that parses `request.formData()` and returns
either `redirect(...)` or `json(...)`, and UI that reads `useActionData()`
(or `fetcher.data`) for errors plus `useNavigation()` (or `fetcher.state`)
for pending state. Anything that bypasses this loop — `fetch()`, raw
`<form>`, `e.preventDefault()` + client state — silently sacrifices
revalidation, progressive enhancement, and race-safe transitions.
## Quick Reference
**`<Form>` + action**:
```tsx
import { json, redirect, type ActionFunctionArgs } from "@remix-run/node";
import { Form, useActionData, useNavigation } from "@remix-run/react";
export async function action({ request }: ActionFunctionArgs) {
const form = await request.formData();
const email = String(form.get("email") ?? "");
if (!email.includes("@")) return json({ errors: { email: "Invalid" } }, { status: 400 });
await createUser({ email });
return redirect("/dashboard");
}
export default function Signup() {
const actionData = useActionData<typeof action>();
const nav = useNavigation();
const busy = nav.state !== "idle" && nav.formAction === "/signup";
return (
<Form method="post" replace>
<input name="email" type="email" />
{actionData?.errors?.email ? <em>{actionData.errors.email}</em> : null}
<button disabled={busy}>{busy ? "Signing up..." : "Sign Up"}</button>
</Form>
);
}
```
## Primitives
| Name | Purpose |
|---|---|
| `<Form>` from `@remix-run/react` | Navigating, progressively-enhanced form that posts to a route `action` and triggers full-page revalidation |
| `<Form navigate={false}>` | Shorthand for "post via fetcher; do not navigate." Equivalent to `<fetcher.Form>` without holding a fetcher ref — useful when you only need pending state, not a programmatic handle |
| `useFetcher()` | Non-navigating submission channel for inline mutations, list rows, popovers — same revalidation, no URL change |
| `useFetchers()` | **Read-only** array of all in-flight fetcher states across the app. Use for global pending indicators (top-bar loader) without prop drilling. No `Form`/`submit`/`load` methods on the returned items — just `formData`, `state`, etc. |
| `useNavigation()` | Observes page-level navigation; the source of truth for `<Form>` pending state |
| `useSubmit()` | Programmatic submission (onChange autosave, keyboard shortcuts). Accepts `HTMLFormElement`, `FormData`, plain object (form-encoded), or plain object encoded as JSON via `{ encType: "application/json" }` |
| `useActionData<typeof action>()` | Read the most recent action result for the current route |
State transitions:
- `useNavigation().state`: `idle → submitting → loading → idle` for non-GET
form submissions; `idle → loading → idle` for GET navigation.
- `useFetcher().state`: `idle → submitting → loading → idle`.
**Asymmetry:** `useNavigation` skips `submitting` for GET navigations; `useFetcher` does NOT — only `fetcher.load()` skips it. `<fetcher.Form method='get'>` and `fetcher.submit(..., {method:'get'})` both transition through `submitting`.
## Key Patterns
### `<Form>` for navigation, `useFetcher` for in-place
`<Form>` changes the URL, adds history, and revalidates all loaders.
`useFetcher` does the same revalidation but stays on the current URL.
Each `useFetcher()` call returns an independent submission channel, so
two rows submitting at once do not share pending state.
### Intent pattern for multiple actions on one route
One `action`, switch on `formData.get("intent")`, distinct
`<button name="intent" value="...">` per operation. Only the clicked
submit button's `name=value` lands in the body. See
[references/intent-actions.md](references/intent-actions.md).
### Optimistic UI from `formData`
`fetcher.formData` and `navigation.formData` are populated synchronously
on submit and cleared at `idle`. Read directly each render; never mirror
into local React state. See
[references/optimistic-ui.md](references/optimistic-ui.md).
### File uploads need `encType="multipart/form-data"`
Without it, `request.formData()` strips file data and you get the
filename string instead of a `File`. Parse with
`unstable_parseMultipartFormData` and a bounded upload handler. The
`unstable_` prefix is permanent in v2. See
[references/uploads.md](references/uploads.md).
## Gates (decision sequencing)
Answer **in order**. **Pass** means the condition is true; pick the API
on the same line and **stop**.
### `<Form>` vs `useFetcher`
1. **Does the URL need to change after the mutation** (creating a record
and routing to `/records/:id`, deleting and going back to a list,
multi-step flow)?
- **Pass →** `<Form method="post">` + `redirect(...)` from the action. **Stop.**
- **Fail →** Step 2.
2. **Is this a mutation against a row, cell, toggle, or sub-section while
the user stays on the same page** (favorite, like, increment quantity,
inline edit)?
- **Pass →** `useFetcher()` with `<fetcher.Form>`. **Stop.**
- **Fail →** Step 3.
3. **Is this loading data outside of normal navigation** (popover content,
combobox results, prefetch)?
- **Pass →** `fetcher.load(href)`. **Stop.**
- **Fail →** Default to `<Form>`. Navigation is the conservative
choice — revalidation and history work out of the box.
Hard rule: never reach for `fetch()` or `axios` for in-app mutations
against your own Remix routes. That bypasses the action lifecycle and
skips loader revalidation.
### `useNavigation` vs `useFetcher.state` for pending state
1. **Is the pending indicator global** (page spinner in root, top-bar
loading bar)?
- **Pass →** `useNavigation()` in `root.tsx`
(`navigation.state !== "idle"`). **Stop.**
- **Fail →** Step 2.
2. **Was the mutation made with `useFetcher`?**
- **Pass →** Use that fetcher's `fetcher.state`. `useNavigation()`
will NOT reflect fetcher activity. **Stop.**
- **Fail →** Step 3.
3. **Is the indicator scoped to one row/button inside a list where each
row has its own fetcher?**
- **Pass →** Use the per-row `fetcher.state` (or look up by key via
`useFetchers()`) so other rows do not flicker. **Stop.**
- **Fail →** Step 4.
4. **Is the indicator scoped to the form just submitted via `<Form>`?**
- **Pass →** `useNavigation()` AND check
`navigation.formAction === "/expected-path"` so unrelated navigations
don't trigger your local spinner. **Stop.**
- **Fail →** Step 5.
5. **Need to render an optimistic value?**
- **Pass →** Read `navigation.formData?.get("field")` (page form) or
`fetcher.formData?.get("field")` (fetcher) — both are populated
while `state !== "idle"`. **Stop.**
## Additional Documentation
- **`<Form>` component**: See [references/form.md](references/form.md) for
`<Form>` vs native `<form>` vs `fetch()`, progressive enhancement,
redirect-after-success, and validation error display via `useActionData`.
- **`useFetcher`**: See [references/fetcher.md](references/fetcher.md) for
inline mutations, list operations, popovers, `fetcher.state`,
`fetcher.data`, `fetcher.Form`, `fetcher.submit`, `fetcher.load`.
- **Optimistic UI**: See
[references/optimistic-ui.md](references/optimistic-ui.md) for
`fetcher.formData` and `useNavigation.formData`, when to apply, and
reverting on failure.
- **File uploads**: See [references/uploads.md](references/uploads.md)
for `unstable_parseMultipartFormData`,
`unstable_createMemoryUploadHandler`,
`unstable_createFileUploadHandler`, and bounded handlers.
- **Intent-based actions**: See
[references/intent-actions.md](references/intent-actions.md) for
multiple actions on one route via the FormData `intent` field.
## Comparison
| Concern | `<Form>` | `useFetcher` | Native `<form>` | `fetch()` |
|---|---|---|---|---|
| URL change / history entry | Yes | No | Yes (hardRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.