jabrena avatar

121 Java Object Oriented Design

This is a refactoring aid that runs your Java code through an OOD quality check before making any changes. It enforces compilation as a safety gate, then applies SOLID principles, fixes code smells like God Class and Feature Envy, and improves patterns around object creation, method signatures, and exception handling. The workflow is deliberate: compile first, read the reference guide for good and bad patterns, apply focused refactorings, then verify with a full Maven build. It's built for systematic cleanup work rather than greenfield development, and the hard stop on compilation failures keeps you from digging deeper holes. Part of the cursor-rules-java project by Juan Antonio Breña Moral.

skills.sh installs
153
GitHub stars
393
last updated
Jun 3, 2026

Install

$ npx -y skills add jabrena/cursor-rules-java --skill 121-java-object-oriented-design --agent claude-code

Installs into .claude/skills of the current project.

Files

Java Object-Oriented Design Guidelines

Review and improve Java code using focused object-oriented design references selected after assessing the request and affected code.

What is covered in this Skill?

  • Fundamental design principles (SOLID, DRY, YAGNI)
  • Class and interface design: composition over inheritance, immutability, accessibility minimization, accessor methods
  • Core OOP concepts: encapsulation, inheritance, polymorphism
  • Object creation patterns: static factory methods, Builder, Singleton, dependency injection, avoiding unnecessary objects
  • OOD code smells: God Class, Feature Envy, Inappropriate Intimacy, Refused Bequest, Shotgun Surgery, Data Clumps
  • Method design: parameter validation, defensive copies, careful signatures, empty collections over nulls, Optional usage
  • Exception handling: checked vs. runtime exceptions, standard exceptions, failure-capture messages, no silent ignoring

Scope: Classify the applicable OOD concerns first, then load only the focused references needed for those concerns. Load multiple references when a refactoring crosses concern boundaries.

Constraints

Sponsors

Details

Repository
github.com/jabrena/cursor-rules-java
Categories
Java & JVM, Design & UI/UX
First seen
Jun 3, 2026

More from jabrena/cursor-rules-java

All 16

Recommended

More Java & JVM
1jabrena avatar142-java-functional-programmingjabrena/cursor-rules-java142 java functional programming135skills.sh installs
2absolutelyskilled avatarandroid-kotlinabsolutelyskilled/absolutelyskilledandroid kotlin133skills.sh installs
3jabrena avatar144-java-data-oriented-programmingjabrena/cursor-rules-java144 java data oriented programming129skills.sh installs
4jabrena avatar170-java-documentationjabrena/cursor-rules-java170 java documentation129skills.sh installs
5aiskillstore avataralibaba-java-coding-guidelines-skillaiskillstore/marketplaceThis brings Alibaba's Java coding guidelines into your editor as a reviewable standard.0skills.sh installs
6limrun-inc avatarlimrun-gradlelimrun-inc/skillsBuild an Android app on a remote Gradle sandbox with `lim gradle build` instead of local Gradle or Android Studio, from any environment (Linux, Windows, macOS, 41.5Kskills.sh installs