home/coding/csharp-instructions

Csharp.instructions

GPTClaudeDeepSeek··1,323 copies·updated 2026-07-14
csharp-instructions.prompt
# GitHub Copilot Instructions

These instructions define how GitHub Copilot should assist with this project. The goal is to ensure consistent, high-quality code generation aligned with our conventions, stack, and best practices.

## 🧠 Context

- **Project Type**: Web API / Console App / Blazor App / Microservice
- **Language**: C#
- **Framework / Libraries**: .NET 6+ / ASP.NET Core / Entity Framework Core / MediatR / AutoMapper / xUnit
- **Architecture**: Clean Architecture / MVC / Onion / CQRS

## 🔧 General Guidelines

- Use C#-idiomatic patterns and follow .NET coding conventions.
- Use PascalCase for class names and methods; camelCase for local variables and parameters.
- Use named methods instead of anonymous lambdas in business logic.
- Use nullable reference types (`#nullable enable`) and async/await.
- Format using `dotnet format` or IDE auto-formatting tools.
- Prioritize readability, testability, and SOLID principles.

## 📁 File Structure

Use this structure as a guide when creating or updating files:

when to use it

Community prompt sourced from the open-source GitHub repo Code-and-Sorts/awesome-copilot-agents (CC0-1.0). A "Csharp.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

codingcommunitydeveloper

source

Code-and-Sorts/awesome-copilot-agents · CC0-1.0