← 返回 Skills 市场
anderskev

Remix V2 Forms Review

作者 Kevin Anderson · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ pending
48
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install remix-v2-forms-review
功能描述
Reviews Remix v2 form code for manual fetch() mutations, native <form> misuse, wrong useNavigation/useFetcher choice, missing pending state, unbounded upload...
使用说明 (SKILL.md)

Remix v2 Forms Code Review

See beagle-remix-v2:remix-v2-forms for canonical patterns. This skill flags violations; the sibling skill teaches the patterns.

Quick Reference

Issue Type Reference
Manual fetch(), native \x3Cform>, wrong \x3CForm> vs useFetcher choice references/form-vs-fetcher.md
useState loading flags, useNavigation for per-row, missing pending state references/pending-state.md
Unbounded memory uploads, missing encType, unvalidated FormData, mirrored optimistic state references/uploads-validation.md
Route sprawl instead of intent pattern, PUT/DELETE without PE fallback references/multi-action-routes.md

Review Checklist

  • In-app mutations use \x3CForm> or \x3Cfetcher.Form>, never fetch() / axios
  • \x3CForm> is imported from @remix-run/react (not native \x3Cform>) for POST mutations
  • useFetcher used when URL should NOT change (row toggle, inline edit)
  • \x3CForm> + redirect(...) used when URL SHOULD change (create, delete-then-list)
  • Pending state derived from useNavigation() or fetcher.state, never useState
  • Per-row pending uses per-row fetcher.state (not page-global useNavigation)
  • useNavigation() calls check navigation.formAction to scope to expected path
  • Optimistic UI reads fetcher.formData / navigation.formData directly (not mirrored)
  • Actions returning success redirect(...), returning json() only for errors / same-page
  • \x3CForm encType="multipart/form-data"> on every file-upload form
  • unstable_createMemoryUploadHandler always has maxPartSize; large files use disk/stream handler
  • FormData values are validated/coerced before reaching the DB (no form.get(x) as string)
  • Multiple mutations on one route use intent pattern, not separate routes
  • method="put|patch|delete" is documented as JS-only, or rewritten as POST + intent
  • nav.formMethod / fetcher.formMethod compared against UPPERCASE strings ("POST", "GET"); v2's v2_normalizeFormMethod default returns UPPERCASE — === "post" silently never matches.

Valid Patterns (Do NOT Flag)

These are correct Remix v2 usage and should not be reported:

  • \x3CForm> without action prop — posts to the current URL by convention; explicit action is optional.
  • GET \x3CForm> — legitimate for search/filter UIs; hits the loader with form fields as URL search params and does NOT call an action. Most "hygiene" rules (intent, redirect, encType) apply only to POST forms.
  • Multiple useFetcher() instances on one page — each call returns an independent submission channel; intentional for parallel mutations to different rows.
  • useSubmit() in an event handler — correct programmatic submission for autosave, keyboard shortcuts, or onChange triggers.
  • Reading fetcher.formData during a submission — intended; this is the canonical optimistic source.
  • useActionData data persisting after submission — known behavior; it returns the last action result until the next navigation or action.
  • navigate={false} on \x3CForm> — turns it into a fetcher form; equivalent to \x3Cfetcher.Form> without holding a fetcher ref.
  • unstable_ prefix on parseMultipartFormData / upload handlers — permanent in v2; do not flag as "unstable API".

Context-Sensitive Rules

Only flag these when the listed condition holds:

Issue Flag ONLY IF
Native \x3Cform> instead of \x3CForm> Method is POST and the route has an action — GET forms and external-URL forms are fine
Missing pending state The form is POST and there is no useNavigation() / fetcher.state read anywhere in the component
Action returns json({ ok: true }) after a create The route is a "/new" or creation surface — same-page edit forms legitimately return JSON
method="put" / "patch" / "delete" Progressive enhancement is in scope for the surface (public app) — admin/JS-only tools may opt out if documented
Unbounded unstable_createMemoryUploadHandler The upload accepts user-controlled files (not a fixed-size internal artifact)
Separate routes per mutation The mutations operate on the same resource with compatible auth — sibling resources with different rules are fine
useNavigation() without formAction filter The component contains other navigation surfaces (sidebar \x3CLink>, sibling forms) that would trigger false positives
Mirroring fetcher.formData into state The shadowed value drives a user-visible element (button label, count, toggle) — a local "is-editing" flag is unrelated

