microservice-patterns
Copilot instructions331 starsChanged 18 months agoMITView on GitHub
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this copilot-instructions.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 4
Always use the latest version C#, currently C# 13 features.
- Distinctive: line 8
Prefer file-scoped namespace declarations and single-line using directives.
- Distinctive: line 10
Ensure that the final return statement of a method is on its own line.
- Distinctive: line 11
Use pattern matching and switch expressions wherever possible.
- Very specific: line 12
Use nameof instead of string literals when referring to member names.
- Very specific: line 13
Ensure that XML doc comments are created for any public APIs.
- Very specific: line 18
Always use is null or is not null instead of == null or != null.
- Distinctive: line 24
Do not emit "Act", "Arrange" or "Assert" comments.
- Distinctive: line 25
Use Moq for mocking in tests.
≈ “Common” is an estimate: at least 1 in 5 of the 3,827 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
General
- Make only high confidence suggestions when reviewing code changes.
- Always use the latest version C#, currently C# 13 features.
Formatting
- Prefer file-scoped namespace declarations and single-line using directives.
- Insert a newline before the opening curly brace of any code block (e.g., after
if,for,while,foreach,using,try, etc.). - Ensure that the final return statement of a method is on its own line.
- Use pattern matching and switch expressions wherever possible.
- Use
nameofinstead of string literals when referring to member names. - Ensure that XML doc comments are created for any public APIs. When applicable, include
<example>and<code>documentation in the comments.
Nullable Reference Types
- Declare variables non-nullable, and check for
nullat entry points. - Always use
is nulloris not nullinstead of== nullor!= null. - Trust the C# null annotations and don't add null checks when the type system says a value cannot be null.
Testing
- We use xUnit SDK v3 for tests.
- Do not emit "Act", "Arrange" or "Assert" comments.
- Use Moq for mocking in tests.
- Copy existing style in nearby files for test method names and capitalization.
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.

