design-postgis-tables
Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and…
Explore an existing PostgreSQL database before answering questions about its data or writing SQL. Use this skill whenever a user asks for a query or a data-backed answer against an unfamiliar schema (counts, missing or failed records, recent changes), asks where a business
Claude Code
$ npx -y skills add timescale/pg-aiguide --skill schema-exploration --agent claude-code
Codex
$ npx skills add timescale/pg-aiguide --skill schema-exploration -a codex -y
Cursor
$ npx skills add timescale/pg-aiguide --skill schema-exploration -a cursor -y
Gemini CLI
$ npx skills add timescale/pg-aiguide --skill schema-exploration -a gemini-cli -y
GitHub Copilot
$ npx skills add timescale/pg-aiguide --skill schema-exploration -a github-copilot -y
OpenCode
$ npx skills add timescale/pg-aiguide --skill schema-exploration -a opencode -y
Windsurf
$ npx skills add timescale/pg-aiguide --skill schema-exploration -a windsurf -y
name: schema-exploration description: | Explore an existing PostgreSQL database before answering questions about its data or writing SQL. Use this skill whenever a user asks for a query or a data-backed answer against an unfamiliar schema (counts, missing or failed records, recent changes), asks where a business concept lives, or asks how tables, joins, views, routines, triggers, RLS, or extensions work. Find the relevant objects with read-only pg_catalog queries, then request approval before inspecting data-derived statistics or rows. Not a schema-design or migration guide. license: Apache-2.0 metadata: author: tigerdata
Start with the user's question, not a full-database audit unless that is the explicit ask. Use the database connection already available to you; if none is available, ask for access or work from provided schema files. Stay within the database and schemas the user has authorized. Catalog metadata can reveal sensitive names or source code: do not export it unnecessarily.
1. Establish the current database, server version, role, and scope. Use [overview](references/overview.md) for a small inventory. Choose relevant schemas; do not assume `public` contains the application. 2. Pick the most promising object(s) and read **only** the matching drill-down reference: [tables](references/tables.md), [partitioning/inheritance](references/partitioning-and-inheritance.md), [foreign tables](references/foreign-tables.md), [views](references/views.md), [routines](references/routines.md), [triggers](references/triggers.md), [security/RLS](references/security.md), or [extensions](references/extensions.md). Follow cross-references only when the question requires them. 3. Corroborate meaning with comments, definitions, keys, and known dependencies. Names are clues, not proof of business meaning. If data-derived values would help, use [data-derived values](references/data-values.md) **only after obtaining approval** for the specific columns and access method. Ask the user when semantics remain ambiguous. 4. If the user wants SQL, follow [query authoring](references/query-authoring.md): establish join keys and grain, then validate a vetted read-only query with plain `EXPLAIN` where authorized. Do not mistake a valid plan for proof of business semantics. 5. Stop once you can answer. Report the specific schema-qualified objects and evidence, distinguish observations from inferences, and state limitations (permissions, stale statistics, missing dependencies, unknown application logic).
Illustrative only; report facts verified in the target database:
AI-optimized PostgreSQL expertise for coding assistants pg-aiguide helps AI coding tools write dramatically better PostgreSQL code.
Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and…
Use this skill for general PostgreSQL table design. **Trigger when user asks to:** - Design PostgreSQL tables, schemas, or data…
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB…
Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and…
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.…
Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production…
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…