원클릭으로
code-review
Use PROACTIVELY when reviewing Java/Spring Boot code quality, Clean Code compliance, or over-design concerns.
메뉴
Use PROACTIVELY when reviewing Java/Spring Boot code quality, Clean Code compliance, or over-design concerns.
Use PROACTIVELY when reviewing unit test code quality, discussing test design, or evaluating test coverage for Java/Spring Boot projects.
Use when reviewing PR changes, comparing branches, or analyzing GitHub pull requests. Supports both gh CLI (PR number) and git diff (branch comparison) modes.
Use when user needs technical design advice, architecture planning, or implementation strategy for Spring Boot projects. Produces actionable Todo List.
Use when analyzing slow queries, optimizing SQL/JPA performance, reviewing EXPLAIN plans, or troubleshooting database bottlenecks.
Clean Architecture design guide for Spring Boot. Use when reviewing code architecture, designing solutions, discussing layer separation, dependency rules, or project structure. Applies Uncle Bob's Clean Architecture principles.
Java best practices guide based on Effective Java. Use when reviewing Java code, discussing design patterns, object creation, equals/hashCode, Optional, Stream API, exception handling, or concurrency. Applies Joshua Bloch's principles.
| name | code-review |
| description | Use PROACTIVELY when reviewing Java/Spring Boot code quality, Clean Code compliance, or over-design concerns. |
| argument-hint | ["file-or-directory"] |
| allowed-tools | Read, Grep, Glob, Bash |
Review code with senior Java developer (15+ years experience) standards, focusing on Clean Code and avoiding over-design.
Don't abstract too early (Rule of Three):
// Bad: Abstract after seeing it once
interface PaymentProcessor { ... }
class CreditCardPaymentProcessor implements PaymentProcessor { ... }
// Only supports credit card anyway
// Good: Wait until multiple payment methods are actually needed
class PaymentService {
public void processCreditCardPayment(...) { ... }
}
YAGNI — No hypothetical design:
// Bad: Fields for "might need later"
class Order {
private PaymentStrategy paymentStrategy; // Might change later?
private ShippingStrategy shippingStrategy; // Might change later?
}
// Good: Solve current problem
class Order {
private String paymentMethod; // Enough for now
}
Avoid meaningless interfaces (single-implementation interfaces add zero value):
// Bad: UserServiceImpl only has one implementation
interface UserService { ... }
class UserServiceImpl implements UserService { ... }
// Good: Extract interface when multiple implementations are needed
class UserService { ... }
@Transactional self-invocation trap: calling an @Transactional method from within the same class bypasses the proxy@Transactional on controller or repository (should be service layer only)@Autowired field injection instead of constructor injection@Transactional on service layer only@Transactional self-invocationIMPORTANT: All output must be in Traditional Chinese (繁體中文)
列出程式碼做得好的地方
| 問題 | 位置 | 影響 | 修正方式 |
|---|---|---|---|
| [問題描述] | [檔案:行號] | [影響] | [修正方式] |
| 問題 | 位置 | 影響 | 修正方式 |
|---|---|---|---|
| [問題描述] | [檔案:行號] | [影響] | [修正方式] |
如果有較大的重構建議,提供 Before/After 程式碼對比
一句話總結程式碼品質和主要改進方向
equals/hashCode 包含所有欄位,導致 Hibernate proxy 比較失敗,應改用 @Getter @Setter