rails-model-generator

Generate Rails model scaffolds with specs, factories, and migrations via TDD.

Updated Nov 1, 2025
One-click install
npx skills add https://github.com/nschneble/rails-superstack --skill rails-model-generator-nschneble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-model-generator
Source: https://github.com/nschneble/rails-superstack/tree/main/.agents/skills/rails-model-generator
Command: npx skills add https://github.com/nschneble/rails-superstack --skill rails-model-generator-nschneble

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Creates Rails models using a Test-Driven Development approach: specify requirements, write specs first, generate migrations, implement models, and iterate with validations and associations to ensure robust, well-tested code.

Core Features & Use Cases

  • TDD-driven model creation workflow: spec first, then migration, then model implementation.
  • Generates a complete scaffold including specs, factories, and templates to guide validations and associations.
  • Ideal for adding new models, validating complex validations, and establishing database tables with confidence.

Quick Start

Define the model requirements using the Step 1 template, then run the generator to scaffold the model, tests, and migration following the TDD workflow.

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 a Rails model using a TDD workflow?

To generate a Rails model using a TDD workflow, you define requirements, write RSpec specs first, create FactoryBot factories, generate migrations, and implement the model. This ensures robust, well-tested code by validating behavior before implementation.

What is the best way to scaffold Rails models with RSpec and FactoryBot?

The best way to scaffold Rails models with RSpec and FactoryBot is using an automated TDD-driven scaffolder. It creates the complete model cycle—specs, factories, migrations, and model files—ensuring validations and associations are established with confidence.

Do I need RSpec and FactoryBot installed to run Rails model generators?

Yes, you need RSpec and FactoryBot installed to run Rails model generators using this TDD workflow. A Ruby on Rails environment with these dependencies is required to write specs, run tests, and verify behavior throughout the scaffolding cycle.

How does test-driven development apply to Rails migrations and model setup?

Test-driven development applies to Rails migrations by specifying requirements and writing specs before creating migrations and implementing models. This approach guides validation and association setup across the complete cycle, ensuring database tables are established with confidence.

Can I add complex validations to an existing Rails model using TDD?

Yes, you can add complex validations to a Rails model using TDD. The generator guides validation and association setup by iterating from specs to implementation, allowing you to validate complex rules and ensure robust, well-tested code behavior.