aspnet-core: Build and Review ASP.NET Core Applications Following Official Guidance

Preface

ASP.NET Core simultaneously supports multiple application models, including Blazor, Razor Pages, MVC, Minimal APIs, and Controller-based Web APIs. Version iterations also introduce differences between WebApplicationBuilder and the older Startup class. When modifying Program.cs, adding authentication, or performing upgrades within an Agent, it is easy to mix deprecated APIs or switch application models in inappropriate scenarios. The following introduces the aspnet-core Skill from the OpenAI Curated directory: it uses topic-specific reference documents to constrain workflows, guiding the assistant to select stacks, build pipelines, and implement features in accordance with Microsoft’s current documentation style.

What is this?

aspnet-core is an Agent Skill maintained by OpenAI in skills/.curated/aspnet-core. The official description states: it is used to build, review, refactor, or architect ASP.NET Core web applications, following current official guidelines for .NET web development.

Applicable tasks include Blazor Web Apps, Razor Pages, MVC, Minimal APIs, Controller-based Web APIs, SignalR, gRPC, middleware, Dependency Injection (DI), configuration, authentication and authorization, testing, performance, deployment, and ASP.NET Core version upgrades. The Skill requires loading only the minimal set of references matching the current task, rather than loading all materials by default.

Core Features

Workflow

The official SKILL.md fixes the reading and execution order:

  1. Confirm the target framework, SDK, and current application model.
  2. When creating a new application or performing a large-scale refactor, first open references/stack-selection.md.
  3. Then open references/program-and-pipeline.md to handle Program.cs, DI, configuration, middleware, routing, logging, and static assets.
  4. Open only one primary reference based on the application type:
    - references/ui-blazor.md
    - references/ui-razor-pages.md
    - references/ui-mvc.md
    - references/apis-minimal-and-controllers.md
  5. Add cross-cutting topic references as needed (data and state, security, real-time/gRPC/background tasks, testing and operations, etc.).
  6. Before introducing new platform APIs to legacy solutions or migrating across major versions, read references/versioning-and-upgrades.md first.
  7. When a task is not covered in focused references, use references/source-map.md to map against the Microsoft Learn documentation tree.

Default Operating Assumptions

  • Unless the repository or user specifies an older version, prioritize the latest stable versions of ASP.NET Core and .NET.
  • As of March 2026, .NET 10 / ASP.NET Core 10 is preferred for production environments in new projects; ASP.NET Core 11 is treated as a preview unless the user explicitly requests preview features.
  • Prioritize WebApplicationBuilder and WebApplication; avoid the legacy Startup and WebHost unless the codebase already uses them or the task is for migration.
  • Prioritize built-in DI, Options/Configuration, Logging, ProblemDetails, OpenAPI, Health Checks, Rate Limiting, Output Caching, and Identity before considering third-party infrastructure.
  • Keep functional slices cohesive to facilitate tracing from pages, components, endpoints, and controllers to services, data access, and tests.
  • Respect existing application models; do not change Razor Pages to MVC or controllers to Minimal APIs without a clear reason.

Reference Coverage

The reference index within the Skill includes: Stack Selection, Program.cs and Pipeline, Blazor / Razor Pages / MVC UI, Minimal APIs and Controller APIs, EF Core and State, Security and Identity, SignalR / gRPC / Hosted Services, Integration Testing and Deployment, Versioning and Upgrades, and source-map for Microsoft documentation.

Execution Notes

  • When generating new code, start from the correct dotnet new template and keep the generated structure recognizable and consistent with official templates.
  • When editing existing solutions, first follow the project’s existing conventions, then use references to avoid framework misuse or outdated patterns.
  • When a task involves “latest” features, verify them on Microsoft Learn or the ASP.NET Core documentation repository rather than relying solely on memory.

Installation and Enablement

The installation method listed by officialskills.sh is:

npx skills add https://github.com/openai/skills --skill aspnet-core

You can also provide the Skill directory link to coding assistants that support Agent Skills for installation:

https://github.com/openai/skills/tree/main/skills/.curated/aspnet-core

The materials do not distinguish installation differences for Cursor, Codex CLI, or Claude Code; simply follow each product’s instructions for npx skills add or SKILL directory mounting.

Typical Usage

The following scenarios are derived from the When to use it section and Workflow in the official materials. They serve as examples of task descriptions to trigger the Skill (combine with the actual framework and version in your repository):

  1. Scaffold a Minimal API: Require OpenAPI documentation and ProblemDetails error responses, following apis-minimal-and-controllers.md and program-and-pipeline.md.
  2. Migrate hosting model: Migrate a legacy application based on Startup to WebApplicationBuilder, confirming the target framework first, then reading versioning-and-upgrades.md and program-and-pipeline.md.
  3. Razor Pages Security: Add Cookie authentication and role-based authorization to a site, opening security-and-identity.md and ui-razor-pages.md.
  4. SignalR in MVC: Integrate a SignalR Hub for real-time notifications in an existing MVC application, using ui-mvc.md as the main reference and opening realtime-grpc-and-background-work.md as needed.
  5. Controller Integration Testing: Use WebApplicationFactory to write integration tests for controller endpoints, referencing testing-performance-and-operations.md.

When generating or modifying code, the assistant should load references in the order of the Workflow rather than loading all files at once.

Applicable Scenarios and Notes

Who it is for: .NET developers who use C# / ASP.NET Core for Web or API development daily and want to receive structure, pipeline, and security practices consistent with current Microsoft guidelines within Agent conversations. This Skill is located in the OpenAI Curated list and originates from the same source as the official Skills repository, having direct significance for filling gaps in the Agent’s reference coverage for the C# web stack.

Limitations and Notes:

  • The Skill acts as a reference and workflow constraint; it cannot replace the TargetFramework and SDK specified locally. Version assumptions are subject to SKILL.md; legacy projects need to explicitly state the target version.
  • “Latest” features must be verified via Microsoft Learn; the materials explicitly require not relying on unverified memory.
  • Do not switch application models without business reasons; the Skill respects existing repository choices by default.
  • Third-party packages and cloud provider deployment details depend on the specific project; the Skill tends to use framework built-in capabilities first.

Conclusion

aspnet-core breaks down stack selection, pipelines, and cross-cutting capabilities across ASP.NET Core’s multiple models and versions into task-loadable references, using a fixed Workflow to reduce the use of outdated APIs and incorrect refactoring. If you mainly maintain .NET web projects like Blazor, MVC, or Minimal APIs within an Agent, you can install it and trigger the scenarios above via task descriptions.

Official Address: https://github.com/openai/skills/tree/main/skills/.curated/aspnet-core

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye