Skip to main content
skill CX Codex

postgres · timescale — Claude Code skill for PostgreSQL work

A skill for PostgreSQL work: table design, indexing, pgvector, PostGIS, TimescaleDB and migrations. Useful when your agent writes SQL blind.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add timescale/pg-aiguide --skill postgres -a claude-code
Open on GitHub

What postgres does

The skill is split into separate references, and the agent loads the one that matches the task. For an existing database there is schema-exploration — read-only inspection of schemas, tables, views, routines, triggers, RLS and extensions through pg_catalog. Then design-postgres-tables covers data types, constraints, indexes, JSONB patterns and partitioning, while design-postgis-tables handles geometry versus geography, SRIDs and spatial indexing.

Search gets two references: pgvector-semantic-search on HNSW and IVFFlat indexes, halfvec storage, quantization and filtered search, and postgres-hybrid-text-search on combining BM25 with vector search through RRF. For TimescaleDB there is hypertable setup with compression and retention policies, a query set for scoring migration candidates, and a step-by-step migration guide. postgres-database-migration is the DDL lock reference with safe patterns, timeout strategies and rollback planning.

Tasks often span areas, so the agent can load several references at once. The skill does not connect to your database on its own: it hands the agent instructions and SQL patterns, and you wire up server access yourself. No PostgreSQL in the project means nothing to install.

What it helps with

  • understand an unfamiliar schema before changing it
  • pick data types and constraints for a new table
  • set up vector search over embeddings
  • combine keyword and semantic search in one query
  • convert a plain table into a TimescaleDB hypertable

Example prompts for the agent

  • Explore the database schema in pg_catalog and show how the orders tables relate
  • Design a table for embeddings with an HNSW index
  • Plan a migration of this table to a hypertable without locking it

How to install postgres

1Skills CLI (Vercel)

npx skills add timescale/pg-aiguide --skill postgres -a claude-code

2Manually: put the files in place

~/.claude/skills/postgres/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/postgres/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about postgres

How do I install postgres in Claude?

Run npx skills add timescale/pg-aiguide --skill postgres -a claude-code. The skill lands in ~/.claude/skills/postgres/SKILL.md.

What does the postgres skill do?

It gives the agent references on table design, indexing, pgvector, PostGIS, TimescaleDB and migrations, loaded per task.

Does the skill connect to my database?

No. It supplies instructions and SQL patterns; you configure PostgreSQL server access separately.

Source text

SKILL.md · Apache-2.0
---
name: postgres
description: |
  Use this skill for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations.

  **Trigger when user asks to:**
  - Explore an existing PostgreSQL database to understand its objects and relationships
  - Design or modify PostgreSQL tables, schemas, or data models
  - Choose data types, constraints, indexes, or partitioning strategies
  - Work with pgvector embeddings, semantic search, or RAG
  - Set up full-text search, hybrid search, or BM25 ranking
  - Use PostGIS for spatial/geographic data
  - Set up TimescaleDB hypertables for time-series data
  - Migrate tables to hypertables or evaluate migration candidates
  - Plan or execute safe schema migrations with zero downtime

  **Keywords:** PostgreSQL, Postgres, SQL, schema, table design, indexes, constraints, pgvector, PostGIS, TimescaleDB, hypertable, semantic search, hybrid search, BM25, time-series, migration
license: Apache-2.0
metadata:
  author: tigerdata
---

# PostgreSQL Expert Skills

This skill provides comprehensive PostgreSQL expertise through specialized references. Load the appropriate reference based on the task.

## Available References

### Existing Databases
- **[schema-exploration](references/schema-exploration/guide.md)** — Read-only, question-driven exploration of schemas, tables, views, routines, triggers, RLS, and extensions using `pg_catalog`. **Use to understand an existing database before designing changes or writing queries.**

### Table Design
- **[design-postgres-tables](references/design-postgres-tables.md)** — Data types, constraints, indexes, JSONB patterns, partitioning, and PostgreSQL best practices. **Use for any general table/schema design task.**
- **[design-postgis-tables](references/design-postgis-tables.md)** — PostGIS spatial table design: geometry vs geography types, SRIDs, spatial indexing, and location-based query patterns. **Use when the task involves geographic or spatial data.**

### Search
- **[pgvector-semantic-search](references/pgvector-semantic-search.md)** — Vector similarity search with pgvector: HNSW/IVFFlat indexes, halfvec storage, quantization, filtered search, and tuning. **Use for embeddings, RAG, or semantic search.**
- **[postgres-hybrid-text-search](references/postgres-hybrid-text-search.md)** — Hybrid search combining BM25 keyword search with pgvector semantic search using RRF. **Use when combining keyword and meaning-based search.**

