agentleFS
jabrenajabrena/cursor-rules-java/skills/111-java-maven-dependencies/SKILL.md

111-java-maven-dependencies

Skill452 starsChanged 3 months agoApache-2.0View on GitHub

Use when you need to add or evaluate Maven dependencies that improve code quality or domain modeling — including nullness annotations (JSpecify), static analysis (Error Prone + NullAway), functional programming (VAVR), architecture testing (ArchUnit), or money and currency support (JavaMoney) — and want a consultative, question-driven approach that adds only what you actually need. This should trigger for requests such as Add Maven dependencies; Add JSpecify nullness dependencies; Add Error Prone NullAway dependencies; Add VAVR functional dependencies; Add ArchUnit architecture testing dependencies; Add JavaMoney dependencies. Part of Plinth Toolkit

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 12 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add essential Maven dependencies that enhance code quality, safety, and domain modeling through a consultative, question-driven approach.

    line 11
  2. Distinctive:

    Before adding Maven dependencies, ensure the project is in a valid state.

    line 23
  3. Very specific:

    MANDATORY: Run ./mvnw validate or mvn validate before any changes

    line 25
  4. Distinctive:

    SAFETY: If validation fails, stop and ask the user to fix issues—do not proceed until resolved

    line 26
  5. Distinctive:

    Add JSpecify nullness dependencies

    line 32
  6. Distinctive:

    Add Error Prone NullAway dependencies

    line 33
  7. Distinctive:

    Add VAVR functional dependencies

    line 34
  8. Distinctive:

    Add ArchUnit architecture testing dependencies

    line 35
  9. Very specific:

    Run ./mvnw validate or mvn validate and stop if validation fails.

    line 42
  10. Distinctive:

    Run this XML-included question flow before reading any dependency implementation reference.

    line 47
  11. Distinctive:

    If Error Prone + NullAway is selected, also select JSpecify unless the project already has equivalent nullness annotations configured.

    line 64
  12. Distinctive:

    If None is selected, do not add dependency-family references.

    line 65
  13. Very specific:

    Format: Use dot notation (e.g., com.example.myproject or org.mycompany.myapp)

    line 75
  14. Distinctive:

    After all applicable questions are answered, confirm the selections and map them to references:

    line 80
  15. Very specific:

    If JSpecify is selected, read references/111-java-maven-dependencies-jspecify.md.

    line 82
  16. Very specific:

    If enhanced compiler analysis is selected, use the Error Prone + NullAway section from references/111-java-maven-dependencies-jspecify.md.

    line 83
  17. Very specific:

    If VAVR is selected, read references/111-java-maven-dependencies-vavr.md.

    line 84
  18. Very specific:

    If ArchUnit is selected, read references/111-java-maven-dependencies-archunit.md.

    line 85
  19. Very specific:

    If JavaMoney is selected, read references/111-java-maven-dependencies-javamoney.md.

    line 86
  20. Distinctive:

    Do not read or apply unselected dependency-family references.

    line 87
  21. Very specific:

    Read only the selected dependency-family references, then implement only the dependencies, properties, scopes, plugin configuration, and …

    line 92

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

Add Maven dependencies for improved code quality

Add essential Maven dependencies that enhance code quality, safety, and domain modeling through a consultative, question-driven approach. This is an interactive SKILL.

What is covered in this Skill?

  • JSpecify: (nullness annotations, provided scope)
  • Error Prone + NullAway: (enhanced static analysis with compile-time null checking)
  • VAVR: (functional programming with Try/Either and immutable collections)
  • ArchUnit: (architecture rule enforcement, test scope)
  • JavaMoney: (Money and Currency API support with JSR 354 and Moneta)

Constraints

Before adding Maven dependencies, ensure the project is in a valid state. Use a consultative, question-driven flow that adds only what the user selects.

  • MANDATORY: Run ./mvnw validate or mvn validate before any changes
  • SAFETY: If validation fails, stop and ask the user to fix issues—do not proceed until resolved
  • BEFORE READING DEPENDENCY REFERENCES: Run the question flow embedded in this SKILL.md first. Ask one consolidated dependency-selection question, then ask only conditional follow-up questions required by the selected options. Read only the dependency references selected by the user's answers. Use consultative language, present trade-offs, and wait for user responses before implementing

When to use this skill

  • Add Maven dependencies
  • Add JSpecify nullness dependencies
  • Add Error Prone NullAway dependencies
  • Add VAVR functional dependencies
  • Add ArchUnit architecture testing dependencies
  • Add JavaMoney dependencies

Workflow

  1. Validate project before changes

Run ./mvnw validate or mvn validate and stop if validation fails.

  1. Ask dependency assessment questions before reading references

Run this XML-included question flow before reading any dependency implementation reference. Ask the consolidated dependency-selection question first, wait for the user's answer, and record selected dependency families before continuing. Ask conditional follow-up questions only when required by the selected dependencies.

Question 1: Which code-quality dependencies do you want to add?

Options:

  • JSpecify (modern nullness annotations, provided scope; recommended for new projects)
  • Error Prone + NullAway (enhanced compiler analysis and compile-time nullness checking; requires JSpecify)
  • VAVR (functional programming support with Try/Either and immutable collections)
  • ArchUnit (architecture testing with JUnit 5, test scope)
  • JavaMoney (Money and Currency API support with JSR 354 and Moneta)
  • None
  • Other (specify)

Recommendation: Select JSpecify for better null-safety annotations. Add Error Prone + NullAway when you want stronger compile-time analysis. Add VAVR only when functional programming patterns are useful for the project. Add ArchUnit when you want automated architecture governance. Add JavaMoney when the domain needs explicit monetary amounts, currencies, formatting, conversion, or precision-safe money calculations.

Selection notes:

  • If Error Prone + NullAway is selected, also select JSpecify unless the project already has equivalent nullness annotations configured.
  • If None is selected, do not add dependency-family references.

Question 2 (conditional): What is your main project package name?

Note: This question is asked only if Error Prone + NullAway was selected.

This is needed to configure NullAway to analyze your code. For example, if your classes are in com.example.myproject, enter com.example.myproject.

Format: Use dot notation (e.g., com.example.myproject or org.mycompany.myapp)

Example: com.example.myproject

After all applicable questions are answered, confirm the selections and map them to references:

  • If JSpecify is selected, read references/111-java-maven-dependencies-jspecify.md.
  • If enhanced compiler analysis is selected, use the Error Prone + NullAway section from references/111-java-maven-dependencies-jspecify.md.
  • If VAVR is selected, read references/111-java-maven-dependencies-vavr.md.
  • If ArchUnit is selected, read references/111-java-maven-dependencies-archunit.md.
  • If JavaMoney is selected, read references/111-java-maven-dependencies-javamoney.md.
  • Do not read or apply unselected dependency-family references.
  1. Read selected references and add only selected dependencies

Read only the selected dependency-family references, then implement only the dependencies, properties, scopes, plugin configuration, and support files chosen by the user while preserving the existing pom.xml structure.

  1. Report trade-offs and next checks

Summarize what was added, why, and any recommended follow-up validations or tooling alignment.

Reference

For detailed guidance, examples, and constraints, see:

  • references/111-java-maven-dependencies-jspecify.md
  • references/111-java-maven-dependencies-vavr.md
  • references/111-java-maven-dependencies-archunit.md
  • references/111-java-maven-dependencies-javamoney.md

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.