schema-exploration
Skill by timescale
Explores an existing PostgreSQL database with read-only catalog queries before answering data questions or writing SQL. Aimed at users working with unfamiliar schemas.
Install schema-exploration
Built from the published package, never by AI.
git clone --depth 1 https://github.com/timescale/pg-aiguide /tmp/pg-aiguide && mkdir -p ~/.claude/skills && cp -r /tmp/pg-aiguide/skills/schema-exploration ~/.claude/skills/schema-explorationRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/timescale/pg-aiguide /tmp/pg-aiguide && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/pg-aiguide/skills/schema-exploration ~/.gemini/antigravity-cli/skills/schema-explorationAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The schema-exploration skill helps an AI assistant learn an existing PostgreSQL database before it answers questions about the data or writes SQL. It starts with a small inventory of the database, server version, role, and relevant schemas. It then reads only the reference that matches the objects under review, such as tables, views, routines, triggers, RLS, or extensions. It relies mainly on read-only pg_catalog queries.
The skill is meant for unfamiliar schemas, such as finding where a business concept lives, checking counts or failed records, or explaining joins. It asks for approval before inspecting data-derived statistics or rows. It separates observed facts from inferences and open questions. It is not a guide to schema design or migrations. The skill is published by timescale under Apache-2.0.
Written from the project's SKILL.md and checked against it.
What it can do
- Database inventoryConfirms the current database, server version, role, and scope before exploring.
- Object drill-downReads matching references for tables, views, routines, triggers, RLS, or extensions.
- Concept lookupFinds the schema-qualified objects where a business concept is likely stored.
- Query authoringEstablishes join keys and grain, then validates a vetted read-only query with plain EXPLAIN.
- Approval-gated data checksRequests approval before inspecting data-derived statistics, values, or rows.
What you need
- A PostgreSQL database connection available to the assistant
Try asking
- Find where customer orders are stored in this PostgreSQL schema
- Explain how the orders and accounts tables join in this database
- Check which views and triggers touch the invoices table
Good to know
- Targets PostgreSQL 18; older majors have alternative notes where applicable
- Does not call discovered functions or run EXPLAIN ANALYZE on unknown queries
- Data-derived statistics and rows require user approval first
- Not a schema-design or migration guide
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/schema-exploration/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md4 KB -
references/data-values.md6 KB -
references/extensions.md2 KB -
references/foreign-tables.md4 KB -
references/overview.md6 KB
Show all 13 files
-
references/partitioning-and-inheritance.md7 KB -
references/psql.md2 KB -
references/query-authoring.md2 KB -
references/routines.md3 KB -
references/security.md2 KB -
references/tables.md8 KB -
references/triggers.md2 KB -
references/views.md2 KB
Alternatives to schema-exploration
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
schema-exploration: common questions
Does this skill change my database?
The source says not to change schema, data, roles, or session settings without authorization. It recommends read-only transactions where the client supports them.
Can it look at my table data?
Only after approval for the specific columns and access method. The skill says sampling should be limited and used only when necessary.
Which PostgreSQL version does it support?
Its queries target PostgreSQL 18, and version-sensitive sections note alternatives for older majors where applicable.
How do I install schema-exploration?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is schema-exploration free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is schema-exploration safe to use?
It scores 87 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to schema-exploration?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
