prisma-json-types-generator
Installation
SKILL.md
prisma-json-types-generator
The generator gives Prisma Json, String, String[], Int, and Float fields TypeScript types taken from comments in the schema. It only rewrites the types emitted by prisma generate. Nothing is checked at runtime or by the database.
Workflow
- Read the relevant Prisma schema and, if it exists, the file that declares the
PrismaJsonnamespace. Readtsconfig.jsononly when the namespace declarations are not picked up. - If the generator is not installed or its setup looks broken, read
references/setup.mdbefore editing fields. - Choose a namespace type or an inline type for the field.
- Add or fix the
///comment directly above the field. - For a namespace type, add or update its declaration.
- Run
prisma generate(prisma generate --sqlwhen the project uses TypedSQL) and the project's type check when you can.
Change only the fields the user asked about.
Namespace or inline types
/// [TypeName] references TypeName in the configured namespace, PrismaJson by default. Use it for objects, types shared by several fields, and anything that may get a Zod schema later.