### TimescaleDB
- **[setup-timescaledb-hypertables](references/setup-timescaledb-hypertables.md)** — Hypertable creation, compression, retention policies, continuous aggregates, and indexes. **Use when setting up TimescaleDB from scratch.**
- **[find-hypertable-candidates](references/find-hypertable-candidates.md)** — SQL queries to analyze existing tables and score them for hypertable conversion. **Use when evaluating which tables to migrate.**
- **[migrate-postgres-tables-to-hypertables](references/migrate-postgres-tables-to-hypertables.md)** — Step-by-step migration: partition column selection, in-place vs blue-green, validation. **Use when executing a migration.**

### Migrations
- **[postgres-database-migration](references/postgres-database-migration.md)** — DDL lock reference, safe migration patterns, timeout strategies, rollback planning, and fork-based testing. **Use when planning or executing schema changes on production databases.**

## How to Use

1. Identify which reference matches the user's task from the descriptions above.
2. Load the reference file to get detailed instructions and SQL patterns.
3. For tasks spanning multiple areas (e.g., "design a table with vector search"), load multiple references as needed.

© tigerdata · Apache-2.0 · timescale/pg-aiguide

Similar skills

All skills for Data and databases →

postgres by other authors comes first.

postgres sanjay3290 Runs safe read-only SQL queries against PostgreSQL databases. Helpful for inspecting schemas, running SELECT queries, and analyzing data without write risks. CX Codex +1 620installs postgres-best-practices neondatabase A skill that feeds your agent guidelines on Postgres schema design, indexing, query optimization, migrations and common pitfalls. Useful whenever it writes SQL or sets up a database. CX Codex +1 1,900installs grepai-storage-postgres yoanbernabeu Moves the GrepAI index onto PostgreSQL with pgvector so a team can share one index and large codebases stay searchable. CX Codex +1 553installs neon-postgres neondatabase This skill guides agents through Neon Postgres connections, schema changes, branching, and database checks. Use it when working with an existing schema or DATABASE_URL. CX Codex +1 281,100installs postgres-patterns affaan-m PostgreSQL best practice reference based on Supabase guidelines. Covers indexing patterns, data type choices, RLS policies, and slow query diagnosis. CX Codex +1 5,200installs supabase-postgres-best-practices official supabase A rule set for Postgres performance, maintained by Supabase. Useful when your agent writes queries, designs schemas or digs into a slow database. CX Codex GP ChatGPT 40installs oracle-to-postgres-migration-expert official Awesome Copilot Community Guides .NET solution migrations from Oracle to PostgreSQL. Helps rewrite data access code to Npgsql and translate PL/SQL procedures into PL/pgSQL. ★ 40,418repo stars

From the same set9

pgvector-semantic-search Configures AI agents to set up vector similarity search in PostgreSQL using pgvector. Helps store embeddings with halfvec, build HNSW indexes, and power RAG apps. CX Codex +1 938installs design-postgres-tables A reference skill for PostgreSQL table design: data types, indexes, constraints, JSONB and partitioning. Useful when your agent writes or edits a schema. CX Codex +1 613installs setup-timescaledb-hypertables Guides agents in designing TimescaleDB and Tiger Cloud hypertables for insert-heavy workloads. Helps configure chunk partitioning, columnstore compression, and sparse indexes. CX Codex +1 507installs find-hypertable-candidates Reads a PostgreSQL schema and ranks which tables are worth converting to TimescaleDB hypertables. Useful before a migration. CX Codex +1 391installs postgres-hybrid-text-search Teaches AI agents how to combine BM25 keyword matching with pgvector semantic retrieval using Reciprocal Rank Fusion in PostgreSQL. CX Codex +1 372installs migrate-postgres-tables-to-hypertables Plans the move of PostgreSQL tables to TimescaleDB hypertables: partition column, chunk interval, keys and compression. CX Codex +1 355installs design-postgis-tables A reference for designing PostGIS spatial tables: geometry types, coordinate systems, spatial indexes and query patterns. Useful when you are laying out a schema for location data. CX Codex +1 344installs pg-aiguide Gives your coding agent semantic search over the PostgreSQL, TimescaleDB and PostGIS manuals plus curated Postgres best-practice skills. CX Codex +1 ★ 1,874repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor