agentleFS
LeanMeanCleanAppsLeanMeanCleanApps/CleanModelContextProtocol/AGENTS.md

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…

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
  1. Distinctive:

    Start with Jacques, our sous-chef and the persona every agent here works as.

    line 5
  2. Distinctive:

    Run these before you say a change is done.

    line 24
  3. Distinctive:

    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 …

    line 37
  4. Distinctive:

    Add a package with a commercial or paid licence, such as MediatR, MassTransit or AutoMapper.

    line 52
  5. Common:

    Commit secrets, connection strings with passwords, or tokens.

    line 53

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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

PathWhat it is
src/ApplicationUse cases: commands, queries, handlers, validators, entities and the repository interfaces. No framework or database code.
src/InfrastructureEF Core with SQLite, the repository, migrations, sample data and the mapping between database models and Application entities.
src/PresentationThe MCP server: tools, resources, prompts, completions, result models, error filters, OAuth, health checks and startup.
tests/Application.Tests.UnitHandler and validator tests with NSubstitute.
tests/Infrastructure.Tests.IntegrationRepository tests against a private in-memory SQLite database.
tests/Presentation.Tests.UnitTool, result mapper and error filter tests.
tests/Presentation.Tests.IntegrationA real MCP client talking to the server through WebApplicationFactory.
.agents/skillsHow 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/mcp

The 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-recommended analysers and .editorconfig style are all enforced by the build.
  • Line coverage stays at or above 95%.
  • The house style holds: this. on members, using directives inside the file-scoped namespace, _ = for unused results, #region blocks for long classes. See csharp-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 following template-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.

SkillUse it when you
clean-architecture-layersDecide where new code belongs
add-a-use-caseAdd a command or query with its handler and validator
mediatorAdd a pipeline behaviour or change how requests are sent
validationAdd or change validation rules
errors-and-exceptionsReport not found or invalid input
pagingReturn a list
data-access-ef-coreRead or write the database
database-migrationsChange the data model
sample-dataChange the seed data or test data
mapping-with-mapperlyMap between database models and entities
cancellationPass a cancellation token anywhere
time-providerNeed the current date or time
configuration-and-environmentsAdd a setting or work with environments
serilogLog something or change log settings
telemetryAdd a span or metric, or change where traces, metrics and logs go
health-checksChange what liveness or readiness checks
optional-token-authProtect an endpoint or change authentication
xml-docs-and-openapiDocument a public type, endpoint or model
csharp-house-styleWrite any C#
packages-and-dependenciesAdd, update or remove a package
docker-and-composeChange the Dockerfile or compose file
test-designDecide which tests a change needs
unit-testsTest a handler, validator or endpoint
integration-testsTest the repository or a real HTTP request
coverageCheck or fix line coverage
ci-for-your-solutionAdd a check to CI, or move it to another CI system
writing-a-skillAdd 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:

SkillUse it when you
expose-a-use-casePut a use case on a tool, resource or prompt
api-conventionsName a tool, set its annotations, shape a result or change an error message
json-serializationAdd a result model or change how JSON looks
presentation-integration-testsWrite a test that talks to the server through an MCP client
mcp-inspectorTry 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:

SkillUse it when you
branches-and-pull-requestsName a branch or open a pull request
ci-pipelineRead or fix a pipeline check
security-findingsDeal with a CodeQL, Trivy or dependency finding
docs-and-voiceWrite a README, docs page or release note
template-authoringChange .template.config/ or the package
family-syncCarry a shared change to all five templates
releasesWork 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 test and dotnet format --verify-no-changes pass.
  • 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.