Skip to content
Back to skills

Database Schema Design

ASecurity

Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.

  • 549 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill database-schema-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Database Schema Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Database Schema Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-database-schema-design-agent-skills-standard/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-database-schema-design-agent-skills-standard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: database-schema-design
description: Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.
metadata:
  triggers:
    files:
    - '**/*.entity.ts'
    - 'prisma/schema.prisma'
    - '**/*.json'
    keywords:
    - schema
    - data model
    - cardinality
    - embed
    - normalize
---
# Database Schema Design

## **Priority: P0 (CRITICAL)**

Start from reads, writes, and ownership. Schema follows access patterns, not vice versa.

## Rules

- Model one business concept per table/collection boundary.
- Choose embed vs reference or normalize vs denormalize from cardinality, update frequency, and read locality.
- Encode uniqueness, nullability, and foreign-key or ownership rules explicitly.
- Prefer additive evolution over destructive redesigns.

## Verify

- [ ] Hot reads are supported without avoidable joins or fan-out.
- [ ] Cardinality and lifecycle were written down for major relationships.
- [ ] Constraints or validation rules exist for business invariants.
- [ ] IDs, timestamps, and soft-delete semantics are consistent.

## Anti-Patterns

- **No schema from ORM defaults**: model business access patterns first.
- **No many-to-many without owner rules**: define source of truth and cleanup behavior.
- **No nullable drift**: nullable fields need lifecycle meaning.

## References

- [Framework Map](../references/framework-map.md)
- [Normalization Tradeoffs](references/normalization-tradeoffs.md)

Files in this skill

  • SKILL.md1.5 KB
  • evals/evals.json1.2 KB
  • references/normalization-tradeoffs.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…