schema-exploration

Installation
SKILL.md

Explore a PostgreSQL database

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.

Workflow

  1. Establish the current database, server version, role, and scope. Use overview 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, partitioning/inheritance, foreign tables, views, routines, triggers, security/RLS, or extensions. 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 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: 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).

Example finding

Illustrative only; report facts verified in the target database:

  • Observed: sales.orders has a primary key on order_id and a foreign key from account_id to sales.accounts.account_id.
  • Inferred: sales.orders likely records one row per order; the keys support this, but do not establish what the business calls an “order.”
  • Unresolved: The catalog does not show whether canceled orders remain in this table. Confirm with the application owner before assuming they do.
Installs
39
GitHub Stars
1.9K
First Seen
Sep 25, 2026