What problem does it solve?
ASP.NET Core codebases often drift into “fat controllers,” EF entity leakage into Razor views, tangled business rules in UI templates, and unclear separation between HTTP, business logic, and data access. This Skill guides a coding agent to restructure the project into a predictable ASP.NET Core MVC layout with thin controllers, dedicated ViewModels, and service-injected business logic.
Core Features & Use Cases
- Thin controller enforcement: Ensures controller actions validate inputs, delegate to injected services, and return Views with ViewModels (no ORM queries or business rules inside controllers).
- Razor view separation: Keeps Razor views focused on display logic using a dedicated ViewModel as the
@model, avoiding .SaveChanges() and @inject calls for business decisions.
- ViewModel-first modeling: Establishes clear InputModels (validated form submissions via Data Annotations) and Output ViewModels (only the data the view needs), mapped in the service layer.
- Data layer isolation with EF Core: Directs DbContext and EF/repository logic into a Data/ layer, injected where needed but never used directly from controllers.
- Page-centric flow guidance: Recommends Razor Pages for self-contained features, while supporting MVC structure for controller/action-centric flows (including Area organization for larger apps).
Quick Start
Use the ASP.NET Core MVC skill to guide your agent to reorganize controllers, views, ViewModels, and EF Core access into a clean, testable structure starting from your current Program.cs, Program wiring, and existing Views/ or Pages/.