postgresql

postgresql is a skill for Claude Code, Codex from andresquirogadev/skillsense. It costs 0 tokens per session (575 once invoked), scanned A, original, MIT.

A set of guidelines for designing PostgreSQL databases, including tables, relationships, indexes, and queries. PostgreSQL is a database system used to store and retrieve application data.

In plain words
What is it for?
Use it when creating PostgreSQL schemas, defining relationships, adding indexes, or checking and improving SQL queries.
Why use it?
It helps avoid unclear table structures, unsafe database changes, slow queries, and common data-handling mistakes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

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.

agentmods
npx agentmods add skills/andresquirogadev/skillsense/postgresql
Any agent
npx skills add andresquirogadev/skillsense --skill postgresql
Clone the repo
git clone --depth 1 https://github.com/andresquirogadev/skillsense

Made for: Claude Code, Codex.

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 postgresql

README.md
[![agentmods](https://agentmods.dev/badge/skills/andresquirogadev/skillsense/postgresql.svg)](https://agentmods.dev/skills/andresquirogadev/skillsense/postgresql)
Your own site
<a href="https://agentmods.dev/skills/andresquirogadev/skillsense/postgresql"><img src="https://agentmods.dev/badge/skills/andresquirogadev/skillsense/postgresql.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.00575
Opus 5 $0.00000 $0.00287
Sonnet 5 $0.00000 $0.00115
Haiku 4.5 $0.00000 $0.00057

Measured 5d ago against content hash 7caf5bc7f958, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

postgresql 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 5d 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/catalog/skills/postgresql/SKILL.md · 46 lines

How it starts

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

PostgreSQL Skill

You are working with a PostgreSQL database. Apply these best practices.

Schema Design

  • Always define a primary key — prefer BIGSERIAL or UUID with gen_random_uuid() as default.
  • Use NOT NULL constraints by default; allow NULL only when the absence of a value is meaningful.
  • Use TEXT instead of VARCHAR(n) unless you have a proven reason to constrain length.
  • Use TIMESTAMPTZ (timestamp with time zone) — never TIMESTAMP without time zone.
  • Define foreign keys with ON DELETE CASCADE or ON DELETE SET NULL (never leave it implicit).
  • Normalize data to at least 3NF; denormalize with JSON/JSONB columns only when truly needed.

Indexes

  • Index every foreign key column — Postgres does NOT create these automatically.
  • Add CREATE INDEX CONCURRENTLY to add indexes without blocking production writes.
  • Use partial indexes for common filtered queries: CREATE INDEX ON orders (status) WHERE status = 'pending'.
  • Use EXPLAIN ANALYZE to verify index usage; look for Seq Scan on large tables as a red flag.
  • Composite indexes: column order matters — most selective or most frequently filtered column first.

Queries

  • Use $1, $2 parameterized queries — never interpolate user input into SQL strings.
  • Use RETURNING * on INSERT/UPDATE/DELETE to avoid a second SELECT round-trip.
  • Use CTEs (WITH … AS (…)) for readability; use WITH … AS MATERIALIZED when you need to prevent inlining.
  • Use window functions (ROW_NUMBER(), RANK(), LAG(), LEAD()) for ranking and running totals.
  • Use UPSERT: INSERT … ON CONFLICT (col) DO UPDATE SET ….

Transactions & Locking

  • Use BEGIN / COMMIT / ROLLBACK for multi-statement atomic operations.
  • Use SELECT … FOR UPDATE SKIP LOCKED for queue-like workloads to avoid lock contention.
  • Keep transactions short — long-running transactions block autovacuum and cause bloat.

Performance

  • Run VACUUM ANALYZE regularly; configure autovacuum aggressively for write-heavy tables.
  • Use pg_stat_user_tables and pg_stat_statements to identify slow queries.
  • Use connection pooling (PgBouncer, Supabase Pooler) for serverless/edge environments.

Read the full file on GitHub · 46 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. 5d ago First seen · 46 lines · 0 tokens per session scan A 7caf5bc7f958

Subscribe to this mod's changes

postgresql is a skill published in the GitHub repository andresquirogadev/skillsense (2 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 575 tokens. 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-08-31.

Related

Other skills, from other repositories

cmux-backend

Backend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM lifecycle, provider integrations, Postgres, Stack Auth pricing gates, migrations, or provider image build scripts.

manaflow-ai/cmux · 53 tokens

postgresql-review

PostgreSQL query review, optimalisering og beste praksis for Nav-applikasjoner.

navikt/copilot · 21 tokens

postgres-patterns

PostgreSQL schema, query, indexing, and performance patterns.

DVNghiem/FlowDeck · 17 tokens

postgres

Execute queries on the Postgres database. Use this skill DIRECTLY whenever the user asks anything about database contents, counts, or data — do NOT read compose.yml or SQL migration files first.

CodelyTV/agentic_programming-course · 40 tokens

django-safe-migration

Write, review, and rewrite Django migrations for PostgreSQL with zero-downtime guarantees. Use this skill whenever the user mentions migrations, Django schema changes, or deployment safety — even if they don't say "zero downtime" explicitly. Trigger on: "review this migration", "is this migration safe?", "write a…

vintasoftware/django-ai-plugins · 156 tokens

postgresql-cli

PostgreSQL interactive terminal (psql) reference and usage guide. Use this skill whenever the user mentions psql, PostgreSQL command-line client, backslash commands, meta-commands, \d commands, database inspection, SQL scripting in PostgreSQL, importing/exporting data with psql, \copy, psql formatting, psql variables…

chaunsin/agent-skills · 148 tokens