rails-controller

Generates Rails controllers with TDD request specs and CRUD operations.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/mlbright/notes --skill rails-controller-mlbright
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rails-controller
Source: https://github.com/mlbright/notes/tree/main/.github/skills/rails-controller
Command: npx skills add https://github.com/mlbright/notes --skill rails-controller-mlbright

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of new Rails controllers by enforcing a Test-Driven Development (TDD) approach, ensuring robust and well-tested code from the outset.

Core Features & Use Cases

  • TDD Workflow: Guides users through writing request specs before controller implementation.
  • Convention Adherence: Promotes project-specific conventions like Pundit for authorization and Pagy for pagination.
  • CRUD Operations: Facilitates the implementation of standard Create, Read, Update, and Delete actions.
  • Use Case: When building a new feature that requires managing user profiles, use this Skill to generate the UsersController with all necessary CRUD actions and corresponding request specs.

Quick Start

Write a failing request spec for your new controller action in spec/requests/ and then implement the controller.

Frequently Asked Questions about rails-controller

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

FAQPage Schema
How do I generate Rails controllers using TDD?▼

This Skill guides you to write failing RSpec request specs before implementing Rails controllers, ensuring robust CRUD operations and multi-tenancy support from the outset.

Can I use Pundit and Pagy when creating Rails controller actions?▼

Yes, generated Rails controllers integrate with Pundit for authorization and Pagy for pagination. This enforces project-specific conventions during standard CRUD operations and API endpoint creation.

What is the TDD workflow for adding a new action to an existing Rails controller?▼

The TDD workflow for adding actions involves writing a failing request spec in the spec/requests/ directory before implementing the corresponding controller action, ensuring the new behavior is tested immediately.

Does this approach support building API endpoints in Rails?▼

Yes, this approach supports implementing API endpoints within a Rails application. It applies the same test-driven methodology, prioritizing request specs before generating the actual controller implementation.

When should I not use a test-driven approach for Rails controllers?▼

You should avoid test-driven controller generation for rapid prototyping where immediate functionality matters more than test coverage, as this methodology strictly prioritizes writing request specs before any implementation.