postgres-drizzle

postgres-drizzle is a skill for Claude Code, Codex from ccheney/robust-skills. It costs 47 tokens per session (665 once invoked), scanned A, original, MIT.

A guide to using PostgreSQL, a relational database, with Drizzle ORM, a JavaScript or TypeScript library for defining tables and querying data. It accounts for differences between Drizzle’s stable and newer APIs.

In plain words
What is it for?
Building APIs and backends, defining tables and relationships, writing queries, generating and applying migrations, and handling transactions or connection pools.
Why use it?
It helps keep database code compatible with the project’s installed Drizzle version and avoids mismatched schema, query, or migration patterns.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Building APIs and backends, defining tables and relationships, writing queries, generating and applying migrations, and handling transactions or connection pools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ccheney/robust-skills/postgres-drizzle
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 ccheney/robust-skills --skill postgres-drizzle
Clone the repo
git clone --depth 1 https://github.com/ccheney/robust-skills

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 postgres-drizzle

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccheney/robust-skills/postgres-drizzle/github.svg)](https://agentmods.dev/skills/ccheney/robust-skills/postgres-drizzle)
Your own site
<a href="https://agentmods.dev/skills/ccheney/robust-skills/postgres-drizzle"><img src="https://agentmods.dev/badge/skills/ccheney/robust-skills/postgres-drizzle/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 postgres-drizzle

Your own site · 80×15
<a href="https://agentmods.dev/skills/ccheney/robust-skills/postgres-drizzle"><img src="https://agentmods.dev/badge/skills/ccheney/robust-skills/postgres-drizzle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 665 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. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 30
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 31
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 32
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 33
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 34
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 35
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00047 $0.00665
Opus 5.5 $0.00019 $0.00266
Sonnet 5.5 $0.00009 $0.00133
Haiku 4.5 $0.00005 $0.00067

Measured 1mo ago against content hash a68232b5a451, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-drizzle 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.

skills/postgres-drizzle/SKILL.md · 42 lines

How it starts

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

PostgreSQL and Drizzle ORM

Match database work to the project's installed API and deployment context. The user's explicit instructions take precedence over this skill's guidelines.

Establish the database contract

Use the relevant schema/query, migration history, and requested behavior as input. For Drizzle code, inspect installed drizzle-orm/drizzle-kit versions and the driver; for SQL, establish the PostgreSQL version when a version-specific feature matters.

The references cover PostgreSQL 17/18 and distinguish Drizzle's 0.x relations() API from the v1 defineRelations() API. Do not mix them or infer the installed API from an npm dist-tag. When the version is unknown, use imports/lockfiles or ask for the missing version before giving version-dependent code.

Keep changes consistent

  • Declare database foreign keys separately from ORM relation metadata. Match nullability, uniqueness, and delete behavior to the actual relationship.
  • Use the transaction handle for every statement in that transaction; a query through the outer connection can escape it.
  • Diagnose slow queries from plans and workload evidence. Evaluate indexes on referencing columns; PostgreSQL does not create them automatically.
  • Generate and inspect migration SQL for schema changes. Preserve applied migration history; use a new migration for subsequent changes.
  • Establish the target before applying migrations or push. Authoring or reviewing SQL does not itself require executing it against a database. Continue execution when the user has already authorized that target and action.
  • Treat EXPLAIN ANALYZE as query execution, including writes. Use a suitable test target or non-executing plan when execution is outside the task.

Deliver the requested SQL/code, migration, or diagnosis, with compatibility assumptions and relevant verification. If execution is requested but the target is missing, prepare the change and ask only for that missing target.

References

Read the topic required for the current operation.

Read the full file on GitHub · 42 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · -184 lines · -72 tokens per session a68232b5a451
  2. 1mo ago First seen · 226 lines · 119 tokens per session scan A b567b8eed243

Subscribe to this mod's changes

postgres-drizzle is a skill published in the GitHub repository ccheney/robust-skills (61 stars, last pushed 21d ago), licensed MIT. It adds 47 tokens to every session and 665 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

supabase

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies…

supabase/agent-skills · 185 tokens

multitenant

Architecture multitenant avec approche tiered (Shared/Dedicated Schema/DB), RBAC/ABAC, field-level encryption. Use when working with multitenant applications, tenant isolation, data segregation.

TheBeardedBearSAS/claude-craft · 0 tokens

supabase

Expert Supabase assistance covering PostgreSQL, Row Level Security (RLS), Edge Functions, Auth, and pgvector. Use when building full-stack web/mobile applications with Postgres backends and instant REST/GraphQL APIs.

G1Joshi/Agent-Skills · 48 tokens

golang-database

This skill should be used when the user asks to "configure a Go database connection pool", "use database/sql in Go", "set up pgxpool", "why is my Go app running out of connections", "scan rows into a Go struct", "handle sql.ErrNoRows", or writes Go code that opens, pools, queries, or scans a PostgreSQL/MySQL…

shennawardana23/skillme · 160 tokens

backend-setup-stack

Bootstraps a local Node.js backend development stack with Docker, PostgreSQL, and an ORM (Prisma or Sequelize). Use this skill whenever the user wants to: initialize a new backend project, set up a Dockerized database locally, wire up an ORM with automated migrations, scaffold an Express server with a health endpoint…

WESTsyre21/setup-backend-stack · 155 tokens

gorm-sql-gorm-query-patterns

GORM ORM query pattern review for PostgreSQL. Use when reviewing or writing Go database code using GORM — covers N+1, Preload vs Joins, transactions, error checking, Save vs Updates, and context propagation. Trigger on any GORM method usage.

saifoelloh/golang-best-practices-skill · 63 tokens