davila7 avatar

Postgres Schema Design

You're getting help designing PostgreSQL schemas through structured prompts. This comes from davila7's template collection, which has a solid 27.7K stars and 233 installs so far. There's no SKILL.md in the repo, so you're working with whatever prompt patterns they've set up for table design, relationships, indexes, and constraints. Useful when you're starting a new project or refactoring an existing schema and want Claude to guide you through normalization, data types, and foreign key decisions. It won't replace knowing Postgres, but it'll save you from forgetting the basics or making obvious mistakes with indexes.

skills.sh installs
248
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill postgres-schema-design --agent claude-code

Installs into .claude/skills of the current project.

Files

PostgreSQL Table Design

Core Rules

  • Define a PRIMARY KEY for reference tables (users, orders, etc.). Not always needed for time-series/event/log data. When used, prefer BIGINT GENERATED ALWAYS AS IDENTITY; use UUID only when global uniqueness/opacity is needed.
  • Normalize first (to 3NF) to eliminate data redundancy and update anomalies; denormalize only for measured, high-ROI reads where join performance is proven problematic. Premature denormalization creates maintenance burden.
  • Add NOT NULL everywhere it’s semantically required; use DEFAULTs for common values.
  • Create indexes for access paths you actually query: PK/unique (auto), FK columns (manual!), frequent filters/sorts, and join keys.
  • Prefer TIMESTAMPTZ for event time; NUMERIC for money; TEXT for strings; BIGINT for integer values, DOUBLE PRECISION for floats (or NUMERIC for exact decimal arithmetic).

PostgreSQL “Gotchas”

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Categories
Design & UI/UX, Databases
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1vudovn avatarmobile-designvudovn/antigravity-kitmobile design239skills.sh installs
2arco-design avatararco-designarco-design/arco-design-skillArco Design React UI component library reference (@arco-design/web-react). Use this skill whenever the user asks to build a page, create a UI, write frontend co229skills.sh installs
3easychen avataropc-business-model-designeasychen/opc-methodologyDesign a viable business model for a one-person company using Lean Canvas and a simplified Business Model Canvas. Use when Codex needs to explain the business-m226skills.sh installs
4thehotwireclub avatarhwc-ux-feedbackthehotwireclub/hotwire_club-skillsImplement cross-cutting Hotwire UX feedback patterns: loading states, busy indicators, progress bars, optimistic UI, render interception, and view/page transiti225skills.sh installs
5sickn33 avatarevent-store-designsickn33/antigravity-awesome-skillsevent store design219skills.sh installs
6qodex-ai avatarsystem-designqodex-ai/ai-agent-skillsDesign and architect software systems. Plans system components, interactions, and deployment patterns for scalability and maintainability.217skills.sh installs