jabrena avatar

122 Java Type Design

This one walks through your Java code looking for type design problems like primitive obsession, weak type hierarchies, and inconsistent naming. It pushes you toward value objects (EmailAddress instead of String, Money instead of double), generic type parameters, and fluent interfaces. The workflow is cautious: it compiles before touching anything, applies refactorings based on pattern examples in the reference doc, then runs clean verify. Good for codebases that work but feel mushy around the edges, where you're passing strings and primitives everywhere instead of domain types. It's opinionated about BigDecimal for money and won't proceed if your project doesn't compile first.

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

Install

$ npx -y skills add jabrena/cursor-rules-java --skill 122-java-type-design --agent claude-code

Installs into .claude/skills of the current project.

Files

Type Design Thinking in Java

Review and improve Java code using comprehensive type design principles that apply typography concepts to code structure and organization for maximum clarity and maintainability.

What is covered in this Skill?

  • Clear type hierarchies: nested static classes, logical structure
  • Consistent naming conventions: domain-driven patterns, uniform interface/implementation naming
  • Strategic whitespace for readability
  • Type-safe wrappers: value objects replacing primitive obsession (EmailAddress, Money)
  • Generic type parameters: flexible reusable types, bounded parameters
  • Domain-specific fluent interfaces: builder pattern, method chaining
  • Type weights: conceptual importance — core domain vs supporting vs utility
  • Type contrast through interfaces: contract vs implementation separation
  • Aligned method signatures: consistent parameter and return types across related classes
  • Self-documenting code: clear descriptive names
  • BigDecimal for precision-sensitive calculations (financial/monetary operations)
  • Strategic type selection: Optional, Set vs List, interfaces over concrete types

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 avatar132-java-testing-integration-testingjabrena/cursor-rules-java132 java testing integration testing128skills.sh installs
2teachingai avatarspring-cloud-alibabateachingai/full-stack-skillsspring cloud alibaba120skills.sh installs
3elastic avatarobservability-edot-java-instrumentelastic/agent-skills>0skills.sh installs
4elastic avatarobservability-edot-java-migrateelastic/agent-skills>0skills.sh installs
5decebals avatarperformance-smell-detectiondecebals/claude-code-javaDetect potential code-level performance smells in Java - streams, collections, boxing, regex, object creation. Provides awareness, not absolutes - always measur341skills.sh installs
6decebals avatarapi-contract-reviewdecebals/claude-code-javaReview REST API contracts for HTTP semantics, versioning, backward compatibility, and response consistency. Use when user asks "review API", "check endpoints", 315skills.sh installs