scaffold-controller

Generates ASP.NET Core REST API controllers with CRUD endpoints, authorization, and MediatR integration.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill scaffold-controller-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffold-controller
Source: https://github.com/GSU26SE55/backend/tree/main/.claude/skills/dev/be/scaffold-controller
Command: npx skills add https://github.com/GSU26SE55/backend --skill scaffold-controller-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing boilerplate REST API controllers for every new entity in a .NET microservice is repetitive and error-prone, especially when each controller must follow strict conventions for routing, authorization policies, and MediatR command/query dispatch. ## Core Features & Use Cases - Full CRUD Scaffolding: Generates a controller with list, detail, create, update, soft-delete, and restore endpoints wired to MediatR commands and queries. - Authorization Conventions: Applies role-based policies such as AdminOnly and ManagerOnly, with public access for GET endpoints by default. - Routing Standards: Enforces lowercase, plural, kebab-case routes and thin controllers that contain no business logic. - Use Case: When adding a new Battery entity to BatteryService, run the scaffold to instantly produce a standards-compliant BatteryController instead of hand-writing six endpoints. ## Quick Start Ask the AI to scaffold a controller for a given service and entity, for example by saying: scaffold a controller for BatteryService with the Battery entity.

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 REST API controller in ASP.NET Core with MediatR?▼

Provide the service name and entity name as arguments, and the scaffold generates a controller where each endpoint calls _mediator.Send with the corresponding command or query. The controller stays thin with no business logic inside.

What endpoints does a generated CRUD controller include?▼

The generated controller includes GET list, GET by id, POST create, PUT update, DELETE soft-delete, and PATCH restore endpoints. Custom actions can be added as PATCH routes under /{id}/action.

How does role-based authorization work in the generated controller?▼

The scaffold applies [Authorize] for authenticated users on create and update, and [Authorize(Policy = "AdminOnly")] for delete and restore. GET list and detail endpoints remain public by default, and ManagerOnly policy is available for adjustment.

What routing conventions does the scaffolded controller follow?▼

Routes are lowercase, plural, and kebab-case, such as /api/battery-logs. POST and PUT bind from the request body with [FromBody], while GET endpoints bind parameters with [FromQuery].

When should I not use controller scaffolding for a new endpoint?▼

Avoid scaffolding when the endpoint does not map to standard CRUD operations, such as webhook receivers, file streaming, or aggregate reporting endpoints. Those cases need hand-written controllers with custom logic beyond MediatR command dispatch.