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

mongo-ruby-driver

AGENTS.md1.4k starsChanged 8 months agoApache-2.0View on GitHub

This is the Ruby driver for the MongoDB database. It provides a Ruby interface for connecting to MongoDB, performing CRUD operations, and managing database connections. The API is standardized across all MongoDB drivers, via the specifications defined in the MongoDB Specifications repository: https://github.com/mongodb/specifications. The driver targets Ruby 2.7+. Do not use syntax or stdlib features unavailable in Ruby 2.7. The project is organized into the following directories: Tests require a running MongoDB instance. Set the URI via the MONGODB_URI environment…

Trending

Quiet since September.about the whole repository

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

Who's talking about mongodb/mongo-ruby-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 · 42

37 more on GitHub

On Hacker News · 1

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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 repositoryOne other file it gives its agents.

The file

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

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Run RuboCop after making changes, and always before committing:

    line 31
  2. Distinctive:

    When writing prose — commit messages, code comments, documentation — be concise, write as a human would, avoid overly complicated …

    line 47
  3. Distinctive:

    Do not write Ruby specs that duplicate behavior already covered by YAML spec tests.

    line 61

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

Project Description

This is the Ruby driver for the MongoDB database. It provides a Ruby interface for connecting to MongoDB, performing CRUD operations, and managing database connections. The API is standardized across all MongoDB drivers, via the specifications defined in the MongoDB Specifications repository: https://github.com/mongodb/specifications. The driver targets Ruby 2.7+. Do not use syntax or stdlib features unavailable in Ruby 2.7.

Project Structure

The project is organized into the following directories:

  • lib/: the main codebase
  • spec/: RSpec tests for the project, and shared test data
  • bin/: executable scripts
  • examples/: example usage of the library
  • gemfiles/: Gemfile files for different usage scenarios (primarily testing, aside from standard.rb which is used for development and production)
  • profile/: profiling scripts and results

Development Workflow

Running tests

Tests require a running MongoDB instance. Set the URI via the MONGODB_URI environment variable:

MONGODB_URI="mongodb://localhost:27017,localhost:27018,localhost:27019/" bundle exec rspec spec/path/to/spec.rb

A replica set is typically available locally at localhost:27017,27018,27019.

Linting

Run RuboCop after making changes, and always before committing:

bundle exec rubocop lib/mongo/changed_file.rb spec/mongo/changed_file_spec.rb

Pass the specific files you modified.

RuboCop is configured with performance, rake, and rspec plugins (.rubocop.yml).

Commit convention

Prefix commit messages with the JIRA ticket: RUBY-#### Short description. The ticket number is typically in the branch name (e.g., branch 3795-foo means RUBY-3795).

Prose style

When writing prose — commit messages, code comments, documentation — be concise, write as a human would, avoid overly complicated sentences, and use no emojis.

Definition of done

Always run the relevant spec file(s) against the local cluster before considering a task complete. Running tests is not optional. "Relevant" means: the spec file for each class you changed, plus any integration specs in spec/integration/ that exercise the affected feature. If MongoDB is not reachable, report this to the user rather than trying to work around it.

Thread and fiber safety

This driver runs in multi-threaded and multi-fiber environments. When writing or modifying code that touches connection pools, server monitors, or any shared state, always consider concurrent access. Use existing synchronization primitives in the codebase rather than introducing new ones.

Spec fixtures

Unified test format YAML fixtures live in spec/spec_tests/data/<suite_name>/. To add new fixtures, copy YAML files from specifications/source/<spec-name>/tests/unified/ into that directory. The runner loads all *.yml files automatically — no runner changes needed.

Do not write Ruby specs that duplicate behavior already covered by YAML spec tests. New Ruby specs should cover behavior that cannot be expressed in the unified test format.

Code Reviews

See .github/code-review.md for code review guidelines.

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.