agentsclimarketplace

Prisma schema naming convention best practices

Skill lazuee/agent-skills/skills/prisma-schema-naming-convention-best-practices

Naming conventions for Prisma schemas that map to MySQL tables using snake_case tables, PascalCase columns, id primary keys, ReferencedTableID foreign keys, explicit unique constraints, and idx_ index names.From its SKILL.md

Install
npx -y skills add lazuee/agent-skills --skill prisma-schema-naming-convention-best-practices

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.6 KB, 569 tokens by cl100k_base, as published. Nobody here has run it

Prisma Schema Naming Convention Best Practices

Conventions for writing Prisma schemas that match a legacy MySQL naming contract. Contains 7 rules across table, key, and constraint naming.

When to Apply

  • Defining or updating models in **/prisma/schema.prisma
  • Reviewing pull requests that change Prisma model names, keys, or constraints
  • Creating new tables and relations that must stay consistent with existing naming
  • Introspecting a legacy database and normalizing naming in the Prisma schema

Rules Summary

Table and Column Naming (HIGH)

table-names-snake-case - @rules/table-names-snake-case.md

Database table names use snake_case plural form, such as users, users_logs, and providers_locations.

model users_logs {
  @@map("users_logs")
}

column-names-pascal-case - @rules/column-names-pascal-case.md

Columns use PascalCase names such as UserID, Details, and DateCreated.

model users_logs {
  UserID      Int
  DateCreated DateTime @db.DateTime(0)
}

Key Naming (HIGH)

primary-key-id - @rules/primary-key-id.md

Every model uses id as the primary key field.

id Int @id @default(autoincrement())

foreign-key-referenced-table-id - @rules/foreign-key-referenced-table-id.md

Foreign key columns use <ReferencedTable>ID, such as UserID, ProviderID, and AccessID.

UserID Int

Relationship and Constraint Naming (HIGH)

join-table-table1-table2 - @rules/join-table-table1-table2.md

Join table names use <table1>_<table2> in snake_case.

model providers_clearances_permits {
  @@map("providers_clearances_permits")
}

explicit-unique-constraints - @rules/explicit-unique-constraints.md

Declare unique constraints explicitly on business-unique columns such as Name, Email, and Username.

@@unique([Email, Username, HashPassword], map: "uq_users_email_username_hashpassword")

index-names-idx-table-column - @rules/index-names-idx-table-column.md

Indexes use idx_<table>_<column> lowercase names via map, especially for foreign keys.

@@index([UserID], map: "idx_users_logs_userid")

References

What ships with it: 7 files

9.7 KB alongside SKILL.md

Gives 0 of the 12 instructions most databases sql skills give in 569 tokens

Counted across 589 of the 662 authors here whose files we hold, read 2026-08-07

  • Use parameterized queriesin 37 of 589, across 34 files
  • Use timestamptz for timestampsin 30 of 589, across 14 files
  • Index foreign keysin 29 of 589, across 18 files
  • Create indexes concurrentlyin 29 of 589, across 24 files
  • Use numeric type for moneyin 25 of 589, across 8 files
  • Use cursor pagination instead of offsetin 24 of 589, across 17 files
  • Select only required columnsin 24 of 589, across 20 files
  • Add indexes manually on foreign key columnsin 22 of 589, across 12 files
  • Normalize to third normal formin 19 of 589, across 10 files
  • Configure connection poolingin 19 of 589, across 17 files
  • Put equality columns before range columns in indexesin 18 of 589, across 10 files
  • Read individual rule files for detailed explanationsin 18 of 589, across 4 files

Said here and by no other author read

  • Map models to snake_case table names
  • Use PascalCase column names
  • Name join tables table1_table2
  • Declare unique constraints explicitly
  • Name indexes idx_table_column

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,629. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.