# Design Reliable Backend Models

Database models often drift without clear naming, relationships, and constraints. This skill guides Claude, Codex, and Claude Code through consistent ORM model design.

## Install

```bash
npx skillstore add eis-its/backend-models
```

## Metadata

- Status: approved
- Slug: eis-its-backend-models
- Skillstore revision: r1
- Version status: missing
- Tree hash: 6f60296a79db8efb0071fd481cd902d4c0072a09786ec098311bed3f0fc2a76e
- Author: EIS-ITS
- GitHub username: EIS-ITS
- License: MIT
- Repository: https://github.com/EIS-ITS/vss-cli/tree/main/.claude/skills/backend-models
- Ref: 26421118b848d9f1efc0aa169d8a7a9e7e0a877e
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: filesystem
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/eis-its-backend-models
- Manifest: https://skillstore.pages.dev/api/skills/eis-its-backend-models/manifest

## Capabilities

- Guides creation of model classes and database table definitions.
- Supports relationship planning for one-to-many and many-to-many models.
- Covers validation rules, database constraints, and foreign keys.
- Helps choose model attributes, data types, timestamps, and indexes.
- Addresses cascade behavior for related records.
- Supports model methods, scopes, and query helper design.

## Use Cases

- Create a new entity model: Define fields, relationships, validations, indexes, and timestamps for a new backend domain entity.
- Improve data integrity rules: Review existing models and identify missing constraints, foreign keys, validations, or cascade behavior.
- Standardize ORM patterns: Align ActiveRecord, SQLAlchemy, Sequelize, or Prisma model changes with shared backend conventions.

## Prompt Templates

### Create a model

```
Create a backend model for [entity]. Include fields, data types, required validations, timestamps, and basic indexes.
```

### Add relationships

```
Update the [entity] model to support [relationship]. Include foreign keys, constraints, cascade behavior, and validation rules.
```

### Refactor model structure

```
Review these existing model requirements and propose a cleaner model structure with stronger naming, constraints, and query helpers.
```

### Audit domain models

```
Audit this backend model design for integrity gaps. Check relationships, indexes, validation rules, constraints, scopes, and lifecycle behavior.
```

## Limitations

- The detailed standards file is referenced outside the skill package.
- It does not inspect a live database schema by itself.
- It does not run migrations or verify database constraints.
- Framework-specific behavior still needs project context.

## Best Practices

- Provide the target framework and ORM before asking for model changes.
- Share existing naming conventions, relationship rules, and migration expectations.
- Ask for constraints and indexes with every model design.

## Anti Patterns

- Do not accept model designs without database-level integrity rules.
- Do not mix unrelated domain concepts into one oversized model.
- Do not use this skill as a substitute for migration testing.

## Security Audit

- Audited at: 2026-07-09T14:05:46.117\+00:00
- Summary: The skill contains one confirmed filesystem finding. SKILL.md line 28 instructs the agent to follow a relative path that escapes the skill directory, which can pull unaudited instructions into the workflow.

## Stats

- Views: 191
- Downloads: 14
- Favorites: 0
- Popularity score: 0
