编程

aspnet-core

试用

按微软当前文档规范,选型并搭建符合官方写法的 ASP.NET Core 应用。

它能做什么

围绕微软当下文档中的写法,提供构建、评审和重构 ASP.NET Core 应用的结构化参考资料。先按场景选定应用模型(Blazor Web App、Razor Pages、MVC、Minimal API 或基于 Controller 的 Web API),再围绕 WebApplicationBuilder 搭建 Program.cs、中间件、依赖注入、配置、路由、日志与静态资源。数据访问、安全、SignalR、gRPC、测试、性能、部署与版本升级等横切关注点,按需加载对应参考。

什么时候用它

  • 为新项目选择合适的 ASP.NET Core 应用模型
  • 用 WebApplicationBuilder 组织 Program.cs、依赖注入和中间件
  • 按官方推荐实现认证、授权与 Identity
  • 把现有解决方案迁移到新的 .NET 主版本

技能文档

ASP.NET Core

Overview

Choose the right ASP.NET Core application model, compose the host and request pipeline correctly, and implement features in the framework style Microsoft documents today.

Load the smallest set of references that fits the task. Do not load every reference by default.

Workflow

  1. Confirm the target framework, SDK, and current app model.
  2. Open references/stack-selection.md first for new apps or major refactors.
  3. Open references/program-and-pipeline.md next for Program.cs, DI, configuration, middleware, routing, logging, and static assets.
  4. Open exactly one primary app-model reference:
    • references/ui-blazor.md
    • references/ui-razor-pages.md
    • references/ui-mvc.md
    • references/apis-minimal-and-controllers.md
  5. Add cross-cutting references only as needed:
    • references/data-state-and-services.md
    • references/security-and-identity.md
    • references/realtime-grpc-and-background-work.md
    • references/testing-performance-and-operations.md
  6. Open references/versioning-and-upgrades.md before introducing new platform APIs into an older solution or when migrating between major versions.
  7. Use references/source-map.md when you need the Microsoft Learn section that corresponds to a task not already covered by the focused references.

Default Operating Assumptions

  • Prefer the latest stable ASP.NET Core and .NET unless the repository or user request pins an older target.
  • As of March 2026, prefer .NET 10 / ASP.NET Core 10 for new production work. Treat ASP.NET Core 11 as preview unless the user explicitly asks for preview features.
  • Prefer WebApplicationBuilder and WebApplication. Avoid older Startup and WebHost patterns unless the codebase already uses them or the task is migration.
  • Prefer built-in DI, options/configuration, logging, ProblemDetails, OpenAPI, health checks, rate limiting, output caching, and Identity before adding third-party infrastructure.
  • Keep feature slices cohesive so the page, component, endpoint, controller, validation, service, data access, and tests are easy to trace.
  • Respect the existing app model. Do not rewrite Razor Pages to MVC or controllers to Minimal APIs without a clear reason.

Reference Guide

  • references/_sections.md: Quick index and reading order.
  • references/stack-selection.md: Choose the right ASP.NET Core application model and template.
  • references/program-and-pipeline.md: Structure Program.cs, services, middleware, routing, configuration, logging, and static assets.
  • references/ui-blazor.md: Build Blazor Web Apps, choose render modes, and use components, forms, and JS interop correctly.
  • references/ui-razor-pages.md: Build page-focused server-rendered apps with handlers, model binding, and conventions.
  • references/ui-mvc.md: Build controller/view applications with clear separation of concerns.
  • references/apis-minimal-and-controllers.md: Build HTTP APIs with Minimal APIs or controllers, including validation and response patterns.
  • references/data-state-and-services.md: Use EF Core, DbContext, options, IHttpClientFactory, session, temp data, and app state responsibly.
  • references/security-and-identity.md: Apply authentication, authorization, Identity, secrets, data protection, CORS, CSRF, and HTTPS guidance.
  • references/realtime-grpc-and-background-work.md: Use SignalR, gRPC, and hosted services.
  • references/testing-performance-and-operations.md: Add integration tests, browser tests, caching, compression, health checks, rate limits, and deployment concerns.
  • references/versioning-and-upgrades.md: Handle target frameworks, breaking changes, obsolete APIs, and migrations.
  • references/source-map.md: Map the official ASP.NET Core documentation tree to the references in this skill.

Execution Notes

  • When generating new code, start from the correct dotnet new template and keep the generated structure recognizable.
  • When editing an existing solution, follow the solution's conventions first and use these references to avoid framework misuse or outdated patterns.
  • When a task mentions "latest", verify the feature on Microsoft Learn or the ASP.NET Core docs repo before relying on memory.

相关技能

以系统方式规划并执行自学:从出口测试倒推课程,加入间隔复习与刻意练习,产出可验证的迁移证据。

作者 Iván93 次安装3 星标

用 NOAA 或 Open-Meteo 预报扫描 Polymarket 温度市场,支持试运行与实盘控制。

作者 Simmer.Markets215 次安装5 星标

自适应教学:先探测基础再讲解,每次只讲一个概念,讲完立刻检查记忆。

272 次安装8 星标

用 Binance 价格动量作为信号,通过 Simmer SDK 在 Polymarket 上交易 5 分钟/15 分钟 BTC 闪盘。

263 次安装50 星标

从 Gmail 邮件中提取日程事件,经过你确认后写入 Google Calendar。

236 次安装5 星标

OpenAI 的更多技能

浏览全部技能

把页面或视图转译为使用目标文件已发布组件、变量和样式构建的 Figma 屏幕。

作者 OpenAI26.9k 星标

按多阶段、带审批节点的工作流,从代码库构建 Figma 设计系统,断点可续作。

作者 OpenAI26.9k 星标

hatch-pet

官方

从概念、品牌线索或参考图生成 Codex 兼容的动态宠物图集,并附带 QA 与打包输出。

作者 OpenAI26.9k 星标

imagegen

官方

通过内置 image_gen 工具生成或编辑位图素材,仅在用户明确要求时切换到 CLI 备用流程。

作者 OpenAI26.9k 星标

直接从 OpenAI 官方开发者文档中拿到带引用的最新答案。

作者 OpenAI26.9k 星标

从 git 历史构建代码归属图,定位安全风险:低 bus factor、隐藏负责人、孤儿敏感代码。

作者 OpenAI26.9k 星标