postgresql · davila7 — Claude Code skill: what it does, how to install
Guides table schema design for PostgreSQL, emphasizing strict data types, indexing for foreign keys, and engine-specific storage nuances.
npx claude-code-templates@latest --skill database/postgresqlWhat postgresql does
This skill guides PostgreSQL schema modeling from first principles. It enforces third normal form before any read-oriented denormalization. For primary keys, it favors BIGINT GENERATED ALWAYS AS IDENTITY. It points users toward NUMERIC for currency, TIMESTAMPTZ for timestamps, and standard TEXT with length constraints instead of VARCHAR(n).
It highlights practical engine traps. PostgreSQL skips automatic index creation on foreign key columns, so you must add them manually. The guide details how UNIQUE treats NULL values, covers gaps in sequence counters, and explains heap storage behavior where row order mirrors insertion time. It also covers structured types like JSONB, arrays, ranges, and pgvector embeddings.
This skill does not apply to non-Postgres engines or query tuning that avoids schema modifications. Destructive production DDL requires verified rollbacks and staging migrations first.
What it helps with
- model normalized PostgreSQL schemas up to 3NF
- place manual indexes on foreign key columns
- select strict data types like
timestamptzandnumeric - define storage and GIN indexes for
jsonband arrays
Example prompts for the agent
- Design an e-commerce schema in PostgreSQL with orders, items, and customers
- Review this migration script and verify whether my foreign key columns need indexes
- Recommend the right Postgres data types and constraints for handling date ranges
How to install postgresql
1claude-code-templates
npx claude-code-templates@latest --skill database/postgresql2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill postgresql -a claude-code3Manually: put the files in place
~/.claude/skills/postgresql/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/postgresql/
Manually: put the files in place
.agents/skills/postgresql/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/postgresql/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates postgresql2Manually: put the files in place
.github/skills/postgresql/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/database/postgresqlManually: put the files in place
.devin/skills/postgresql/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about postgresql
How to install postgresql in Claude Code?
Run npx claude-code-templates@latest --skill database/postgresql or use the skills installer by running npx skills add davila7/claude-code-templates --skill postgresql -a claude-code.
What does the postgresql skill do?
It provides PostgreSQL table modeling guidance to Claude Code, covering schema normalization, data type selection, manual FK indexing, and engine pitfalls.
When should you avoid using this skill?
Skip it when targeting non-Postgres engines or when optimizing SQL queries without altering table structures.
Similar skills
All skills for Data and databases →postgresql by other authors comes first.