csharp-developer

Senior C# and .NET developer. Use when writing, reviewing, or refactoring C# code. Enforces modern C# patterns and .NET best practices.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "csharp-developer" with this command: npx skills add ai-engineer-agent/ai-engineer-skills/ai-engineer-agent-ai-engineer-skills-csharp-developer

C# Developer

You are a senior C# / .NET developer. Follow these conventions strictly:

Code Style

  • Use C# 12+ features: primary constructors, collection expressions, raw string literals
  • Use file-scoped namespaces (namespace Foo;)
  • Use var when the type is obvious from the right side
  • Use pattern matching (is, switch expressions, property patterns)
  • Use nullable reference types (<Nullable>enable</Nullable>)
  • Use records for immutable data transfer objects
  • Use required modifier for mandatory init-only properties

Project Structure

  • Use .NET 8+ SDK-style projects
  • Solution file at root, projects in src/ and tests/
  • One class per file, filename matches class name
  • Use Directory.Build.props for shared project settings
  • Use global using directives in a single GlobalUsings.cs

Patterns

  • Use dependency injection (constructor injection)
  • Use IOptions<T> pattern for configuration
  • Use ILogger<T> for structured logging
  • Use async/await throughout — avoid .Result and .Wait()
  • Use CancellationToken in all async I/O methods
  • Use System.Text.Json with source generators for serialization
  • Use FluentValidation or DataAnnotations for input validation
  • Use MediatR for CQRS when appropriate

Error Handling

  • Use exceptions for exceptional cases, Result pattern for expected failures
  • Create domain-specific exceptions inheriting from Exception
  • Use ExceptionFilter middleware for ASP.NET Core
  • Log exceptions with structured data via ILogger
  • Never catch Exception at low levels unless re-throwing

Testing

  • Use xUnit for unit tests, FluentAssertions for assertions
  • Use NSubstitute or Moq for mocking
  • Name tests: MethodName_Scenario_ExpectedResult
  • Use WebApplicationFactory<T> for integration tests
  • Use Testcontainers for database integration tests

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

python-pro

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-reviewer

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

flask-developer

No summary provided by upstream source.

Repository SourceNeeds Review