Communitygithub.com

YepAPI/skills

CRUDジェネレーター、データテーブル、ユーザー管理、ロールベースアクセス、一括操作。

skills とは?

このスキルは、管理パネルを構築するための包括的なパターンとルールを提供します。サーバーサイドのページネーション、ソート、フィルタリングを備えたデータテーブル、一貫したCRUD操作のレイアウト、ロールベースのアクセス制御、一括操作、ユーザー管理、監査ログに焦点を当てています。主にClaude CodeやCursorなどのAIエージェントに適しており、開発者が管理インターフェースを効率的に実装できるよう支援します。このスキルは、TypeScriptの型安全なパーミッションチェックパターンとRESTful APIのパターンを定義し、クライアントサイドのみの権限チェックやブラウザでの全データ読み込みといったアンチパターンを回避するための具体的なガイドラインを提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/admin-panel

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

管理パネル

ルール

  • データテーブル: サーバーサイドのページネーション、ソート、フィルタリング — すべての行をクライアント側で読み込まない — ?page=1&limit=25&sort=createdAt&order=desc を使用
  • CRUDパターン: 一覧(テーブル)、作成(フォーム/モーダル)、詳細表示、更新(編集フォーム)、削除(確認ダイアログ) — すべてのリソースで一貫したレイアウト
  • ロールベースアクセス: ロール(admin, editor, viewer)を権限マトリックスで定義 — すべてのAPIルートでサーバーサイドの権限チェックを行い、UIだけで済ませない
  • 一括操作: 複数行を選択し、バッチアクション(削除、エクスポート、ステータス変更) — 破壊的な操作には確認を要求し、大量のバッチはバックグラウンドで処理
  • 検索: 主要フィールドに対するデバウンス付きテキスト検索(300ms) — カラムフィルターと組み合わせて正確なクエリを実行
  • ユーザー管理: ユーザー一覧、詳細表示、ロール変更、アカウントの無効化/有効化、なりすまし(監査ログ付きで管理者のみ)
  • 監査ログ: 誰がいつ何を変更したかを記録 — { userId, action, resource, resourceId, changes, timestamp }
  • レイアウト: サイドバーナビゲーション(折りたたみ可能)、パンくずリスト、アクションボタン付きページタイトル — レスポンシブだがデスクトップ最適化

権限チェックパターン

const PERMISSIONS = {
  admin: ["users:read", "users:write", "users:delete", "data:read", "data:write", "data:delete"],
  editor: ["data:read", "data:write"],
  viewer: ["data:read"],
} as const;

function can(role: string, permission: string): boolean {
  return PERMISSIONS[role]?.includes(permission) ?? false;
}

// ミドルウェア
if (!can(user.role, "users:write")) return Response.json({ error: "Forbidden" }, { status: 403 });

データテーブル API パターン

GET /api/admin/users?page=1&limit=25&sort=createdAt&order=desc&search=john&role=admin

戻り値: { data: [...], total: 150, page: 1, limit: 25, totalPages: 6 }

避けるべきこと

  • クライアントサイドのみの権限チェック — 常にサーバー側で強制すること
  • すべてのデータを読み込んでからブラウザでページネーションすること — サーバーサイドのページネーションを使用すること
  • 破壊的な操作に対する確認がないこと — 削除や一括操作は常に確認すること
  • 監査証跡の欠如 — 誰が何を変更したかを把握する必要があります

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Tenant isolation (row-level vs schema), subdomain routing, per-tenant config, and data partitioning.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

関連スキル