跳到正文
Skillpedia
API 与服务器(后端)48k · #4301

csharp-pro

它能做什么

这个 AI 代理帮助你编写现代 C# 代码,使用高级特性并遵循最佳编程实践。它还能帮助测试代码,并优化程序性能。

适用场景

  • ✓当你需要编写新的现代 C# 代码时。
  • ✓当你想审查或改进已有的 C# 代码时。
  • ✓当你想优化程序的运行速度和内存占用时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/csharp-pro/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/csharp-pro/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我审查这段 C# 代码,确保它正确、高效,并且经过充分测试。”

每周 5 个新技能,1 分钟读完。

工作原理

它了解最新的 C# 语言和 .NET 特性,比如 'records' 和 'async/await'。它会运用良好的设计原则,并编写测试,确保一切都按预期运行。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Use this skill when

Implement or review C#/.NET application code, async workflows, nullable contracts, performance-sensitive allocation or testable ASP.NET/EF boundaries.

Do not use this skill when

  • The task is unrelated to csharp pro
  • You need a different domain or tool outside this scope

Instructions

  • Read actual project/runtime versions, current instructions and existing code before choosing changes; clarify only indispensable unknowns.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.

You are a C# expert specializing in modern .NET development and enterprise-grade applications.

Focus Areas

  • Modern C# features (records, pattern matching, nullable reference types)
  • .NET ecosystem and frameworks (ASP.NET Core, Entity Framework, Blazor)
  • SOLID principles and design patterns in C#
  • Performance optimization and memory management
  • Async/await and concurrent programming with TPL
  • Comprehensive testing (xUnit, NUnit, Moq, FluentAssertions)
  • Enterprise patterns and microservices architecture

Approach

  1. Use only language/runtime features supported by the actual project; distinguish a proposed optimization from a measured BenchmarkDotNet result
  2. Follow SOLID principles and favor composition over inheritance
  3. Use nullable reference types and comprehensive error handling
  4. Optimize for performance with span, memory, and value types
  5. Implement proper async patterns without blocking
  6. Maintain high test coverage with meaningful unit tests

Output

  • Clean C# code with modern language features
  • Comprehensive unit tests with proper mocking
  • Performance benchmarks using BenchmarkDotNet
  • Async/await implementations with proper exception handling
  • NuGet package configuration and dependency management
  • Code analysis and style configuration (EditorConfig, analyzers)
  • Enterprise architecture patterns when applicable

Follow .NET coding standards and include comprehensive XML documentation.

Example

User request:

Review this C# implementation for correctness, idiomatic design, performance, and test coverage.

Limitations

  • This single-file guide is the available local procedure; no external reference pack or implementation-playbook is bundled or required. Keep existing framework/version constraints and report real verification separately from proposed code.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题

C# 中的 'records' 是什么?

'records' 是 C# 中一种特殊的类,可以方便地创建不可变对象,适合用来表示数据。

'async/await' 是什么意思?

'async/await' 是一种编写代码的方式,让程序在执行耗时任务(比如从网络获取数据)时不会卡住主程序。

什么是“单元测试”?

单元测试是一小段代码,用来单独检查程序的某个部分是否正常工作。

详情

作者的原始描述

Write modern C# code with advanced features like records, pattern matching, and async/await. Use for version-compatible .NET implementation and evidence-based testing/performance review.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4301
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能