Syntic

Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.

LanguagesFree Safe

Csharp Developer

Security Scan Summary

Status: Safe

Source: Syntic Skills registry

Automated security scan completed with no high-risk patterns detected. Manual review is still required.

About This Skill

Use when building applications on .NET 8+ with ASP.NET Core, Entity Framework Core, minimal APIs, and async patterns.

Downloadable SKILL.md

Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.

SKILL.md
---
name: Csharp Developer
description: Use when building applications on .NET 8+ with ASP.NET Core, Entity Framework Core, minimal APIs, and async patterns.
category: Languages
version: 1.0.0
tools: []
---

# C# and .NET 8+ Development

Build applications on .NET 8+ using ASP.NET Core, Entity Framework Core, and modern C# language features.

## Core Principles

- **Latest C# features:** Primary constructors, collection expressions, `required` properties, pattern matching, raw string literals.
- **Async all the way.** Every I/O operation uses `async/await`. Never call `.Result` or `.Wait()`.
- **Nullable reference types** enabled. Treat `CS8600` warnings as errors. Design APIs to eliminate null ambiguity.
- **Dependency injection** is the backbone. Register services in `Program.cs`, inject via constructor.

## ASP.NET Core Architecture

```
Api/
  Program.cs              # Service registration, middleware
  Endpoints/              # Minimal API endpoint groups
  Filters/                # Exception filters, validation
Application/
  Services/               # Business logic
  DTOs/                   # Request/response records
  Validators/             # FluentValidation validators
Domain/
  Entities/               # Domain entities with behavior
  ValueObjects/           # Immutable value objects
Infrastructure/
  Data/                   # DbContext, migrations
  ExternalServices/       # HTTP clients, message brokers
```

## Minimal APIs

- Use minimal APIs for new projects. Map endpoints in extension methods grouped by feature.
- Use `TypedResults` for compile-time response type safety: `Results<Ok<User>, NotFound, ValidationProblem>`.
- Use endpoint filters for cross-cutting concerns: validation, logging, authorization.
- Use `[AsParameters]` to bind complex query parameters from a record type.

## Entity Framework Core

- Use `DbContext` with `DbSet<T>` for each aggregate root. Configure entities with `IEntityTypeConfiguration<T>`.
- Use migrations with `dotnet ef migrations add`. Review generated SQL before applying.
- Use `AsNoTracking()` for read-only queries to reduce overhead.
- Use `ExecuteUpdateAsync` and `ExecuteDeleteAsync` for bulk operations without loading entities.
- Use split queries (`AsSplitQuery()`) for multiple `Include()` calls to avoid cartesian explosion.
- Use compiled queries (`EF.CompileAsyncQuery`) for hot-path queries executed thousands of times.

## Async Patterns

- `Task` for async operations. `ValueTask` for methods that complete synchronously most of the time.
- `IAsyncEnumerable<T>` for streaming results from databases or APIs.
- `Channel<T>` for producer-consumer patterns. `SemaphoreSlim` for async rate limiting.
- `CancellationToken` on every async method. Pass through entire call chain.
- `Parallel.ForEachAsync` for concurrent processing with controlled parallelism.

## Configuration and DI

- **Options pattern:** `builder.Services.Configure<SmtpOptions>(builder.Configuration.GetSection("Smtp"))`.
- Register with appropriate lifetimes: `Scoped` (per-request), `Singleton` (stateless), `Transient` (lightweight).
- `IHttpClientFactory` with named or typed clients. Never instantiate `HttpClient` directly.
- **Keyed services** in .NET 8 for multiple implementations of same interface.

## Testing

- xUnit with `FluentAssertions` for readable assertions.
- `WebApplicationFactory<Program>` for integration tests (full ASP.NET pipeline).
- `Testcontainers` for database integration tests against PostgreSQL or SQL Server.
- NSubstitute or Moq for unit testing with mocked dependencies.
- `Bogus` for generating realistic test data.

Bundle Download

Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.

Install Targets

Syntic App

  1. 1. Create a dedicated folder for this skill in your local skills library.
  2. 2. Place SKILL.md into that folder.
  3. 3. Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1. Save SKILL.md in your local Syntic Code skills directory.
  2. 2. Keep related files in the same skill folder.
  3. 3. Run in a safe environment and validate outputs.

Source

https://github.com/rohitg00/awesome-claude-code-toolkit/blob/main/agents/language-experts/csharp-developer.md

Open Source Link
Languages

Related Skills