controller-agent

Generate thin RESTful Rails controllers with Pundit authorization and request specs.

Updated Nov 1, 2025
One-click install
npx skills add https://github.com/nschneble/rails-superstack --skill controller-agent-nschneble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: controller-agent
Source: https://github.com/nschneble/rails-superstack/tree/main/.agents/skills/controller-agent
Command: npx skills add https://github.com/nschneble/rails-superstack --skill controller-agent-nschneble

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers avoid bloated controllers by generating thin, RESTful Rails controllers that delegate business logic to services, enforce authorization with Pundit, and accompany each action with request specs.

Core Features & Use Cases

  • Thin Controllers that orchestrate workflows by delegating to services and policies.
  • RESTful Actions that follow Rails conventions (index, show, new, create, edit, update, destroy) and proper HTTP status handling.
  • Authorization & Error Handling with Pundit policies and standardized error responses.
  • Use cases include creating resources like Articles or Users, updating routes, and ensuring end-to-end test coverage with request specs.

Quick Start

Provide a resource name and attributes, and the skill will generate a RESTful controller scaffold with specs.

Frequently Asked Questions about controller-agent

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

FAQPage Schema
How do I generate thin Rails controllers with service objects and authorization?

You can scaffold thin RESTful Rails controllers by providing a resource name and attributes, which generates actions delegating to service objects and Pundit policies alongside RSpec request specs.

How do I add Pundit authorization to a Rails controller scaffold?

Pundit authorization is enforced automatically within each generated RESTful controller action, ensuring proper policy checks before delegating business logic to service objects.

What is the best way to test Rails controllers with RSpec request specs?

Automatically generating RSpec request specs in spec/requests provides end-to-end test coverage for each RESTful controller action and its HTTP status handling, ensuring proper validation.

Does this Rails controller generator work with Rails 8?

This generator targets Rails 8+ applications, producing RESTful controllers with standard actions like index, show, new, create, edit, update, and destroy following current Rails conventions.

How do I prevent bloated Rails controllers when creating new resources?

You prevent bloated controllers by generating thin controllers that orchestrate workflows by delegating business logic to service objects and Pundit policies, avoiding direct logic implementation in the controller.

Can I generate standard RESTful controller actions with error handling for Rails?

You can generate standard RESTful actions with standardized error responses and proper HTTP status handling, following Rails conventions for resources like Articles or Users.