code-quality
Skill7 starsChanged 21 days agoApache-2.0View on GitHub
Comprehensive code review for Java - clean code principles, API contracts, null safety, exception handling, and performance. Use when user says "review code", "refactor", "check API", or before merging changes.
77 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- magnusrodseth/dotfilestheir own version, first seen Nov 8, 2026
- KadirHarmanc/nazar-skilltheir own version, first seen Nov 8, 2026
- AndersonAndrad/skillstheir own version, first seen Nov 8, 2026
- Mehul72/skillstheir own version, first seen Nov 8, 2026
- eea/eea.agent.skillstheir own version, first seen Nov 8, 2026
- notque/vexjoy-agenttheir own version, first seen Nov 7, 2026
Used with
Projects with it also use spring-boot, pr-workflow and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ffsshhttiikkSkillspring-boot
Spring Boot framework and Java enterprise patterns
Also in 3 projects that use this
glommerSkillpr-workflow
General guidelines for Commits, formatting, CI, dependencies, security
Also in 4 projects that use this
vm0-aiSkillcli-design
Design patterns and conventions for the Okou CLI user experience
Also in 3 projects that use this
0xSeroSkillsecurity
Also in 10 projects that use this
abdullah1854Skillimplementation-plan
Also in 3 projects that use this
OpenAISkillreact-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Also in 5 projects that use this
Other versions77 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- piomin/claude-ai-spring-boot★ 1.4k15% same
- piomin/spring-boot-app-with-claudecode★ 186% same
Wrote their own version · 75
- tursodatabase/turso★ 25ksame name
- superdesigndev/treg★ 7.7ksame name
- doorkeeper-gem/doorkeeper★ 5.5ksame name
- static-web-server/static-web-server★ 2.4ksame name
- microsoft/winappCli★ 1.4ksame name
- glommer/pgmicro★ 1.2ksame name
- vm0-ai/vm0★ 1.2ksame name
- rommapp/argosy-launcher★ 710same name
- waybarrios/opencode-power-pack★ 547same name
- notque/claude-code-toolkit★ 448same name
65 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- design-patternsSkill
- java-modernSkill
- jpa-patternsSkill
- logging-patternsSkill
- quarkusSkill
- testing-patternsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 71 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before merging PR or releasing API changes
“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Quality Review Skill
Systematic code review combining clean code principles, API design, and Java best practices.
When to Use
- "review this code" / "code review" / "check this PR"
- "refactor" / "clean this code" / "improve readability"
- "review API" / "check endpoints" / "REST review"
- Before merging PR or releasing API changes
Review Strategy
- Quick scan - Understand intent, identify scope
- Checklist pass - Apply relevant categories below
- Summary - List findings by severity (Critical → Minor → Good)
Clean Code Principles
DRY - Don't Repeat Yourself
Violation:
// ❌ Duplicated validation logic
public void createUser(UserRequest req) {
if (req.getEmail() == null || !req.getEmail().contains("@")) {
throw new ValidationException("Invalid email");
}
}
public void updateUser(UserRequest req) {
if (req.getEmail() == null || !req.getEmail().contains("@")) {
throw new ValidationException("Invalid email");
}
}Fix:
// ✅ Single source of truth
public class EmailValidator {
public void validate(String email) {
if (email == null || !email.contains("@")) {
throw new ValidationException("Invalid email");
}
}
}KISS - Keep It Simple
Violation:
// ❌ Over-engineered
public interface UserFactory {
User createUser();
}
public class ConcreteUserFactory implements UserFactory {
public User createUser() { return new User(); }
}Fix:
// ✅ Simple
public User createUser() { return new User(); }YAGNI - You Aren't Gonna Need It
Violation:
// ❌ Premature abstraction
public class ConfigurableUserServiceFactoryProvider { }Fix:
// ✅ Implement when actually needed
public class UserService { }API Contract Review
HTTP Verb Semantics
| Verb | Use For | Idempotent | Safe |
| GET | Retrieve resource | Yes | Yes |
| POST | Create new resource | No | No |
| PUT | Replace entire resource | Yes | No |
| PATCH | Partial update | No* | No |
| DELETE | Remove resource | Yes | No |
Common Mistakes:
// ❌ POST for retrieval
@Path("/users")
public class UserResource {
@POST
@Path("/search")
public List<User> search(SearchCriteria criteria) { }
}
// ✅ GET with query params
@GET
public List<User> search(@QueryParam("name") String name) { }
// ❌ GET for state change
@GET
@Path("/{id}/activate")
public void activate(@PathParam("id") Long id) { }
// ✅ POST/PATCH for state change
@POST
@Path("/{id}/activate")
public Response activate(@PathParam("id") Long id) { }API Versioning
// ✅ URL path versioning (recommended)
@Path("/api/v1/users")
public class UserResourceV1 { }
// ❌ No versioning
@Path("/users") // Breaking changes affect all clientsResponse Status Codes
| Code | Use Case | Example |
| 200 OK | Successful GET/PUT/PATCH | Found resource |
| 201 Created | Successful POST | New resource created |
| 204 No Content | Successful DELETE | Resource deleted |
| 400 Bad Request | Validation failure | Invalid input |
| 404 Not Found | Resource doesn't exist | User not found |
| 409 Conflict | State conflict | Duplicate email |
| 500 Server Error | Unexpected error | Database down |
DTO vs Entity Exposure
// ❌ Exposing JPA entity
@GET
@Path("/{id}")
public User getUser(@PathParam("id") Long id) {
return userRepository.findById(id); // Exposes internals, N+1 risk
}
// ✅ Use DTO
@GET
@Path("/{id}")
public UserResponse getUser(@PathParam("id") Long id) {
return userService.findById(id); // Returns DTO
}Java Code Review Checklist
Null Safety
Check for:
// ❌ NPE risk
String name = user.getName().toUpperCase();
// ✅ Safe with Optional
String name = Optional.ofNullable(user.getName())
.map(String::toUpperCase)
.orElse("");
// ✅ Safe with early return
if (user.getName() == null) return "";
return user.getName().toUpperCase();Flags:
- Chained calls without null checks
Optional.get()withoutisPresent()- Returning
nullinstead ofOptionalor empty collection - Missing
@Nullable/@NonNullon public APIs
Exception Handling
Check for:
// ❌ Swallowing exceptions
try {
process();
} catch (Exception e) { } // Silent failure
// ❌ Losing stack trace
catch (IOException e) {
throw new RuntimeException(e.getMessage()); // Lost context
}
// ✅ Proper handling
catch (IOException e) {
log.error("Failed to process file: {}", filename, e);
throw new ProcessingException("File processing failed", e);
}Flags:
- Empty catch blocks
- Catching
ExceptionorThrowable(too broad) - Not logging exceptions
- Creating new exception without original cause
Resource Management
Check for:
// ❌ Resource leak
FileInputStream fis = new FileInputStream(file);
String content = read(fis);
fis.close(); // Won't execute if read() throws
// ✅ Try-with-resources
try (FileInputStream fis = new FileInputStream(file)) {
return read(fis);
} // Auto-closedTransaction Boundaries
Check for:
// ❌ Missing transaction
public void createUser(UserRequest request) {
User user = new User();
userRepository.persist(user);
roleRepository.persist(new Role(user)); // Two separate transactions
}
// ✅ Proper transaction
@Transactional
public void createUser(UserRequest request) {
User user = new User();
userRepository.persist(user);
roleRepository.persist(new Role(user)); // Single atomic transaction
}Naming Conventions
Good:
// ✅ Clear intent
public List<User> findActiveUsersByRole(String role) { }
public boolean isEmailValid(String email) { }
public void activateUser(Long userId) { }Bad:
// ❌ Unclear
public List<User> get(String s) { }
public boolean check(String str) { }
public void doStuff(Long id) { }Performance
Check for:
// ❌ N+1 query problem
List<User> users = userRepository.listAll();
for (User user : users) {
List<Order> orders = orderRepository.find("user.id", user.getId()).list(); // N queries
}
// ✅ Join fetch
public List<User> findAllWithOrders() {
return getEntityManager()
.createQuery("SELECT DISTINCT u FROM User u LEFT JOIN FETCH u.orders", User.class)
.getResultList();
}
// ❌ Loading all data
List<User> allUsers = userRepository.listAll(); // Could be millions
// ✅ Pagination
List<User> users = userRepository.findAll().page(Page.of(0, 20)).list();Review Output Format
## Code Review: [Component/Feature Name]
### Critical Issues
- **Null safety violation** (UserService.java:42) - `user.getName().toUpperCase()` can NPE. Use Optional or null check.
- **Resource leak** (FileHandler.java:15) - FileInputStream not closed. Use try-with-resources.
### Important Improvements
- **API design** - POST used for idempotent update (UserResource.java:28). Use PUT instead.
- **Transaction missing** - Multi-step operation needs @Transactional (OrderService.java:56).
- **N+1 query** - Loop fetches orders individually (line 89). Use JOIN FETCH.
### Code Smells
- **Long method** - extractUserData() is 80 lines. Consider extracting sub-methods.
- **Magic number** - Use named constant instead of `86400` (line 123).
- **Inconsistent naming** - Mix of camelCase and snake_case in variables.
### Good Practices Observed
- ✅ Constructor injection used throughout
- ✅ DTOs properly separate from entities
- ✅ Comprehensive validation on all endpoints
- ✅ Good test coverage (87%)Quick Reference Flags
| Category | Red Flags |
| Null Safety | Chained calls, Optional.get(), returning null |
| Exceptions | Empty catch, broad catch, lost stack trace |
| Resources | Manual close(), missing try-with-resources |
| API Design | Wrong HTTP verb, no versioning, entity exposure |
| Transactions | Multi-step writes without @Transactional |
| Performance | N+1 queries, loading all data, missing indexes |
| Clean Code | Code duplication, magic numbers, unclear names |
Severity Levels
- Critical - Security, data loss, crash risk → Must fix before merge
- Important - Performance, maintainability, correctness → Should fix
- Code Smell - Style, complexity, minor issues → Nice to have
- Good - Positive feedback to reinforce good practices
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

