Skip to content

MONGOCRYPT-955 add AGENTS.md - #1211

Merged
kevinAlbs merged 8 commits into
mongodb:masterfrom
kevinAlbs:M955
Aug 13, 2026
Merged

MONGOCRYPT-955 add AGENTS.md#1211
kevinAlbs merged 8 commits into
mongodb:masterfrom
kevinAlbs:M955

Conversation

@kevinAlbs

Copy link
Copy Markdown
Collaborator

Summary

Add an AGENTS.md for libmongocrypt.

As a drive-by: fix formatting steps CONTRIBUTING.md to refer to uv (not pipx).

Background & Motivation

Organization of build steps was inspired by mongodb/mongo-cxx-driver#1636.

Evaluating

I used Claude to draft an AGENTS.md evaluator. It tested responses to read-only prompts before / after adding AGENTS.md. The draft is in this branch. Response correctness did not change much. But token usage reduced:

model passed before passed after Δ tokens before tokens after Δ
sonnet 52/60 (87%) 60/60 (100%) 🟢 +13% 1,412,187 849,919 🟢 -40%
opus 56/60 (93%) 59/60 (98%) 🟢 +5% 1,630,504 720,407 🟢 -56%
haiku 55/60 (92%) 51/60 (85%) 🔴 -7% 3,010,864 690,846 🟢 -77%

The reduced token usage gave me some confidence the AGENTS.md helped lower the need to explore. But I was not confident this evaluator was valuable enough to add to this PR. And I did not want to continue adding scope to this task.

@kevinAlbs
kevinAlbs requested a review from a team as a code owner August 3, 2026 15:45

@connorsmacd connorsmacd left a comment

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.

LGTM with some minor feedback. Erring on the side of approving this now since I will be away until next week.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

@vector-of-bool vector-of-bool left a comment

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.

Sorry, thought I submitted my pending comments a few days ago. A few comments regarding redundant information that the model already knows.

Comment thread AGENTS.md

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.

Can the text in this file be reflowed to a column limit? Not important but aides readability across both very wide and very narrow screens.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am slightly averse to hard-wrapping I think I have a historical peeve of my small text changes in the spec repo creating big diffs after rewrapping. I expect that is less of an issue with modern GitHub highlighting content changes.

I am admittedly biased towards my own workflow with VS Code. VS Code does not appear to have built-in support for hard wrapping. But I can enable soft wrapping in VS Code with user settings:

    "[markdown]": {
        "editor.wordWrap": "wordWrapColumn",
        "editor.wordWrapColumn": 120,
        "editor.rulers": [
            120
        ],
    },
Image

With that said, would hard wrapping still seem preferable? I am open to it if it may help with reading (though I might poke you for recommendations on a wrapping tool).

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.

Soft wrapping may be a useful compromise.

The wrapping happens automatically for me because I have an extension, "Reflow Markdown", installed that formats markdown files on save. It may not be the optimal formatter though, and it can garble some constructs like admonitions. May be better to adopt a proper tool like mdformat in the future. I'd say leave it for now and we can discuss reformatting of everything altogether at some future date.

Comment thread AGENTS.md Outdated
Comment on lines +37 to +40
> [!IMPORTANT]
> For multi-configuration generators (e.g. "Visual Studio *", "Ninja Multi-Config", etc.), use `--config <config>` during the build, install, and test steps instead of `CMAKE_BUILD_TYPE=<config>`.
> The `CMAKE_BUILD_TYPE` option will be ignored by the configuration step.
> Only use `CMAKE_BUILD_TYPE` with single-configuration generators (e.g. Makefile Generators, Ninja, etc.).

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 believe that models will have information like this baked-in. e.g. I've never needed to guide an LLM on how multi-config generators work, it just knows.

I think the only thing that needs to be specified is the configuration parameters that are specific to this project.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I originally erred towards consistency with the C and C++ driver AGENTS.md, but I tend to agree. I expect CMake instructions common to any CMake project are unlikely to help an LLM. I removed some CMake notes, and left notes about preferences (e.g. using cmake-build) or project specific options.

Comment thread AGENTS.md Outdated
Comment on lines +44 to +47
- `-G <generator-name>`: specify a build system generator (e.g. `Ninja`).
- `-D CMAKE_PREFIX_PATH:PATH=<prefix>`: installation prefixes to search with `find_*()` (e.g. an installed libbson with `USE_SHARED_LIBBSON=ON`, or OpenSSL).
- `-D CMAKE_INSTALL_PREFIX:PATH=<install-prefix>`: install directory used by `install()`. Use `cmake-build/install/` when system modification is undesirable or disallowed by the user.
- `-D CMAKE_BUILD_TYPE:STRING=<config>`: build type on single-configuration generators.

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.

Same as comment above

Comment thread AGENTS.md
> [!IMPORTANT]
> For multi-configuration generators, the executable appears under a `<config>/` subdirectory (e.g. `cmake-build/Debug/test-mongocrypt`).

A few tests need a real crypt_shared library; download one with the `mongodl.py` script from drivers-evergreen-tools: <https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/mongodl.py>

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 have a user skill for mongodl that may be useful for sharing across projects in the org, but I don't know how to do that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have not tried it, but https://github.com/10gen/agent-skills might be an option for an org-wide skill.

@vector-of-bool vector-of-bool left a comment

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.

LGTM

@kevinAlbs
kevinAlbs merged commit ab64438 into mongodb:master Aug 13, 2026
47 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants