java-spring

Develops and reviews Spring Boot services covering JPA, Security, testing, and Boot 4 migration.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill java-spring-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-spring
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/java-spring
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill java-spring-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Spring Boot codebases fail in predictable ways that generic Java knowledge misses: self-invocation silently bypassing @Transactional proxies, e-mails sent inside transactions that later roll back, N+1 queries hidden behind findAll, and Spring Boot 4 renames that compile but never run migrations. This Skill encodes those adjudicated rules so an agent writes, reviews, tests, and migrates Spring services correctly the first time. ## Core Features & Use Cases - Opinionated Core Rules: 25 ordered rules covering constructor injection, @ConfigurationProperties binding, transaction boundaries, lazy fetching, Security 7 lambda DSL, test slices, and actuator exposure. - Guided Workflows: Step-by-step checklists for implementing a feature, adding tests at the right slice, reviewing a diff, diagnosing runtime failures, migrating to Spring Boot 4, and upgrading the JDK from 17 to 25. - Deep References: Topic files on data-jpa, security, testing, modulith, observability, build/packaging, the Boot 3.5 to 4 migration, and Java language features, all verified against Spring Boot 4.1. - Use Case: Ask the agent to review an OrderService that e-mails customers inside a transaction and lists orders slowly; it flags the self-invocation proxy bypass, moves the side effect to @TransactionalEventListener(AFTER_COMMIT), and replaces the N+1 with a projection query. ## Quick Start Ask the agent to review the Order.java, OrderRepository.java and OrderService.java files in this project and explain exactly what is wrong with the transaction handling and query performance.

Frequently Asked Questions about java-spring

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

FAQPage Schema
How do I migrate a Spring Boot 3.5 application to Spring Boot 4?

Upgrade to the newest 3.5.x first and clear all deprecation warnings, then rename starters (spring-boot-starter-web becomes spring-boot-starter-webmvc), add spring-boot-starter-flyway explicitly, replace @MockBean with @MockitoBean, and rewrite security config as a SecurityFilterChain bean with the lambda DSL. Run spring-boot-properties-migrator temporarily to catch renamed properties.

Why is my @Transactional annotation not working in Spring?

@Transactional is proxy-based, so an internal this.method() call, a private method, or a final method silently bypasses the proxy and no transaction starts. Move the inner method to its own injected bean rather than changing the annotation or propagation value.

How do I fix N+1 queries in Spring Data JPA?

Fix N+1 with a projection selecting only needed columns first, an @EntityGraph second, and a JPQL join fetch third. Never join fetch two collections in one query, since the cartesian product forces in-memory pagination.

Does Spring Boot 4 still support @MockBean and TestRestTemplate?

No. Spring Boot 4 removed @MockBean and @SpyBean in favor of @MockitoBean and @MockitoSpyBean, and TestRestTemplate is replaced by RestTestClient with @AutoConfigureRestTestClient. @SpringBootTest also no longer auto-configures MockMvc, so add @AutoConfigureMockMvc explicitly.

Should I use Spring MVC or WebFlux for a new service?

Choose Spring MVC unless the entire request path is non-blocking. One JDBC call or block() on a Reactor event loop costs more than MVC, and with virtual threads enabled on Java 21+, MVC handles I/O-bound concurrency without the reactive model.

Why do my @DataJpaTest tests pass but fail in production?

Without flush() and clear() on TestEntityManager before a read assertion, the assertion is served from Hibernate's first-level cache and the query never executes. Also run repository tests against the real database with Testcontainers instead of H2, which has different SQL and constraint behavior.