agentleFS
projectmesaprojectmesa/mesa/AGENTS.md

mesa

AGENTS.md3.9k starsChanged 8 months agoApache-2.0View on GitHub

Instructions for AI coding assistants working on Mesa, a Python library for agent-based modelling. The knowledge lives in the developer guide; this file tells you how to behave and where to look. You are working for a human contributor. The goal is a contribution they understand and that fits Mesa, not the fastest possible diff. Docs: pip install -e ".[docs]", then make html in docs/ and inspect the rendered result.

  • Installs packages

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

5 rules. About 0 are common, 3 are distinctive, and 2 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check what was decided before: Read Project decisions and search existing issues, discussions, and PRs.

    line 13
  2. Distinctive:

    Name the trade-off: If the change touches one of the design principles (core vs.

    line 14
  3. Distinctive:

    Verify claims: Run the tests. Measure performance claims on a realistic workload with the same seed, before and after.

    line 16
  4. Very specific:

    Keep optional dependencies optional: import them inside the code that needs them (for example NetworkX in Network).

    line 21
  5. Very specific:

    Use built-in exceptions (ValueError, TypeError, …) for ordinary validation.

    line 23

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

Instructions for AI coding assistants working on Mesa, a Python library for agent-based modelling. The knowledge lives in the developer guide; this file tells you how to behave and where to look.

How to help a contributor

You are working for a human contributor. The goal is a contribution they understand and that fits Mesa, not the fastest possible diff.

  1. Problem before code. Mesa works in three stages: problem → concept → implementation (see How we work).
    • For a feature or enhancement, check whether there is an issue or discussion where a maintainer agreed to it. If there isn't, don't write the implementation. Help the user sharpen the problem (who is it for, what's the use case, what exists already) and draft a discussion post instead.
    • For a bug fix, reproduce the bug first with a minimal example, and ask the user how they ran into it in a real model. If you can't reproduce it, say so. Don't invent a bug report or a fix for behaviour you haven't observed. If it's an edge case found only by reading the code, that no realistic model would hit, tell the user it's likely to be closed rather than merged.
  2. Keep it small. One PR solves one agreed problem. Don't bundle refactors, drive-by cleanups, or formatting changes to unrelated code.
  3. Check what was decided before. Read Project decisions and search existing issues, discussions, and PRs. Many ideas have been discussed, and some were deliberately declined.
  4. Name the trade-off. If the change touches one of the design principles (core vs. examples, performance vs. readability, stability vs. experimentation, and so on), tell the user which side they're choosing and why.
  5. Help them understand; don't speak for them. Explain the code and the reasoning so the user can defend the change in review. Don't write the main text of a PR or issue for them, including the motivation, "what I learned", and reasoning sections. Those must be in their own words; you can help improve the language of text they wrote. Remind them to mention AI use in the PR description.
  6. Verify claims. Run the tests. Measure performance claims on a realistic workload with the same seed, before and after. Never report results you didn't produce.

Rules that are expensive to get wrong

  • Simulation behaviour must be deterministic for a given seed. Use the model's RNG (model.rng / model.random), and never let results depend on set iteration order.
  • Keep optional dependencies optional: import them inside the code that needs them (for example NetworkX in Network).
  • Experimental features live in mesa.experimental and may change. Stable APIs follow the deprecation policy: no breaking changes without a deprecation cycle and a migration guide entry.
  • Use built-in exceptions (ValueError, TypeError, …) for ordinary validation; see Errors and exceptions.
  • Core examples (mesa/examples) are canonical and lean. New examples go to mesa-examples unless maintainers agreed otherwise.

Commands

pip install -e ".[dev]"     # development install
pre-commit install          # ruff lint + format on commit
ruff check . --fix && ruff format .
pytest tests/               # CI runs: pytest tests/ -Werror -Wdefault::PendingDeprecationWarning
pytest --cov=mesa tests/    # check coverage didn't go down

Docs: pip install -e ".[docs]", then make html in docs/ and inspect the rendered result.

Where to look

TaskRead
Designing or proposing a changeDesign principles, Project decisions
Writing code, tests, docs, or examplesStandards
Deprecating or changing a stable APIDeprecations, migration guide
Opening a PR.github/PULL_REQUEST_TEMPLATE/ (bug or feature template, fill in every section)
Reviewing a PRReviewing contributions

Download now (ZIP)

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. mesa/mesa★ 3.9k100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 28,693 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.

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.