What problem does it solve?
This Skill enforces best practices and prevents common pitfalls in C# development, ensuring more robust, secure, and maintainable code.
Core Features & Use Cases
- Error Handling: Guides on proper exception management, preventing silent failures and stack trace corruption.
- Resource Management: Ensures correct disposal of
IDisposable and IAsyncDisposable objects using using statements.
- Async Patterns: Promotes correct usage of
async/await, CancellationToken, and avoids deadlocks.
- Nullability: Leverages C# nullable reference types for improved type safety.
- Security: Warns against insecure practices like using
Random for security-sensitive operations or SQL injection vulnerabilities.
- Use Case: When writing a new API endpoint in C#, this Skill will ensure that all external calls are cancellable, exceptions are handled specifically, and resources like database connections are properly disposed of.
Quick Start
Apply the csharp-coding skill to ensure proper error handling and resource management in your C# code.