api-controller-generator

Generate ASP.NET Core RESTful API controllers with MediatR, versioning, and authorization.

69|13|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/ronnythedev/dotnet-clean-architecture-skills --skill api-controller-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-controller-generator
Source: https://github.com/ronnythedev/dotnet-clean-architecture-skills/tree/main/sample/POS/.claude/skills/07-api-controller-generator
Command: npx skills add https://github.com/ronnythedev/dotnet-clean-architecture-skills --skill api-controller-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of RESTful API controllers in ASP.NET Core projects, eliminating boilerplate and enforcing consistent patterns for versioning, routing, and authorization.

Core Features & Use Cases

  • MediatR integration: Controllers dispatch commands and queries via ISender, reducing direct coupling to handlers.
  • API versioning and routing: Generates controllers that follow versioned routes and consistent naming conventions for stability.
  • Authorization and security: Includes role-based and permission-based access controls with attributes like Authorize and HasPermission.
  • Consistent responses and DTOs: Encourages a clear separation between API layer DTOs and domain models, with standard HTTP status codes.
  • Use Case: Quickly scaffold a new feature's API surface in a Clean Architecture solution, including CRUD patterns and common templates.

Quick Start

Create a new controller scaffold by targeting a feature and entity, then integrate the generated code into your ASP.NET Core API project. Ensure MediatR, API versioning, and authorization are properly configured and that the necessary policies exist.

Frequently Asked Questions about api-controller-generator

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

FAQPage Schema
How do I generate boilerplate RESTful API controllers for ASP.NET Core?

You can scaffold RESTful API controllers in ASP.NET Core by targeting a feature and entity, which generates boilerplate code with versioned routes, routing conventions, and standard HTTP status codes ready for project integration.

How does MediatR integrate with generated ASP.NET Core API controllers?

Generated ASP.NET Core API controllers integrate MediatR by dispatching commands and queries via ISender, reducing direct coupling to handlers and enforcing Clean Architecture separation in your RESTful API project.

Can I apply API versioning and role-based authorization when scaffolding ASP.NET Core controllers?

Yes, you can apply API versioning and role-based authorization when scaffolding ASP.NET Core controllers. The generated code supports versioned routes and includes role-based and permission-based access controls like Authorize and HasPermission attributes.

Do I need pre-configured authorization policies to use the generated ASP.NET Core controller boilerplate?

Yes, you need pre-configured authorization policies. You must ensure authorization is properly configured and that necessary permission policies exist before integrating the generated controller boilerplate into your ASP.NET Core solution.

What is the best way to scaffold CRUD API endpoints in a Clean Architecture ASP.NET Core solution?

The best way to scaffold CRUD API endpoints in a Clean Architecture solution is using automated controller generation, which provides common CRUD templates, DTO separation, and standard HTTP status codes to accelerate ASP.NET Core development.

Why do the generated ASP.NET Core controllers separate API layer DTOs from domain models?

The generated ASP.NET Core controllers separate API layer DTOs from domain models to enforce clear separation of concerns, returning standard HTTP status codes while maintaining consistent response structures across the RESTful API surface.

Related Skills