{"id":"d441e9c9-ac4e-4c6d-91f4-ee592fb3bbdd","shortId":"MEPBb5","kind":"skill","title":"122-java-type-design","tagline":"Use when you need to review, improve, or refactor Java code for type design quality — including establishing clear type hierarchies, applying consistent naming conventions, eliminating primitive obsession with domain-specific value objects, leveraging generic type parameters, cre","description":"# Type Design Thinking in Java\n\nReview and improve Java code using comprehensive type design principles that apply typography concepts to code structure and organization for maximum clarity and maintainability.\n\n**What is covered in this Skill?**\n\n- Clear type hierarchies: nested static classes, logical structure\n- Consistent naming conventions: domain-driven patterns, uniform interface/implementation naming\n- Strategic whitespace for readability\n- Type-safe wrappers: value objects replacing primitive obsession (EmailAddress, Money)\n- Generic type parameters: flexible reusable types, bounded parameters\n- Domain-specific fluent interfaces: builder pattern, method chaining\n- Type weights: conceptual importance — core domain vs supporting vs utility\n- Type contrast through interfaces: contract vs implementation separation\n- Aligned method signatures: consistent parameter and return types across related classes\n- Self-documenting code: clear descriptive names\n- BigDecimal for precision-sensitive calculations (financial/monetary operations)\n- Strategic type selection: Optional, Set vs List, interfaces over concrete types\n\n**Scope:** The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.\n\n## Constraints\n\nBefore applying any type design changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until resolved. After applying improvements, run full verification.\n\n- **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change\n- **SAFETY**: If compilation fails, stop immediately and do not proceed — compilation failure is a blocking condition\n- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements\n- **BEFORE APPLYING**: Read the reference for detailed examples, good/bad patterns, and constraints\n- **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes\n- **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance\n\n## When to use this skill\n\n- Review Java code for type design\n- Improve type design in Java code\n- Fix primitive obsession in Java code\n- Create value objects in Java code\n- Create type hierarchies in Java code\n- Create fluent interfaces in Java code\n\n## Workflow\n\n1. **Compile project before type-design changes**\n\nRun `./mvnw compile` or `mvn compile` and stop immediately if compilation fails.\n\n2. **Read type-design reference and inspect code**\n\nRead `references/122-java-type-design.md` and identify type hierarchy, naming, and value-object improvements.\n\n3. **Apply type-design refactorings**\n\nImplement selected type-safety and readability improvements based on applicable patterns.\n\n4. **Verify with full build**\n\nRun `./mvnw clean verify` or `mvn clean verify` after applying improvements.\n\n## Reference\n\nFor detailed guidance, examples, and constraints, see [references/122-java-type-design.md](references/122-java-type-design.md).","tags":["122","java","type","design","cursor","rules","jabrena","agent-skills","ai-skills","claude","claude-code","claude-code-skills"],"capabilities":["skill","source-jabrena","skill-122-java-type-design","topic-agent-skills","topic-ai-skills","topic-claude","topic-claude-code","topic-claude-code-skills","topic-claude-code-subagents","topic-claude-skills","topic-cursor-agent","topic-cursor-ai","topic-cursor-skills","topic-cursorai","topic-github-copilot"],"categories":["cursor-rules-java"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/jabrena/cursor-rules-java/122-java-type-design","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add jabrena/cursor-rules-java","source_repo":"https://github.com/jabrena/cursor-rules-java","install_from":"skills.sh"}},"qualityScore":"0.631","qualityRationale":"deterministic score 0.63 from registry signals: · indexed on github topic:agent-skills · 362 github stars · SKILL.md body (3,071 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-26T18:53:40.802Z","embedding":null,"createdAt":"2026-04-18T22:01:55.549Z","updatedAt":"2026-04-26T18:53:40.802Z","lastSeenAt":"2026-04-26T18:53:40.802Z","tsv":"'/mvnw':233,260,371,427 '1':362 '122':1 '2':382 '3':403 '4':421 'across':155 'align':147 'ambigu':288 'appli':26,60,198,206,226,239,268,271,296,404,435 'applic':202,419 'area':197 'ask':291,313 'base':200,417 'bigdecim':165 'block':256 'bound':118 'build':425 'builder':125 'calcul':170 'case':283,299 'chain':128 'chang':210,241,297,369 'clarifi':293 'clariti':70 'class':84,157 'clean':261,265,428,432 'clear':23,79,162 'code':16,53,64,161,192,327,336,342,348,354,360,390 'compil':214,216,234,237,244,252,363,372,375,380 'comprehens':55 'concept':62 'conceptu':131 'concret':182 'condit':257 'consist':27,87,150 'constraint':204,281,443 'contract':143 'contrast':140 'convent':29,89 'core':133,196 'cover':75 'cre':43 'creat':343,349,355 'descript':163 'design':5,19,45,57,209,330,333,368,386,407 'detail':276,439 'document':160 'domain':35,91,121,134 'domain-driven':90 'domain-specif':34,120 'driven':92 'edg':282,298 'elimin':30 'emailaddress':110 'ensur':211 'establish':22 'exampl':190,203,277,441 'fail':217,245,381 'failur':253 'file':303 'financial/monetary':171 'fix':337 'flexibl':115 'fluent':123,356 'full':229,424 'generic':40,112 'good/bad':191,278 'guidanc':319,440 'hierarchi':25,81,351,396 'identifi':394 'immedi':219,247,378 'implement':145,409 'import':132 'improv':12,51,227,269,331,402,416,436 'includ':21 'input':302 'inspect':389 'interfac':124,142,180,357 'interface/implementation':95 'java':3,15,48,52,326,335,341,347,353,359 'java-type-design':2 'leverag':39 'list':179 'logic':85 'maintain':72 'mandatori':231 'maximum':69 'method':127,148 'miss':307,311 'money':111 'mvn':236,264,374,431 'name':28,88,96,164,397 'need':9 'nest':82 'object':38,106,345,401 'obsess':32,109,339 'oper':172 'option':176 'organ':67,188 'paramet':42,114,119,151 'pattern':93,126,193,279,420 'precis':168 'precision-sensit':167 'primit':31,108,338 'principl':58 'proceed':222,251,316 'project':213,364 'qualiti':20 'question':294 'read':272,383,391 'readabl':100,415 'recommend':199 'refactor':14,408 'refer':186,274,387,437 'references/122-java-type-design.md':392,445,446 'relat':156 'replac':107 'report':308 'request':285 'requir':301 'resolv':224 'return':153 'reusabl':116 'review':11,49,325 'run':228,232,259,370,426 'safe':103 'safeti':242,413 'scope':184,286 'see':444 'select':175,410 'self':159 'self-docu':158 'sensit':169 'separ':146 'set':177 'setup':318 'signatur':149 'skill':78,324 'skill-122-java-type-design' 'source-jabrena' 'specif':36,122 'static':83 'stop':218,246,289,377 'strateg':97,173 'structur':65,86 'support':136 'think':46 'tool':305 'topic-agent-skills' 'topic-ai-skills' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-claude-code-subagents' 'topic-claude-skills' 'topic-cursor-agent' 'topic-cursor-ai' 'topic-cursor-skills' 'topic-cursorai' 'topic-github-copilot' 'type':4,18,24,41,44,56,80,102,113,117,129,139,154,174,183,208,329,332,350,367,385,395,406,412 'type-design':366,384,405 'type-saf':101 'type-safeti':411 'typographi':61 'uniform':94 'use':6,54,322 'util':138 'valu':37,105,344,400 'value-object':399 'verif':230 'verifi':258,262,266,422,429,433 'vs':135,137,144,178 'weight':130 'whether':314 'whitespac':98 'workflow':361 'wrapper':104","prices":[{"id":"d570591f-49d1-432f-af9e-8e7ae56d872e","listingId":"d441e9c9-ac4e-4c6d-91f4-ee592fb3bbdd","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"jabrena","category":"cursor-rules-java","install_from":"skills.sh"},"createdAt":"2026-04-18T22:01:55.549Z"}],"sources":[{"listingId":"d441e9c9-ac4e-4c6d-91f4-ee592fb3bbdd","source":"github","sourceId":"jabrena/cursor-rules-java/122-java-type-design","sourceUrl":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/122-java-type-design","isPrimary":false,"firstSeenAt":"2026-04-18T22:01:55.549Z","lastSeenAt":"2026-04-26T18:53:40.802Z"}],"details":{"listingId":"d441e9c9-ac4e-4c6d-91f4-ee592fb3bbdd","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"jabrena","slug":"122-java-type-design","github":{"repo":"jabrena/cursor-rules-java","stars":362,"topics":["agent-skills","ai-skills","claude","claude-code","claude-code-skills","claude-code-subagents","claude-skills","cursor-agent","cursor-ai","cursor-skills","cursorai","github-copilot","intellij-idea","java","prompting","system-prompts"],"license":"apache-2.0","html_url":"https://github.com/jabrena/cursor-rules-java","pushed_at":"2026-04-26T13:48:39Z","description":"A curated and opinionated collection of Skills and Agents to be used in modern SDLC workflows for Java Enterprise development with your favorite AI Agent harness.","skill_md_sha":"de380cc3b38385cfbc2fba01756034a306760064","skill_md_path":"skills/122-java-type-design/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/122-java-type-design"},"layout":"multi","source":"github","category":"cursor-rules-java","frontmatter":{"name":"122-java-type-design","license":"Apache-2.0","description":"Use when you need to review, improve, or refactor Java code for type design quality — including establishing clear type hierarchies, applying consistent naming conventions, eliminating primitive obsession with domain-specific value objects, leveraging generic type parameters, creating type-safe wrappers, designing fluent interfaces, ensuring precision-appropriate numeric types (BigDecimal for financial calculations), and improving type contrast through interfaces and method signature alignment. This should trigger for requests such as Review Java code for type design; Improve type design in Java code; Fix primitive obsession in Java code; Create value objects in Java code. Part of cursor-rules-java project"},"skills_sh_url":"https://skills.sh/jabrena/cursor-rules-java/122-java-type-design"},"updatedAt":"2026-04-26T18:53:40.802Z"}}