From java-core
Detects GoF design patterns like Singleton, Builder, Decorator, Strategy in Java code (Java 8+) or recommends patterns for problems with minimal implementations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/java-core:java-design-patternThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Either detect which design patterns are used in the provided code, or recommend the right pattern for a described problem. Tailor all examples to the detected Java version (Java 8+).
Either detect which design patterns are used in the provided code, or recommend the right pattern for a described problem. Tailor all examples to the detected Java version (Java 8+).
Scan the code for these common patterns and name them explicitly:
Creational:
volatile or enum)create() or of() returning an interface typeBuilder class with fluent setters and build()Structural:
@Transactional, @Cacheable, @Async are all proxies; flag manual proxies*Adapter or *Wrapper class name)Behavioral:
ApplicationEvent / @EventListener or manual listener listfinal algorithm method calling overridable stepsFor each detected pattern: name it, show the key code that reveals it, explain how it's used here.
When the user describes a problem, recommend the most appropriate pattern:
| Problem | Recommended Pattern |
|---|---|
| Need multiple algorithms interchangeable at runtime | Strategy |
| Object creation is complex, many optional fields | Builder |
| Need to add behaviour without modifying existing class | Decorator |
| Need to notify multiple objects when state changes | Observer |
| Complex subsystem needs a simple interface | Facade |
| Same operation on tree structures | Composite |
| Object has distinct lifecycle states | State |
| Need only one instance globally | Singleton (or Spring @Component) |
Show a minimal Java implementation for the recommended pattern, appropriate for the detected Java version:
Function<T,R>)Mode A: List each detected pattern with: name + location + explanation + any concerns (e.g., non-thread-safe Singleton) Mode B: Recommend pattern + minimal before/after code + when to use vs alternatives
/java-solid to check if patterns are applied correctlyjava-architect agent for full design guidancenpx claudepluginhub ducpm2303/claude-java-plugins --plugin java-coreDecision guide for the 23 Gang of Four patterns. Maps code symptoms and goals to the right pattern, then loads the structural recipe.
Gang of Four patterns (Creational, Structural, Behavioral) and when to apply them.
Recommends creational, structural, behavioral, and distributed design patterns with implementations, unit tests, and trade-offs; detects anti-patterns like God Object, circular dependencies, and primitive obsession.