What problem does it solve?
This Skill solves the problem of building correct Rails models reliably without guessing validations, associations, scopes, or database constraints by guiding you through a TDD-first creation flow.
Core Features & Use Cases
- TDD-first model workflow: Define model requirements, write the model tests (expecting RED), then generate migrations and implement the model until tests pass (GREEN).
- Validation and association scaffolding: Includes templates and patterns for common Rails concerns like presence/uniqueness/format validations, enums, scopes, callbacks, and association behavior.
- Database-ready migrations: Produces migration guidance including indexes, defaults, null constraints, and multi-tenant ownership considerations.
- Use case: When adding a new domain model (e.g., a Tenant-scoped User/Account child model) with required attributes, uniqueness rules, associations to other records, and scoped queries, use this Skill to generate the full implementation loop with tests driving correctness.
Quick Start
Use the rails-model-generator skill to create a new Rails model by describing its table, attributes, validations, associations, and scopes, then follow the TDD checklist to generate the migration and implement the model until the tests pass.