AgentSkillsCN

Backend Models

以清晰的命名、恰当的数据类型、合理的约束条件,以及关系定义,构建数据库模型。在创建或修改ORM模型文件、数据库实体定义,或数据结构模式时,应使用此技能。在定义表间关系、外键,以及级联行为时,应使用此技能。在实施模型验证规则、时间戳,或索引时,应使用此技能。在使用SQLAlchemy、Sequelize、ActiveRecord、SQLx、Prisma,或其他类似ORM框架时,应使用此技能。在为列选择合适的数据类型,或建立数据完整性约束(NOT NULL、UNIQUE、外键)时,应使用此技能。

SKILL.md
--- frontmatter
name: Backend Models
description: Define database models with clear naming, appropriate data types, proper constraints, and relationship definitions. Use this skill when creating or modifying ORM model files, database entity definitions, or data structure schemas. When defining table relationships, foreign keys, and cascade behaviors. When implementing model validation rules, timestamps, or indexes. When working with model files in frameworks like SQLAlchemy, Sequelize, ActiveRecord, SQLx, Prisma, or similar ORMs. When choosing appropriate data types for columns or establishing data integrity constraints (NOT NULL, UNIQUE, foreign keys).

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 ORM model files or database entity definitions
  • When defining table relationships (one-to-many, many-to-many, one-to-one)
  • When establishing foreign key constraints and cascade behaviors
  • When choosing appropriate data types for database columns
  • When adding timestamps (created_at, updated_at) to models
  • When implementing data integrity constraints (NOT NULL, UNIQUE, CHECK)
  • When creating indexes on frequently queried columns
  • When working with model validation at the ORM layer
  • When defining model naming conventions (singular vs plural)
  • When working with ORM frameworks like SQLAlchemy, Sequelize, ActiveRecord, SQLx, Diesel, or Prisma

Instructions

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