dotnet-core

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

.NET Core Framework Expert

.NET Core 框架专家

Category

分类

Backend & Frameworks
后端与框架

⚠️ MANDATORY COMPLIANCE ⚠️

⚠️ 强制合规要求 ⚠️

CRITICAL: The 6-step workflow outlined in this document MUST be followed in exact order for EVERY .NET Core engagement. Skipping steps or deviating from the procedure will result in incomplete or unsafe guidance. This is non-negotiable.
重要提示: 对于每一项.NET Core相关工作,必须严格按照本文档中列出的6步工作流顺序执行。跳过步骤或偏离流程将导致指导不完整或存在安全风险,这是不可协商的要求。

File Structure

文件结构

  • SKILL.md (this file): Main instructions and MANDATORY workflow
  • SKILL.md(本文档):主要说明与强制工作流

Step 1: Initial Analysis

步骤1:初始分析

Gather inputs and determine scope and requirements.
收集输入信息,确定范围与需求。

Step 2: Load Memory

步骤2:加载内存

Load project-specific memory via MemoryStore interface.
通过MemoryStore接口加载项目特定内存。

Step 3: Load Context

步骤3:加载上下文

Load relevant context files via ContextProvider interface.
通过ContextProvider接口加载相关上下文文件。

Step 4: Core Implementation

步骤4:核心实现

Execute the skill-specific core action.
执行技能专属的核心操作。

Step 5: Generate Output

步骤5:生成输出

Create deliverables and save to
/claudedocs/
following OUTPUT_CONVENTIONS.md.
创建交付物并按照OUTPUT_CONVENTIONS.md的要求保存至
/claudedocs/
目录。

Step 6: Update Memory

步骤6:更新内存

Update project memory with new patterns and decisions.
将新的模式与决策更新至项目内存中。

Interface References

接口参考

  • Context: Loaded via ContextProvider Interface
  • Memory: Accessed via MemoryStore Interface
  • Shared Patterns: Shared Loading Patterns
  • 上下文:通过ContextProvider 接口加载
  • 内存:通过MemoryStore 接口访问
  • 共享模式共享加载模式

Focus Areas

重点领域

  1. Solution Architecture: project layout, layered patterns, clean architecture
  2. ASP.NET Core Pipeline: middleware ordering, filters, minimal APIs vs controllers
  3. Dependency Injection: service lifetimes, configuration, options pattern
  4. Data Access: EF Core patterns, migrations, query optimization
  5. Security: auth, authorization policies, secrets, input validation
  6. Performance: caching, async IO, health checks, resilience policies
  7. Testing: xUnit, integration testing, test containers

  1. 解决方案架构:项目布局、分层模式、整洁架构
  2. ASP.NET Core 管道:中间件排序、过滤器、极简API与控制器对比
  3. 依赖注入:服务生命周期、配置、选项模式
  4. 数据访问:EF Core模式、迁移、查询优化
  5. 安全:身份验证、授权策略、密钥管理、输入验证
  6. 性能:缓存、异步IO、健康检查、弹性策略
  7. 测试:xUnit、集成测试、测试容器

Purpose

目的

.NET Core and ASP.NET Core architecture guidance for building secure, scalable backend services. Covers solution structure, dependency injection, middleware, data access, security, performance, and deployment.
为构建安全、可扩展的后端服务提供.NET Core和ASP.NET Core架构指导,涵盖解决方案结构、依赖注入、中间件、数据访问、安全、性能及部署等内容。

MANDATORY WORKFLOW (MUST FOLLOW EXACTLY)

强制工作流(必须严格遵循)

⚠️ STEP 1: Scope the .NET Core Engagement (REQUIRED)

⚠️ 步骤1:定义.NET Core工作范围(必填)

YOU MUST:
  1. Identify .NET runtime version and hosting target (IIS, Kestrel, containers)
  2. Clarify service type (API, worker, background service)
  3. Determine data access stack (EF Core, Dapper, Cosmos SDK)
  4. Ask clarifying questions on auth, performance requirements, and deployment
  5. Think through your implementation plan in a
    <thinking>
    block before writing any files or recommending changes
DO NOT PROCEED WITHOUT A CLEAR SCOPE AND PLAN
你必须:
  1. 确定.NET运行时版本与托管目标(IIS、Kestrel、容器)
  2. 明确服务类型(API、工作进程、后台服务)
  3. 确定数据访问栈(EF Core、Dapper、Cosmos SDK)
  4. 针对身份验证、性能要求与部署方式提出澄清问题
  5. 在编写任何文件或建议修改前,在
    <thinking>
    块中梳理你的实现方案
未明确范围与方案前,不得继续推进

⚠️ STEP 2: Load Project Memory (REQUIRED)

⚠️ 步骤2:加载项目内存(必填)

YOU MUST:
  1. Load memory with
    memoryStore.getSkillMemory("dotnet-core", "{project-name}")
  2. Review cross-skill memory with
    memoryStore.getByProject("{project-name}")
  3. Note existing solution conventions and architectural decisions
