rails-models

Manage Rails ActiveRecord models, migrations, indexes, and schema formats.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/jcuervo/rails-skills --skill rails-models-jcuervo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-models
Source: https://github.com/jcuervo/rails-skills/tree/main/rails-models
Command: npx skills add https://github.com/jcuervo/rails-skills --skill rails-models-jcuervo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill aids in the design, management, and audit of the domain and persistence layer of Rails applications. It streamlines tasks related to models, associations, validations, scopes, enums, callbacks, and type modeling, along with database migrations, indexing, constraints, schema format, multiple databases, full-text search, and seeds.

Core Features & Use Cases

  • Modeling and Persistence: Design and evolve ActiveRecord models, associations, validations, scopes, enums, callbacks, and type modeling.
  • Migrations and Indexing: Write, edit, and reverse migrations; add indexes and constraints.
  • Schema Format: Choose and manage the schema format between schema.rb and structure.sql.
  • Full-Text Search: Implement full-text or fuzzy search over models.
  • Change Auditing: Record changes to models for audit trails or versioning.
  • Data Protection: Encrypt columns, record consent, export, and erase personal data.
  • Use Case: If you need to create a new model with associations and validations, generate a migration for a new table, or implement full-text search on a model, this Skill can help you do it efficiently.

Quick Start

Use the rails-models skill to create a new model with associations and validations for a User.

Frequently Asked Questions about rails-models

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Rails model with associations and validations?

Rails schema format selection between schema.rb and structure.sql is handled by configuring the database settings. This skill manages the schema format choice to ensure persistence layer consistency, accommodating structure.sql when using database features like full-text search.

How do I implement full-text search on an ActiveRecord model?

Auditing changes to Rails models for audit trails requires recording modifications to model attributes over time. This skill implements change auditing by setting up mechanisms to track updates, ensuring versioning and historical data protection compliance within the domain layer.

Do I need a configured Rails app to manage database migrations?

Yes, you need a configured Rails app with database access to manage database migrations. This skill requires the application to be set up and connected to the database to write, edit, and reverse migrations, add indexes, and apply constraints.

What is the best way to add indexes and constraints to a Rails database?

The best way to add indexes and constraints to a Rails database is through migration generation. This skill writes migrations that define database indexes and constraints, ensuring data integrity and optimizing query performance within the ActiveRecord schema.