Best for
- Adding CRUD pages, views, or components for a model in an ASP.NET Core project
- Scaffolding API controllers or Minimal API endpoints with Entity Framework Core
- Generating Razor Pages, MVC views, or Blazor components backed by a DbContext
dotnet/skills/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md
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-
Decision brief
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; s…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/dotnet/skills --skill "plugins/dotnet-data/skills/create-datadriven-aspnetcore"Inspect the Agent Skill "create-datadriven-aspnetcore" from https://github.com/dotnet/skills/blob/1b896e91feb0f613cb54a914f1efd2897810ae02/plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md at commit 1b896e91feb0f613cb54a914f1efd2897810ae02. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Parse the scaffolding request to identify: - Scaffolder type: Razor Pages, Blazor components, MVC controller, Minimal API, empty page/view/component - Model class and its namespace - DbContext: new or existing, database provider (SQLite, SQL Server, etc.) - Named items: controll…
Parse the scaffolding request to identify: - Scaffolder type: Razor Pages, Blazor components, MVC controller, Minimal API, empty page/view/component - Model class and its namespace - DbContext: new or existing, database provider (SQLite, SQL Server, etc.) - Named items: controll…
Skip this step for API controllers and Minimal API endpoints.
Skip this step for non-Blazor scaffolders.
Generate all code files manually. Follow these constraints:
Permission review
The documentation asks the agent to read local files, directories, or repositories.
Inspect the project file, `Program.cs`, target model, validation attributes, navigation properties, and foreign keys before editing.The documentation asks the agent to create, modify, or delete local files.
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.The documentation asks the agent to read local files, directories, or repositories.
Inspect the project's layout file (`_Layout.cshtml`, `MainLayout.razor`, or equivalent)The documentation asks the agent to create, modify, or delete local files.
Create a `.http` file named `{ModelName}.http` in the project directory. If a file with that name exists, append a numeric suffix (`Product2.http`, `Product3.http`) until uniqueThe documentation includes network, browsing, or remote request actions.
Every request must target the correct URL path matching an actual mapped endpointEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 95/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 5,248 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
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
Program.cs, target model, validation attributes, navigation properties, and foreign keys before editing.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.EnsureCreated or seed the database in Program.cs.MVC, Razor Pages, and Blazor
Minimal APIs
GET (list and by ID), POST, PUT, and DELETE endpoints for both child and required-parent resources.WithOpenApi when OpenAPI is enabled..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.
_Layout.cshtml, MainLayout.razor, or equivalent)site.css, app.css, Tailwind config, etc.)All generated files MUST match the existing UI framework, CSS classes, and conventions. If Bootstrap is used, generate Bootstrap markup. If Tailwind is used, generate Tailwind markup.
Skip this step for non-Blazor scaffolders.
[SupplyParameterFromForm] properties MUST use = new() (not null!) — prevents EditForm crash on initial GETProgram.cs must chain .AddInteractiveServerComponents() on AddRazorComponents() and .AddInteractiveServerRenderMode() on MapRazorComponents<App>(). only add interactive server services/render mode when the generated components actually use @rendermode InteractiveServer (or the project already does)..AddInteractiveWebAssemblyRenderMode())Generate all code files manually. Follow these constraints:
RuntimeCompilation, or other convenience packages)When generating Minimal API or MVC API endpoints with OpenAPI support enabled, add rich metadata to every endpoint so the OpenAPI document is descriptive and useful:
.WithName("GetTodoItems") — unique operation ID for each endpoint.WithTags("TodoItems") — group endpoints by resource.WithDescription("Returns all todo items") — human-readable summary.Produces<List<TodoItem>>(StatusCodes.Status200OK) — document success response type.Produces(StatusCodes.Status404NotFound) — document error responses.ProducesValidationProblem() — for endpoints that validate input.WithOpenApi() — opt the endpoint into OpenAPI generation (if not already globally enabled)Example for a Minimal API GET endpoint:
group.MapGet("/", async (TodoDbContext db) =>
await db.TodoItems.ToListAsync())
.WithName("GetAllTodoItems")
.WithTags("TodoItems")
.WithDescription("Returns all todo items")
.Produces<List<TodoItem>>(StatusCodes.Status200OK);
Skip this step if the scaffolding request does not involve Entity Framework.
Program.cs — always use migrationsdotnet ef: prefer dotnet tool restore from a local tool manifest. Only install globally if no manifest exists.http file MUST create parent entities before child entities. Use FK values consistent with creation orderSkip this step for non-API scaffolders.
.http file named {ModelName}.http in the project directory. If a file with that name exists, append a numeric suffix (Product2.http, Product3.http) until uniquedotnet restore && dotnet build from the project directorydotnet ef migrations add InitialCreatedotnet ef database updateProperties/launchSettings.json — if a profile named https exists, use dotnet run --launch-profile https.http request one at a time in dependency orderdotnet build succeeds with zero errors.http requests return 2xx status codes (if API scaffolder)RuntimeCompilation, etc.)[SupplyParameterFromForm] properties use = new() (if Blazor scaffolder)| Pitfall | Solution |
|---|---|
| Generated UI doesn't match project's CSS framework | Always inspect layout and CSS files before generating code (Step 2) |
Blazor EditForm crashes on initial GET | Use = new() not null! for [SupplyParameterFromForm] properties |
| EF migration fails due to missing parent entity CRUD | Scaffold CRUD for FK-dependent entities when request mentions foreign keys |
.http file has wrong FK values | Order requests by dependency; use values consistent with creation order |
dotnet ef not found | Try dotnet tool restore first; only install globally as fallback |
| Added unnecessary packages | Only add packages explicitly required for the scaffolded functionality |
| Generated code uses different naming conventions | Inspect existing project files to match naming patterns before generating |
Frequently asked questions
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; s…
The source record exposes this install command: npx skills add https://github.com/dotnet/skills --skill "plugins/dotnet-data/skills/create-datadriven-aspnetcore". Inspect the command and pinned source before running it.
Static rules flagged read-files, write-files, network in the source; the page lists the matching lines and excerpts.
Alternatives
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre
HKUDS/Vibe-Trading
Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
brucesongs/kali-claw
Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.