मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग40k · #7177

dotnet-best-practices

यह क्या करती है

यह AI एजेंट इस बात का ध्यान रखता है कि आपका .NET/C# कोड अनुशंसित best practices के हिसाब से लिखा गया हो। यह documentation, संरचना, design pattern के इस्तेमाल, dependency injection, resource management, async/await के उपयोग, testing, configuration, AI integration, error handling, security और कोड की कुल गुणवत्ता की जांच करता है।

कब इस्तेमाल करें

  • ✓जब आप नया C# कोड लिख रहे हों।
  • ✓जब आप मौजूदा कोड की समीक्षा (review) कर रहे हों।
  • ✓जब आप परफ़ॉर्मेंस या सुरक्षा को बेहतर बनाना चाहते हों।

Skill का लिंक

https://github.com/github/awesome-copilot/blob/main/skills/dotnet-best-practices/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/github/awesome-copilot/blob/main/skills/dotnet-best-practices/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“जांचो कि यह C# कोड best practices के हिसाब से है या नहीं।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट आपके कोड में कुछ खास पैटर्न देखता है, जैसे सही documentation, design patterns का इस्तेमाल और सही error handling। वह आपके कोड की तुलना नियमों के एक सेट से करता है और सुधार के सुझाव देता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

.NET/C# Best Practices

Your task is to ensure .NET/C# code in ${selection} meets the best practices specific to this solution/project. This includes:

Documentation & Structure

  • Create comprehensive XML documentation comments for all public classes, interfaces, methods, and properties
  • Include parameter descriptions and return value descriptions in XML comments
  • Follow the established namespace structure: {Core|Console|App|Service}.{Feature}

Design Patterns & Architecture

  • Use primary constructor syntax for dependency injection (e.g., public class MyClass(IDependency dependency))
  • Implement the Command Handler pattern with generic base classes (e.g., CommandHandler<TOptions>)
  • Use interface segregation with clear naming conventions (prefix interfaces with 'I')
  • Follow the Factory pattern for complex object creation.

Dependency Injection & Services

  • Use constructor dependency injection with null checks via ArgumentNullException
  • Register services with appropriate lifetimes (Singleton, Scoped, Transient)
  • Use Microsoft.Extensions.DependencyInjection patterns
  • Implement service interfaces for testability

Resource Management & Localization

  • Use ResourceManager for localized messages and error strings
  • Separate LogMessages and ErrorMessages resource files
  • Access resources via _resourceManager.GetString("MessageKey")

Async/Await Patterns

  • Use async/await for all I/O operations and long-running tasks
  • Return Task or Task<T> from async methods
  • Use ConfigureAwait(false) where appropriate
  • Handle async exceptions properly

Testing Standards

  • Use MSTest framework with FluentAssertions for assertions
  • Follow AAA pattern (Arrange, Act, Assert)
  • Use Moq for mocking dependencies
  • Test both success and failure scenarios
  • Include null parameter validation tests

Configuration & Settings

  • Use strongly-typed configuration classes with data annotations
  • Implement validation attributes (Required, NotEmptyOrWhitespace)
  • Use IConfiguration binding for settings
  • Support appsettings.json configuration files

Semantic Kernel & AI Integration

  • Use Microsoft.SemanticKernel for AI operations
  • Implement proper kernel configuration and service registration
  • Handle AI model settings (ChatCompletion, Embedding, etc.)
  • Use structured output patterns for reliable AI responses

Error Handling & Logging

  • Use structured logging with Microsoft.Extensions.Logging
  • Include scoped logging with meaningful context
  • Throw specific exceptions with descriptive messages
  • Use try-catch blocks for expected failure scenarios

Performance & Security

  • Use C# 12+ features and .NET 8 optimizations where applicable
  • Implement proper input validation and sanitization
  • Use parameterized queries for database operations
  • Follow secure coding practices for AI/ML operations

Code Quality

  • Ensure SOLID principles compliance
  • Avoid code duplication through base classes and utilities
  • Use meaningful names that reflect domain concepts
  • Keep methods focused and cohesive
  • Implement proper disposal patterns for resources
अक्सर पूछे जाने वाले सवाल

'best practices' क्या होते हैं?

ये कोड लिखने के सबसे कुशल और सुरक्षित तरीके होते हैं, जिससे कोड को संभालना आसान होता है और आम गलतियों से बचा जा सकता है।

क्या इस एजेंट को इस्तेमाल करने के लिए सभी तकनीकी शब्द समझना ज़रूरी है?

नहीं, यह एजेंट उन लोगों की भी मदद करने के लिए बना है जो अनुभवी प्रोग्रामर नहीं हैं। यह ऐसे नियम लागू करने पर ध्यान देता है जो कोड की गुणवत्ता बढ़ाते हैं।

क्या यह एजेंट मेरा कोड अपने-आप ठीक कर सकता है?

यह एजेंट मुख्य रूप से कमियां पहचानने और सुधार सुझाने पर ध्यान देता है। अपने-आप सुधार करना दूसरे टूल्स या आपकी अपनी मदद पर निर्भर कर सकता है।

जानकारी

लेखक का मूल विवरण

Ensure .NET/C# code meets best practices for the solution/project.

repo: github/awesome-copilot

लोकप्रियता

GitHub स्टार
40k
रैंकिंग में स्थान
#7177
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

acquire-codebase-knowledge

40k

आपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-assess

40k

आपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-generate-instructions

40k

आपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-policy

40k

आपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।

AI और एजेंटएजेंट

मिलती-जुलती skills