scaffold-model

Generate Rails model scaffolds with migration, validations, associations, scopes, and RSpec specs.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/erwaen/one-shot-test --skill scaffold-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-model
Source: https://github.com/erwaen/one-shot-test/tree/main/.claude/skills/scaffold-model
Command: npx skills add https://github.com/erwaen/one-shot-test --skill scaffold-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffolding a new Rails model is time-consuming and error-prone, requiring migrations, model definitions, factories, and tests to be built consistently across projects.

Core Features & Use Cases

  • Automates generation of migration, model, factory, and spec boilerplate that adheres to project conventions.
  • Enforces database and code quality standards, including proper column types, indexing, validations, and scopes.
  • Use Case: Add a new ActiveRecord model like Booking and immediately obtain ready-to-run files and tests that integrate with your CI workflow.

Quick Start

Run the scaffold-model tool with the model name and attributes to generate a production-ready model scaffold.

Frequently Asked Questions about scaffold-model

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

FAQPage Schema
How do I scaffold a Rails model with migrations, validations, and RSpec tests?

To scaffold a Rails model, this tool automates generating the migration, model definitions, validations, associations, scopes, and an RSpec model spec. It produces deterministic files that integrate with standard test and lint workflows using Rails generators, FactoryBot, and RuboCop.

What's the best way to generate production-ready Rails models with consistent boilerplate?

The best way to generate production-ready Rails models is using an automated scaffolding tool that matches existing model conventions and enforces database and code quality standards. It outputs ready-to-run migration, factory, and spec files that integrate directly with your CI workflow.

Can I use FactoryBot and RuboCop when scaffolding new ActiveRecord models?

Yes, you can use FactoryBot and RuboCop when scaffolding new ActiveRecord models. The tool applies these dependencies to generate consistent code and tests, ensuring the produced model factories and specs adhere to your project's linting and testing conventions.

Do I need a Rails project environment to scaffold new models and migrations?

Yes, you need a Rails project environment and Ruby to scaffold new models and migrations. The tool relies on Rails generators within an existing project context to produce deterministic files that match your current database schema and code conventions.

Why does my Rails model scaffolding fail to match existing project conventions?

Rails model scaffolding may fail to match conventions if the tool does not analyze existing models. This tool targets production-grade adoption by explicitly matching existing models, applying conventions, and producing deterministic files to ensure consistency across your project.

What is automated Rails model scaffolding and when do I need it?

Automated Rails model scaffolding is the process of generating migration, model, factory, and spec boilerplate simultaneously. You need it when adding a new ActiveRecord model to ensure consistent database indexing, validations, and tests without manual, error-prone file creation.