‹ 首页

admin-crud-style

@quanxiaoxiao · 收录于 今天 · 上游提交 3 个月前

Enforce consistent CRUD admin page style using React + shadcn/ui + Tailwind + lucide-react. Covers layout, filters, tables, pagination, forms, and interaction patterns for management systems.

适合你,如果正在用React开发后台管理系统,需要一致的UI风格。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add quanxiaoxiao/quan-skills/admin-crud-style
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- quanxiaoxiao/quan-skills/admin-crud-style
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify quanxiaoxiao/quan-skills/admin-crud-style
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
0GitHub stars
~836最小装载
~836含声明引用
~902文本包总量
索引托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · f6f857f

Admin CRUD Style

Generate and review CRUD admin pages with a unified layout, interaction, and component standard.

Use This Skill

Use this skill when the task involves:

  • creating a new admin CRUD page (list + create + edit + delete)
  • reviewing an existing admin page for layout or interaction consistency
  • scaffolding filters, tables, form dialogs, or pagination for a management UI
  • ensuring shadcn/ui component usage follows the project baseline
When NOT to use

Do not use this skill when:

  • the task is a public-facing marketing or content page
  • the task is a dashboard with charts or analytics (no CRUD table)
  • the UI framework is not React + shadcn/ui + Tailwind
Pre-Read Order

Read the target repository first:

  1. README.md
  2. package.json
  3. existing admin pages for current patterns
  4. src/components/ui/ to check installed shadcn components

Then load bundled guidance from this skill pack:

  1. ../../checklists/admin-crud-style.checklist.md
  2. ../../prompts/admin-crud-scaffold.md
Workflow
  1. Identify the entity and its CRUD operations. Determine which fields are filterable, which are table columns, and which belong in the form.
  1. Ensure required shadcn/ui components are installed. Check for Card, Button, Input, Select, Table, Badge, Dialog, Drawer, AlertDialog, DropdownMenu, Skeleton, Label, Pagination, Tooltip.
  1. Apply the standard page structure. Every CRUD list page follows: PageHeader → FilterCard → TableCard (with Pagination) → FormDialog/Drawer.
  1. Implement interaction patterns consistently. Enter triggers search, reset clears filters and resets pagination, edit opens pre-populated dialog, delete requires AlertDialog confirmation.
  1. Split code into logical files. Page component, filter component, table component, form dialog component, and custom hooks for data fetching and mutations.
Implementation Rules
Technology Stack
  • React + Tailwind CSS + shadcn/ui + lucide-react
  • @tanstack/react-query for data fetching
  • Zod for form validation
  • sonner for toast notifications
Page Layout
PageContainer (p-6 space-y-6 bg-muted/30)
├─ PageHeader (title + primary action button)
├─ FilterCard (Card p-4, max 4 fields per row, gap-4)
├─ TableCard (Card p-4, Table + Pagination)
└─ FormDialog or FormDrawer
Component Rules
  • Filters and table in separate Cards
  • Dialog for simple forms, Drawer for complex multi-section forms
  • Delete via AlertDialog with destructive style
  • Badge for status columns
  • Icons from lucide-react only
  • Loading state: skeleton rows or overlay, never empty table
  • Empty state: clean message, no large illustrations
Styling
  • Spacing: gap-4, gap-6, p-4, p-6
  • Borders: border-muted
  • Corners: rounded-xl
  • Avoid excessive shadows or animations
File Structure
pages/<entity>/
├── index.tsx
├── components/
│   ├── <entity>-filters.tsx
│   ├── <entity>-table.tsx
│   └── <entity>-form-dialog.tsx
└── hooks/
    ├── use-<entity>-list.ts
    └── use-<entity>-form.ts
Hook Naming
use<Entity>List
use<Entity>Form
use<Entity>Filters
Verification

Before completing, verify:

  1. Page follows the standard layout structure
  2. All required shadcn components are installed
  3. Filters, table, form, and delete confirmation all present
  4. Interaction patterns match the spec (Enter search, reset, pre-populated edit, delete confirmation)
  5. Code is split into logical files, not monolithic
  6. Keyboard navigation and basic accessibility work
Output Contract

Return results in this order:

  1. Entity — what CRUD entity is being built
  2. Components — list of files created or modified
  3. shadcn Components — any newly installed components
  4. Verification — interaction and layout checks passed
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。