121 java object oriented design

From jabrena/cursor-rules-java · View interactive version

121 java object oriented design is an AI agent skill from the GitHub repository jabrena/cursor-rules-java. Use when reviewing, improving, or refactoring Java object-oriented design, including applying SOLID, DRY, or YAGNI; improving classes and interfaces; correcting encapsulation, inheritance, or polymorphism; resolving God Class, Feature Envy, or Data Clumps; and improving object creation, methods, or

How to use this skill

Skill file

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?

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

Before applying any OOD changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until resolved. After applying improvements, run full verification.

When to use this skill

Workflow

  1. Compile project before OOD changes

Run ./mvnw compile or mvn compile and stop immediately if compilation fails.

  1. Assess code and classify OOD concerns

Analyze the request and affected Java code before reading implementation guidance. Classify each relevant problem into one or more concerns:

If the request is dedicated type-design work, use skill 122. If it is dedicated exception-handling work, use skill 126.

  1. Read only applicable OOD references

Map the classified concerns to focused references:

Read every reference required by a cross-concern refactoring, but do not read unrelated references.

  1. Apply focused refactorings

Prioritize findings by impact: CRITICAL, MAINTAINABILITY, FLEXIBILITY, or CODE_QUALITY. Apply the smallest suitable refactoring for each diagnosed concern while preserving observable behavior:

Apply changes incrementally and compile after each significant refactoring.

  1. Verify with full build

Run ./mvnw clean verify or mvn clean verify after applying improvements.

  1. Report applied OOD improvements

Report findings by impact and concern, focused references used, refactorings applied, maintainability/flexibility/testability benefits, behavior-preservation evidence, and the final compilation and test result.

Reference

For detailed guidance, examples, and constraints, see:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.