scaffold-controller

Scaffold Rails resources with HTML views, API endpoints, and RSpec tests.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/erwaen/one-shot-test --skill scaffold-controller
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-controller
Source: https://github.com/erwaen/one-shot-test/tree/main/.claude/skills/scaffold-controller
Command: npx skills add https://github.com/erwaen/one-shot-test --skill scaffold-controller

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of a full Rails resource by generating a controller, views, API endpoint, serializer, routes, and end-to-end request specs, eliminating repetitive boilerplate.

Core Features & Use Cases

  • HTML controller with RESTful actions, Pundit authorization, and proper flash messages.
  • ERB views for index/show/new/edit with Bootstrap styling and form handling.
  • API controller under api/v1 with JSON:API-compliant responses and proper error handling.
  • Serializer that exposes only needed fields and aligns with API contracts.
  • Route setup and a ready-made RSpec request spec covering roles and permissions.

Quick Start

Provide the resource name and the tool will scaffold the controller, routes, API, and tests for that resource.

Frequently Asked Questions about scaffold-controller

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

FAQPage Schema
How do I scaffold a Rails controller with API endpoints and RSpec tests?

Scaffolding a Rails controller with API endpoints and tests requires generating the HTML controller, Pundit policy, ERB views, API controller, serializer, routes, and RSpec request specs following Rails conventions.

Does this Rails scaffolding tool generate Pundit authorization policies?

Yes, this Rails scaffolding tool generates Pundit authorization policies, implementing a Pundit policy alongside the HTML controller, API controller, and RSpec request specs to manage permissions.

Can I generate JSON:API compliant serializers and API controllers in Rails?

Yes, you can generate JSON:API compliant serializers and API controllers in Rails. The scaffolding creates an API controller under api/v1 with JSON:API-compliant responses, error handling, and a serializer exposing only needed fields.

What is the best way to add Bootstrap styled ERB views for a new Rails resource?

The best way to add Bootstrap styled ERB views for a new Rails resource is using a scaffolding generator that automatically produces index, show, new, and edit ERB views with Bootstrap styling and form handling.

How do I create RSpec request specs that cover roles and permissions for a Rails API?

To create RSpec request specs covering roles and permissions for a Rails API, use a scaffolding generator that produces ready-made request specs testing Pundit authorization policies alongside JSON:API endpoints.