Teaches an AI agent to build a database introspection capability inside the repository it is working in. Introspection is a read-only tool that reads a live database's catalogs and renders the current structure, security (row-level security, roles, grants), views, functions, and extensions into committed, navigable files shareable without a running database or credentials. Use when a repository needs an always-current, addressable picture of its database state, when asked to introspect a database, generate or refresh database state, make a schema readable for humans and agents, audit which callers can reach which objects, or capture the architect's intent behind the schema. The method is database-agnostic with a PostgreSQL reference implementation, and extends to layers around the database such as the cluster, a connection pooler (PgBouncer), and a REST layer (PostgREST). Not for authoring migrations, asserting expectations (that is validation), or writing hand-maintained documentation.
2026-06-19