prisma-next-contract

Validate Prisma schema definitions and emit canonical IR and TypeScript types.

47.5k|2.5k|Updated Jun 20, 2019
One-click install
npx skills add https://github.com/prisma/prisma --skill prisma-next-contract
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-next-contract
Source: https://github.com/prisma/prisma/tree/main/skills/prisma-next-contract
Command: npx skills add https://github.com/prisma/prisma --skill prisma-next-contract

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill manages the complexity of defining and evolving your data layer, ensuring that your database schema, TypeScript types, and runtime configuration remain perfectly synchronized without manual boilerplate.

Core Features & Use Cases

  • Contract Authoring: Define models, relations, and custom types using either PSL or the TypeScript builder.
  • Automated Emit Pipeline: Automatically generate canonical Contract IR (JSON) and precise TypeScript types from your source files.
  • Extension Integration: Seamlessly wire in advanced database capabilities like pgvector, PostGIS, or Supabase via namespaced constructors.

Quick Start

Use the prisma-next-contract skill to emit the contract artifacts for your current project configuration.

Frequently Asked Questions about prisma-next-contract

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

FAQPage Schema
How do I keep my Prisma schema and TypeScript types synchronized?

To keep your Prisma schema and TypeScript types synchronized, you can use a data contract skill to validate schema definitions and automatically emit canonical IR and TypeScript types from your source files, ensuring structural integrity across database migrations without manual boilerplate.

What is a data contract in Prisma Next?

A Prisma Next data contract is a defined schema layer that manages the lifecycle of your data models using either PSL or a programmatic TypeScript builder, ensuring your database schema, TypeScript types, and runtime configuration remain perfectly synchronized.

Can I use a TypeScript builder instead of PSL for Prisma schema definitions?

Yes, you can use a programmatic TypeScript builder instead of PSL for Prisma schema definitions. The contract lifecycle supports both PSL and TypeScript builder surfaces, allowing you to define models, relations, and custom types for SQL and NoSQL targets.

How do I wire pgvector or PostGIS capabilities into my Prisma schema?

To wire pgvector or PostGIS capabilities into your Prisma schema, you use namespaced constructors via extension integration. This allows you to seamlessly integrate advanced database capabilities into your data contract authoring pipeline.

Does the Prisma data contract support NoSQL database targets?

Yes, the Prisma data contract supports NoSQL database targets. It validates schema definitions and emits canonical Contract IR and TypeScript types for both SQL and NoSQL targets, ensuring structural integrity across different database configurations.

What is the best way to automate TypeScript type generation from a database schema?

The best way to automate TypeScript type generation from a database schema is to use an automated emit pipeline. By defining a data contract, it generates canonical Contract IR and precise TypeScript types from your source files, eliminating manual boilerplate.