← ClaudeAtlas

backend-models-standardslisted

Define database models with clear naming, appropriate data types, constraints, relationships, and validation at multiple layers. Use this skill when creating or modifying database model files, ORM classes, schema definitions, or data model relationships. Apply when working with model files (e.g., models.py, models/, ActiveRecord classes, Prisma schema, Sequelize models), defining table structures, setting up foreign keys and relationships, configuring cascade behaviors, implementing model validations, adding timestamps, or working with database constraints (NOT NULL, UNIQUE, foreign keys). Use for any task involving data integrity enforcement, relationship definitions, or model-level data validation.
Microck/ordinary-claude-skills · ★ 394 · API & Backend · score 79
Install: claude install-skill Microck/ordinary-claude-skills
# Backend Models Standards **Core Rule:** Models define data structure and integrity. Keep them focused on data representation, not business logic. ## When to use this skill - When creating or modifying database model files (models.py, models/, schema.prisma, etc.) - When defining ORM classes or ActiveRecord models for database tables - When establishing table relationships (one-to-many, many-to-many, has-many, belongs-to) - When configuring foreign keys, indexes, and cascade behaviors - When implementing model-level validation rules - When adding timestamp fields (created_at, updated_at) for auditing - When setting database constraints (NOT NULL, UNIQUE, CHECK constraints) - When choosing appropriate data types for model fields - When balancing normalization with query performance needs - When defining model methods or scopes for common queries 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. ## Naming Conventions **Models:** Singular, PascalCase (`User`, `OrderItem`, `PaymentMethod`) **Tables:** Plural, snake_case (`users`, `order_items`, `payment_methods`) **Relationships:** Descriptive and clear - `user.orders` (one-to-many) - `order.items` (one-to-many) - `product.categories` (many-to-many) **Avoid generic names:** `data`, `info`, `record`, `entity` ## Required Fields **Timestamps on every model:** ```python created_at = Column(DateTime, nullable=False, default=da