rails-model-generator

Generate Rails model specs, migrations, and scaffolding with RSpec and FactoryBot.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/reckerswartz/resume_builder --skill rails-model-generator-reckerswartz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-model-generator
Source: https://github.com/reckerswartz/resume_builder/tree/main/.windsurf/skills/rails-model-generator
Command: npx skills add https://github.com/reckerswartz/resume_builder --skill rails-model-generator-reckerswartz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates Rails models using a TDD approach - spec first, then migration, then model. Use when creating new models, adding model validations, defining associations, or setting up database tables.

Core Features & Use Cases

  • Spec-first scaffolding: write model specs, generate corresponding models and migrations automatically.
  • Validation and association helpers: scaffold validations and associations as per requirements.
  • End-to-end workflow: supports creating new models, adding validations, defining associations, and setting up database tables in Rails apps.

Quick Start

Define the model name, attributes, and associations, then run the generator to create the spec, migration, and model scaffolding end-to-end.

Frequently Asked Questions about rails-model-generator

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

FAQPage Schema
How do I generate Rails models using a spec-first TDD approach?

To generate Rails models using a spec-first TDD approach, you define the model name, attributes, and associations, then run the generator to automatically create RSpec tests, migrations, and model scaffolding end-to-end.

Can I add validations and associations to an existing Rails model with this scaffolding tool?

Yes, you can add validations and associations by writing the corresponding RSpec tests first, which then triggers the automatic generation of the updated model scaffolding and deterministic database migrations.

Does this Rails model generator work with RSpec and FactoryBot in Rails 8 apps?

Yes, this Rails model generator works explicitly with RSpec and FactoryBot in Rails 8 apps, satisfying end-to-end workflow requirements including spec-driven scaffolding and clean, maintainable model implementations.

What is the best way to create deterministic migrations from RSpec model specs?

The best way to create deterministic migrations from RSpec model specs is using an automated TDD-driven generator that reads your spec requirements and scaffolds the database migration alongside the model implementation simultaneously.

Why write model specs before migrations when creating new Rails database tables?

Writing model specs before migrations ensures a test-first approach that validates your database design requirements upfront, leading to cleaner, maintainable model implementations and deterministic migrations in your Rails application.