Skip to content
cccskills
FreePublished on GitHub

React Router Action Contract Review

Checks React Router v7 action conventions: validation errors returned as data with 4xx status (not thrown), redirect on success, and 3-branch ErrorBoundary handling.

The English summary is being prepared. Showing the original description.

See how to install

Files included (4)

  • SKILL.md3.6 KB
  • fixtures/01-thrown-validation-happy.md998 B
  • fixtures/02-intentional-404-guard.md946 B
  • golden/01-thrown-validation-happy.md792 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: action のエラー契約と ErrorBoundary 分岐をチェックリスト型で検査する

Goal / 目的

  • バリデーション失敗が ErrorBoundary へ throw され、フォームのインラインエラー表示と自動 revalidation の制御が壊れるのを防ぐ。
  • action 成功時の redirect() 欠落による再送信問題、エラー返却時のステータス不備(2xx のまま)を検出する。

Non-goals / 扱わないこと

  • loader / data loading の規約(react-router-loader-boundary のスコープ)。
  • Form と fetcher のどちらを使うべきかの UX 判断(要件依存のため一律指摘しない。質問に留める)。
  • バリデーションライブラリの選定。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。

  • 差分に action / clientAction の追加・変更、または ErrorBoundary の変更が含まれている
  • diff コンテキストが利用可能である

ゲート不成立時の出力: NO_REVIEW: react-router-action-contract — action / ErrorBoundary の変更なし

False-positive guards / 抑制条件

  • throw data("Not Found", { status: 404 }) 等、リソース不在・認可エラーの 意図的な throw は公式に許可された規約であり指摘しない(バリデーション失敗の throw と区別する)。
  • React Router 管理外の外部 API へ直接 POST する設計が要件上正当な場合は指摘しない。
  • 成功時に同一ページへ結果を表示する設計(redirect しない)が意図的な場合は質問に留める。

Rule / ルール

  • 期待されるバリデーション失敗は return data({ errors }, { status: 400 }) で返す(throw しない。2xx のままだと不要な revalidation が走る点も確認)。
  • 成功時は redirect() で再送信問題を防ぐ。
  • ErrorBoundary は isRouteErrorResponse(error) / error instanceof Error / その他 の 3 分岐で処理し、error.message への直接アクセスを避ける。
  • 独立して失敗してよい UI 単位にはルート単位の ErrorBoundary を検討する(root のみでも最低限は満たすため、強制はしない)。

Evidence / 根拠の取り方

  • 指摘は <file>:<line> で差分に紐づけ、公式規約(form-validation / error-boundary)を 1 行で添える。

Output / 出力(短文版の推奨)

コメントは日本語で返す。

  • Finding: どの契約に反しているか(1文)
  • Impact: インラインエラー不能 / 再送信 / 不要 revalidation 等
  • Fix: data({errors}, {status: 400}) / redirect() / 3 分岐の最小修正案

Sources / 出典

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What this skill does>

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

画像・ボタン・フォーム要素に適切なアクセシブルネームがあるか確認する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

Ensure ADRs capture context, decision, alternatives, tradeoffs, and follow-ups in a way that prevents future drift.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

敵対的分析手法を統合したレビューの entry skill。認知バイアス対策の3手法 (Pre-mortem / War Game / Logic Torturing)と、宣言・主張と実態の乖離を突く claim-vs-actual 検出3パターン(Self-Contradiction / Refactor-Claim Audit / Cross-File Leakage)へルーティングし、通常のレビューでは見えない設計の盲点・ 防御の穴・論理の弱点・宣言と実装のズレを可視化する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

Review changes to the Agent Skills import/export bridge for path safety, round-trip fidelity, and validation correctness.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

Checks whether AI-assisted work defines review criteria, accessible context, explicit review loop, human judgment boundary, and feedback capture before delegating to an agent.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 22, 2026

See all skills by s977043

Report a problem with this skill