rails-controller

Generate Rails controllers from failing request specs using TDD.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates a repeatable, TDD-driven workflow for generating Rails controllers, ensuring request specs guide implementation and reducing boilerplate in RESTful design.

Core Features & Use Cases

  • Generates RESTful Rails controllers scaffold with request-spec first approach, enabling red-green-refactor workflow.
  • Integrates with common Rails conventions (Pundit authorization, Pagy pagination, Presenters, multi-tenancy via current_account, and Turbo Stream responses) to produce production-ready controllers.
  • Supports namespaced and nested controllers with consistent patterns and test coverage; ideal for CRUD resources and API endpoints.

Quick Start

Write a failing request spec in spec/requests/, then implement the controller actions and run the tests to see RED and GREEN.

Frequently Asked Questions about rails-controller

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

FAQPage Schema
How do I build Rails controllers using a TDD workflow?

Rails controllers built with TDD require a failing request spec in spec/requests/ first, then implementing the controller actions and running tests to achieve GREEN. This enforces a red-green-refactor workflow that reduces boilerplate in RESTful design.

Can I generate namespaced and nested Rails controllers with request specs?

Yes, namespaced and nested Rails controllers can be generated with consistent patterns and test coverage. The workflow supports both namespaced and nested controllers, making it ideal for CRUD resources and API endpoints using request-spec first approach.

Does this Rails controller workflow support Pundit authorization and multi-tenancy?

Yes, the Rails controller workflow integrates with Pundit authorization and multi-tenancy via current_account. It also supports Pagy pagination, Presenters, and Turbo Stream responses to produce production-ready controllers.

What is the best way to add Turbo Stream responses to Rails 8 controllers?

The best way to add Turbo Stream responses in Rails 8 controllers is through a TDD-first workflow that generates RESTful resources with Turbo Stream support built-in. This ensures request specs guide implementation and reduce boilerplate.

How do I write request specs first before implementing Rails controller actions?

To write request specs first, place a failing request spec in spec/requests/, then implement the controller actions and run the tests to see RED and GREEN. This TDD-first approach ensures specs guide the implementation of RESTful controllers.

Why does my Rails controller need a failing request spec before implementation?

A failing request spec is needed before implementation to enforce a TDD-driven workflow that ensures test coverage guides the controller actions. This reduces boilerplate and creates repeatable, production-ready RESTful controllers.