backend-models
Define and structure database models with proper naming conventions, data integrity constraints, and relationship definitions. Use this skill when creating or modifying database model files, defining table schemas, setting up model relationships (one-to-many, many-to-many, one-to-one), working with ORM model files (schema.prisma, models/*, app/models/*, entities/*), implementing data validation at the model level, adding timestamps and audit fields, defining foreign keys and indexes, choosing appropriate data types, configuring cascade behaviors, or balancing database normalization with query performance. Apply this skill when designing database schemas, creating new models, refactoring existing model structures, or reviewing data integrity and relationship configurations.
When & Why to Use This Skill
This Claude skill streamlines the process of defining and structuring backend database models to ensure high data integrity and architectural consistency. It automates the creation of complex schemas, relationship mappings (one-to-one, one-to-many, many-to-many), and ORM configurations for frameworks like Prisma and TypeORM. By enforcing naming conventions and optimizing indexing strategies, it helps developers build scalable, high-performance database layers while maintaining strict adherence to backend coding standards.
Use Cases
- Initial Schema Design: Rapidly defining new database tables with appropriate data types, primary keys, and foreign key constraints.
- ORM Relationship Management: Setting up complex associations and cascade behaviors between models to ensure data consistency across the application.
- Performance Optimization: Adding strategic indexes and balancing normalization to improve query execution speeds in high-traffic environments.
- Data Integrity Enforcement: Implementing model-level validation rules, unique constraints, and audit fields like timestamps for robust data tracking.
- Database Refactoring: Restructuring existing models and relationships to accommodate new features or improve legacy schema designs.
| name | Backend Models |
|---|---|
| description | Define and structure database models with proper naming conventions, data integrity constraints, and relationship definitions. Use this skill when creating or modifying database model files, defining table schemas, setting up model relationships (one-to-many, many-to-many, one-to-one), working with ORM model files (schema.prisma, models/*, app/models/*, entities/*), implementing data validation at the model level, adding timestamps and audit fields, defining foreign keys and indexes, choosing appropriate data types, configuring cascade behaviors, or balancing database normalization with query performance. Apply this skill when designing database schemas, creating new models, refactoring existing model structures, or reviewing data integrity and relationship configurations. |
Backend Models
When to use this skill
- When creating or modifying database model files (e.g.,
schema.prisma,models/*,app/models/*,entities/*) - When defining table schemas and column data types
- When setting up model relationships (one-to-many, many-to-many, one-to-one)
- When adding database constraints (NOT NULL, UNIQUE, foreign keys, check constraints)
- When implementing timestamps (createdAt, updatedAt) and audit fields
- When choosing appropriate data types for columns based on data requirements
- When adding indexes on foreign keys and frequently queried fields
- When defining validation rules at the model or database level
- When configuring cascade behaviors for relationships (CASCADE, SET NULL, RESTRICT)
- When balancing database normalization with practical query performance needs
- When naming models following singular/plural conventions
- When reviewing data integrity and relationship definitions
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