sql-postgresql-guide

sql-postgresql-guide is a skill for Claude Code from xonovex/platform. It costs 69 tokens per session (649 once invoked), scanned A, original, MIT.

A guide to editing PostgreSQL 15 and later queries, database structures, and migrations. PostgreSQL is a relational database system; migrations are files that change a database’s structure over time.

In plain words
What is it for?
Use it when writing SQL, designing tables and constraints, adding indexes, working with JSONB data, configuring row-level security, or reviewing migrations.
Why use it?
It helps prevent data-integrity problems, inefficient queries, unsafe schema changes, and weak isolation between customers or users.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the xonovex-skill-sql-postgresql plugin — 1 skill shipped together

Good fit Use it when writing SQL, designing tables and constraints, adding indexes, working with JSONB data, configuring row-level security, or reviewing migrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xonovex/platform/sql-postgresql-guide
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xonovex/platform --skill sql-postgresql-guide
Clone the repo
git clone --depth 1 https://github.com/xonovex/platform

Made for: Claude Code.

Or install xonovex-skill-sql-postgresql, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-postgresql-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/xonovex/platform/sql-postgresql-guide/github.svg)](https://agentmods.dev/skills/xonovex/platform/sql-postgresql-guide)
Your own site
<a href="https://agentmods.dev/skills/xonovex/platform/sql-postgresql-guide"><img src="https://agentmods.dev/badge/skills/xonovex/platform/sql-postgresql-guide/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-postgresql-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/xonovex/platform/sql-postgresql-guide"><img src="https://agentmods.dev/badge/skills/xonovex/platform/sql-postgresql-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 649 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.00649
Opus 5 $0.00034 $0.00324
Sonnet 5 $0.00014 $0.00130
Haiku 4.5 $0.00007 $0.00065

Measured 2d ago against content hash 331364d1e61c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sql-postgresql-guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/skill/skill-sql-postgresql/sql-postgresql-guide/SKILL.md · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Coding Guidelines

Requirements

  • PostgreSQL ≥ 15.

Essentials

Gotchas

  • ANALYZE updates planner statistics: bulk inserts without re-analyzing produce stale plans and full scans
  • JSONB supports indexing (GIN); JSON doesn't: pick JSONB unless you specifically need preserved formatting
  • Most DDL participates in transactions, but commands such as CREATE INDEX CONCURRENTLY cannot run inside a transaction block: check every migration operation before wrapping the whole file
  • Prefer SQL-standard GENERATED ... AS IDENTITY for new auto-generated keys because its sequence relationship and override rules are declared on the column; SERIAL/BIGSERIAL remain supported PostgreSQL shorthand, not deprecated syntax

Progressive disclosure

Read the full file on GitHub · 38 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 38 lines · 69 tokens per session scan A 331364d1e61c

Subscribe to this mod's changes

sql-postgresql-guide is a skill published in the GitHub repository xonovex/platform (5 stars, last pushed 3d ago), licensed MIT. It adds 69 tokens to every session and 649 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.

Related

Other skills, from other repositories

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens

neon

Use when you have picked Neon (serverless Postgres) and need to connect correctly from a serverless or edge runtime, wire database branching into dev, preview and CI, or stop being burned by scale-to-zero cold starts and pooler limits — including choosing HTTP versus WebSocket connections and pooled versus direct…

ericrisco/rsc-harness · 93 tokens

diesel-guard

Lints Diesel and SQLx Postgres migrations for unsafe schema changes that lock tables or cause downtime, and authors custom Rhai checks. Use when reviewing, writing, or fixing SQL migrations, when diesel-guard reports a violation, when configuring diesel-guard.toml, or when the user mentions migration safety, table…

ayarotsky/diesel-guard · 77 tokens

srtd-cli

This skill should be used when the user mentions "srtd", "sql templates", "migrations-templates", "live reload sql", "supabase functions", when working with files in supabase/migrations-templates/, when .buildlog.json or srtd.config.json is detected, or when writing Postgres functions/views/triggers for Supabase.

t1mmen/srtd · 75 tokens

database

Query and manage SQLite, PostgreSQL, and MySQL databases from the command line. Use when the user asks to run SQL queries, inspect database schemas, create or alter tables, import or export data, manage indexes, analyze query performance with EXPLAIN, back up or restore databases, or perform CRUD operations via…

bug-ops/zeph · 76 tokens