aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on…
Generate or scaffold ASP.NET Core code — Razor Pages, Blazor components, MVC controllers, views, and Minimal API endpoints — without using ASP.NET Core CLI scaffolding/code-generation tools. Use when (1) adding CRUD pages, views, or API endpoints backed by Entity Framework (EF
$ npx -y skills add managedcode/dotnet-skills --skill create-datadriven-aspnetcore --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/create-datadriven-aspnetcoreContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate or scaffold ASP.NET Core code — Razor Pages, Blazor components, MVC controllers, views, and Minimal API endpoints — without using ASP.NET Core CLI scaffolding/code-generation tools. Use when (1) adding CRUD pages, views, or API endpoints backed by Entity Framework (EF
name: create-datadriven-aspnetcore description: Generate or scaffold ASP.NET Core code — Razor Pages, Blazor components, MVC controllers, views, and Minimal API endpoints — without using ASP.NET Core CLI scaffolding/code-generation tools. Use when (1) adding CRUD pages, views, or API endpoints backed by Entity Framework (EF Core) and a database, (2) generating code to create, read, update, and delete data using a DbContext, (3) scaffolding UI components that match the project's existing CSS framework and coding patterns, or (4) creating data-driven forms, tables, and navigation for a model class. Do not use for non-ASP.NET projects or when CLI-based scaffolding is preferred.
Generate ASP.NET Core scaffolded code — controllers, views, Razor Pages, Blazor components, Minimal API endpoints. The generated code matches the project's existing CSS framework, layout conventions, and coding patterns. No CLI-based scaffolding/code-generation tools are used; standard `dotnet` CLI commands for build, restore, and migrations are still expected.
| Input | Required | Description | |-------|----------|-------------| | Scaffolding request | Yes | Natural-language description of what to scaffold (see format below) | | Project file path | Yes | Full path to the target `.csproj` file | | Solution root path | Recommended | Path to the solution root for multi-project solutions |
The scaffolding request should be a natural-language description of what to scaffold. The request must include the target project path and enough detail for the agent to generate the correct code. Examples:
**Razor Pages with EF:**
Scaffold Razor Pages with CRUD for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`. Create a new DbContext `<DbContextName>` using <database-provider>. Also scaffold CRUD for any entity that `<ModelName>` depends on via required foreign keys, so parent entities can be created first.
**Blazor CRUD components:**
Scaffold Blazor CRUD components for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`. Create a new DbContext `<DbContextName>` using <database-provider>.
**Minimal API endpoints:**
Scaffold Minimal API endpoints for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`. Name the endpoints class `<EndpointsClassName>`. Create a new DbContext `<DbContextName>` using <database-provider>. Enable OpenAPI support.
**MVC Controller with views:**
Scaffold an MVC controller with views and Entity Framework for the `<ModelName>` model (from `<Namespace>`) in project `<path-to-csproj>`. Name the controller `<ControllerName>`. Use existing DbContext `<DbContextName>`. Generate views.
**Empty items (no EF):**
Scaffold an empty Razor Page named `<PageName>` in project `<path-to-csproj>`.
Parse the scaffolding request to identify:
Complete the applicable checklist in order. Do not stop after creating only the requested child resource when a required foreign key makes a parent resource necessary.
**All EF scaffolders**
1. Inspect the project file, `Program.cs`, target model, validation attributes, navigation properties, and foreign keys before editing. 2. Reuse the requested existing `DbContext`; otherwise create the requested context. Add only the required provider package and register it with `AddDbContext` using the requested provider and connection string. You will need to add Microsoft.EntityFrameworkCore.Design (PrivateAssets="all") when migrations are needed and it's missing. 3. Generate complete CRUD for the requested entity and every required parent entity: list, details, create, edit, and delete. 4. Use the EF migration lifecycle: create a migration and apply it. Never call `EnsureCreated` or seed the database in `Program.cs`. 5. Restore, build, and test the generated project. Fix errors before reporting completion.
**MVC, Razor Pages, and Blazor**
1. Inspect the existing layout, CSS, and representative UI before generating markup. 2. Generate the complete child and required-parent UI flows, including a navigation path to each resource so users can create a parent before creating a child. 3. Match the existing UI framework and conventions; preserve existing render-mode configuration for Blazor.
**Minimal APIs**
1. Use a route group for each resource and map `GET` (list and by ID), `POST`, `PUT`, and `DELETE` endpoints for both child and required-parent resources. 2. Add OpenAPI metadata to every endpoint: unique name, tags, description, success/error response metadata, and `WithOpenApi` when OpenAPI is enabled. 3. Create an executable `.http` file with every CRUD request. Create parent records first, capture or clearly reuse their returned IDs in child requests, and run the requests in dependency order.
Skip this step for API controllers and Minimal API endpoints.
1. Inspec
Stop explaining .NET to your AI. Start building. We've all been there: asking Claude to use Entity Framework, only to get EF6 patterns in a .NET 8 project. Explaining to Copilot that Blazor Server and Blazor WebAssembly aren't the same thing.
Repo: managedcode/dotnet-skills
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on…
Build, upgrade, and operate Aspire 13.5.x C# or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing,…
Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns. USE FOR:…
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and…
Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. USE…
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET…