Skip to content

CSHARP-5943: Initial small AGENTS.md file for the C# driver#1934

Open
ajcvickers wants to merge 1 commit intomongodb:mainfrom
ajcvickers:CSHARP-5943
Open

CSHARP-5943: Initial small AGENTS.md file for the C# driver#1934
ajcvickers wants to merge 1 commit intomongodb:mainfrom
ajcvickers:CSHARP-5943

Conversation

@ajcvickers
Copy link
Copy Markdown
Contributor

See notes in DRIVERS-3428.

@ajcvickers ajcvickers added the maintenance Non-code maintenance (deps, docs, configs, etc.). label Apr 2, 2026
@ajcvickers ajcvickers marked this pull request as ready for review April 2, 2026 14:27
@ajcvickers ajcvickers requested a review from a team as a code owner April 2, 2026 14:27
@ajcvickers ajcvickers requested review from Copilot and kyra-rk April 2, 2026 14:27
@ajcvickers
Copy link
Copy Markdown
Contributor Author

For reviewers, see notes and discussion here: https://jira.mongodb.org/browse/DRIVERS-3428

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial agent-focused repository guide for the MongoDB C# driver, outlining the tech stack, repo layout, common commands, and test environment variables.

Changes:

  • Introduces a new Agents.md with a high-level overview of the driver and repository structure.
  • Documents build/test commands and a matrix of environment variables for optional test suites.
  • Notes commit/PR message conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Tech Stack
- .NET library projects producing NuGet packages
- Multi-targeted to various .NET versions from .NET Framework 4.7.2 up
- xUnit + FluentAssertions for testing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part about FluentAssertions.. I think we need to discuss about it in the team. Sometime ago we had a discussion about using the basic assertions against the fluent ones.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added FluentAssertions to my list of things to bring up in retrospective. For now, I think we should leave it--Claude explicitly called out that it was useful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... just to leave the record: I do remember discussion about FluentAssertion turned to be commercial, and we should either stop using it, or pin the version and never bump it until it possible. But I do not remember if we really made any decisions. We also discussed possibility to switch to Shouldly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what you said. I also think that at the time we didn't decide which direction to take though.


## Commit and PR Conventions

- Commit and PR messages start with a JIRA number: `CSHARP-1234: Description`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true only for the first commit in a branch, doesn't it?
In my file I also have that branch names contain the JIRA ticket number. And also that it can use the ticket number from a branch to look up context from JIRA when needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will clarify that it is the first commit.

Sometimes branch names don't match--even Robert had names with "b" appended or similar occasionally. That's why I didn't add it, but I can, and we can see if any exceptions cause real issues.

## Commands
- Build: `dotnet build CSharpDriver.sln`
- Run all tests: `dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0`
- Run a single test class: `dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 --filter "FullyQualifiedName~ClassName"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my file I also have a note about the fact that tests cannot be run in parallel.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you found this to be an issue? I would expect that Claude would not try to do that given that tests are not configured that way by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happened to me when it was trying to run tests on multiple classes, I think it had multiple sub-agents trying to run tests in parallel so I had to add it.

- Multi-targeted to various .NET versions from .NET Framework 4.7.2 up
- xUnit + FluentAssertions for testing

## Project Structure
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something that I found useful was also to give the path to the specification repo that I have locally. It's super useful for certain kind of feature implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I think we would have to standardize on the location to put that here, but it could be a good candidate for each of our user-specific agents file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, for sure we should not standardize the location, but it's a good add.

| X.509 authentication | `MONGO_X509_CLIENT_CERTIFICATE_PATH`, `MONGO_X509_CLIENT_CERTIFICATE_PASSWORD` |
| PLAIN authentication | `PLAIN_AUTH_TESTS_ENABLED` |
| SOCKS5 proxy | `SOCKS5_PROXY_SERVERS_ENABLED` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another line I have:

"Do not strip BOMs: Source files may have a UTF-8 BOM (U+FEFF). Prefer using the Edit tool over Write to avoid accidentally removing it."

(not sure if it's still an issue)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What issues have we had with BOMs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On some files both Claude and OpenCode were removing BOMs, so I was getting a change on the first line of some files.

@kyra-rk kyra-rk removed their request for review April 8, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Non-code maintenance (deps, docs, configs, etc.).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants