agentleFS
MongoDBKnown publishermongodb/mongo-java-driver/AGENTS.md

mongo-java-driver

AGENTS.md2.7k starsChanged 7 months agoApache-2.0View on GitHub

All changes require human review. Breaking changes to public API require a major version bump — always warn if binary compatibility is affected. Also consult .AGENTS.md / ~/.AGENTS.md if present for local agent settings. Architecture: Multi-module Gradle project: bson → driver-core → driver-sync/driver-reactive-streams → language wrappers (driver-kotlin-sync, driver-kotlin-coroutine, driver-scala). See .agents/references/project-guide for module structure and dependency graph. Each module has its own AGENTS.md. The default branch is main (not master). Always use main when comparing, diffing, or creating branches. -…

Trending

Quiet since September.about the whole repository

Dec 2025: 2 mentionsJan 2026: 0 mentionsFeb 2026: 2 mentionsMar 2026: 2 mentionsApr 2026: 0 mentionsMay 2026: 4 mentionsJun 2026: 4 mentionsJul 2026: 6 mentionsAug 2026: 2 mentionsSep 2026: 6 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the mongodb/mongo-java-driver repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about mongodb/mongo-java-driver

The biggest 5 of 43 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 43

Talked about on GitHub and Hacker News (43 times).

On GitHub · 39

34 more on GitHub

On Hacker News · 4

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All changes require human review.

    line 3
  2. Distinctive:

    Commits: Keep commits logical and reviewable — each commit should be a coherent unit of change

    line 17
  3. Very specific:

    TODO comments: Must reference a Jira ticket if the work belongs to a different ticket: // TODO JAVA-XXXX reasoning for the todo

    line 18
  4. Distinctive:

    Read before modifying — understand existing code and patterns first

    line 23
  5. Distinctive:

    No rewrites without explicit permission

    line 26
  6. Distinctive:

    When stuck or uncertain: stop, explain, propose alternatives, ask

    line 27
  7. Very specific:

    When authoring or reviewing changes: consult the relevant .agents/references/ file for each area the changes touch

    line 28
  8. Very specific:

    Java 8 baseline: no Java 9+ language features unless the module raises sourceCompatibility.

    line 34
  9. Very specific:

    Do not reformat outside your changes.

    line 48
  10. Distinctive:

    Every code change must include tests.

    line 54
  11. Distinctive:

    Do not reduce coverage.

    line 55
  12. Very specific:

    Nullability: use com.mongodb.lang annotations.

    line 66
  13. Very specific:

    Secrets: Never render credentials (usernames, passwords, tokens, keys) in toString() — emit <hidden> instead.

    line 69
  14. Very specific:

    Thread safety: use com.mongodb.annotations (@ThreadSafe / @NotThreadSafe / @Immutable).

    line 72
  15. Distinctive:

    Never add dependencies without justification

    line 98
  16. Very specific:

    All dependency versions are managed in gradle/libs.versions.toml — never declare versions inline in build.gradle.kts

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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

AGENTS.md - MongoDB Java Driver

All changes require human review. Breaking changes to public API require a major version bump — always warn if binary compatibility is affected. Also consult .AGENTS.md / ~/.AGENTS.md if present for local agent settings.

Architecture: Multi-module Gradle project: bson → driver-core → driver-sync/driver-reactive-streams → language wrappers (driver-kotlin-sync, driver-kotlin-coroutine, driver-scala).

See .agents/references/project-guide for module structure and dependency graph. Each module has its own AGENTS.md.

Git

The default branch is main (not master). Always use main when comparing, diffing, or creating branches.

  • Branch naming: JAVA-XXXX matching the Jira ticket (e.g., JAVA-6143)
  • Commits: Keep commits logical and reviewable — each commit should be a coherent unit of change
  • TODO comments: Must reference a Jira ticket if the work belongs to a different ticket: // TODO JAVA-XXXX reasoning for the todo

Core Rules

  • Read before modifying — understand existing code and patterns first
  • Minimal changes only — no drive-by refactoring or unrelated changes
  • Preserve existing comments — only remove if provably incorrect
  • No rewrites without explicit permission
  • When stuck or uncertain: stop, explain, propose alternatives, ask
  • When authoring or reviewing changes: consult the relevant .agents/references/ file for each area the changes touch

Build

Gradle with Kotlin DSL. Build JDK: 17+. Source baseline: Java 8. Versions in gradle/libs.versions.toml.

  • Java 8 baseline: no Java 9+ language features unless the module raises sourceCompatibility.
  • Kotlin 1.8 with JVM target 1.8; all Kotlin modules enforce explicitApi().

Details for both are in .agents/references/style-reference.

./gradlew check                        # Full validation (format + static checks + tests)
./gradlew :driver-core:test            # Single module tests
./gradlew integrationTest -Dorg.mongodb.test.uri="mongodb://localhost:27017"

Style

check depends on spotlessApply to auto-fix formatting — run ./gradlew spotlessApply independently when needed. Do not reformat outside your changes. See .agents/references/style-reference for prohibited patterns, required headers, and full formatting rules.

Testing

  • Every code change must include tests. Do not reduce coverage.
  • Integration tests require a running MongoDB instance (see the test URI in Build section) — do not attempt to run integrationTest without a configured server.
  • See .agents/references/testing-guide for framework details and running specific tests.
  • See .agents/references/spec-tests for MongoDB specification test conventions.

API

All com.mongodb.internal.* / org.bson.internal.* is private API — never expose in public APIs.

Nullability: use com.mongodb.lang annotations; new packages must declare @NonNullApi in package-info.java.

Secrets: Never render credentials (usernames, passwords, tokens, keys) in toString() — emit <hidden> instead.

Thread safety: use com.mongodb.annotations (@ThreadSafe / @NotThreadSafe / @Immutable); public API classes must be thread-safe unless annotated otherwise.

See .agents/references/api-design for stability annotations, design principles, and the full nullability and thread safety conventions.

Code Design

Applies to implementation code — internal packages, method bodies, and private or package-access program elements.

See .agents/references/code-design for the rules.

Do Not Modify Without Human Approval

  • Wire protocol / authentication handshakes (com.mongodb.internal.connection)
  • Connection pool core code (com.mongodb.internal.connection.pool)
  • Security-critical encryption code / JNA bindings (mongodb-crypt)
  • Public API contracts (breaking changes need major version bump)
  • BSON specification compliance
  • Spec test data submodule (testing/resources/specifications/)
  • Release/versioning scripts, .evergreen/ config, credentials/secrets

See .agents/skills/evergreen for CI validation and patch builds.

Dependencies

  • Never add dependencies without justification
  • All dependency versions are managed in gradle/libs.versions.toml — never declare versions inline in build.gradle.kts

Before Submitting

./gradlew spotlessApply docs check scalaCheck   # formatting + docs + static checks + all tests

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.