/java:spring-boot-integrationsfrom java
Use when adding caching, Logbook HTTP logging, outbound HTTP clients or Resilience4j in a project that follows the java-standards opt-in. Covers stale-tolerant Spring Cache use, Logbook configuration and masking, one client per remote system implementing a driven port, RestClient and Boot 4 HTTP service groups, timeouts, OAuth2 client credentials, fault tolerance, clients generated from OpenAPI specifications and outbound URLs kept in properties (rules S54 to S60).
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>.
S54. Cache data that can tolerate staleness. Configuration values, lookup tables and any other data that changes rarely and can safely be slightly stale go through Spring Cache.
@CacheEvict.@Cacheable has no effect when a method calls another
method on the same class.S55. Zalando Logbook in every environment. Use Logbook for visibility on raw
HTTP traffic. It stays active in production at TRACE, which requires enabling
that one logger explicitly. It must not slow the application down, make it
heavier or fill the logs with personal data:
logbook.strategy: body-only-if-status-at-least. Bodies of successful
requests carry personal data that an obfuscation list will never fully catch.
Full bodies are for non-production environments.S56. Mask sensitive values. Logs never contain credentials, tokens or
presigned URLs. Setting a Logbook obfuscation list replaces its defaults, so
list everything explicitly, including Authorization.
logging:
level:
org.zalando.logbook: TRACE
logbook:
strategy: body-only-if-status-at-least
minimum-status: 400
predicate:
exclude:
- path: /actuator/**
write:
max-body-size: 4096
obfuscate:
headers: [Authorization, Cookie, Set-Cookie, X-Api-Key]
parameters: [access_token, X-Amz-Signature]
json-body-fields: [password, token, secret]
S57. One client per remote system. Every remote HTTP API gets its own
client, named <Target>HttpClient and placed in the client.http package of
the feature that uses it, for example payment.client.http.PayPalHttpClient.
domain, named by what the core needs, such as
PaymentGateway (see D6). The port takes and returns domain objects.
PayPalHttpClient implements it, and it and the remote API's DTOs are
package-private, so no external model leaks into the services. This is the
anti-corruption layer of D4.RestClient, configured the Spring Boot way. Use an
@HttpExchange interface backed by RestClient, or RestClient directly,
and configure it through properties and Spring Boot's builder customizers
rather than by hand (see S5). With more than two operations, the interface is
generated from the remote's OpenAPI specification (see S59).
@HttpExchange interface belongs to an HTTP service
group, one per remote system. @ImportHttpServices registers it, and Spring
Boot includes auto-configuration support and configuration properties for
HTTP Service Clients, configured per group with the pattern
spring.http.serviceclient.<group-name>.* (see S60).RestClient directly, build it
from Spring Boot's RestClient.Builder and bind its base URL and timeouts
with @ConfigurationProperties (see S4 and S60).Authorization header by hand from a stored token.S58. Resilience4j for fault tolerance. When a remote call needs a circuit
breaker, a bulkhead or a rate limiter, use Resilience4j through its Spring Boot
integration, and configure each instance in properties (see S5). For retries
alone, Spring Framework 7 and later has @Retryable built in.
S59. Generated clients from OpenAPI. When we call more than two operations of a remote API that has an OpenAPI specification, the client is generated with OpenAPI Generator rather than written by hand. For a public product, look for its specification online first: the vendor's developer portal, its GitHub organization, or the APIs.guru directory. For an internal service, use the specification its build generates (see B8). With one or two operations, a hand-written client is simpler than a generator setup.
src/main/resources/openapi/, so a
vendor change arrives as a reviewed diff. The generated code isn't committed:
the build generates it.spring generator with the
spring-http-interface library, so the generated interfaces run on our
configured RestClient (see S57). On Boot 3,
useHttpServiceProxyFactoryInterfacesConfigurator generates the class that
creates them. On Boot 4, register them in the remote's HTTP service group with
@ImportHttpServices instead.<Target>HttpClient implementation, which maps them to domain objects with a
MapStruct mapper, so nothing generated leaks into the services.<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator-maven-plugin.version}</version>
<executions>
<execution>
<id>paypal-payments</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi/paypal-payments.yaml</inputSpec>
<generatorName>spring</generatorName>
<library>spring-http-interface</library>
<apiPackage>com.company.app.payment.client.http.paypal.api</apiPackage>
<modelPackage>com.company.app.payment.client.http.paypal.model</modelPackage>
<configOptions>
<useSpringBoot3>true</useSpringBoot3>
<useHttpServiceProxyFactoryInterfacesConfigurator>true</useHttpServiceProxyFactoryInterfacesConfigurator>
<openApiNullable>false</openApiNullable>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
On Spring Boot 4, set useSpringBoot4 instead of useSpringBoot3.
S60. Outbound URLs live in properties. No URL is written in code. Values that change per environment come from environment variables.
spring.http.serviceclient.<group-name>.* (see S5 and S57), with
defaults for every client under spring.http.clients.*. On Boot 3, and for a
client that uses RestClient directly, they're our own properties, named as
S61 describes and bound with @ConfigurationProperties (see S4).carrier-api.properties, loaded with @PropertySource
the way api-paths.properties is (see S62), so application.properties stays
readable.### PAYPAL: generated client, Boot 4 HTTP service group ###
spring.http.serviceclient.paypal.base-url=${PAYPAL_API_BASE_URL:https://api-m.sandbox.paypal.com}
spring.http.serviceclient.paypal.connect-timeout=2s
spring.http.serviceclient.paypal.read-timeout=5s
@Configuration(proxyBeanMethods = false)
@ImportHttpServices(group = "paypal", types = PaymentsApi.class)
class PayPalHttpClientConfig {
// Registers the generated PayPal interfaces in the "paypal" group (see S59).
}
### CARRIER: hand-written client ###
carrier.api.protocol=https
carrier.api.host=${CARRIER_API_HOST:api.sandbox.carrier.example}
carrier.api.version=v1
carrier.api.base-url=${carrier.api.protocol}://${carrier.api.host}/${carrier.api.version}
carrier.api.shipments-path=/shipments
carrier.api.shipment-path=${carrier.api.shipments-path}/{shipmentId}
carrier.api.connect-timeout=2s
carrier.api.read-timeout=5s
@Configuration(proxyBeanMethods = false)
@PropertySource("classpath:carrier-api.properties")
@EnableConfigurationProperties(CarrierApiProperties.class)
class CarrierHttpClientConfig {
// Loads the carrier's endpoints and binds them to CarrierApiProperties.
}
@ConfigurationProperties("carrier.api")
record CarrierApiProperties(String baseUrl,
String shipmentsPath,
String shipmentPath,
Duration connectTimeout,
Duration readTimeout) {}
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub leonardo-marziali/agentic-development-kit --plugin java13 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).Other plugins' skills for the same job