Communitygithub.com

YepAPI/skills

数据库设计技能:模式规范化、索引策略和迁移模式。

skills 是什么?

该技能专注于数据库设计的最佳实践,涵盖数据规范化、索引策略、迁移模式以及数据管理等多个方面。它为开发者提供了一套完整的规则集,帮助构建稳健、高效且易于维护的数据库架构。技能支持通过版本控制管理数据库迁移,确保变更可追溯、可回滚。同时,它强调使用软删除(deletedAt)处理用户相关记录,以保障数据安全性;而真正临时数据则采用硬删除。此外,技能还涉及连接池配置(如PgBouncer、Prisma Accelerate或Supabase Pooler)以及备份策略,确保数据库在无服务器环境下的性能和可靠性。它适用于任何需要数据库设计的项目中,可搭配Claude Code、Cursor、Codex等AI代码工具使用,帮助开发者快速生成符合规范的设计方案。

兼容平台~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——内部关系使用自增整数
  • 为无服务器环境配置连接池——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.

相关技能