PlugWiki

postgresql-table-design skill: PostgreSQL schema rules for your coding agent

wshobson's skill that gives your agent clear PostgreSQL schema rules for keys, data types, constraints, indexes and partitioning.

Installs
28.3K
on skills.sh
Stars
42.1K
on GitHub
Files
1
besides SKILL.md
Updated
Oct 2026
last repo commit

postgresql-table-design is a rulebook for your agent. It loads when you design or review a PostgreSQL-specific schema: choosing column types, keys, constraints or indexes, deciding whether to partition a large table, or planning a change without downtime.

Its rules include BIGINT identity keys, TIMESTAMPTZ for time, NUMERIC for money, TEXT for strings, manual indexes on foreign keys, and no serial, money or timestamp without time zone. It bundles no scripts. A second file holds the full data-type catalog, workload patterns, extensions, JSONB indexing and worked examples.

Good for

  • Developers designing a new PostgreSQL schema who want sound defaults
  • Reviewers checking a schema before it ships
  • Teams planning schema changes on a live database

Install postgresql-table-design

Claude Code

  1. 1

    Copy this prompt.

    Install the postgresql-table-design skill in Claude Code. Run this command:
    
    npx skills add https://github.com/wshobson/agents --skill postgresql-table-design
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

Sections in SKILL.md

  1. When to Use
  2. Core Rules
  3. PostgreSQL Gotchas
  4. Data Types
  5. Types to avoid
  6. Constraints
  7. Indexing
  8. Partitioning
  9. Examples
  10. Going deeper

Key facts

Installs on skills.sh
28,276 as of 2026-11-02
Last repo commit
2026-10-30

What it includes

  • Primary keys, normalize to 3NF, NOT NULL, indexes, preferred types

    Prefer BIGINT identity keys, normalize first, add NOT NULL where required, index real access paths including foreign keys.

    Try: “Design a PostgreSQL schema for orders and customers using postgresql-table-design.”

    Read · Core rules

  • Identifier case, UNIQUE and NULLs, FK indexes, sequence gaps, MVCC

    Read · PostgreSQL gotchas

  • What to use, plus a table of types to avoid

    Avoid timestamp without time zone, char(n), varchar(n), money, timetz and serial; the skill lists the replacement for each.

    Read · Data types

  • PK, FK, UNIQUE (NULLS NOT DISTINCT), CHECK, EXCLUDE

    Read · Constraints

  • B-tree, composite, covering, partial, expression, GIN, GiST, BRIN

    Read · Indexing

  • RANGE, LIST, HASH for large tables; no table inheritance

    Read · Partitioning

  • users, orders and a JSONB profiles table as SQL

    Read · Examples

  • Type catalog, row-level security, workload patterns, extensions, JSONB

    Opened when needed. Covers update-heavy, insert-heavy and upsert design, safe schema evolution, generated columns, extensions such as pg_trgm and pgvector, and JSONB indexing.

    Read · references/details.md

From the official docs

Questions

What does the postgresql-table-design skill do?

It gives your agent PostgreSQL-specific rules for designing tables, choosing types, adding constraints and indexes, and partitioning. It is guidance for writing and reviewing schemas.

How do I install it in Claude Code, the Claude app or Codex?

Use the install box at the top of this page. The repo README also documents a skills-only install with the skills CLI or gh skill, which installs a skill without the plugin's agents, commands or hooks.

Does it need a database connection or API key?

No key or connection appears in SKILL.md or the details file, and it bundles no scripts. It tells your agent what SQL to write; it does not connect to a database itself.

Is it safe?

It only contains instructions and example SQL, but your agent may write DDL such as ALTER TABLE or DROP for you. Run generated migrations on a test database first, since the skill mentions index creation and column changes on live databases.

Which PostgreSQL versions does it assume?

Some advice names versions, for example NULLS NOT DISTINCT needs PG15+, uuidv7() needs PG18+, and foreign keys referencing partitioned tables need PG12+. Check the version you run.

Is it only for PostgreSQL?

Yes. The description says PostgreSQL-specific, and the rules lean on PostgreSQL behavior such as no auto-indexed foreign keys and heap storage.

Information

updated Nov 2, 2026

Repository
wshobson/agents
Folder
plugins/database-design/skills/postgresql-table-design

wshobson/agentsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. postgresql-table-design SKILL.md · github.com
  2. references/details.md · github.com
  3. wshobson/agents README · github.com
  4. skills.sh listing · skills.sh

Updated Nov 2, 2026.