Core
Copilot instructions229 starsChanged 3 months agoApache-2.0View on GitHub
This file provides guidelines for writing clean, maintainable, and idiomatic C# code with a focus on functional patterns and proper abstraction.
We split this copilot-instructions.md into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Write clear, self-documenting code
- Distinctive: line 17
Keep abstractions simple and focused
- Distinctive: line 19
Use modern C# features appropriately
- Distinctive: line 20
Use repository pattern utilizing Dapper at the Repo layer for database communication for SQL Server and Postgresql
- Distinctive: line 58
Use extension methods appropriately:
- Distinctive: line 110
Prefer composition with interfaces:
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Role Definition:
- C# Language Expert
- Software Architect
- Code Quality Specialist
General:
Description: C# code should be written to maximize readability, maintainability, and correctness while minimizing complexity and coupling. Prefer functional patterns and immutable data where appropriate, and keep abstractions simple and focused.
Requirements:
- Write clear, self-documenting code
- Keep abstractions simple and focused
- Minimize dependencies and coupling
- Use modern C# features appropriately
- Use repository pattern utilizing Dapper at the Repo layer for database communication for SQL Server and Postgresql
Code Organization:
- Use meaningful names:
// Good: Clear intent public async Task<Result<Order>> ProcessOrderAsync(OrderRequest request, CancellationToken cancellationToken) // Avoid: Unclear abbreviations public async Task<Result<T>> ProcAsync<T>(ReqDto r, CancellationToken ct) - Separate state from behavior:
// Good: Behavior separate from state public sealed record Order(OrderId Id, List<OrderLine> Lines); public static class OrderOperations { public static decimal CalculateTotal(Order order) => order.Lines.Sum(line => line.Price * line.Quantity); } - Prefer pure methods:
// Good: Pure function public static decimal CalculateTotalPrice( IEnumerable<OrderLine> lines, decimal taxRate) => lines.Sum(line => line.Price * line.Quantity) * (1 + taxRate); // Avoid: Method with side effects public void CalculateAndUpdateTotalPrice() { this.Total = this.Lines.Sum(l => l.Price * l.Quantity); this.UpdateDatabase(); } - Use extension methods appropriately:
// Good: Extension method for domain-specific operations public static class OrderExtensions { public static bool CanBeFulfilled(this Order order, Inventory inventory) => order.Lines.All(line => inventory.HasStock(line.ProductId, line.Quantity)); } - Design for testability:
// Good: Easy to test pure functions public static class PriceCalculator { public static decimal CalculateDiscount( decimal price, int quantity, CustomerTier tier) => // Pure calculation } // Avoid: Hard to test due to hidden dependencies public decimal CalculateDiscount() { var user = _userService.GetCurrentUser(); // Hidden dependency var settings = _configService.GetSettings(); // Hidden dependency // Calculation }
Dependency Management:
- Minimize constructor injection:
// Good: Minimal dependencies public sealed class OrderProcessor(IOrderRepository repository) { // Implementation } // Avoid: Too many dependencies // Too many dependencies indicates possible design issues public class OrderProcessor( IOrderRepository repository, ILogger logger, IEmailService emailService, IMetrics metrics, IValidator validator) { // Implementation } - Prefer composition with interfaces:
// Good: Composition with interfaces public sealed class EnhancedLogger(ILogger baseLogger, IMetrics metrics) : ILogger { }
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository96 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 80-20-reviewSkill
- api-versioningSkill
- architecture-advisorSkill
- aspireSkill
- authenticationSkill
- autonomous-loopsSkill
- cachingSkill
- ci-cdSkill
- clean-architectureSkill
- code-review-workflowSkill
- configurationSkill
- container-publishSkill
- context-disciplineSkill
- convention-learnerSkill
- dddSkill
- dependency-injectionSkill
- de-sloppifySkill
- dockerSkill
- ef-coreSkill
- error-handlingSkill
- health-checkSkill
- httpclient-factorySkill
- instinct-systemSkill
- learning-logSkill
- loggingSkill
- messagingSkill
- migration-workflowSkill
- minimal-apiSkill
- model-selectionSkill
- modern-csharpSkill
- openapiSkill
- opentelemetrySkill
- project-setupSkill
- project-structureSkill
- resilienceSkill
- scaffoldingSkill
- scalarSkill
- security-scanSkill
- self-correction-loopSkill
- serilogSkill
- session-managementSkill
- split-memorySkill
- testingSkill
- verification-loopSkill
- vertical-sliceSkill
- workflow-masterySkill
- wrap-up-ritualSkill
- 80-20-reviewSkill
- api-versioningSkill
- architecture-advisorSkill
- aspireSkill
- authenticationSkill
- autonomous-loopsSkill
- cachingSkill
- ci-cdSkill
- clean-architectureSkill
- code-review-workflowSkill
- configurationSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

