schema-exploration
Skill1.9k starsChanged 3 months agoApache-2.0View on GitHub
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.
1 other project uses a version of this.
Trending
Steady talk.about the whole repository
Most recently taken up by
- langchain-ai/deepagentstheir own version, first seen Aug 28, 2026
Who's talking about timescale/pg-aiguide
- A Hacker News story“Show HN: Pg-aiguide – Write better PostgreSQL code with AI”Hacker News · Nov 24, 2025 · 3 points
- @fred.camblor.fr“A nice MCP for opinionated best (/recent) postgres practices for schema design, indexing and constraint …”Bluesky · Dec 30, 2025 · 2 likes
- sudosubin/agents.nix“claude-code-plugins.github.timescale.pg-aiguide: init at 0.6.1”GitHub · Oct 4, 2026
- sudosubin/agents.nix“claude-code-marketplaces.github.timescale.pg-aiguide: init at 0.6.1”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.timescale.pg-aiguide: init at 0.6.1”GitHub · Oct 3, 2026
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub, Hacker News and Bluesky (15 times).
On GitHub · 13
- Oct 4, 2026claude-code-plugins.github.timescale.pg-aiguide: init at 0.6.1 — sudosubin/agents.nix0 reactions
- Oct 4, 2026claude-code-marketplaces.github.timescale.pg-aiguide: init at 0.6.1 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.timescale.pg-aiguide: init at 0.6.1 — sudosubin/agents.nix0 reactions
- Jun 16, 2026chore(skills): add timescale/pg-aiguide Postgres/PostGIS skills — digitie/kor-travel-geo0 reactions
- Jun 6, 2026content(mcp): add pg-aiguide MCP Server — JSONbored/awesome-claude0 reactions · 3 comments
8 more on GitHub
- Jun 3, 2026Try a third-party PostgreSQL MCP — jabrena/plinth0 reactions · 2 comments
- Apr 13, 2026Audit candidate: timescale/pg-aiguide — xiaolai/nlpm0 reactions · 4 comments
- Apr 6, 2026Audit candidate: timescale/pg-aiguide — xiaolai/nlpm0 reactions · 3 comments
- Jan 23, 2026Add MCP section — mgramin/awesome-db-tools0 reactions · 2 comments
- Jan 4, 2026[MCP Catalog] New MCP server candidate: io.github.timescale/pg-aiguide — obot-platform/mcp-catalog0 reactions
- Jan 3, 2026Weekly Journal Sources - Week of 2026-01-06 — beijaflor/gen-ai-journal0 reactions · 1 comment
- Dec 12, 2025dec 2025 jan 2026 — kimtth/azure-openai-llm-notes0 reactions
- Nov 26, 2025Add Postgres documentation MCP and schema-design skill — davila7/claude-code-templates0 reactions · 1 comment
On Hacker News · 1
- Nov 24, 2025Show HN: Pg-aiguide – Write better PostgreSQL code with AI3 points
On Bluesky · 1
- Dec 30, 2025A nice MCP for opinionated best (/recent) postgres practices for schema design, indexing and constraint Avoids the 35y history of old SQL… — @fred.camblor.fr2 likes and reposts
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- langchain-ai/deepagents★ 30ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
If the user wants SQL, follow query authoring: establish join keys and grain, then validate a vetted read-only query with plain EXPLAIN …
- Distinctive: line 20
Stop once you can answer. Report the specific schema-qualified objects and evidence, distinguish observations from inferences, and state …
- Very specific: line 34
All reference queries are plain PostgreSQL SQL.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
- Establish the current database, server version, role, and scope. Use overview for a small inventory. Choose relevant schemas; do not assume
publiccontains the application. - 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.
- 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.
- If the user wants SQL, follow query authoring: establish join keys and grain, then validate a vetted read-only query with plain
EXPLAINwhere authorized. Do not mistake a valid plan for proof of business semantics. - 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.ordershas a primary key onorder_idand a foreign key fromaccount_idtosales.accounts.account_id. - Inferred:
sales.orderslikely 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.
Safety and execution
- Prefer structural catalog queries;
pg_statsis data-derived and requires approval too. Do not change schema, data, roles, or session-wide settings without authorization. Never call discovered functions or procedures, refresh materialized views, or runEXPLAIN ANALYZEon unknown queries. A function markedSTABLEorIMMUTABLEis not a safety guarantee. - If your client supports transactions, use a read-only transaction and a reasonable statement timeout for exploration. Metadata queries are not a license to run full-table counts or unrestricted scans. Ask before sampling data; sample only when necessary, with explicit limits and a clear understanding of table size and access controls.
- All reference queries are plain PostgreSQL SQL. Bind
$1,$2, etc. as values using your client's API.psqlusers can follow the optional psql adapter. Never interpolate an untrusted object name as raw SQL; placeholders cannot replace SQL identifiers in data queries. - Queries target PostgreSQL 18. Each version-sensitive section notes alternatives for older majors where applicable. Check
server_version_numfirst. If a query fails due to permissions or version differences, report the limitation instead of guessing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

