db-enforcer

Enforce PostgreSQL and Prisma schema integrity with migration-first workflows and RLS policies.

14|5|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/oakoss/agent-skills --skill db-enforcer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-enforcer
Source: https://github.com/oakoss/agent-skills/tree/main/skills/db-enforcer
Command: npx skills add https://github.com/oakoss/agent-skills --skill db-enforcer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures your PostgreSQL database schema and your TypeScript application code stay perfectly in sync, preventing data integrity issues and enabling robust, type-safe database operations.

Core Features & Use Cases

  • Type-to-DB Synchronization: Automatically align TypeScript types with PostgreSQL CHECK constraints.
  • Migration Safety: Enforce a "migration-first" approach for all schema changes, preventing accidental data loss.
  • Row-Level Security (RLS): Implement secure, granular access control directly at the database level.
  • Use Case: When designing a new feature that involves user roles and permissions, use this Skill to ensure your Prisma schema, database constraints, and RLS policies are all correctly defined and aligned from the start.

Quick Start

Use the db-enforcer skill to generate a migration script for adding a new 'status' enum to the 'orders' table.

Frequently Asked Questions about db-enforcer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync TypeScript types with PostgreSQL CHECK constraints using Prisma?

You can sync TypeScript types with PostgreSQL CHECK constraints using Prisma by enforcing type-to-database synchronization, automatically aligning your application types with database schema rules for type-safe SQL operations.

What is a migration-first workflow for PostgreSQL schema changes?

A migration-first workflow for PostgreSQL schema changes requires generating and validating migration scripts before altering the Prisma schema, preventing accidental data loss and ensuring safe database migrations.

How do I implement Row-Level Security policies in PostgreSQL with Prisma?

You can implement Row-Level Security (RLS) policies in PostgreSQL with Prisma by applying zero-trust access controls directly at the database level, ensuring secure and granular data governance for user roles.

Does Prisma support PostgreSQL UUIDv7 and virtual columns for type-safe SQL?

Yes, Prisma supports PostgreSQL UUIDv7 and virtual columns through generated SQL and mapping features, enabling robust type-safe SQL and advanced schema design for data integrity.

How do I generate a migration script for adding an enum to a PostgreSQL table?

To generate a migration script for adding an enum to a PostgreSQL table, use a migration-first approach to create the schema change script, ensuring your Prisma mapping and database constraints remain aligned.