pproenca/dot-skills/drizzle-nextjs-postgres

Claude Code and agent skill by pproenca/dot-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Drizzle ORM against PostgreSQL inside a Next.js App Router app. Covers client construction (globalThis singleton across HMR, serverless pool sizing, `prepare:false` behind PgBouncer/Supavisor, driver choice when you need interactive transactions, `server-only`), reads in Server Components under Next.js 16 Cache Components (`use cache` superseding `unstable_cache` and the `revalidate`/`dynamic` segment configs, Suspense boundaries, React `cache()` dedupe), Server Actions (authorization inside th…

Install

npx vskill@latest install pproenca/dot-skills/drizzle-nextjs-postgres

SKILL.md

The same SKILL.md was published earlier as pproenca/dot-skills/drizzle-nextjs-postgres.

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

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

Quick Reference

1. Client Construction & Driver Choice
2. Reads in Server Components
3. Server Actions & Mutations
4. Postgres Schema Definition
5. Migrations & Schema Change Safety
6. Transactions & Pooled Connections
7. Postgres Query Building

How to Use

Read a reference file when its decision comes up. Each rule names the wrong default it corrects, then shows the canonical way (with an incorrect/correct contrast only where the wrong way is a real trap).

Related Skills

  • drizzle-sqlite — the same ORM against SQLite-family backends; covers the dialect-agnostic query-building rules this skill deliberately omits
  • nextjs — App Router patterns beyond the data layer
  • relational-database-design — choosing the schema this skill teaches you to declare

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and source references

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pproenca/dot-skills/drizzle-nextjs-postgres/badge)](https://verified-skill.com/skills/pproenca/dot-skills/drizzle-nextjs-postgres)

Something wrong with this skill or its page? Tell us.