Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

database-postgresql

FreeNo executable scriptsNot checked

Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or…

HoangNguyen0403by HoangNguyen0403★ 598 GitHub stars

About this skill

PostgreSQL Database Standards

Priority: P0 (CRITICAL)

Rules

  • Keep PostgreSQL choices driven by real read/write paths.
  • Use explicit migrations; never rely on synchronize: true in production.
  • Treat RLS, constraints, and indexes as first-class schema behavior; use queryRunner.query() when raw migration SQL is required.
  • Enable RLS explicitly in a migration (ALTER TABLE <table> ENABLE ROW LEVEL SECURITY) and create tenant policies before application rollout.
  • Put multi-step consistency inside one transaction boundary.

Verify

  • Destructive schema change uses expand -> backfill -> contract rollout.
  • Query shape has matching indexes for filter, join, and sort paths.
  • Pagination strategy is explicit.
  • Transaction boundary matches one business action.
  • RLS or tenant predicates are supported by indexes.

Anti-Patterns

  • No N+1 queries: Use query builders or eager-load relations instead of lazy-loading in loops.
  • No heavy RLS joins: Keep RLS predicates simple; move complex logic to query/view layer.
  • No synchronize in production: Always run explicit migrations; synchronize: true destructive.
  • No blind index sprawl: each index needs a query owner.

References

Install database-postgresql in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

evals/evals.jsonreferences/anti-patterns.mdreferences/best-practices.mdreferences/checklist.mdreferences/implementation.mdreferences/sql-gotchas.md

FAQ

What does the database-postgresql skill do?

Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or query-performance work for PostgreSQL.

How do I install the database-postgresql skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the database-postgresql skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare database-postgresql with