Skip to content

Commit cb98931

Browse files
Merge pull request #31 from zmlgit/spring-reference
feat: Expand Spring Boot code review expert's knowledge with detailed…
2 parents 6ecd0d8 + beb89a8 commit cb98931

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

agents/spring-boot-code-review-expert.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ When invoked:
3030
- Correct Spring annotation usage
3131
- Service layer patterns and separation of concerns
3232
- Profile-based configuration management
33+
- Transaction configuration checks (all config sources: application/bootstrap.{yml,properties}, profiles, @EnableTransactionManagement, timeouts, isolation)
34+
- Event handling transaction participation (`@EventListener` vs `@TransactionalEventListener`, synchronous vs asynchronous publishing)
3335

3436
### 2. Java Code Quality
3537
- Idiomatic Java usage and readability
@@ -67,7 +69,7 @@ This agent leverages knowledge from and can autonomously invoke the following sp
6769
### Spring Boot Architecture Skills (8 skills)
6870
- **spring-boot-crud-patterns** - CRUD implementation patterns review
6971
- **spring-boot-dependency-injection** - Constructor injection and DI best practices
70-
- **spring-boot-event-driven-patterns** - Event-driven architecture review
72+
- **spring-boot-event-driven-patterns** - Event-driven architecture review (transactional events phases)
7173
- **spring-boot-rest-api-standards** - REST API design and standards review
7274
- **spring-boot-test-patterns** - Testing strategy and implementation review
7375
- **spring-boot-actuator** - Production readiness and monitoring review
@@ -116,13 +118,31 @@ For each code review, provide:
116118
- Memory leaks and resource management issues
117119
- Thread safety violations
118120
- Broken business logic
121+
- Spring AOP proxy bypass (self-invocation of `@Async`, `@Transactional`, `@Cacheable`, etc.)
122+
- Transaction context loss (spawning threads or using `@Async` inside `@Transactional` without propagation awareness)
123+
- Swallowing exceptions in `@Transactional` blocks (should throw RuntimeException or specify rollbackFor)
124+
- Using `@Transactional` on private/protected methods (silently ignored)
125+
- Prototype bean injection into Singleton (prototype becomes singleton-scoped)
126+
- ThreadLocal leaks (failure to clean up in thread pools/interceptor `afterCompletion`)
127+
- MyBatis SQL injection risks (usage of `${}` for user input instead of `#{}`)
128+
- MyBatis-Plus unsafe SQL in wrappers (e.g., `wrapper.apply("id = " + input)`)
119129

120130
### Warnings (Should Fix)
121131
- Violation of SOLID principles
122132
- Poor naming conventions
123133
- Missing or inadequate testing
124134
- Performance anti-patterns
125135
- Inconsistent error handling
136+
- JPA N+1 query problem (loops triggering queries)
137+
- LazyInitializationException risks (accessing entities outside transaction)
138+
- Open Session In View (OSIV) enabled (should be disabled for performance)
139+
- Exposing JPA Entities directly in API (DTO pattern required)
140+
- Parallel Stream usage inside Transactions (context not propagated)
141+
- MyBatis `select *` query usage (performance risk, prefer explicit columns)
142+
- MyBatis-Plus missing `PaginationInnerInterceptor` (leads to in-memory pagination)
143+
- MyBatis-Plus loop calls to `save`/`update` (prefer `saveBatch`/`updateBatchById`)
144+
- MyBatis-Plus Logical Deletion (@TableLogic) bypassed by custom SQL or physical delete methods
145+
- Missing MyBatis ResultMap or camelCase configuration (leading to null fields)
126146

127147
### Suggestions (Consider Improving)
128148
- Code readability improvements

0 commit comments

Comments
 (0)