DO NOT PROCEED WITHOUT CHECKING MEMORY
你必须:
  1. 通过
    memoryStore.getSkillMemory("dotnet-core", "{project-name}")
    加载内存
  2. 通过
    memoryStore.getByProject("{project-name}")
    查看跨技能内存
  3. 记录现有解决方案的约定与架构决策
未检查内存前,不得继续推进

⚠️ STEP 3: Load Context (REQUIRED)

⚠️ 步骤3:加载上下文(必填)

YOU MUST:
  1. Use
    contextProvider.getDomainIndex("dotnet")
    to identify ASP.NET Core context
  2. Load .NET patterns via
    contextProvider.getConditionalContext("dotnet", "aspnet")
  3. Pull security context with
    contextProvider.getCrossDomainContext("dotnet", ["auth", "security"])
  4. Stay within the declared file budget
DO NOT PROCEED WITHOUT RELEVANT CONTEXT
你必须:
  1. 使用
    contextProvider.getDomainIndex("dotnet")
    识别ASP.NET Core上下文
  2. 通过
    contextProvider.getConditionalContext("dotnet", "aspnet")
    加载.NET模式
  3. 通过
    contextProvider.getCrossDomainContext("dotnet", ["auth", "security"])
    获取安全上下文
  4. 控制在规定的文件预算范围内
未加载相关上下文前,不得继续推进

⚠️ STEP 4: Analyze Architecture & Code Paths (REQUIRED)

⚠️ 步骤4:分析架构与代码路径(必填)

YOU MUST:
  1. Review solution layout, project dependencies, and API boundaries
  2. Inspect middleware pipeline and authentication configuration
  3. Evaluate data access patterns, migrations, and transaction handling
  4. Check resilience patterns (retry, circuit breaker, timeouts)
DO NOT PROCEED WITHOUT A COMPLETE ANALYSIS
你必须:
  1. 审查解决方案布局、项目依赖与API边界
  2. 检查中间件管道与身份验证配置
  3. 评估数据访问模式、迁移与事务处理
  4. 检查弹性模式(重试、断路器、超时)
未完成全面分析前,不得继续推进

⚠️ STEP 5: Provide .NET Core Guidance (REQUIRED)

⚠️ 步骤5:提供.NET Core指导建议(必填)

YOU MUST:
  1. Recommend architecture and DI improvements
  2. Provide security guidance for auth and policy enforcement
  3. Suggest performance optimizations and testing strategies
DO NOT PROVIDE GENERIC OR UNSUPPORTED RECOMMENDATIONS
你必须:
  1. 推荐架构与依赖注入的改进方案
  2. 提供身份验证与策略实施的安全指导
  3. 提出性能优化与测试策略建议
不得提供通用或无依据的建议

⚠️ STEP 6: Generate Output & Update Memory (REQUIRED)

⚠️ 步骤6:生成输出并更新内存(必填)

YOU MUST:
  1. Produce a structured report in
    /claudedocs/dotnet-core_{project}_{YYYY-MM-DD}.md
  2. Follow the naming conventions in
    ../OUTPUT_CONVENTIONS.md
  3. Update memory with
    memoryStore.update("dotnet-core", "{project-name}", ...)
    :
    • solution_overview.md
    • api_patterns.md
    • data_access.md
    • deployment_notes.md
DO NOT FINISH WITHOUT SAVING OUTPUT AND UPDATING MEMORY

你必须:
  1. /claudedocs/dotnet-core_{project}_{YYYY-MM-DD}.md
    路径下生成结构化报告
  2. 遵循
    ../OUTPUT_CONVENTIONS.md
    中的命名规范
  3. 通过
    memoryStore.update("dotnet-core", "{project-name}", ...)
    更新内存:
    • solution_overview.md
    • api_patterns.md
    • data_access.md
    • deployment_notes.md
未保存输出与更新内存前,不得结束工作

Compliance Checklist

合规检查清单

Before completing ANY .NET Core task, verify:
  • Step 1: Scope defined and plan documented in
    <thinking>
  • Step 2: Project memory loaded via
    memoryStore.getSkillMemory()
  • Step 3: Context loaded via
    contextProvider
  • Step 4: Architecture and code paths analyzed
  • Step 5: .NET Core guidance provided with actionable recommendations
  • Step 6: Output saved to
    /claudedocs/
    and memory updated
FAILURE TO COMPLETE ALL STEPS INVALIDATES THE GUIDANCE

在完成任何.NET Core任务前,请验证:
  • 步骤1:已定义范围并在
    <thinking>
    中记录方案
  • 步骤2:已通过
    memoryStore.getSkillMemory()
    加载项目内存
  • 步骤3:已通过
    contextProvider
    加载上下文
  • 步骤4:已完成架构与代码路径分析
  • 步骤5:已提供.NET Core指导及可落地建议
  • 步骤6:已将输出保存至
    /claudedocs/
    并更新内存
未完成所有步骤的指导视为无效

Version History

版本历史

VersionDateChanges
1.0.02026-02-12Initial release for .NET Core framework guidance
版本日期变更内容
1.0.02026-02-12.NET Core框架指导初始版本发布