backend-models

定义具有适当数据类型、约束、关系和验证规则的数据库模型和架构。在创建或修改数据库模型、ORM实体、架构定义或数据验证层时使用此技能。当处理Prisma架构文件、TypeORM实体、Drizzle架构定义、Mongoose模型、数据库模型类、定义表结构和关系的文件、数据库实体的验证模式或实现数据完整性约束和级联行为的文件时使用此功能。

📖 中文导读:定义具有适当数据类型、约束、关系和验证规则的数据库模型和架构。在创建或修改数据库模型、ORM实体、架构定义或数据验证层时使用此技能。当处理Prisma架构文件、TypeORM实体、Drizzle架构定义、Mongoose模型、数据库模型类、定义表结构和关系的文件、数据库实体的验证模式或实现数据完整性约束和级联行为的文件时使用此功能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Backend Models description: Define database models and schemas with proper data types, constraints, relationships, and validation rules. Use this skill when creating or modifying database models, ORM entities, schema definitions, or data validation layers. When working on Prisma schema files, TypeORM entities, Drizzle schema definitions, Mongoose models, database model classes, files defining table structures and relationships, validation schemas for database entities, or files implementing data integrity constraints and cascading behaviors.

Backend Models

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend models.

When to use this skill

  • When creating or modifying Prisma schema files (schema.prisma)
  • When defining TypeORM entities or Drizzle schema definitions
  • When writing Mongoose schemas or Sequelize models
  • When implementing database table structures with columns and data types
  • When defining relationships between models (one-to-one, one-to-many, many-to-many)
  • When adding database constraints (NOT NULL, UNIQUE, CHECK, foreign keys)
  • When creating indexes on model fields for query performance
  • When implementing model-level validation rules or business logic
  • When defining cascade behaviors for related data (CASCADE, SET NULL, RESTRICT)
  • When setting up timestamps (createdAt, updatedAt) or soft delete functionality

Instructions

For details, refer to the information provided in this file: backend models