/java:java-testing-standardsfrom java
Use when writing or reviewing tests in a Java project that follows the java-standards opt-in. Covers branch coverage, shouldXWhenY naming with @Nested and AssertJ, parameterized tests, mandatory unit tests for the domain, application services and mappers, optional slice and integration tests, WireMock, and the shortcuts never to take (rules T1 to T7).
Ships in java. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before applying this skill, read .claude/java-standards.json at the
repository root. If it doesn't exist, or the file you're working on is
outside its include/exclude scope, follow the conventions of the
surrounding code instead.
Break a rule only with a concrete reason, and write that reason down. At
Stop, the java plugin blocks on violations in lines you changed; mark a
justified exception with // java-rules:allow <ID> <reason>.
T1. Test every branch. All code branches are tested.
T2. Readable tests. Name test classes <Subject>Test (not *Tests or
*IT), name tests shouldXWhenY, group them with @Nested and @DisplayName,
and assert with AssertJ.
T3. Parameterize. When several tests share the same logic and differ only in their data, write one parameterized test instead.
T4. Unit tests are mandatory. Unit tests cover the domain, the application
services, the commands' validation (see S34) and the mappers. A mapper test
builds the generated implementation with its converters, such as
new ProjectEntityMapperImpl(new ProjectIdMapper(), ...), and checks the
reconstitution and the constructor MapStruct chose (see S15 and S23), with no
Spring context and no database.
T5. Integration tests are optional. Unit tests are the required suite. Integration tests are a choice per project, so T6 is a set of hints, not rules, and nothing in the build requires them.
T6. Hints for integration tests. When a project has them, or before it adds them:
ETag and error codes. Run it with the Bruno CLI
against a running instance, locally or after a deployment. It exercises the
routing, the validation, the JSON, the error model and the real database
together, without any test infrastructure in the build.@WebMvcTest or
the GraphQL tester, outbound HTTP clients against WireMock, including timeouts
and remote errors, and repositories with the data store's slice test, such as
@DataJpaTest. The repository round trip (save, getById, update,
getById) covers what unit tests can't: the dirty-checked update and the
change history (see S8 and S48).@ServiceConnection needs
no further configuration. Where CI can't run containers, use a database
service of the CI system itself, such as a GitHub Actions or GitLab CI service
container, with @AutoConfigureTestDatabase(replace = Replace.NONE), or the
engine's own binaries started without Docker, such as zonky's embedded
PostgreSQL.T7. No shortcuts. Never mock value objects or DTOs, and never set fields by reflection.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub leonardo-marziali/agentic-development-kit --plugin javaOther plugins' skills for the same job
13 skills in this plugin
/checkUse when the user asks to "check the Java standard", "run the java rules", "check these Java files", "run NullAway / ArchUnit on this", or wants pre-existing Java files checked, not just the lines a session changed. Reports every finding of the plugin's source rules, build-file rules, NullAway and ArchUnit./formatUse when the user asks to "format Java", "format these Java files", "run the Eclipse formatter", or wants Java files the session never touched formatted. Formats whole Java files with the plugin's Eclipse JDT engine and the project's formatter profile, including pre-existing files./java-build-standardsUse when editing pom.xml, build.gradle or lombok.config in a project that follows the java-standards opt-in. Covers choosing and parameterizing dependency versions, declaring the Java version, Eclipse JDT formatting, Spring Modulith and ArchUnit together, the OpenAPI contract check, coverage gates and configuring Lombok with MapStruct through one lombok.config (rules B1 to B10)./java-ddd-eventsUse when modelling bounded contexts, aggregates, value objects, domain services, ports and adapters, state machines, events, messaging or scheduled jobs in a project that follows the java-standards opt-in. Covers the ubiquitous language, bounded contexts and anti-corruption layers, the hexagonal core with driving and driven ports enforced by ArchUnit, aggregate boundaries, references by identity, one aggregate per transaction, optimistic locking on the root, read models that bypass the aggregate, plain-Java domain classes, creation factories, step builders, early identity and reconstitution, explicit state machines, value objects, domain and integration events, the transactional outbox, idempotent consumers, versioned schemas and safe scheduled jobs (rules D1 to D29)./java-language-standardsUse when writing or reviewing Java code in a project that follows the java-standards opt-in. Covers Javadoc and comments, naming, member, field and argument order, var, text blocks, records and sealed types, imports, visibility, overloads for optional arguments, null-safety with JSpecify and NullAway on every framework version, Optional, not repeating knowledge, utility classes, explained empty bodies and builders for long argument lists (rules J1 to J26)./mapstruct-mappingUse when creating DTOs, commands, read models, domain objects, entities or MapStruct mappers in a project that follows the java-standards opt-in. Covers the model set, DTO and anemic entity style, one mapper per layer boundary, @Context lookups, no java() expressions, abstract mappers with nullability proxies, explicit ignores, the fixed method vocabulary of repositories, query services and mappers, immutable value objects and grouping related values into one type (rules S13 to S24, D22 and D23).