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.

Good fit Use it when creating PostgreSQL schemas, defining relationships, adding indexes, or checking and improving SQL queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/andresquirogadev/skillsense/postgresql
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 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/github.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/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 postgresql

Your own site · 80×15
<a href="https://agentmods.dev/skills/andresquirogadev/skillsense/postgresql"><img src="https://agentmods.dev/badge/skills/andresquirogadev/skillsense/postgresql.svg" alt="Reviewed on agentmods" width="80" 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. 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.00000 $0.00575
Opus 5.5 $0.00000 $0.00230
Sonnet 5.5 $0.00000 $0.00115
Haiku 4.5 $0.00000 $0.00057

Measured 1mo ago against content hash 7caf5bc7f958, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 6mo 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

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

mesh-memory

Self-hosted semantic memory for AI agents via MCP. Save worklogs, decisions, and notes, then recall them across sessions by meaning, not keyword. Postgres + pgvector with auto-tagging.

skillmds/skillmd · 44 tokens

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

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

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