- Home
- Skills
- APIs & Backend
- Spring Boot Code Review
Spring Boot Code Review
Systematic Spring Boot code reviews identifying security holes, N+1 queries, and transaction bugs with concrete fixes.
$9
Works with the AI Agents you already use
Spring Boot Code Review
Example session with this skill installed
Review this service for transaction and performance issues:
@Service
public class OrderService {
public void process(List<Long> ids) {
ids.forEach(this::updateStatus);
}
@Transactional
public void updateStatus(Long id) {
Order o = repo.findById(id).get();
o.setStatus("DONE");
repo.save(o);
}
}
- Read your context and instructions
- Compiled the spring boot code
I have reviewed the OrderService for transaction boundaries and performance bottlenecks.
Code Review — OrderService
Scope: Pasted code block
Stack: Spring Boot (JPA)
Critical
1. Transactional Self-Invocation
- Location: line 8
- Problem: The
@Transactionalannotation onupdateStatusis ignored because it is called fromprocesswithin the same class. Spring's AOP proxy only intercepts external calls, meaning no transaction is started and data integrity is at risk. - Fix:
@Service
@RequiredArgsConstructor
public class OrderService {
private final OrderRepository repo;
@Transactional
public void process(List<Long> ids) {
repo.findAllById(ids).forEach(o -> {
o.setStatus("DONE");
});
}
}
High
2. N+1 Update Pattern
- Location: line 4
- Problem: The code performs an individual
findByIdandsaveinside a loop. This results in 2N database roundtrips. - Fix: Use
repo.findAllById(ids)to fetch all entities in one query and rely on the transaction's dirty checking to persist changes.
Low
3. Unsafe Optional Get
- Location: line 10
- Problem: Calling
.get()onfindByIdwithoutisPresent()check will throwNoSuchElementExceptionif an ID is invalid. - Fix: Use
.orElseThrow(() -> new EntityNotFoundException(id))or handle the empty case gracefully.
Summary
- Critical: 1, High: 1, Medium: 0, Low: 1
- Fix first: Transactional Self-Invocation (Item 1)
- Verdict: Do not ship until the Transactional proxy issue is resolved.
Next steps
- Would you like me to generate a complete refactored version of this Service?
- Shall I review the
OrderRepositoryto check for missing indexes?
Connects securely to your tools. The creator never sees your data.
About this skill
Java backend developers face high stakes when deploying Spring Boot applications. A single missed @Transactional annotation or an N+1 query can lead to data inconsistency or production outages. This skill provides a systematic, expert-level code review focused specifically on the Spring ecosystem.
What it does
- Security Audit identifies SQL injection, broken access control, and exposed credentials.
- Data Access Review catches N+1 queries, missing pagination, and improper JPA/MyBatis configurations.
- Transaction Analysis detects self-invocation bugs and incorrect rollback handling.
- API Validation checks for missing
@Validannotations and leaked internal entities. - Performance Profiling flags blocking calls on hot paths and unbounded thread pools.
How it works
- Code Collection asks for specific file paths or pasted code blocks to define the review scope.
- Context Mapping identifies the stack including Spring Boot version, ORM, and database.
- Checklist Execution runs a structured analysis across security, data, and performance categories.
- Report Generation produces a graded severity report (Critical to Low) with line-level citations and code fixes.
Frameworks & tools
Specifically designed for Java and Kotlin applications built on Spring Boot. Covers JPA, Hibernate, MyBatis, Spring Security, and standard Spring configuration patterns.
Why this beats prompting it yourself
Generic prompts often miss framework-specific nuances like Spring proxy behavior or MyBatis-specific injection risks. This skill uses a specialized reference checklist and severity guide to ensure every finding is actionable and graded by real-world impact.
Use cases
- Pre-PR Audit to catch N+1 queries and transaction bugs before they hit the main branch.
- Security Hardening to identify SpEL injection or broken access control in controllers.
- Refactoring Support to clean up swalled exceptions and oversized service methods.
Known limitations
Does not support languages other than Java or Kotlin. It is a source code reviewer, not a replacement for a dynamic penetration test or a full system architecture audit.
Limited to Java/Kotlin on Spring Boot. Cannot perform dynamic analysis or penetration testing. Requires user-provided source files or code blocks.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.