研发协作
在开发、审查、重构或架构 ASP.NET Core Web…
适用于 Blazor Web Apps、Razor Pages、MVC、Minimal APIs、控制器 Web API、SignalR、gRPC、中间件、DI、配置、认证授权、测试、性能、部署或 ASP.NET Core 升级等任务。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 59/100 ×0.15
适用场景
在开发、审查、重构或架构 ASP.NET特定
解决思路
- 选择正确的 ASP.NET Core 应用模型,正确组合 host 和请求管线,并按 Microsoft 当前文档的框架风格实现功能。
- 加载与任务匹配的最小 reference 集;不要默认加载全部 reference。
- 确认目标框架、SDK 和当前应用模型。
- 新应用或重大重构时,先打开 references/stack-selection.md。
- 下一步打开 references/program-and-pipeline.md,处理 Program.cs、DI、配置、中间件、路由、日志和静态资源。
- 只打开一个主要应用模型 reference:references/ui-blazor.md、references/ui-razor-pages.md、references/ui-mvc.md、references/apis-minimal-and-controllers.md。
- 仅在需要时添加跨领域 reference:references/data-state-and-services.md、references/security-and-identity.md、references/realtime-grpc-and-background-work.md、references/testing-performance-and-operations.md。
- 在向较旧解决方案引入新平台 API 或在主要版本之间迁移前,打开 references/versioning-and-upgrades.md。
- 当任务没有已被 focused references 覆盖、需要对应 Microsoft Learn 章节时,使用 references/source-map.md。
- 除非仓库或用户固定较旧目标,优先使用最新稳定版 ASP.NET Core 和 .NET。
- 截至 2026 年 3 月,新生产工作优先使用 .NET 10 / ASP.NET Core 10;除非用户明确要求 preview 功能,否则将 ASP.NET Core 11 视为 preview。
- 优先使用 WebApplicationBuilder 和 WebApplication;除非代码库已使用或任务就是迁移,避免旧式 Startup 和 WebHost 模式。
- 在添加第三方基础设施前,优先使用内置 DI、options/configuration、logging、ProblemDetails、OpenAPI、health checks、rate limiting、output caching 和 Identity。
- 保持 feature slices 内聚,使 page、component、endpoint、controller、validation、service、data access 和 tests 易于追踪。
- 尊重现有应用模型;没有明确理由,不要将 Razor Pages 重写为 MVC,或将 controllers 重写为 Minimal APIs。
- 使用 references/_sections.md 作为快速索引和阅读顺序。
- 使用 references/stack-selection.md 选择正确的 ASP.NET Core 应用模型和模板。
- 使用 references/program-and-pipeline.md 组织 Program.cs、services、middleware、routing、configuration、logging 和 static assets。
- 使用 references/ui-blazor.md 构建 Blazor Web Apps,选择 render modes,并正确使用 components、forms 和 JS interop。
- 使用 references/ui-razor-pages.md 构建以 page 为中心的服务端渲染应用,使用 handlers、model binding 和 conventions。
- 使用 references/ui-mvc.md 构建 controller/view 应用,并保持清晰的关注点分离。
- 使用 references/apis-minimal-and-controllers.md 用 Minimal APIs 或 controllers 构建 HTTP APIs,包括 validation 和 response patterns。
- 使用 references/data-state-and-services.md 负责任地使用 EF Core、DbContext、options、IHttpClientFactory、session、temp data 和 app state。
- 使用 references/security-and-identity.md 应用 authentication、authorization、Identity、secrets、data protection、CORS、CSRF 和 HTTPS 指引。
- 使用 references/realtime-grpc-and-background-work.md 使用 SignalR、gRPC 和 hosted services。
- 使用 references/testing-performance-and-operations.md 添加 integration tests、browser tests、caching、compression、health checks、rate limits 和 deployment concerns。
- 使用 references/versioning-and-upgrades.md 处理 target frameworks、breaking changes、obsolete APIs 和 migrations。
- 使用 references/source-map.md 将官方 ASP.NET Core 文档树映射到本 skill 的 references。
- 生成新代码时,从正确的 dotnet new 模板开始,并保持生成的结构可识别。
- 编辑现有解决方案时,先遵循该解决方案的约定,并使用这些 references 避免框架误用或过时模式。
- 当任务提到 “latest” 时,先到 Microsoft Learn 或 ASP.NET Core docs repo 验证该功能,再依赖记忆。
适用边界 · 注意事项
- 不适用于非 ASP.NET Core/.NET Web 应用开发。
- 当仓库或用户明确固定旧框架/旧模式且任务不是迁移时,不要强行套用最新模式或全面重写应用模型。
- 不要默认加载所有 reference,也不要在任务提到 “latest” 时仅凭记忆使用新特性。