Hard gates (before writing findings)

Run these in order. Do not draft user-facing findings until every gate passes for the batch you are about to report.

  1. Location evidencePass: Each issue lists a repo path and either a line range or a short verbatim quote from the file you read (not from memory or diff-only guesswork). Name the route module, the component, and the action if one exists.

  2. Exemption checkPass: For each issue, you can state in one line why it is not covered by Valid Patterns (Do NOT Flag) and any matching row in Context-Sensitive Rules.

  3. Form-method checkPass: Before flagging missing intent, missing encType, missing redirect, or missing pending state, you have confirmed the form is method="post" (or put|patch|delete). GET forms are legitimate for search/filter and trigger loaders, not actions — applying POST-form rules to them is a false positive.

  4. ProtocolPass: You completed the Pre-Report Verification Checklist in review-verification-protocol for this review.

Additional Documentation

When to Load References

  • Reviewing forms that call fetch() / axios / native \x3Cform>, or choose between \x3CForm> and useFetcherform-vs-fetcher.md
  • Reviewing loading flags, spinners, disabled-button logic, per-row pending → pending-state.md
  • Reviewing file uploads, unstable_* handlers, FormData parsing, optimistic UI → uploads-validation.md
  • Reviewing routes with multiple mutations, intent fields, PUT/DELETE methods → multi-action-routes.md

Review Questions

  1. Does every in-app mutation flow through a route action (no manual fetch())?
  2. Is the \x3CForm> vs useFetcher choice driven by whether the URL should change?
  3. Is pending state derived from useNavigation() / fetcher.state (never useState)?
  4. Are per-row spinners wired to per-row fetcher.state (not page-global useNavigation)?
  5. Do file-upload forms set encType="multipart/form-data" and use bounded handlers?
  6. Are FormData values validated before reaching the DB?
  7. Do multiple mutations on one resource use the intent pattern, not separate routes?
  8. Do POST forms have at least one real submit button for progressive enhancement?

False-Positive Notes

  • A \x3CForm> rendering inside a non-route component is still tied to the nearest route's action — read the route file before flagging "missing action".
  • useActionData() returning data after a successful submission is expected behavior; the data persists until the next navigation. Only flag if a success banner is rendered unconditionally without a dismiss path.
  • Code that imports Form aliased (e.g. import { Form as RemixForm }) is still the Remix component — match on import source, not local name.

Before Submitting Findings

Complete Hard gates (especially gate 4), then report only issues that still pass the review-verification-protocol pre-report checks.

如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install remix-v2-forms-review
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /remix-v2-forms-review 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release for remix-v2-forms-review. - Provides an auditing checklist to review Remix v2 form/mutation code for common anti-patterns, intent-pattern violations, and missing state management. - Lists valid Remix v2 usage patterns to prevent false positives. - Documents context-sensitive and hard-gate review steps to ensure findings are accurate and actionable. - Includes quick references and links to in-depth documentation for form primitives, pending state management, file uploads, and multi-action routes. - Designed for use alongside canonical pattern documentation found in beagle-remix-v2:remix-v2-forms.
元数据
Slug remix-v2-forms-review
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Remix V2 Forms Review 是什么?

Reviews Remix v2 form code for manual fetch() mutations, native <form> misuse, wrong useNavigation/useFetcher choice, missing pending state, unbounded upload... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 48 次。

如何安装 Remix V2 Forms Review?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install remix-v2-forms-review」即可一键安装,无需额外配置。

Remix V2 Forms Review 是免费的吗?

是的,Remix V2 Forms Review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Remix V2 Forms Review 支持哪些平台?

Remix V2 Forms Review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Remix V2 Forms Review?

由 Kevin Anderson(@anderskev)开发并维护,当前版本 v1.0.0。

💬 留言讨论