agentleFS
scalametascalameta/metals/AGENTS.md

metals

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

This document provides instructions for AI agents working on the Metals codebase. If Metals MCP tools are available, use them to run tests. Otherwise, use the following command: Note: By convention, test names should be kebab-case with no spaces (e.g., private-member instead of private member). Make sure to use the user's default shell to run the command. For more information on filtering tests in MUnit, see the MUnit filtering documentation. Before committing: - ALWAYS format all changed Scala files using…

Trending

Quiet since August.about the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 2 mentionsJul 2026: 0 mentionsAug 2026: 2 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the scalameta/metals repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about scalameta/metals

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

See all 35

Talked about on GitHub, Hacker News and Bluesky (35 times).

On GitHub · 33

28 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 code style.

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

The file

Show its rules and text

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

15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

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

    If Metals MCP tools are available, use them to run tests.

    line 8
  2. Distinctive:

    Make sure to use the user's default shell to run the command.

    line 18
  3. Very specific:

    ALWAYS format all changed Scala files using Metals MCP format-file tool or ./bin/scalafmt if the former is not available.

    line 33
  4. Very specific:

    ALWAYS run sbt --client scalafixAll to fix any Scala code issues.

    line 35
  5. Very specific:

    Don't use .iterator unless really necessary.

    line 39
  6. Distinctive:

    Prefer for-loops over map/flatmap, unless they fit in one line (one or maximum two calls)

    line 41
  7. Very specific:

    don't call .toList unless it's necessary

    line 43
  8. Very specific:

    ALWAYS use Metals MCP tools to compile and run tests instead of relying on bash commands.

    line 44
  9. Very specific:

    PREFER use Metals MCP tools to format code instead of relying on bash commands

    line 46
  10. Very specific:

    ALWAYS use Metals MCP get-source tool to get the sources of a dependencies

    line 47
  11. Distinctive:

    If MCP tools are not available report that to the user

    line 48
  12. Very specific:

    after adding a dependency to build.sbt, ALWAYS run the import-build tool

    line 49
  13. Very specific:

    use sbt --client instead of sbt to connect to a running sbt server for faster execution

    line 52
  14. Distinctive:

    NEVER use non-local returns

    line 54
  15. Distinctive:

    always create new commits, instead of amending existing ones

    line 58

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

This document provides instructions for AI agents working on the Metals codebase.

Running Tests

If Metals MCP tools are available, use them to run tests. Otherwise, use the following command:

sbt --client SBT_PROJECT/testOnly TEST_CLASS "-- *TEST_NAME_GLOB"

Note: By convention, test names should be kebab-case with no spaces (e.g., private-member instead of private member).

Make sure to use the user's default shell to run the command.

Example

sbt --client javapc/testOnly pc.CompletionIdentifierSuite "-- *private-member"

For more information on filtering tests in MUnit, see the MUnit filtering documentation.

Preparing for PRs

Before committing:

  • ALWAYS format all changed Scala files using Metals MCP format-file tool or ./bin/scalafmt if the former is not available.
  • ALWAYS run sbt --client scalafixAll to fix any Scala code issues.

Working with Scala code

  • Don't use .iterator unless really necessary. Prefer working with higher order functions, like filter, map, flatmap directly on collections
  • Prefer for-loops over map/flatmap, unless they fit in one line (one or maximum two calls)
  • don't call .toList unless it's necessary
  • ALWAYS use Metals MCP tools to compile and run tests instead of relying on bash commands. Only use sbt if the MCP tools are not available.
  • PREFER use Metals MCP tools to format code instead of relying on bash commands
  • ALWAYS use Metals MCP get-source tool to get the sources of a dependencies
  • If MCP tools are not available report that to the user
  • after adding a dependency to build.sbt, ALWAYS run the import-build tool
  • to lookup a dependency or the latest version, use the find-dep tool
  • to lookup the API of a class, use the inspect tool
  • use sbt --client instead of sbt to connect to a running sbt server for faster execution
  • NEVER use non-local returns

Git

  • always create new commits, instead of amending existing ones

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.