Effective Java
Review, refactor, and explain Java code using distilled Effective Java principles for API design, immutability, generics, enums, streams, exceptions, concurr... Skill: Effective Java Owner: linbingqiang Summary: Review, refactor, and explain Java code using distilled Effective Java principles for API design, immutability, generics, enums, streams, exceptions, concurr... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-20T06:22:55.339Z | user Initial public release Archive index: Archive v1.0.0: 5 files, 9971 bytes Files: references/item-map.md (6534b), references/review-
Rank
62
Safety
84
Downloads
1.1k
Updated
Oct 11, 2026
Version
1.0.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1.1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 1.0.0release · observed Apr 20, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s1797wcfm7pxx8rx4zamnntvc9857mgm:effective-java- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-linbingqiang-effective-java/snapshot"
Documentation
CLAWHUB
20,622 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: effective_java description: Review, refactor, and explain Java code using distilled Effective Java principles for API design, immutability, generics, enums, streams, exceptions, concurrency, and serialization. --- # Effective Java ## Core Stance Use this skill as an Effective Java design and review lens, not as a rigid style guide. Prefer APIs that are simple, type-safe, immutable where practical, composition-friendly, well-documented at boundaries, and hard to misuse. Do not reproduce book text. Paraphrase the principles, explain tradeoffs, and cite item numbers only as navigation aids when helpful. ## Workflow 1. Classify the task: new API design, code review, refactor, bug fix, performance pass, or teaching/explanation. 2. Load `references/review-checklist.md` for reviews, refactors, or whenever code is provided. 3. Load `references/item-map.md` when the user asks for item-level mapping, broad Effective Java coverage, or a learning summary. 4. Inspect the public contract first: construction, mutability, equality, generics, exceptions, threading, serialization, and compatibility. 5. Prioritize recommendations by semantic risk before style: correctness, API safety, encapsulation, maintainability, then performance. 6. If editing code, make the smallest change that preserves existing behavior and public compatibility unless the user explicitly asks for an API redesign. ## Default Review Order - **Correctness**: broken invariants, resource leaks, equality/hash violations, unsafe publication, races, swallowed exceptions. - **API design**: confusing construction, boolean traps, excessive overloads, raw types, wildcard misuse, checked exceptions that are not recoverable. - **Encapsulation**: exposed mutable state, public fields, inheritance without contracts, mutable static state, missing defensive copies. - **Type safety**: unchecked casts, heap pollution, arrays mixed with generics, int constants where enums fit. - **Clarity**: stream/lambda overuse, unclear method references, unnecessary cleverness, duplicated construction logic. - **Performance**: avoid premature tuning; flag avoidable object churn, boxing, synchronization bottlenecks, and inappropriate parallel streams only after semantics are sound. ## High-Value Heuristics - Prefer named static factories when names, caching, subtype returns, or instance control improve the API; keep constructors when the simple shape is clearer. - Use builders for constructors with many optional parameters; validate invariants in one place before object publication. - Prefer dependency injection over hard-coded singletons or static utilities for resources that vary or need testing. - Favor immutability, minimize visibility, and make defensive copies at trust boundaries. - Prefer composition over inheritance unless inheritance is deliberately designed, documented, and tested. - Eliminate raw types; use bounded wildcards with PECS: producers `extends`, consumers `super`. - Use enums instead of
_meta.json
{
"ownerId": "kn78qwphcqsracs039f5avstah81s7r9",
"slug": "effective-java",
"version": "1.0.0",
"publishedAt": 1776666175339
}references/item-map.md
# Effective Java Item Map This is a compact, paraphrased map of Effective Java, 3rd edition. Use it for item-level navigation and learning summaries; do not treat it as a substitute for the book. ## Object Creation and Destruction 1. Prefer static factories when naming, caching, subtyping, or instance control makes construction clearer. 2. Use builders when constructors would require many optional or interdependent parameters. 3. Enforce singleton properties carefully; enum singletons are often simplest. 4. Prevent instantiation of utility classes with a private constructor. 5. Prefer dependency injection to hard-coded resources. 6. Avoid unnecessary objects, especially in hot paths. 7. Remove obsolete references that prevent garbage collection. 8. Avoid finalizers and cleaners for normal cleanup. 9. Use try-with-resources for deterministic resource release. ## Methods Common to All Objects 10. Override `equals` only when logical equality is needed and can satisfy the full contract. 11. Always override `hashCode` when overriding `equals`. 12. Implement `toString` for useful diagnostics and logging. 13. Prefer copying alternatives to `clone`; if cloning, respect its tricky contract. 14. Implement `Comparable` only with a consistent, documented total ordering. ## Classes and Interfaces 15. Minimize accessibility of every type and member. 16. Use accessors instead of public mutable fields. 17. Minimize mutability; immutable objects are simpler and safer. 18. Favor composition and forwarding over inheritance for reuse. 19. Design and document inheritance deliberately, or prohibit it. 20. Prefer interfaces to abstract classes for type definitions. 21. Design interfaces carefully because default methods can create compatibility traps. 22. Do not use interfaces only to export constants. 23. Prefer class hierarchies to tagged classes with mode fields. 24. Prefer static member classes over nonstatic ones when no enclosing instance is needed. 25. Keep one top-level class per source file. ## Generics 26. Do not use raw types in new code. 27. Eliminate unchecked warnings; suppress only tightly and with justification. 28. Prefer lists to arrays when generics are involved. 29. Favor generic types over casts at use sites. 30. Favor generic methods for reusable type-safe operations. 31. Use bounded wildcards to make APIs flexible. 32. Combine generics and varargs carefully; avoid heap pollution. 33. Use type tokens for type-safe heterogeneous containers. ## Enums and Annotations 34. Use enums instead of integer constants for fixed sets. 35. Do not rely on enum ordinals for data or persistence. 36. Use `EnumSet` instead of bit fields. 37. Use `EnumMap` instead of ordinal indexing. 38. Model extensible enum-like behavior with interfaces when needed. 39. Prefer annotations to naming patterns. 40. Consistently use `@Override`. 41. Use marker interfaces when type relationships matter at compile time. ## Lambdas and Streams 42. Prefer lambdas to anonymous
references/review-checklist.md
# Effective Java Review Checklist Use this checklist when reviewing or refactoring Java code. Start at the top and stop when you have enough high-value findings; avoid dumping every possible style preference. ## 1. Construction and Lifecycle - Static factories: use when a name clarifies intent, instances are controlled or cached, return type can be an interface or subtype, or construction can hide complexity. - Constructors: keep when arguments are few, required, and obvious; avoid telescoping constructors with many optional values. - Builders: use for many optional parameters, cross-field validation, and readable call sites; keep the target object immutable when possible. - Dependency injection: inject clocks, random sources, clients, repositories, configuration, and strategies; avoid global statics for variable resources. - Resource cleanup: use try-with-resources for `AutoCloseable`; avoid finalizers and cleaners except as last-resort safety nets. - Object churn: reuse expensive immutable objects; avoid accidental boxing and regex recompilation in hot paths. ## 2. Object Contracts - `equals`: check reflexive, symmetric, transitive, consistent, and non-null behavior; avoid equality across incompatible subclasses. - `hashCode`: update with every significant equality field; ensure equal objects have equal hashes. - `toString`: include useful state for diagnostics without exposing secrets or unstable implementation details. - `clone`: be skeptical; prefer copy constructors, static copy factories, or builders. - `Comparable`: ensure ordering is consistent, transitive, and documented when inconsistent with `equals`. ## 3. Classes and Interfaces - Visibility: make classes, constructors, methods, fields, and nested types as private or package-private as possible. - Mutability: make fields `final` where practical; protect invariants; avoid leaking mutable internals. - Defensive copies: copy incoming mutable values and outgoing mutable state at trust boundaries. - Inheritance: prefer composition; if inheritable, document override hooks and self-use, or prohibit with `final` or private constructors. - Interfaces: define behavior contracts; avoid constant interfaces; use skeletal implementations only when they reduce repeated correct code. - Nested classes: make nested classes `static` unless they need the enclosing instance. ## 4. Generics and Type Safety - Remove raw types and unchecked warnings at the source; do not suppress broad scopes. - Prefer generic methods and classes over casts at call sites. - Use bounded wildcards for flexibility: `? extends T` for producers, `? super T` for consumers. - Prefer lists to arrays for generic element types; arrays are covariant and reified, generics are invariant and erased. - Guard varargs with generics; use `@SafeVarargs` only when the method does not write into or expose the varargs array unsafely. - Prefer type-safe heterogeneous containers when a map needs keys of different value types. ## 5. Enums
skill-card.md
## Description: Review, refactor, and explain Java code using distilled Effective Java principles for API design, immutability, generics, enums, streams, exceptions, concurrency, and serialization. This skill is ready for commercial/non-commercial use. ## Publisher: [linbingqiang](https://clawhub.ai/user/linbingqiang) ### License/Terms of Use: MIT-0 ## Use Case: Developers and engineers use this skill to review, refactor, and explain Java code through an Effective Java lens, prioritizing correctness, API safety, encapsulation, type safety, concurrency, and maintainability. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Refactoring guidance may lead an agent to change Java source in ways that affect public API compatibility or behavior. Mitigation: Review proposed patches and compatibility assumptions before applying them, especially for public APIs, concurrency guarantees, and serialization compatibility. Risk: Review recommendations may be incomplete when project context is missing. Mitigation: Provide relevant source files, API contracts, tests, and thread-safety or serialization expectations so findings can be grounded in the codebase. ## Reference(s): - [Effective Java Review Checklist](references/review-checklist.md) - [Effective Java Item Map](references/item-map.md) - [ClawHub Skill Page](https://clawhub.ai/linbingqiang/skills/effective-java) ## Skill Output: **Output Type(s):** [Text, Markdown, Code, Guidance] **Output Format:** [Markdown with prioritized findings, explanations, and optional code patches or examples] **Output Parameters:** [1D] **Other Properties Related to Output:** [May include line-referenced review findings, compatibility assumptions, and validation notes.] ## Skill Version(s): 1.0.0 (source: server release metadata) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/linbingqiang/skills/effective-java",
"sourceUrl": "https://clawhub.ai/linbingqiang/skills/effective-java",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T12:07:23.995Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-linbingqiang-effective-java/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-linbingqiang-effective-java/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T12:07:23.995Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/linbingqiang/effective-java",
"sourceUrl": "https://clawhub.ai/linbingqiang/effective-java",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T12:07:23.995Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.0",
"href": "https://clawhub.ai/linbingqiang/effective-java",
"sourceUrl": "https://clawhub.ai/linbingqiang/effective-java",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-20T06:22:55.339Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-linbingqiang-effective-java/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-linbingqiang-effective-java/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.0",
"description": "Initial public release",
"href": "https://clawhub.ai/linbingqiang/effective-java",
"sourceUrl": "https://clawhub.ai/linbingqiang/effective-java",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-20T06:22:55.339Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
