Back to skills
SkillHub ClubAnalyze Data & AIFull StackBackendData / AI

Backend Models

Define database models, schemas, and ORM mappings with proper relationships, constraints, and data integrity rules. Use this skill when creating or modifying ORM model classes, database schema definitions, model relationships, validators, or working with files like models.py, schema.prisma, entity classes, or Sequelize/TypeORM/ActiveRecord model definitions. Apply this skill when defining primary keys, foreign keys, indexes, unique constraints, timestamps, or when implementing model validation logic, serializers, and data type mappings. This skill ensures models follow naming conventions, include appropriate database constraints, define clear relationships with cascade behaviors, balance normalization with performance needs, and maintain data integrity at both the model and database levels.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
0
Hot score
74
Updated
March 20, 2026
Overall rating
C0.5
Composite score
0.5
Best-practice grade
N/A

Install command

npx @skill-hub/cli install overtimepog-agenttheo-backend-models
databaseormbackendschemamodels

Repository

overtimepog/AgentTheo

Skill path: .claude/skills/backend-models

Define database models, schemas, and ORM mappings with proper relationships, constraints, and data integrity rules. Use this skill when creating or modifying ORM model classes, database schema definitions, model relationships, validators, or working with files like models.py, schema.prisma, entity classes, or Sequelize/TypeORM/ActiveRecord model definitions. Apply this skill when defining primary keys, foreign keys, indexes, unique constraints, timestamps, or when implementing model validation logic, serializers, and data type mappings. This skill ensures models follow naming conventions, include appropriate database constraints, define clear relationships with cascade behaviors, balance normalization with performance needs, and maintain data integrity at both the model and database levels.

Open repository

Best for

Primary workflow: Analyze Data & AI.

Technical facets: Full Stack, Backend, Data / AI.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: overtimepog.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install Backend Models into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/overtimepog/AgentTheo before adding Backend Models to shared team environments
  • Use Backend Models for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: Backend Models
description: Define database models, schemas, and ORM mappings with proper relationships, constraints, and data integrity rules. Use this skill when creating or modifying ORM model classes, database schema definitions, model relationships, validators, or working with files like models.py, schema.prisma, entity classes, or Sequelize/TypeORM/ActiveRecord model definitions. Apply this skill when defining primary keys, foreign keys, indexes, unique constraints, timestamps, or when implementing model validation logic, serializers, and data type mappings. This skill ensures models follow naming conventions, include appropriate database constraints, define clear relationships with cascade behaviors, balance normalization with performance needs, and maintain data integrity at both the model and database levels.
---

# 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 classes (Django models, SQLAlchemy, Prisma, TypeORM, ActiveRecord)
- When defining database schemas, entity classes, or data models
- When establishing relationships between models (one-to-many, many-to-many, foreign keys)
- When adding database constraints (NOT NULL, UNIQUE, CHECK constraints)
- When defining model validators, custom fields, or data type mappings
- When working with files like `models.py`, `schema.prisma`, `entities/`, or model definition files
- When implementing model-level business logic, computed properties, or hooks
- When adding timestamps (created_at, updated_at) or soft delete functionality
- When defining cascade behaviors for relationships (CASCADE, SET NULL, RESTRICT)
- When optimizing model queries with select_related, prefetch_related, or eager loading
- When creating model serializers, schemas, or data transfer objects (DTOs)
- When balancing normalization with denormalization for performance

## Instructions

For details, refer to the information provided in this file:
[backend models](../../../agent-os/standards/backend/models.md)


---

## Referenced Files

> The following files are referenced in this skill and included for context.

### ../../../agent-os/standards/backend/models.md

```markdown
## Database model best practices

- **Clear Naming**: Use singular names for models and plural for tables following your framework's conventions
- **Timestamps**: Include created and updated timestamps on all tables for auditing and debugging
- **Data Integrity**: Use database constraints (NOT NULL, UNIQUE, foreign keys) to enforce data rules at the database level
- **Appropriate Data Types**: Choose data types that match the data's purpose and size requirements
- **Indexes on Foreign Keys**: Index foreign key columns and other frequently queried fields for performance
- **Validation at Multiple Layers**: Implement validation at both model and database levels for defense in depth
- **Relationship Clarity**: Define relationships clearly with appropriate cascade behaviors and naming conventions
- **Avoid Over-Normalization**: Balance normalization with practical query performance needs

```

Backend Models | SkillHub