java-spring-patterns

Implement Spring Boot patterns for configuration, resilience, security, and messaging.

6|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/wesleyosantos91/multi-agents --skill java-spring-patterns
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: java-spring-patterns
Source: https://github.com/wesleyosantos91/multi-agents/tree/main/devin/.devin/skills/java-spring-patterns
Command: npx skills add https://github.com/wesleyosantos91/multi-agents --skill java-spring-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers implement Spring Boot features in production by standardizing reusable patterns for configuration, resilience, security, messaging, caching, scheduling, observability, and querying.

Core Features & Use Cases

  • Type-safe configuration & wiring: Use @ConfigurationProperties, @EnableConfigurationProperties, @ConditionalOnProperty, and @Profile to build predictable bean graphs.
  • Resilience and failure handling: Apply Resilience4j circuit breaker, retry, and rate limiter with fallbacks for graceful degradation.
  • Production service foundations: Secure endpoints with Spring Security (JWT, stateless sessions), integrate messaging via Kafka/SQS listeners, cache hot paths, schedule recurring jobs with distributed locks, and add metrics/timers with Micrometer/OpenTelemetry.
  • Efficient endpoints: Implement pagination, filtering, and sorting using PageRequest plus specification-style query composition.
  • Anti-pattern guidance: Avoid common Spring pitfalls like field @Autowired, overly broad @Transactional, controller-to-service calls, silent open-in-view, generic catch blocks in services, and @Async without a configured executor.

Quick Start

Ask the Skill to propose a Spring Boot implementation approach for a new payment API endpoint that is secured with JWT, processes events from Kafka, uses circuit breaker + retry, caches product lookups, and exposes Micrometer metrics.

Frequently Asked Questions about java-spring-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a Spring Boot REST endpoint with JWT authentication and stateless sessions?▼

Spring Boot REST endpoints can be secured using Spring Security with JWT and stateless sessions. This approach establishes explicit security rules for API configuration, ensuring deterministic access control and protected resource exposure.

What is the best way to add a circuit breaker and retry logic to a Spring Boot service?▼

The best way to add a circuit breaker and retry logic is using Resilience4j. It provides production-grade failure handling with configurable rate limiting and deterministic fallback behavior for graceful service degradation.

How do I implement Kafka or SQS message consumption in a Spring Boot application?▼

Kafka or SQS message consumption in Spring Boot is implemented using listener-based messaging patterns. This approach standardizes event processing integration across real services, ensuring reliable asynchronous communication.

Why should I avoid field @Autowired and overly broad @Transactional in Spring Boot?▼

Field @Autowired and overly broad @Transactional are Spring Boot anti-patterns that create unpredictable bean graphs and transactional overhead. Using constructor injection and explicit transaction boundaries ensures predictable configuration and performance.

How do I add Micrometer and OpenTelemetry metrics to Spring Boot endpoints?▼

Micrometer and OpenTelemetry metrics are added to Spring Boot endpoints by introducing measurable instrumentation. This provides production-grade observability through timers and custom metrics for monitoring API performance.

Can I use @ConfigurationProperties and @Profile together for predictable bean wiring?▼

Yes, you can use @ConfigurationProperties and @Profile together for predictable bean wiring. This type-safe configuration approach uses @EnableConfigurationProperties and @ConditionalOnProperty to build deterministic bean graphs across environments.