controller-patterns

Review and standardize Rails controllers for RESTful conventions and authorization.

6|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/RoleModel/rolemodel-skills --skill controller-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: controller-patterns
Source: https://github.com/RoleModel/rolemodel-skills/tree/main/skills/controller-patterns
Command: npx skills add https://github.com/RoleModel/rolemodel-skills --skill controller-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rails applications often suffer from inconsistent controller patterns, weak authorization, and scattered error handling, making maintenance hard and security risky.

Core Features & Use Cases

  • Authorization integration: ensures every action is checked against policies and scopes.
  • RESTful action scaffolding: promotes standard index/show/new/create/edit/update/destroy patterns.
  • Before actions and strong params: centralizes resource loading and parameter whitelisting for security.
  • Consistent messaging and status codes: standardizes redirects, flash notices, and HTTP responses.
  • Guided code generation: provides templates and examples to jumpstart new controllers with best practices.

Quick Start

To review a controller or generate a new one, ask the AI to apply Rails controller patterns to your ProductsController with strong params for name, description, and price.

Frequently Asked Questions about controller-patterns

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

FAQPage Schema
How do I enforce RESTful conventions and authorization checks in Rails controllers?

To enforce RESTful conventions and authorization checks in Rails controllers, apply standardized patterns that integrate policy scopes, use before_actions for resource loading, and scaffold standard index, show, create, and destroy actions consistently.

What is the best way to standardize error handling and flash messages across Rails controllers?

Standardizing error handling and flash messages in Rails involves applying consistent controller patterns to centralize HTTP status codes, redirects, and flash notices, ensuring maintainable organization across all actions.

How do I scaffold a new Rails controller with strong parameters and before_actions?

Scaffolding a new Rails controller with strong parameters and before_actions requires guided code generation that centralizes parameter whitelisting for security and resource loading, promoting standard RESTful action patterns.

Can I use this controller pattern review on existing Rails controllers?

Yes, this controller pattern review can be applied to existing Rails controllers to automate the enforcement of best practices, ensuring proper RESTful conventions, authorization checks, and error handling are integrated.

Does this approach support Rails conventions for strong parameters and before_actions?

Yes, this approach fully supports Rails conventions by adhering to strong parameters for whitelisting, before_actions for centralized resource loading, and standard RESTful action scaffolding as part of its functional requirements.