
121-java-object-oriented-design
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 exception contracts. Triggers include review Java OOD, refactor Java OOD, improve Java OOD, fix OOP misuse, and identify Java code smells. Part of Plinth Toolkit
- Installs
- 472
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/jabrena/plinth --skill 121-java-object-oriented-design- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads 121-java-object-oriented-design automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
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.
- MANDATORY: Run
./mvnw compileormvn compilebefore applying any change - SAFETY: If compilation fails, stop immediately and do not proceed — compilation failure is a blocking condition
- VERIFY: Run
./mvnw clean verifyormvn clean verifyafter applying improvements - PROGRESSIVE DISCLOSURE: Classify the applicable OOD concerns before reading references, then read only the references mapped to those concerns
- MULTI-CONCERN CHANGES: Read multiple focused references only when the request or diagnosed code problems cross concern boundaries
- PRESERVE BEHAVIOR: Apply focused, incremental refactorings without changing observable business behavior
- INCREMENTAL SAFETY: Compile after each significant refactoring and keep changes easy to revert if validation reveals a regression
- DEPENDENCY SAFETY: Confirm refactoring does not break imports, dependencies, class relationships, or established contracts
- ADJACENT SKILLS: Use skill 122 for dedicated type-design work and skill 126 for dedicated exception-handling work; use the overlapping skill 121 references only when those topics are part of a broader OOD review
- EDGE CASE: If request scope is ambiguous, stop and ask a clarifying question before applying changes
- EDGE CASE: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance
When to use this skill
- Review Java code for object-oriented design
- Refactor Java code for object-oriented design
- Improve Java code for object-oriented design
- Fix OOP concept misuse in Java code
- Identify and resolve code smells in Java code
- Improve object creation patterns in Java code
- Improve method design in Java code
- Improve exception handling in Java code
Workflow
- Compile project before OOD changes
Run ./mvnw compile or mvn compile and stop immediately if compilation fails.
- 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:
- Fundamental principles: SOLID, DRY, or YAGNI violations.
- Core OOP concepts: encapsulation, inheritance, or polymorphism misuse.
- Code smells: God Class, Feature Envy, Inappropriate Intimacy, Refused Bequest, Shotgun Surgery, or Data Clumps.
- Object creation: factories, builders, singletons, dependency injection, or unnecessary object creation.
- Classes and interfaces: accessibility, public fields, mutability, composition, or inheritance design.
- Enums and annotations: int constants, ordinals, bit fields, ordinal indexing, or missing
@Override. - Methods: parameter validation, defensive copies, signatures, null collections, or
Optional. - Exceptions: exception contracts that are part of the broader OOD review.
If the request is dedicated type-design work, use skill 122. If it is dedicated exception-handling work, use skill 126.
- Read only applicable OOD references
Map the classified concerns to focused references:
- For SOLID, DRY, or YAGNI, read
references/121-java-object-oriented-design-principles.md. - For encapsulation, inheritance, or polymorphism, read
references/121-java-object-oriented-design-oop-concepts.md. - For object-oriented code smells, read
references/121-java-object-oriented-design-code-smells.md. - For factories, builders, singletons, dependency injection, or unnecessary objects, read
references/121-java-object-oriented-design-object-creation.md. - For class and interface boundaries, accessibility, mutability, composition, or inheritance design, read
references/121-java-object-oriented-design-classes-interfaces.md. - For enums, ordinals, bit fields, enum lookup, or
@Override, readreferences/121-java-object-oriented-design-enums-annotations.md. - For method contracts, validation, defensive copies, signatures, collection returns, or
Optional, readreferences/121-java-object-oriented-design-methods.md. - For exception contracts within a broader OOD review, read
references/121-java-object-oriented-design-exceptions.md.
Read every reference required by a cross-concern refactoring, but do not read unrelated references.
- 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:
- Extract classes or methods to restore focused responsibilities.
- Introduce or refine abstractions for extension, interface segregation, and dependency inversion.
- Correct inheritance hierarchies to preserve substitutability, or replace inheritance with composition.
- Move behavior to eliminate Feature Envy and improve encapsulation.
- Introduce cohesive value or parameter objects for Data Clumps.
- Hide exposed state and reduce unnecessary coupling.
Apply changes incrementally and compile after each significant refactoring.
- Verify with full build
Run ./mvnw clean verify or mvn clean verify after applying improvements.
- 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:
- references/121-java-object-oriented-design-principles.md
- references/121-java-object-oriented-design-oop-concepts.md
- references/121-java-object-oriented-design-code-smells.md
- references/121-java-object-oriented-design-object-creation.md
- references/121-java-object-oriented-design-classes-interfaces.md
- references/121-java-object-oriented-design-enums-annotations.md
- references/121-java-object-oriented-design-methods.md
- references/121-java-object-oriented-design-exceptions.md
FAQ
What does the 121-java-object-oriented-design skill do?
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 exception contracts. Triggers include review Java OOD, refactor Java OOD, improve Java OOD, fix OOP misuse, and identify Java code smells. Part of Plinth Toolkit
How do I install 121-java-object-oriented-design?
Run npx skills add https://github.com/jabrena/plinth --skill 121-java-object-oriented-design in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/121-java-object-oriented-design/ (personal) or .claude/skills/121-java-object-oriented-design/ (project).
Which AI agents can use 121-java-object-oriented-design?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is 121-java-object-oriented-design safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains 121-java-object-oriented-design?
It is published by jabrena in jabrena/plinth. It has 472 recorded installs.
More from jabrena/plinth
110-java-maven-best-practices
jabrena/plinth
Use when you need to review, improve, or troubleshoot a Maven pom.xml file — including dependency management with BOMs, plugin configuration, version centralization, multi-module project structure, build profiles, or any situation where you want to align your Maven setup with industry best practices. This should trigger for requests such as Review pom.xml to improve it; Apply Maven best practices to pom.xml; Improve Maven POM configuration; Review Maven dependency management and plugin configuration; Modernize Maven build conventions for a Java project. Part of Plinth Toolkit
124-java-secure-coding
jabrena/plinth
Use when you need to apply Java secure coding best practices — including validating untrusted inputs, defending against injection attacks with parameterized queries, minimizing attack surface via least privilege, applying strong cryptographic algorithms, handling exceptions securely without exposing sensitive data, managing secrets at runtime, avoiding unsafe deserialization, and encoding output to prevent XSS. This should trigger for requests such as Review Java code for secure coding; Find input validation risks in Java code; Review Java code for injection vulnerabilities; Improve secure error handling in Java services; Harden Java code against common security flaws. Part of Plinth Toolkit
131-java-testing-unit-testing
jabrena/plinth
Open the skill to read its SKILL.md instructions.
141-java-refactoring-with-modern-features
jabrena/plinth
Open the skill to read its SKILL.md instructions.
125-java-concurrency
jabrena/plinth
Open the skill to read its SKILL.md instructions.
122-java-type-design
jabrena/plinth
Open the skill to read its SKILL.md instructions.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.