Communitygithub.com

YepAPI/skills

資料庫設計規範:綱要正規化、索引策略與遷移模式。

skills 是什麼?

此技能提供一套完整的資料庫設計準則,涵蓋從綱要設計、索引策略到資料遷移與備份的最佳實踐。它預設要求遵循第三正規化(3NF),僅在經由實際效能測試後才允許去正規化。索引方面,除了主鍵自動建立外,還需為外鍵及經常篩選或排序的欄位手動建立索引;所有遷移腳本必須納入版本控制,包含向上(up)與向下(down)操作,並使用描述性命名。此外,針對不同情境提供明確指引:使用者相關記錄採用軟刪除(`deletedAt`),短暫的暫存資料則使用硬刪除;公開 ID 使用 UUID,內部關聯則使用自動遞增整數。技能亦涵蓋 Serverless 環境的連線池配置(如 PgBouncer、Prisma Accelerate、Supabase pooler)、自動化每日備份與還原測試,以及查詢最佳化(使用 `EXPLAIN ANALYZE`、避免 `SELECT *`)。此技能適用於任何使用關聯式資料庫的開發環境,如 Node.js、Python 或 Go 專案,能幫助團隊建立一致且高效能的資料層。

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

在你喜歡的 AI 中提問

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

說明文件

資料庫設計

規則

  • 預設正規化至 3NF — 僅在經由實際效能測量後才進行去正規化
  • 索引策略:主鍵(自動建立)、外鍵、經常進行篩選或排序的欄位
  • 遷移:納入版本控制、包含 up + down 操作、使用描述性命名
  • 開發用的種子資料 — 使用真實的測試資料,而非 foo/bar
  • 使用者相關記錄使用軟刪除(deletedAt)— 真正短暫的資料則使用硬刪除
  • 公開 ID 使用 UUID — 內部關聯則使用自動遞增整數
  • 使用連線池以支援 Serverless — PgBouncer、Prisma Accelerate 或 Supabase pooler
  • 備份策略:每日自動備份,並測試還原流程
  • 查詢最佳化:使用 EXPLAIN ANALYZE、避免使用 SELECT *、指定特定欄位

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

CRUD generators, data tables, user management, role-based access, and bulk operations.

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

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

相關技能