# Dotnet patterns

> Dotnet patterns is an open-source agent skill for developer tools. Guides an AI agent to write and review idiomatic C# and .NET code. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/dotnet-patterns
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** dotnet-patterns
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives the agent a set of C# and .NET conventions to apply when writing or reviewing code. It covers preferring immutable records and init-only properties, explicit nullability and access modifiers, interface-based services registered through the dependency injection container, and async/await used end to end with cancellation tokens.

The guidance also includes practical building blocks for ASP.NET Core work: the options pattern for strongly typed configuration, a result type for expected failures, a repository over EF Core, custom middleware with request timing, minimal API route groups, and guard clauses. A closing table lists common anti-patterns such as async void, blocking on tasks, and mutable static state, with the recommended fix for each.

The skill is a set of written instructions and code examples with no scripts. It works with C# and .NET projects and does not require any particular tools.

## When your agent uses it

> Idiomatic C# and .NET patterns, conventions, dependency injection, async/await, and best practices for building robust, maintainable .NET applications. Use when writing or reviewing C# / .NET code — DI, async, or general conventions.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/dotnet-patterns)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/dotnet-patterns)

## Features

- **Immutable data modeling:** Guidance on records, init-only properties and required members for data models.
- **Dependency injection setup:** Patterns for interface boundaries and registering services with the DI container.
- **Async and cancellation:** Rules for async all the way down, concurrent tasks and passing cancellation tokens.
- **ASP.NET Core patterns:** Examples for options binding, middleware, minimal API route groups and typed results.
- **Data access with EF Core:** A repository example using EF Core with no-tracking queries and includes.
- **Anti-pattern reference:** A table of common C# mistakes paired with the recommended fix for each.

## Good for

- Review a C# service class for async misuse and blocking calls
- Refactor a .NET class to use constructor injection and interfaces
- Set up strongly typed configuration with the options pattern
- Add a request timing middleware to an ASP.NET Core app
- Structure minimal API endpoints with route groups

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/dotnet-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/dotnet-patterns &&
cp -R "$tmp/.agents/skills/dotnet-patterns" ~/.claude/skills/dotnet-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/dotnet-patterns` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/dotnet-patterns` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/dotnet-patterns &&
cp -R "$tmp/.agents/skills/dotnet-patterns" ~/.agents/skills/dotnet-patterns &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/dotnet-patterns` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/dotnet-patterns` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/dotnet-patterns &&
cp -R "$tmp/.agents/skills/dotnet-patterns" ~/.cursor/skills/dotnet-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/dotnet-patterns` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/dotnet-patterns
```

Or copy the folder to `~/.gemini/skills/dotnet-patterns` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/dotnet-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/dotnet-patterns &&
cp -R "$tmp/.agents/skills/dotnet-patterns" ~/.copilot/skills/dotnet-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/dotnet-patterns` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/dotnet-patterns` into your agent's skills folder as `dotnet-patterns`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Dotnet patterns activate?

It is meant for writing or reviewing C# and .NET code, including tasks involving dependency injection, async behavior or general conventions.

### Does Dotnet patterns run any scripts or need extra tools?

No scripts are included and no allowed tools are set. It consists of guidance and code examples in a SKILL.md file.

### How do I install Dotnet patterns in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/dotnet-patterns to use it in all your projects, or to .claude/skills/dotnet-patterns in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Dotnet patterns run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Dotnet patterns?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Dotnet patterns?

The closest alternatives to Dotnet patterns are Dotnet best practices, Dotnet design pattern review, Csharp testing, Csharp async and Ef core.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Dotnet best practices](https://ai-powered.com/skills/dotnet-best-practices): Dotnet best practices is an open-source agent skill for developer tools.
- [Dotnet design pattern review](https://ai-powered.com/skills/dotnet-design-pattern-review): Dotnet design pattern review is an open-source agent skill for design and media.
- [Csharp testing](https://ai-powered.com/skills/csharp-testing): Csharp testing is an open-source agent skill for developer tools.
- [Csharp async](https://ai-powered.com/skills/csharp-async): Csharp async is an open-source agent skill for developer tools.
- [Ef core](https://ai-powered.com/skills/ef-core): Ef core is an open-source agent skill for databases.
- [Aspnet core](https://ai-powered.com/skills/aspnet-core): Aspnet core is a free agent skill for developer tools.
- [Patterns](https://ai-powered.com/skills/patterns-xiaolai): Patterns is an open-source agent skill for developer tools.
- [Cpp coding standards](https://ai-powered.com/skills/cpp-coding-standards): Cpp coding standards is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/dotnet-patterns
