agentleFS
spring-projectsspring-projects/spring-framework/AGENTS.md

spring-framework

AGENTS.md60k starsChanged 2 years agoApache-2.0View on GitHub

Concise extract of CONTRIBUTING.md, which remains the reference for humans.

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

12 rules. About 0 are common, 2 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Run ./gradlew :<module>:check before finishing: it runs tests and Checkstyle (src/checkstyle/checkstyle.xml), which enforces most of the …

    line 9
  2. Very specific:

    Do not run clean unless needed.

    line 11
  3. Very specific:

    Import order, groups separated by a blank line: java.*, then javax.* + jakarta.*, then others, then org.springframework.*, then static …

    line 22
  4. Very specific:

    No wildcard imports. No static imports in production code except constants/enum constants and third-party DSL factory methods.

    line 23
  5. Very specific:

    Every source file: Apache 2.0 license header (Copyright 2002-present the original author or authors., copy from an existing file), package, …

    line 24
  6. Very specific:

    Always reference fields with this., never methods.

    line 25
  7. Distinctive:

    No blank line between method description and tags.

    line 35
  8. Very specific:

    Add @since to new classes and new public/protected methods.

    line 36
  9. Distinctive:

    Add or update tests for any code change.

    line 41
  10. Very specific:

    Test class names end with Tests.

    line 43
  11. Very specific:

    Use the standard Mockito API (when(...).thenReturn(...)), not BDDMockito (given(...)), in new test code.

    line 44
  12. Very specific:

    Never write annotations verbatim in commit messages or PR titles (it mentions GitHub users): enclose them in backticks, as in @Override .

    line 55

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

Spring Framework agent guidelines

Concise extract of CONTRIBUTING.md, which remains the reference for humans.

Build

  • Gradle build, JDK from .sdkmanrc (currently JDK 25, sdk env install / sdk env); artifacts target Java 17+.
  • Scope builds to the modules you touched: ./gradlew :spring-webmvc:test, a single test with --tests <fully.qualified.ClassTests>.
  • Run ./gradlew :<module>:check before finishing: it runs tests and Checkstyle (src/checkstyle/checkstyle.xml), which enforces most of the code style below.
  • NullAway null-safety checks run during compilation; fix reported errors instead of suppressing them.
  • Do not run clean unless needed; the build is incremental and cached.
  • Reference docs: ./gradlew antora, output in framework-docs/build/site/index.html.

Code style

  • Match surrounding code; do not reformat unrelated code; a file should look like it was written by a single author.
  • Tabs, LF, UTF-8, no trailing whitespace.
  • Aim for 90 characters per line for code (105 acceptable, 120 max) and ~80 for Javadoc.
  • Wrap lines after separators (, + ? : && ||), never before.
  • K&R braces, with else, catch, and finally on a new line.
  • Two blank lines before fields, constructors, static {} blocks, and inner classes; one blank line after a multiline method signature.
  • Import order, groups separated by a blank line: java.*, then javax.* + jakarta.*, then others, then org.springframework.*, then static imports.
  • No wildcard imports. No static imports in production code except constants/enum constants and third-party DSL factory methods; use them in tests (e.g. assertThat).
  • Every source file: Apache 2.0 license header (Copyright 2002-present the original author or authors., copy from an existing file), package, imports, exactly one top-level class.
  • Always reference fields with this., never methods. Always add @Override.
  • No var in production code. No single-character variable names. Wrap ternaries in parentheses with the non-null condition first: (foo != null ? foo : "default").
  • Argument checks: Assert.notNull(event, "Event must not be null"); state checks: Assert.state(...).
  • Null-safety with JSpecify: packages are @NullMarked in package-info.java, use org.jspecify.annotations.Nullable explicitly (e.g. private @Nullable String name;), repeat super method nullness on overrides, @Contract where useful.
  • Static utility classes: abstract, Utils suffix, private constructor.
  • No System.out/System.err or printStackTrace().

Javadoc

  • First sentence in imperative style ("Return", not "Returns"); <p> to start extra paragraphs; {@code} for code and null.
  • No blank line between method description and tags; do not indent wrapped tag descriptions.
  • Add @since to new classes and new public/protected methods; omit a .0 patch version (@since 7.1, not 7.1.0).
  • Tag order for types: @author, @since, @param, @see, @deprecated; for members: @param, @return, @throws, @since, @see, @deprecated.

Tests

  • Add or update tests for any code change.
  • JUnit Jupiter, AssertJ (including assertThatIllegalArgumentException() and similar), Mockito. No JUnit 4/Jupiter/TestNG assertions, no Hamcrest.
  • Test class names end with Tests.
  • Use the standard Mockito API (when(...).thenReturn(...)), not BDDMockito (given(...)), in new test code; do not migrate existing BDDMockito usage.

Docs

  • Reference docs are AsciiDoc in framework-docs/modules/ROOT; code snippets for include-code:: live in framework-docs/src/main/{java,kotlin}.

Commits and pull requests

  • Pull requests target main.
  • Subject: imperative, capitalized verb, at most 55 characters, no fix:/docs: prefixes, no issue/PR number, no trailing period.
  • Body wrapped at 72 characters explaining the motivation, followed by Closes gh-123 (or See gh-123), then a Signed-off-by: Name <email> trailer (DCO, use git commit -s).
  • Never write annotations verbatim in commit messages or PR titles (it mentions GitHub users): enclose them in backticks, as in `@Override`.
  • Changes must be reviewed by a human who remains accountable for them before being submitted.

Download now (ZIP)

Trending

Quiet since August.about the whole repository

Dec 2025: 1 mentionJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 4 mentionsMay 2026: 9 mentionsJun 2026: 2 mentionsJul 2026: 2 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the spring-projects/spring-framework repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about spring-projects/spring-framework

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

See all 88

Talked about on GitHub, Stack Overflow, YouTube, Hacker News, Bluesky and the web (88 times).

On GitHub · 32

27 more on GitHub

On Stack Overflow · 30

25 more on Stack Overflow

On YouTube · 20

15 more on YouTube

On Hacker News · 4

On Bluesky · 1

On the web · 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 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.