java-language-design

Design and review Java APIs for immutability, contracts, and idiomatic use.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/ririnto/sinon --skill java-language-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-language-design
Source: https://github.com/ririnto/sinon/tree/main/plugins/java/skills/java-language-design
Command: npx skills add https://github.com/ririnto/sinon --skill java-language-design

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Design idiomatic Java APIs, review class structure for immutability and clarity, choose between records and sealed classes, and shape public contracts with narrow surfaces and explicit value semantics.

Core Features & Use Cases

  • Guidance on idiomatic Java API design, mutability boundaries, and visibility decisions.
  • Decision support for records vs sealed classes and for checked vs unchecked exception boundaries.
  • Ready-to-adapt templates and patterns for constructing clean, maintainable public APIs.

Quick Start

Ask the skill to review a Java API surface and apply idiomatic design guidance.

Frequently Asked Questions about java-language-design

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

FAQPage Schema
How do I design idiomatic Java APIs with clear contracts and immutability?

To design idiomatic Java APIs, enforce explicit mutability boundaries and narrow public surfaces. This approach ensures clear contracts and maintainable class structures using records, sealed types, and proper exception boundaries.

When should I use Java records vs sealed classes for API design?

Use Java records for transparent data carriers and sealed classes when you need restricted hierarchical structures. This distinction helps enforce explicit value semantics and narrow public surfaces in your API design.

What is the best way to handle checked vs unchecked exceptions in Java public APIs?

The best way to handle checked vs unchecked exceptions in Java public APIs is to enforce clear exception boundaries. Use checked exceptions for recoverable conditions and unchecked exceptions for programming errors to shape robust public contracts.

How do I review a Java class structure to enforce mutability boundaries?

Review a Java class structure by analyzing its public surface and applying idiomatic design guidance. Enforce explicit mutability boundaries by refactoring to records or sealed types and narrowing exposed state.

Does refactoring Java APIs for immutability require specific frameworks?

Refactoring Java APIs for immutability does not require external frameworks. It relies on native language features like records, sealed classes, and visibility modifiers to establish explicit mutability boundaries and narrow public surfaces.