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.
npx skills add timescale/pg-aiguide --skill postgres -a claude-codeWhat 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_catalogand 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-code2Manually: put the files in place
~/.claude/skills/postgres/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/postgres/
1Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a codex2Manually: put the files in place
.agents/skills/postgres/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a cursor2Manually: put the files in place
.cursor/skills/postgres/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install timescale/pg-aiguide postgres2Manually: put the files in place
.github/skills/postgres/SKILL.md1Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a gemini-cli2Platform CLI
gemini skills install https://github.com/timescale/pg-aiguide --path skills/postgresManually: put the files in place
.devin/skills/postgres/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a opencodeClaude.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 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.