claude/skills/react-router-v7-mastery/SKILL.md
React Router v7のモダンな開発手法を提供するスキル。ファイルベースルーティング(auto-routes)、機能的凝集とコロケーション、Hono統合(Cloudflare Workers)、型安全なパターンマッチング等のベストプラクティスを含む。
npx skillsauth add kazuph/dotfiles react-router-v7-masteryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
React Router v7のモダンな開発手法とベストプラクティスを提供するスキル。
単一の明確な役割に集中したモジュール設計により、変更耐性と保守性を向上させる。
関連コードを同じ場所に配置し、人為的な関心の分離を排除する。
ファイル構造がルート定義を自動的に決定し、ゼロコンフィグで動作する。
Hono をサーバーエントリーポイントとし、API は Hono、UI は React Router で処理するハイブリッド構成。 詳細は references/with-hono.md を参照。
server/index.ts で Hono インスタンスを作成。/api/* は Hono の app.route() で処理。* を React Router の createRequestHandler に委譲。AppLoadContext を通じて Cloudflare Bindings (env, cf, ctx) を Loader/Action に注入。// server/index.ts
import { Hono } from "hono";
import { createRequestHandler } from "react-router";
const app = new Hono();
app.route("/api", apiRoutes); // APIはHonoで
app.all("*", (c) => requestHandler(c.req.raw, getLoadContext(c))); // UIはReact Routerで
export default app;
詳細は references/auto-routes-guide.md を参照。
// app/routes.ts
import { autoRoutes } from 'react-router-auto-routes'
export default autoRoutes({
routesDir: 'routes',
routeRegex: /\.(ts|tsx|js|jsx)$/,
})
同じリソースでもロールによって責務が異なる場合は、ルートを分離する(例: _buyer+/products vs _seller+/products)。
+ で始まるファイル・フォルダはルート処理から除外され、ヘルパーやテストを共存させられる。
routes/
├── dashboard/
│ ├── route.tsx → /dashboard
│ ├── +helpers.ts # 除外
│ └── +components/ # 除外
ルート分岐できない場合、ts-pattern で各ケースを独立させる。
app/routes/
├── _buyer+/ # 購入者向け
├── _seller+/ # 出品者向け
└── _shared/ # 共有コンポーネント
tools
X (Twitter) API read-only CLI. Bookmarks retrieval, tweet search, engagement analytics (likes/RT aggregation), mentions, user lookup. Use when: reading X bookmarks, searching tweets, aggregating likes/retweets, checking mentions, looking up users. Triggers: bookmark, bookmarks, X search, Twitter search, likes count, RT count, engagement, tweet analytics.
testing
単体テスト方針の要約。Kiro流で使うときは本文を必ず参照・展開する。
tools
Send prompts to other AI CLIs (Codex, Claude Code) running in sibling tmux panes and receive results back. Use this skill when the user asks to send a question or task to Codex or another Claude Code instance in a tmux pane. Handles pane discovery, CLI startup if needed, prompt delivery with proper Enter timing, delivery verification, and result return via tmux send-keys.
data-ai
TAKT ピースエンジン。Agent Team を使ったマルチエージェントオーケストレーション。ピースYAMLワークフローに従ってマルチエージェントを実行する。