AgentSkillsCN

Backend Models

定义数据库模型和模式,包括正确的命名、数据类型、约束、关系和索引策略。适用于创建或修改数据库模型、实体定义或模式文件时。适用于处理models.py、models/*.ts、entities/*.ts、schema.prisma或ORM模型定义文件时。适用于定义表结构、设置外键关系、添加数据库约束(NOT NULL、UNIQUE)、选择合适的数据类型或实现模型级验证时。

SKILL.md
--- frontmatter
name: Backend Models
description: Define database models and schemas with proper naming, data types, constraints, relationships, and indexing strategies. Use this skill when creating or modifying database models, entity definitions, or schema files. When working on files like models.py, models/*.ts, entities/*.ts, schema.prisma, or ORM model definitions. When defining table structures, setting up foreign key relationships, adding database constraints (NOT NULL, UNIQUE), choosing appropriate data types, or implementing model-level validation.

When to use this skill:

  • When creating new database model or entity files
  • When modifying existing model definitions
  • When working on files in models/, entities/, or schema/ directories
  • When defining table columns and their data types
  • When setting up relationships between models (one-to-one, one-to-many, many-to-many)
  • When adding database constraints (NOT NULL, UNIQUE, foreign keys)
  • When creating indexes on foreign keys and frequently queried columns
  • When adding timestamps (created_at, updated_at) to models
  • When implementing cascade behaviors for relationships
  • When balancing database normalization with query performance
  • When adding model-level validation rules

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.

Instructions

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