agentleFS
testcontainerstestcontainers/testcontainers-java/.agents/skills/change-module/SKILL.md

change-module

Skill8.8k starsChanged 2 days agoMITView on GitHub

Fix a bug in, add a feature to, or upgrade the default image of an existing Testcontainers for Java module or core, without breaking the public API. Use for changes under modules/<name>/ or core/.

The file

We split this skill into the rules it gives an agent

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

  • 2

    Very specific

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

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

    Read the existing tests and the module docs page (docs/modules//<name>.md), including which codeinclude markers it uses.

    line 13
  2. Distinctive:

    Keep the change focused on the issue.

    line 18
  3. Very specific:

    Public API changes must be additive: Add new methods or overloads.

    line 19
  4. Distinctive:

    Wait strategy changes: keep the overall startup timeout as one budget (don't give each sub-wait the full timeout), and make sure the …

    line 20
  5. Distinctive:

    Check the image's release notes for changed ports, env vars, startup log lines or health endpoints, and adjust the wait strategy if needed.

    line 27
  6. Distinctive:

    If older versions behave differently, keep them working (branch on the parsed version only when unavoidable) and keep a test for the oldest …

    line 28
  7. Distinctive:

    Don't open PRs that only bump a client library version.

    line 29
  8. Distinctive:

    If you changed core, also run the tests of one or two modules that depend on the changed behaviour.

    line 38
  9. Distinctive:

    Update the module docs page if behaviour or options changed.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
SKILL.md

Fix, extend or upgrade an existing module

Read AGENTS.md first.

1. Understand the current behaviour

  • Find the container class in modules/<name>/src/main/java/org/testcontainers/<name>/. Check whether a deprecated twin exists in org.testcontainers.containers; a change usually belongs in the new package, and the deprecated class should keep working.
  • Read the existing tests and the module docs page (docs/modules/**/<name>.md), including which codeinclude markers it uses.
  • For a bug, write a failing test first that reproduces the reported behaviour.

2. Make the change

  • Keep the change focused on the issue. Don't reformat unrelated code (Spotless will handle formatting).
  • Public API changes must be additive. Add new methods or overloads. To replace something, deprecate it with @Deprecated and a Javadoc @deprecated use {@link ...} pointer. Don't change existing signatures, return types or visibility; japicmp in check fails on that.
  • Wait strategy changes: keep the overall startup timeout as one budget (don't give each sub-wait the full timeout), and make sure the strategy works for every image tag the module claims to support.
  • Validate new withXxx(...) arguments and fail with a clear message.
  • Main code stays Java 8 compatible.

3. Upgrading the default or tested image version

  • Users always pass an explicit image, so an "upgrade" usually means updating the tags used in tests and docs. Some database modules keep a DEFAULT_TAG used by their JDBC/R2DBC container providers; changing it changes behaviour for jdbc:tc: URL users, so call that out in the PR.
  • Check the image's release notes for changed ports, env vars, startup log lines or health endpoints, and adjust the wait strategy if needed.
  • If older versions behave differently, keep them working (branch on the parsed version only when unavoidable) and keep a test for the oldest supported behaviour where practical.
  • Don't open PRs that only bump a client library version; Dependabot does that.

4. Verify

./gradlew spotlessApply
./gradlew :testcontainers-<name>:check     # or :testcontainers:check for core

If you changed core, also run the tests of one or two modules that depend on the changed behaviour.

5. Docs and PR

  • Update the module docs page if behaviour or options changed; prefer codeinclude from tests.
  • In the PR, describe the broken behaviour and how the change fixes it, and reference the issue (Fixes #<number>).

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.