drizzle-nextjs-postgres

drizzle-nextjs-postgres is a skill for Claude Code, Codex from pproenca/dot-skills. It costs 228 tokens per session (2,633 once invoked), scanned A, original, MIT.

Guidance for using Drizzle ORM with PostgreSQL in a Next.js App Router application. It covers database connections, queries, caching, migrations, and server-side data access.

In plain words
What is it for?
Use it when building database modules, Server Components, route handlers, metadata queries, or Server Actions backed by PostgreSQL.
Why use it?
It helps avoid connection, caching, migration, and server-runtime mistakes that are common when combining Next.js with PostgreSQL.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when building database modules, Server Components, route handlers, metadata queries, or Server Actions backed by PostgreSQL.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/pproenca/dot-skills/drizzle-nextjs-postgres"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/drizzle-nextjs-postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 228 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,633 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
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00228 $0.02633
Opus 5 $0.00114 $0.01316
Sonnet 5 $0.00046 $0.00527
Haiku 4.5 $0.00023 $0.00263

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

Security

Grade A, and why

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

skills/.experimental/drizzle-nextjs-postgres/SKILL.md · 117 lines

How it starts

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

Drizzle + PostgreSQL in Next.js

Library-reference skill for Drizzle ORM on PostgreSQL inside the Next.js App Router — 36 rules across 7 categories. Each rule names the wrong default it corrects; there is no rule for things a capable model already gets right.

This skill is self-contained: it includes the migration-workflow and type-inference rules a Postgres + Next.js developer needs even where the underlying wrong default is not Postgres-specific, so you never have to load a second skill mid-task. A few of those knowingly overlap the sibling drizzle-sqlite skill (same wrong default, restated for this context); the rest are decisions that only exist, or only bite differently, because the dialect is PostgreSQL or the code runs in the App Router.

Pinned to drizzle-orm 0.45.2, drizzle-kit 0.31.10, Next.js 16.2.11, PostgreSQL 14+.

When to Apply

  • Writing or reviewing the lib/db module — driver choice, pooling, singletons, server-only
  • Fetching data in a Server Component, Route Handler, or generateMetadata with db.select() / db.query.*
  • Deciding what to cache: use cache, cacheLife, cacheTag, React cache(), or nothing
  • Writing a Server Action that mutates rows and has to invalidate what the read path cached
  • Defining or changing a pgTable — column types, indexes, enums, constraints
  • Running drizzle-kit generate / migrate / push, or hand-editing a generated .sql file
  • Wrapping work in db.transaction(), or debugging a race, deadlock, or exhausted pool
  • Reviewing a list, count, or pagination query that is fine locally and slow in production

Rule Categories

# Category Prefix Covers
1 Client Construction & Driver Choice conn- Singletons across HMR, serverless pool sizing, poolers, driver capability, server-only, passing schema
2 Reads in Server Components rsc- Suspense boundaries, use cache / cacheLife / cacheTag, request dedupe, waterfalls, runtime choice
3 Server Actions & Mutations mut- Authorization and validation in the action, cache invalidation, deferred writes
4 Postgres Schema Definition schema- timestamptz, identity columns, text vs varchar, numeric, jsonb, bigint modes, table config, enums
5 Migrations & Schema Change Safety migrate- generate vs push, concurrent indexes, where migrations run, renames, lock-safe constraints
6 Transactions & Pooled Connections tx- Connection cost of a held transaction, row locking, serialization retries
7 Postgres Query Building query- Keyset pagination, count cost, driver-dependent execute shape, NULL semantics, prepared statements

Read the full file on GitHub · 117 lines

Files

What ships with it

40 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. 5d ago First seen · 117 lines · 228 tokens per session scan A 702871ee04c7

Subscribe to this mod's changes

drizzle-nextjs-postgres is a skill published in the GitHub repository pproenca/dot-skills (205 stars, last pushed 24d ago), licensed MIT. It adds 228 tokens to every session and 2,633 once invoked, about $0.0011 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-03.

Related

Other skills, from other repositories

azure-postgres-ts

Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package. Use for PostgreSQL queries, connection pooling, transactions, and Microsoft Entra ID (passwordless) authentication. Triggers: "PostgreSQL", "postgres", "pg client", "node-postgres", "Azure PostgreSQL…

microsoft/skills · 94 tokens

butterbase

AI-native, open-source backend-as-a-service with a built-in Model Context Protocol server. Postgres, auth, storage, functions, AI gateway.

butterbase-ai/butterbase · 34 tokens

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

supabase-cli

This skill should be used when user asks to "use supabase CLI", "supabase init", "supabase start", "run migrations", "deploy edge functions", "manage Supabase project", or works with the supabase command-line tool for local development and project management.

fcakyon/claude-codex-settings · 60 tokens

supabase-js

This skill should be used when user asks to "use supabase-js", "query Supabase database", "supabase auth", "supabase storage", "supabase realtime", "supabase edge functions", or works with the @supabase/supabase-js JavaScript/TypeScript SDK.

fcakyon/claude-codex-settings · 64 tokens

supabase-node

Express/Hono with Supabase and Drizzle ORM.

alinaqi/maggy · 14 tokens