java

Review Java and Kotlin code against Effective Java design principles.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/Objective-Arts/lens --skill java-objective-arts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java
Source: https://github.com/Objective-Arts/lens/tree/main/.claude/canon/java
Command: npx skills add https://github.com/Objective-Arts/lens --skill java-objective-arts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write more robust, maintainable, and secure Java code by adhering to established best practices and design principles, particularly those outlined by Joshua Bloch.

Core Features & Use Cases

  • Defensive Design: Emphasizes creating APIs that are easy to use correctly and hard to use incorrectly.
  • Immutability: Guides on making classes immutable by default to enhance thread-safety and predictability.
  • Composition over Inheritance: Promotes using composition for code reuse to avoid the pitfalls of inheritance.
  • Use Case: When designing a new public API for a Java library, use this Skill to ensure the API is intuitive, prevents common errors, and is easy for other developers to integrate with.

Quick Start

Review the attached Java code file for adherence to Effective Java principles.

Frequently Asked Questions about java

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

FAQPage Schema
How do I enforce Effective Java design principles in my codebase?

To enforce Effective Java design principles, you review Java code for adherence to practices like minimizing mutability, favoring composition, and programming to interfaces. This ensures robust object-oriented programming and improves general code quality in Java and Kotlin projects.

What is the best way to design a Java API that is hard to use incorrectly?

The best way to design a robust Java API is by applying defensive design principles. This involves making classes immutable by default to enhance thread-safety and predictability, ensuring the API is intuitive and prevents common integration errors.

Why does favoring composition over inheritance improve Java code quality?

Favoring composition over inheritance improves Java code quality by avoiding the pitfalls of inheritance for code reuse. It promotes flexible and maintainable object-oriented programming structures, which is a core Effective Java design principle for robust class construction.

Can I use this to review Kotlin projects for object-oriented design patterns?

Yes, you can use this to review Kotlin projects. The design principles apply to general code quality and object-oriented programming in both Java and Kotlin projects, guiding class construction and API design effectively.

When do I need to minimize mutability in Java class construction?

You need to minimize mutability in Java class construction when you want to enhance thread-safety and predictability. Making classes immutable by default is a defensive design practice that creates robust and secure APIs.