skills/code-review/SKILL.md
Perform thorough code reviews of Java/Spring Boot code covering security, performance, correctness, design, and style. Use this skill whenever the user asks for a code review, wants feedback on their code, shares code for evaluation, or says things like "review this code", "what's wrong with this", "can you check this class", "PR review", "give me feedback on this implementation", "is this code production-ready". Always use this skill as the framework for reviewing any Java or Spring Boot code — it ensures no critical category is missed.
npx skillsauth add jyjeanne/ai-setup-forge code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform structured code reviews across five dimensions: Security, Correctness, Performance, Design, and Style. Always review in this priority order.
Flag these immediately, block merge:
SQL Injection
// ❌ CRITICAL
String query = "SELECT * FROM users WHERE name = '" + name + "'";
// ✅ Safe
@Query("SELECT u FROM User u WHERE u.name = :name")
Optional<User> findByName(@Param("name") String name);
Sensitive Data Exposure
log.info("Password: {}", password) ❌toString() auto-generated by Lombok ❌ (use @ToString.Exclude)Missing Authorization Checks
// ❌ Any user can delete any resource
@DeleteMapping("/{id}")
public void delete(@PathVariable Long id) { ... }
// ✅ Check ownership or role
@PreAuthorize("hasRole('ADMIN') or @securityService.isOwner(#id)")
@DeleteMapping("/{id}")
public void delete(@PathVariable Long id) { ... }
Deserialization / Input Trust Issues
@Valid on @RequestBodyNullPointerException Risks
// ❌ Potential NPE
user.getAddress().getCity().toUpperCase();
// ✅ Safe
Optional.ofNullable(user.getAddress())
.map(Address::getCity)
.map(String::toUpperCase)
.orElse("Unknown");
Transaction Boundaries
// ❌ No @Transactional on method that does multiple DB writes
public void transferFunds(Long fromId, Long toId, BigDecimal amount) {
accountRepo.debit(fromId, amount);
accountRepo.credit(toId, amount); // if this fails, money is lost
}
// ✅
@Transactional
public void transferFunds(...) { ... }
Entity Mutability in Collections
LazyInitializationExceptionEquals/HashCode on JPA Entities
@EqualsAndHashCode on @Entity with all fieldsid field for entity equalityN+1 Query Problem
// ❌ N+1: one query per user's orders
users.forEach(u -> System.out.println(u.getOrders().size()));
// ✅ Fetch join
@Query("SELECT u FROM User u LEFT JOIN FETCH u.orders WHERE u.id IN :ids")
List<User> findAllWithOrders(@Param("ids") List<Long> ids);
Missing Pagination
Pageable ❌Unnecessary DB Calls
// ❌ Loads full entity just to check existence
if (userRepository.findById(id).isPresent()) { ... }
// ✅
if (userRepository.existsById(id)) { ... }
Stream vs Collection Choice
.collect(Collectors.toList()) then immediately streaming againSingle Responsibility Violation
Hardcoded Values
// ❌
if (user.getAge() > 18) { ... }
Thread.sleep(5000);
// ✅
if (user.getAge() > legalAgeRequirement) { ... }
@Value("${app.retry.delay-ms}") private int retryDelayMs;
Magic String / Status Checks
// ❌
if ("ACTIVE".equals(user.getStatus())) { ... }
// ✅
if (UserStatus.ACTIVE == user.getStatus()) { ... }
Tight Coupling
new ConcreteService() instead of injected interfaceNaming
calculateTotal(), not total()isActive(), hasPermission(), canDelete()usr, svc, mgrMethod Length
Commented-Out Code
Logging Practices
// ❌ String concatenation in log
log.debug("Processing user " + userId + " with status " + status);
// ✅ Parameterized
log.debug("Processing user {} with status {}", userId, status);
Structure your review as:
## Code Review Summary
### 🔴 Critical Issues (must fix)
- [Issue]: [Explanation] → [Fix]
### 🟡 Important Issues (should fix)
- [Issue]: [Explanation] → [Fix]
### 🟢 Suggestions (nice to have)
- [Suggestion]: [Explanation]
### ✅ What's Done Well
- [Positive observations]
### Overall Assessment
[Production-ready | Needs minor changes | Needs significant work]
@Valid on all @RequestBody parameters@Transactional on multi-step write operationsRuntimeException or Exception catchesSystem.out.println in production codedevelopment
Generate breadboard circuit mockups and visual diagrams using HTML5 Canvas drawing techniques. Use when asked to create circuit layouts, visualize electronic component placements, draw breadboard diagrams, mockup 6502 builds, generate retro computer schematics, or design vintage electronics projects. Supports 555 timers, W65C02S microprocessors, 28C256 EEPROMs, W65C22 VIA chips, 7400-series logic gates, LEDs, resistors, capacitors, switches, buttons, crystals, and wires.
development
Apply lean thinking to UX: hypothesis-driven design, collaborative sketching, and rapid experiments instead of heavy deliverables. Use when the user mentions "Lean UX", "design hypothesis", "UX experiment", "collaborative design", or "outcome over output". Covers hypothesis statements, MVPs for UX, and cross-functional collaboration. For Build-Measure-Learn, see lean-startup. For usability audits, see ux-heuristics.
development
Design MVPs, validated learning experiments, and pivot-or-persevere decisions using Build-Measure-Learn. Use when the user mentions "MVP scope", "validated learning", "pivot or persevere", "vanity metrics", or "test assumptions". Covers innovation accounting and actionable metrics. For 5-day prototype testing, see design-sprint. For customer motivation analysis, see jobs-to-be-done.
tools
Instrument, trace, evaluate, and monitor LLM applications and AI agents with LangSmith. Use when setting up observability for LLM pipelines, running offline or online evaluations, managing prompts in the Prompt Hub, creating datasets for regression testing, or deploying agent servers. Triggers on: langsmith, langchain tracing, llm tracing, llm observability, llm evaluation, trace llm calls, @traceable, wrap_openai, langsmith evaluate, langsmith dataset, langsmith feedback, langsmith prompt hub, langsmith project, llm monitoring, llm debugging, llm quality, openevals, langsmith cli, langsmith experiment, annotate llm, llm judge.