code-quality

Reviews Java code for clean code principles, API contracts, null safety, and performance issues.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/zuldare/apuntesIA --skill code-quality-zuldare
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-quality
Source: https://github.com/zuldare/apuntesIA/tree/main/skills/code-quality
Command: npx skills add https://github.com/zuldare/apuntesIA --skill code-quality-zuldare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent code reviews let null pointer risks, resource leaks, N+1 queries, and poor API design slip into production. This Skill provides a systematic Java code review checklist so every review covers clean code principles, REST API contracts, exception handling, and performance. ## Core Features & Use Cases - Clean Code Review: Detects DRY, KISS, and YAGNI violations with concrete before/after Java examples. - API Contract Validation: Checks HTTP verb semantics, versioning, status codes, and DTO vs entity exposure in Spring controllers. - Java Safety & Performance Checks: Flags null safety risks, swallowed exceptions, resource leaks, missing @Transactional boundaries, and N+1 query problems. - Use Case: Before merging a pull request, ask for a review and receive findings organized by severity (Critical, Important, Code Smell, Good) with file and line references. ## Quick Start Review this Java pull request for clean code violations, API design issues, and null safety problems.

Frequently Asked Questions about code-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review Java code for null safety issues?▼

Check for chained method calls without null checks, Optional.get() without isPresent(), and methods returning null instead of Optional or empty collections. Prefer Optional.map chains or early returns, and annotate public APIs with @Nullable or @NonNull.

How to check REST API design in a Spring code review?▼

Verify HTTP verbs match semantics (GET for retrieval, POST for creation, PUT for replacement), confirm URL path versioning like /api/v1, check correct status codes such as 201 for creation, and ensure endpoints return DTOs rather than JPA entities.

What is the N+1 query problem and how do I fix it?▼

The N+1 problem occurs when a loop executes one query per entity, such as fetching orders for each user individually. Fix it with a JOIN FETCH query in JPA or batch loading, and add pagination instead of loading entire tables.

When should I use @Transactional in a Spring service?▼

Use @Transactional whenever a method performs multiple related writes, such as saving a user and their roles together. Without it, each repository call commits separately, leaving data inconsistent if a later step fails.

Why is catching generic Exception considered bad practice?▼

Catching Exception or Throwable hides unexpected errors and makes debugging harder, especially with empty catch blocks that silently swallow failures. Catch specific exceptions, log with context, and rethrow wrapped exceptions preserving the original cause.