aspnet-mvc
Skill1 starsChanged 3 months agoApache-2.0View on GitHub
Use for classic ASP.NET MVC 5 or ASP.NET Core MVC applications built with controllers, Razor views, model binding, filters, and server-rendered HTML.
In this repository14 other files it gives its agents.
- aspnet-core-apiSkill
- blazorSkill
- docker-dotnetSkill
- dotnet-expertSkill
- dotnet-file-based-appsSkill
- dotnet-messagingSkill
- dotnet-observabilitySkill
- dotnet-performanceSkill
- dotnet-testingSkill
- dotnet-version-guideSkill
- efcore-postgresqlSkill
- gitlab-basicsSkill
- gitlab-ci-dotnetSkill
- pandocSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 16 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Use for server-rendered MVC applications, controllers, Razor views, view models, routing, model binding, validation, filters, areas, …
- Distinctive: line 30
Do not use for a pure Web API, Blazor-only UI, Razor Pages-only project, or frontend code with no MVC boundary.
- Distinctive: line 36
Do not mix APIs between the two generations.
- Distinctive: line 43
Keep controller actions focused on HTTP/input orchestration.
- Distinctive: line 45
Keep Razor views focused on presentation and use partials or view components for reusable UI.
- Distinctive: line 46
Test routing, binding, validation, authorization, status/redirect behavior, and important rendered output.
- Distinctive: line 47
Run build, tests, and a smoke test through the real host.
- Distinctive: line 51
Use explicit action names, route constraints, and appropriate HTTP verbs.
- Distinctive: line 53
Never bind domain entities directly for writes.
- Distinctive: line 56
Keep GET actions side-effect free.
- Distinctive: line 57
Do not expose exception details or internal IDs unnecessarily.
- Distinctive: line 61
Use strongly typed views and display/editor templates.
- Distinctive: line 64
Do not trust hidden fields for authorization or ownership.
- Distinctive: line 65
Keep localization, date, number, and culture behavior explicit.
- Distinctive: line 66
Avoid database calls from views.
- Distinctive: line 85
Verify runtime generation, routing, binding and validation, antiforgery, authorization, output encoding, error handling, performance, …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ASP.NET MVC
When to Use
Use for server-rendered MVC applications, controllers, Razor views, view models, routing, model binding, validation, filters, areas, layouts, and migration from classic ASP.NET MVC to ASP.NET Core MVC.
When Not to Use
Do not use for a pure Web API, Blazor-only UI, Razor Pages-only project, or frontend code with no MVC boundary.
Identify the Runtime
Classic ASP.NET MVC 5 usually has System.Web, Global.asax, Web.config, App_Start, and packages.config. ASP.NET Core MVC usually has a Microsoft.NET.Sdk.Web project, Program.cs, appsettings.json, and middleware registration.
Do not mix APIs between the two generations. System.Web.Mvc attributes and HttpContext types are not interchangeable with Microsoft.AspNetCore.Mvc.
Workflow
- Identify runtime, target framework, hosting model, route style, view engine, authentication, and dependency injection setup.
- Preserve existing conventions before introducing newer patterns.
- Separate request models, domain models, and view models.
- Keep controller actions focused on HTTP/input orchestration; put business logic in services.
- Validate model state and authorization before side effects.
- Keep Razor views focused on presentation and use partials or view components for reusable UI.
- Test routing, binding, validation, authorization, status/redirect behavior, and important rendered output.
- Run build, tests, and a smoke test through the real host.
Controller and Action Rules
- Use explicit action names, route constraints, and appropriate HTTP verbs.
- Return the correct result: View, PartialView, Redirect, File, NotFound, BadRequest, or ProblemDetails.
- Never bind domain entities directly for writes; use input models and explicit mapping.
- Protect POST forms with antiforgery tokens when cookie authentication is used.
- Validate authorization at resource/action level.
- Keep GET actions side-effect free.
- Do not expose exception details or internal IDs unnecessarily.
Razor and Model Binding
- Use strongly typed views and display/editor templates.
- Encode output by default; treat Html.Raw as a security-sensitive exception.
- Validate both client-side and server-side.
- Do not trust hidden fields for authorization or ownership.
- Keep localization, date, number, and culture behavior explicit.
- Avoid database calls from views.
ASP.NET Core MVC Setup
Inspect Program.cs for AddControllersWithViews, authentication, authorization, static files, routing, and MapControllerRoute. Keep middleware order explicit and configure antiforgery, HTTPS, error handling, caching, and security headers deliberately.
Classic MVC 5 Notes
Inspect Web.config, Global.asax, FilterConfig, RouteConfig, BundleConfig, Areas, and dependency-injection bootstrap. Respect IIS hosting, System.Web lifecycle, machine-key, Forms Authentication, and MVC 5 package constraints.
Migration Notes
- Replace System.Web and HttpModules/HttpHandlers with ASP.NET Core middleware and services.
- Replace Web.config configuration with appsettings, options, environment variables, and secret providers.
- Rework routing, filters, authentication, session, caching, bundling, and static-file behavior instead of only changing namespaces.
- Port views incrementally and test encoding, model binding, antiforgery, authorization, and URL generation.
Quality Gate
Verify runtime generation, routing, binding and validation, antiforgery, authorization, output encoding, error handling, performance, tests, and production configuration.
Example: MVC POST with Validation and Anti-Forgery
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(
CreateOrderViewModel model,
CancellationToken ct)
{
if (!ModelState.IsValid)
return View(model);
var orderId = await _orders.CreateAsync(model, ct);
return RedirectToAction(nameof(Details), new { id = orderId });
}For classic MVC, verify anti-forgery configuration and binding behavior. For ASP.NET Core MVC, prefer validated request models, explicit authorization policies, async actions, and a service layer. Do not bind domain entities directly from form input.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

