Communitygithub.com

YepAPI/skills

CRUD 生成器、資料表格、使用者管理、角色權限控管與批次操作。

skills 是什麼?

此技能提供一個完整的後台管理面板解決方案,專為需要快速建立 CRUD 介面的開發者設計。它內建了伺服器端分頁、排序與篩選的資料表格規則,支援角色基礎存取控制(RBAC),並包含使用者管理與稽核日誌功能。技能支援批次操作(如批次刪除、匯出與狀態變更),並強調所有權限檢查必須在伺服器端執行,以確保安全性。此技能適用於 Claude Code 等 AI 助理平台,適合用於生成具一致佈局與安全機制的管理後台。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/admin-panel

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

管理後台

規則

  • 資料表格:伺服器端分頁、排序與篩選 — 絕不在客戶端載入所有資料列 — 使用 ?page=1&limit=25&sort=createdAt&order=desc
  • CRUD 模式:列表(表格)、建立(表單/對話框)、檢視(詳細檢視)、更新(編輯表單)、刪除(確認對話框)— 所有資源採用一致的版面配置
  • 角色基礎存取控制:定義角色(admin、editor、viewer)搭配權限矩陣 — 在每個 API 路由的伺服器端檢查權限,而不僅是 UI
  • 批次操作:選取多個資料列、批次動作(刪除、匯出、狀態變更)— 對破壞性動作進行確認,大量批次則在背景處理
  • 搜尋:針對關鍵欄位進行防抖文字搜尋(300 毫秒)— 結合欄位篩選器進行精確查詢
  • 使用者管理:列出使用者、檢視詳細資料、變更角色、停用/啟用帳號、模擬登入(僅限管理員並記錄稽核日誌)
  • 稽核日誌:記錄誰在何時變更了什麼 — { 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.

相關技能