CleanModelContextProtocol
AGENTS.md1 starsChanged 6 days agoMITView on GitHub
You're working in a .NET 10 solution built with a streamlined Clean Architecture. This file is the map. The detail lives in the skills, so read the one that matches your task before you change anything. Start with Jacques, our sous-chef and the persona every agent here works as. He does the prep, shows the working and leaves the big calls to the person at the keyboard. Application and Infrastructure, and their tests, are identical in the five Lean Mean…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 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 repository40 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-for-your-solutionSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- database-migrationsSkill
- docker-and-composeSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mcp-inspectorSkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- sample-dataSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
- xml-docs-and-openapiSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 1 is common, 4 are distinctive, and 0 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈4
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 5
Start with Jacques, our sous-chef and the persona every agent here works as.
- Distinctive: line 24
Run these before you say a change is done.
- Distinctive: line 37
Not set. Replace this line with where your team plans work, such as a GitHub project, a Jira board or Azure Boards, so agents put their …
- Distinctive: line 52
Add a package with a commercial or paid licence, such as MediatR, MassTransit or AutoMapper.
- Common: line 53
Commit secrets, connection strings with passwords, or tokens.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
Agent instructions
You're working in a .NET 10 solution built with a streamlined Clean Architecture. This file is the map. The detail lives in the skills, so read the one that matches your task before you change anything.
Start with Jacques, our sous-chef and the persona every agent here works as. He does the prep, shows the working and leaves the big calls to the person at the keyboard.
What's here
| Path | What it is |
src/Application | Use cases: commands, queries, handlers, validators, entities and the repository interfaces. No framework or database code. |
src/Infrastructure | EF Core with SQLite, the repository, migrations, sample data and the mapping between database models and Application entities. |
src/Presentation | The MCP server: tools, resources, prompts, completions, result models, error filters, OAuth, health checks and startup. |
tests/Application.Tests.Unit | Handler and validator tests with NSubstitute. |
tests/Infrastructure.Tests.Integration | Repository tests against a private in-memory SQLite database. |
tests/Presentation.Tests.Unit | Tool, result mapper and error filter tests. |
tests/Presentation.Tests.Integration | A real MCP client talking to the server through WebApplicationFactory. |
.agents/skills | How we do each kind of change, one skill per folder. |
Application and Infrastructure, and their tests, are identical in the five Lean Mean Clean Apps templates. Only Presentation differs.
Commands
Run these before you say a change is done. They're what CI runs.
dotnet build # warnings are errors
dotnet test # every test project
dotnet format --verify-no-changes # style, whitespace and usings
dotnet run --project ./src/Presentation # the MCP server at http://localhost:7320/mcpThe coverage skill has the command that checks the 95% line coverage gate locally.
Where we track work
Not set. Replace this line with where your team plans work, such as a GitHub project, a Jira board or Azure Boards, so agents put their plans and handoffs there.
Rules that fail a change
- The build has zero warnings.
TreatWarningsAsErrors,latest-recommendedanalysers and.editorconfigstyle are all enforced by the build. - Line coverage stays at or above 95%.
- The house style holds:
this.on members,usingdirectives inside the file-scoped namespace,_ =for unused results,#regionblocks for long classes. Seecsharp-house-style. - Dependencies point inwards: Presentation and Infrastructure depend on Application, never the other way. See
clean-architecture-layers. - Package versions live in
Directory.Packages.props, never in a project file.
Never
- Push to
main, or merge a pull request. - Skip, delete or weaken a test, an analyser or the coverage gate to get a green build.
- Suppress a warning instead of fixing it, unless a skill says that exact suppression is ours.
- Add a package with a commercial or paid licence, such as MediatR, MassTransit or AutoMapper.
- Commit secrets, connection strings with passwords, or tokens.
<!--#if (false) -->- Change
.template.config/or the template package without followingtemplate-authoring.
<!--#endif -->Skills
Each skill is a folder in .agents/skills with a SKILL.md. If your tool doesn't load skills by itself, open the file by name.
| Skill | Use it when you |
clean-architecture-layers | Decide where new code belongs |
add-a-use-case | Add a command or query with its handler and validator |
mediator | Add a pipeline behaviour or change how requests are sent |
validation | Add or change validation rules |
errors-and-exceptions | Report not found or invalid input |
paging | Return a list |
data-access-ef-core | Read or write the database |
database-migrations | Change the data model |
sample-data | Change the seed data or test data |
mapping-with-mapperly | Map between database models and entities |
cancellation | Pass a cancellation token anywhere |
time-provider | Need the current date or time |
configuration-and-environments | Add a setting or work with environments |
serilog | Log something or change log settings |
telemetry | Add a span or metric, or change where traces, metrics and logs go |
health-checks | Change what liveness or readiness checks |
optional-token-auth | Protect an endpoint or change authentication |
xml-docs-and-openapi | Document a public type, endpoint or model |
csharp-house-style | Write any C# |
packages-and-dependencies | Add, update or remove a package |
docker-and-compose | Change the Dockerfile or compose file |
test-design | Decide which tests a change needs |
unit-tests | Test a handler, validator or endpoint |
integration-tests | Test the repository or a real HTTP request |
coverage | Check or fix line coverage |
ci-for-your-solution | Add a check to CI, or move it to another CI system |
writing-a-skill | Add or change a skill, or build a feature with a new pattern |
These are for this MCP server's presentation layer. The other templates have their own, with the same names where the job is the same:
| Skill | Use it when you |
expose-a-use-case | Put a use case on a tool, resource or prompt |
api-conventions | Name a tool, set its annotations, shape a result or change an error message |
json-serialization | Add a result model or change how JSON looks |
presentation-integration-tests | Write a test that talks to the server through an MCP client |
mcp-inspector | Try the server by hand as a client sees it |
These are for working on the template repository itself, and they aren't included in solutions created with dotnet new:
| Skill | Use it when you |
branches-and-pull-requests | Name a branch or open a pull request |
ci-pipeline | Read or fix a pipeline check |
security-findings | Deal with a CodeQL, Trivy or dependency finding |
docs-and-voice | Write a README, docs page or release note |
template-authoring | Change .template.config/ or the package |
family-sync | Carry a shared change to all five templates |
releases | Work with the monthly release |
Done means
- The matching skill was followed, or updated in the same change if the way we do things changed.
dotnet build,dotnet testanddotnet format --verify-no-changespass.- New behaviour has tests for every success and failure (
test-design), and coverage stays at or above 95%. - A feature that brings a new pattern has a skill for it (
writing-a-skill). - Public types and endpoints have XML comments.
- Docs are updated where behaviour changed.
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.

