
PostgreSQL Table Design
Guides an agent through PostgreSQL schema design: column types, keys, constraints, indexes and partitioning.
- Repository
- wshobson/agents
- Stars
- 42,095
- Licence
- MIT
- Files
- 2 files
What it does
When installed, the agent follows a set of PostgreSQL-specific schema best practices when you ask it to design or review database tables. It recommends suitable data types (for example TIMESTAMPTZ for times, NUMERIC for money), flags missing primary keys, foreign key indexes and NOT NULL constraints, and suggests indexing, partitioning and JSONB approaches. For deeper material such as the full type catalogue, workload patterns and worked DDL, it reads a companion reference file.
Great for
- Developers designing a new PostgreSQL schema before it goes into production
- Engineers reviewing an existing schema for common mistakes such as missing foreign-key indexes or risky types
- Teams planning a schema change on a live database who want guidance on avoiding downtime
Skip it if
- Non-PostgreSQL databases (MySQL, SQL Server, etc.), since the rules are PostgreSQL-specific and may mislead
- Production-critical decisions made without testing: the guidance is general rules of thumb, and performance claims such as the 100M-row partitioning threshold should be verified against your own workload
Try asking
- “Review this CREATE TABLE statement for PostgreSQL best practices and suggest indexes.”
- “Design a PostgreSQL schema for an orders and customers system with proper constraints.”
- “Should I partition my events table by created_at in PostgreSQL? It has about 300 million rows.”
- “Help me store semi-structured product attributes in PostgreSQL using JSONB with the right indexes.”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 2 original files, the MIT licence and an attribution note.
postgresql-table-design.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip postgresql-table-design.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip postgresql-table-design.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- State your PostgreSQL version up front, since some advice (UNIQUE NULLS NOT DISTINCT, uuidv7()) depends on PG15 or PG18+.
- Paste your actual DDL and typical queries so the agent can check indexes against real access paths rather than generic rules.
- Ask the agent to explain each recommendation, then verify index and partition choices with EXPLAIN ANALYZE on realistic data.
What's inside
- references/details.md
- SKILL.md
Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.