advanced-alchemy-modeling

Installation
SKILL.md

Modeling

Execution Workflow

  1. Choose a base class around key shape and audit needs: BigIntBase, BigIntAuditBase, UUIDBase, UUIDv7Base, or related variants.
  2. Add mixins intentionally: SlugKey for URL slugs, audit columns when timestamps are required, and UniqueMixin when get-or-create semantics matter.
  3. Model relationships with explicit loading strategy such as selectin or joined instead of relying on defaults.
  4. Use UniqueMixin to collapse duplicate creation logic for tags, lookup tables, and many-to-many helper models.
  5. Customize the declarative base only when the built-in bases do not fit an existing schema or database-specific requirement.

Implementation Rules

  • Pick one primary-key strategy per bounded context and keep it consistent.
  • Let mixins own their concern; do not duplicate slug or audit columns by hand.
  • Implement both unique_hash() and unique_filter() whenever UniqueMixin is used.
  • Keep model classes transport-agnostic and leave request or response shaping to services or framework layers.

Example Pattern

Related skills

More from alti3/litestar-skills

Installs
11
GitHub Stars
5
First Seen
Mar 9, 2026