rails-controller

Create Rails controllers with integration-test-first development and Turbo Stream responses.

3|Updated Oct 16, 2025
One-click install
npx skills add https://github.com/dchuk/source_monitor --skill rails-controller-dchuk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-controller
Source: https://github.com/dchuk/source_monitor/tree/main/.claude/skills/rails-controller
Command: npx skills add https://github.com/dchuk/source_monitor --skill rails-controller-dchuk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps Rails developers adopt a test-driven workflow to create controllers, ensuring integration tests guide the implementation and reduce regressions.

Core Features & Use Cases

  • RESTful controller scaffolding aligned with project conventions.
  • Integration-test-first approach that drives action creation and routing.
  • Multi-tenancy support, authorization, and Turbo Stream responses for dynamic updates.

Quick Start

Write a failing integration test in test/controllers/ or test/integration/, run the test to RED, implement the controller action, then re-run tests until GREEN.

Frequently Asked Questions about rails-controller

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

FAQPage Schema
How do I create Rails controllers using a test-driven development workflow?

To create Rails controllers with test-driven development, write a failing integration test first, run it to RED, implement the controller action to satisfy the test, then re-run tests until GREEN. This ensures integration tests guide the implementation and reduce regressions.

What is the best way to add Turbo Stream responses to a Rails controller?

Adding Turbo Stream responses to a Rails controller involves implementing actions that respond to the Turbo Stream format alongside HTML. This Skill generates controllers that deliver dynamic updates by verifying behavior across both HTML and Turbo Stream formats using integration tests.

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

Yes, this Rails controller generation approach supports multi-tenancy and Pundit authorization. It applies project conventions like Pundit policy_scope usage, current_account multi-tenancy, and Pagy pagination directly within the generated controller actions and tests.

How do I test Rails controller behavior across different response formats like HTML and Turbo Stream?

Testing Rails controller behavior across HTML and Turbo Stream formats requires writing integration tests that assert responses for each format. This Skill drives development by creating integration tests verifying complete CRUD actions and behavior across both formats before implementation.

Can I use integration tests to drive the creation of RESTful controller actions in Rails?

Yes, you can use integration tests to drive the creation of RESTful controller actions in Rails. This approach ensures tests fail before implementation, guiding routing and action creation while applying strong parameters and complete CRUD behaviors.

What are the limitations of test-first controller scaffolding for Rails projects?

The limitations of test-first controller scaffolding include a strict dependency on existing project conventions like Pundit, Pagy, and Presenters. It requires writing and running failing integration tests before any action implementation, which may slow down rapid prototyping.