Four times as many constraints and 55% more indexes: that is the gap TigerData, the company behind TimescaleDB, measures between the e-commerce schema Claude Code designs with and without pg-aiguide. It is the vendor's own demo, but the problem it targets is real: coding agents write SQL that runs and schemas that age badly. The postgres skill has 1,500 installs on skills.sh and the Apache 2.0 repo sits at around 1,900 stars; the latest change, on 12 November 2026, lets the model pull in the context around each search result.
What it does
pg-aiguide is two skills plus an MCP server.
The postgres skill kicks in for almost any PostgreSQL work: table design, choosing types, constraints and indexes, semantic search with pgvector, hybrid search with BM25, spatial data with PostGIS, TimescaleDB hypertables and zero-downtime schema migrations. Its SKILL.md doesn't load everything at once. It is an index that points to focused guides (design-postgres-tables, postgres-database-migration, pgvector-semantic-search…) and the agent only reads the one that fits the task. The migrations guide, for instance, covers which lock each DDL statement takes, timeouts and rollback planning.
The schema-exploration skill is the more interesting one if you've inherited a database. Given a question like "where do cancelled orders live?", it follows five steps: establish the version, role and schemas; query only pg_catalog to find the relevant objects; corroborate meaning with comments, keys and dependencies; if SQL is needed, validate it with a plain EXPLAIN; and when it answers, separate what it observed from what it inferred.
The MCP server (https://mcp.tigerdata.com/docs) adds a search_docs tool with semantic and keyword search over the version-specific PostgreSQL manual, the TimescaleDB docs and the PostGIS docs.
How to install it
As Agent Skills, for Claude Code, Codex, Cursor, Gemini CLI and other compatible agents:
npx skills add timescale/pg-aiguide --skill postgres
npx skills add timescale/pg-aiguide --skill schema-explorationAs a Claude Code plugin, which bundles the skills and the MCP server:
claude plugin marketplace add timescale/pg-aiguide
claude plugin install pg@aiguideThere is no special command to use it: just ask the agent for a schema, a migration or a query against a database it doesn't know.
Risks and limits
- Network: the skills are Markdown and SQL with no scripts of their own, but the plugin connects to an MCP server hosted by TigerData, so your documentation searches go to a third-party service. If that's a problem, install only the skills with
npx skills add. - Database access:
schema-explorationuses whatever connection the agent already has. Its rules are cautious (read-only catalog queries, ask before looking atpg_statsor real rows, never runEXPLAIN ANALYZEor discovered functions, use a read-only transaction with a timeout), but they are instructions to the model, not permissions. The real guarantee is connecting it with a read-only role. - Version: the exploration queries target PostgreSQL 18, with alternatives for older majors in some sections, and the
\bindshortcut needspsql16 or later. - Ecosystem bias: a good share of the guides cover TimescaleDB and Tiger Cloud. For plain PostgreSQL, the design, search and migration guides are what you need.
skills.sh lists schema-exploration as passing all three security audits it publishes (Gen Agent Trust Hub, Socket and Snyk).
Compared with what came before
Without the skill, the agent falls back on its training: correct SQL, but often dated, light on constraints and indexes, and missing newer features such as GENERATED ALWAYS AS IDENTITY or NULLS NOT DISTINCT. The manual alternative is pasting your team's style guide or manual links into the context and keeping them up to date by hand. pg-aiguide packages and versions all that, and splitting local skills from the remote MCP lets you choose how much you hand to a third party.
Sources
- timescale/pg-aiguide — GitHub
- postgres — timescale/pg-aiguide — skills.sh
- schema-exploration — timescale/pg-aiguide — skills.sh