What problem does it solve?
Lucid ORM models provide the data layer for AdonisJS applications, but patterns vary and business logic can creep into models. This Skill defines standardized model patterns for columns, relationships, computed properties, hooks, and safe serialisation to improve consistency and maintainability.
Core Features & Use Cases
- Define columns and their types via decorators to ensure type-safety and serialisation.
- Define relationships (belongsTo, hasMany, hasOne, manyToMany) to model domain entities and navigable aggregates.
- Implement computed properties (accessors) for derived state without business logic in models.
- Use model hooks for lifecycle side effects while keeping core business rules in services/actions.
- Apply scopes, soft deletes, and mixins/traits to compose reusable behaviour.
- Organize models with clear structure, naming, and versionable patterns for maintainability across projects.
Quick Start
Scaffold a new AdonisJS Lucid model with columns, relations, hooks, and optional features following the patterns shown.