Hexagonal Architecture Layers Java
Gentleman-Programming/Gentleman-Skills
Hexagonal architecture layering for Java services with strict boundaries.
A practical Java reference for Builder, Factory, Singleton, Strategy, Observer and other patterns, with a table matching problems to patterns.
$ npx skills add decebals/claude-code-java --skill design-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install decebals/claude-code-java design-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/decebals/claude-code-java.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/design-patterns .claude/skills/design-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "design-patterns" agent skill from https://github.com/decebals/claude-code-java/tree/main/skills/design-patterns into .claude/skills/design-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "design-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/decebals/claude-code-java/tree/main/skills/design-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add decebals/claude-code-java --skill design-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install decebals/claude-code-java design-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/decebals/claude-code-java.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/design-patterns .agents/skills/design-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "design-patterns" agent skill from https://github.com/decebals/claude-code-java/tree/main/skills/design-patterns into .agents/skills/design-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "design-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add decebals/claude-code-java --skill design-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install decebals/claude-code-java design-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/decebals/claude-code-java.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/design-patterns .cursor/skills/design-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "design-patterns" agent skill from https://github.com/decebals/claude-code-java/tree/main/skills/design-patterns into .cursor/skills/design-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "design-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/decebals/claude-code-java.git --path skills/design-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add decebals/claude-code-java --skill design-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install decebals/claude-code-java design-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/decebals/claude-code-java.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/design-patterns .gemini/skills/design-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "design-patterns" agent skill from https://github.com/decebals/claude-code-java/tree/main/skills/design-patterns into .gemini/skills/design-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "design-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install decebals/claude-code-java design-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add decebals/claude-code-java --skill design-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/decebals/claude-code-java.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/design-patterns .github/skills/design-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "design-patterns" agent skill from https://github.com/decebals/claude-code-java/tree/main/skills/design-patterns into .github/skills/design-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "design-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add decebals/claude-code-java --skill design-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install decebals/claude-code-java design-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/decebals/claude-code-java.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/design-patterns .opencode/skills/design-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "design-patterns" agent skill from https://github.com/decebals/claude-code-java/tree/main/skills/design-patterns into .opencode/skills/design-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "design-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
design-patternsA practical Java reference for Builder, Factory, Singleton, Strategy, Observer and other patterns, with a table matching problems to patterns.
Design patterns are presented for Java with modern examples, including Builder, Factory Method and Singleton among the creational patterns and Strategy and Observer among the behavioral ones, with Decorator, Adapter and Template Method in the quick lookup table. Each pattern gets a use-when line and annotated Java code, often contrasting an antipattern with the better version.
Examples show Lombok's @Builder for builders, Spring-managed alternatives to hand-written factories and singletons, an enum-based thread-safe singleton with a warning about global state, and Strategy both as an interface and as a Java 8 functional interface. A quick table maps problems such as complex construction, swappable algorithms or change notifications to the matching pattern.
Read from SKILL.md and the folder at commit 0d98fe9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are java).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Java Design Patterns Reference loads about 4.4k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 318 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from decebals/claude-code-java at commit 0d98fe9, republished under its MIT licence (© decebals). 318 words, ~4,397 tokens.
.claude/skills/design-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Practical design patterns reference for Java with modern examples.
| Problem | Pattern |
|---|---|
| Complex object construction | Builder |
| Create objects without specifying class | Factory |
| Multiple algorithms, swap at runtime | Strategy |
| Add behavior without changing class | Decorator |
| Notify multiple objects of changes | Observer |
| Ensure single instance | Singleton |
| Convert incompatible interfaces | Adapter |
| Define algorithm skeleton | Template Method |
Use when: Object has many parameters, some optional.
// ❌ Telescoping constructor antipattern
public class User {
public User(String name) { }
public User(String name, String email) { }
public User(String name, String email, int age) { }
public User(String name, String email, int age, String phone) { }
// ... explosion of constructors
}
// ✅ Builder pattern
public class User {
private final String name; // required
private final String email; // required
private final int age; // optional
private final String phone; // optional
private final String address; // optional
private User(Builder builder) {
this.name = builder.name;
this.email = builder.email;
this.age = builder.age;
this.phone = builder.phone;
this.address = builder.address;
}
public static Builder builder(String name, String email) {
return new Builder(name, email);
}
public static class Builder {
// Required
private final String name;
private final String email;
// Optional with defaults
private int age = 0;
private String phone = "";
private String address = "";
private Builder(String name, String email) {
this.name = name;
this.email = email;
}
public Builder age(int age) {
this.age = age;
return this;
}
public Builder phone(String phone) {
this.phone = phone;
return this;
}
public Builder address(String address) {
this.address = address;
return this;
}
public User build() {
return new User(this);
}
}
}
// Usage
User user = User.builder("John", "john@example.com")
.age(30)
.phone("+1234567890")
.build();With Lombok:
@Builder
@Getter
public class User {
private final String name;
private final String email;
@Builder.Default private int age = 0;
private String phone;
}Use when: Need to create objects without specifying exact class.
// ✅ Factory Method pattern
public interface Notification {
void send(String message);
}
public class EmailNotification implements Notification {
@Override
public void send(String message) {
System.out.println("Email: " + message);
}
}
public class SmsNotification implements Notification {
@Override
public void send(String message) {
System.out.println("SMS: " + message);
}
}
public class PushNotification implements Notification {
@Override
public void send(String message) {
System.out.println("Push: " + message);
}
}
// Factory
public class NotificationFactory {
public static Notification create(String type) {
return switch (type.toUpperCase()) {
case "EMAIL" -> new EmailNotification();
case "SMS" -> new SmsNotification();
case "PUSH" -> new PushNotification();
default -> throw new IllegalArgumentException("Unknown type: " + type);
};
}
}
// Usage
Notification notification = NotificationFactory.create("EMAIL");
notification.send("Hello!");With Spring (preferred):
public interface NotificationSender {
void send(String message);
String getType();
}
@Component
public class EmailSender implements NotificationSender {
@Override public void send(String message) { /* ... */ }
@Override public String getType() { return "EMAIL"; }
}
@Component
public class SmsSender implements NotificationSender {
@Override public void send(String message) { /* ... */ }
@Override public String getType() { return "SMS"; }
}
@Component
public class NotificationFactory {
private final Map<String, NotificationSender> senders;
public NotificationFactory(List<NotificationSender> senderList) {
this.senders = senderList.stream()
.collect(Collectors.toMap(
NotificationSender::getType,
Function.identity()
));
}
public NotificationSender getSender(String type) {
return Optional.ofNullable(senders.get(type))
.orElseThrow(() -> new IllegalArgumentException("Unknown: " + type));
}
}Use when: Exactly one instance needed (use sparingly!).
// ✅ Modern singleton (enum-based, thread-safe)
public enum DatabaseConnection {
INSTANCE;
private Connection connection;
DatabaseConnection() {
// Initialize connection
}
public Connection getConnection() {
return connection;
}
}
// Usage
Connection conn = DatabaseConnection.INSTANCE.getConnection();With Spring (preferred):
@Component // Default scope is singleton
public class DatabaseConnection {
// Spring manages single instance
}Warning: Singletons can be problematic:
Use when: Multiple algorithms for same operation, need to swap at runtime.
// ✅ Strategy pattern
public interface PaymentStrategy {
void pay(BigDecimal amount);
}
public class CreditCardPayment implements PaymentStrategy {
private final String cardNumber;
public CreditCardPayment(String cardNumber) {
this.cardNumber = cardNumber;
}
@Override
public void pay(BigDecimal amount) {
System.out.println("Paid " + amount + " with card " + cardNumber);
}
}
public class PayPalPayment implements PaymentStrategy {
private final String email;
public PayPalPayment(String email) {
this.email = email;
}
@Override
public void pay(BigDecimal amount) {
System.out.println("Paid " + amount + " via PayPal: " + email);
}
}
public class CryptoPayment implements PaymentStrategy {
private final String walletAddress;
public CryptoPayment(String walletAddress) {
this.walletAddress = walletAddress;
}
@Override
public void pay(BigDecimal amount) {
System.out.println("Paid " + amount + " to wallet: " + walletAddress);
}
}
// Context
public class ShoppingCart {
private PaymentStrategy paymentStrategy;
public void setPaymentStrategy(PaymentStrategy strategy) {
this.paymentStrategy = strategy;
}
public void checkout(BigDecimal total) {
paymentStrategy.pay(total);
}
}
// Usage
ShoppingCart cart = new ShoppingCart();
cart.setPaymentStrategy(new CreditCardPayment("4111-1111-1111-1111"));
cart.checkout(new BigDecimal("99.99"));
// Change strategy at runtime
cart.setPaymentStrategy(new PayPalPayment("user@example.com"));
cart.checkout(new BigDecimal("49.99"));With Java 8+ (functional):
// Strategy as functional interface
@FunctionalInterface
public interface PaymentStrategy {
void pay(BigDecimal amount);
}
// Usage with lambdas
PaymentStrategy creditCard = amount ->
System.out.println("Card payment: " + amount);
PaymentStrategy paypal = amount ->
System.out.println("PayPal payment: " + amount);
cart.setPaymentStrategy(creditCard);Use when: Objects need to be notified of changes in another object.
// ✅ Observer pattern (modern Java)
public interface OrderObserver {
void onOrderPlaced(Order order);
}
public class OrderService {
private final List<OrderObserver> observers = new ArrayList<>();
public void addObserver(OrderObserver observer) {
observers.add(observer);
}
public void removeObserver(OrderObserver observer) {
observers.remove(observer);
}
public void placeOrder(Order order) {
// Process order
saveOrder(order);
// Notify all observers
observers.forEach(observer -> observer.onOrderPlaced(order));
}
}
// Observers
public class InventoryService implements OrderObserver {
@Override
public void onOrderPlaced(Order order) {
// Reduce inventory
order.getItems().forEach(item ->
reduceStock(item.getProductId(), item.getQuantity())
);
}
}
public class EmailNotificationService implements OrderObserver {
@Override
public void onOrderPlaced(Order order) {
sendConfirmationEmail(order.getCustomerEmail(), order);
}
}
public class AnalyticsService implements OrderObserver {
@Override
public void onOrderPlaced(Order order) {
trackOrderEvent(order);
}
}
// Setup
OrderService orderService = new OrderService();
orderService.addObserver(new InventoryService());
orderService.addObserver(new EmailNotificationService());
orderService.addObserver(new AnalyticsService());With Spring Events (preferred):
// Event
public record OrderPlacedEvent(Order order) {}
// Publisher
@Service
public class OrderService {
private final ApplicationEventPublisher eventPublisher;
public void placeOrder(Order order) {
saveOrder(order);
eventPublisher.publishEvent(new OrderPlacedEvent(order));
}
}
// Listeners (observers)
@Component
public class InventoryListener {
@EventListener
public void handleOrderPlaced(OrderPlacedEvent event) {
// Reduce inventory
}
}
@Component
public class EmailListener {
@EventListener
public void handleOrderPlaced(OrderPlacedEvent event) {
// Send email
}
@EventListener
@Async // Async processing
public void handleOrderPlacedAsync(OrderPlacedEvent event) {
// Send email asynchronously
}
}Use when: Define algorithm skeleton, let subclasses fill in steps.
// ✅ Template Method pattern
public abstract class DataProcessor {
// Template method - defines the algorithm
public final void process() {
readData();
processData();
writeData();
if (shouldNotify()) {
notifyCompletion();
}
}
// Steps to be implemented by subclasses
protected abstract void readData();
protected abstract void processData();
protected abstract void writeData();
// Hook - optional override
protected boolean shouldNotify() {
return true;
}
protected void notifyCompletion() {
System.out.println("Processing completed!");
}
}
public class CsvDataProcessor extends DataProcessor {
@Override
protected void readData() {
System.out.println("Reading CSV file...");
}
@Override
protected void processData() {
System.out.println("Processing CSV data...");
}
@Override
protected void writeData() {
System.out.println("Writing to database...");
}
}
public class ApiDataProcessor extends DataProcessor {
@Override
protected void readData() {
System.out.println("Fetching from API...");
}
@Override
protected void processData() {
System.out.println("Transforming API response...");
}
@Override
protected void writeData() {
System.out.println("Writing to cache...");
}
@Override
protected boolean shouldNotify() {
return false; // Override hook
}
}
// Usage
DataProcessor csvProcessor = new CsvDataProcessor();
csvProcessor.process();
DataProcessor apiProcessor = new ApiDataProcessor();
apiProcessor.process();Use when: Add behavior dynamically without modifying existing classes.
// ✅ Decorator pattern
public interface Coffee {
String getDescription();
BigDecimal getCost();
}
public class SimpleCoffee implements Coffee {
@Override
public String getDescription() {
return "Coffee";
}
@Override
public BigDecimal getCost() {
return new BigDecimal("2.00");
}
}
// Base decorator
public abstract class CoffeeDecorator implements Coffee {
protected final Coffee coffee;
public CoffeeDecorator(Coffee coffee) {
this.coffee = coffee;
}
@Override
public String getDescription() {
return coffee.getDescription();
}
@Override
public BigDecimal getCost() {
return coffee.getCost();
}
}
// Concrete decorators
public class MilkDecorator extends CoffeeDecorator {
public MilkDecorator(Coffee coffee) {
super(coffee);
}
@Override
public String getDescription() {
return coffee.getDescription() + ", Milk";
}
@Override
public BigDecimal getCost() {
return coffee.getCost().add(new BigDecimal("0.50"));
}
}
public class SugarDecorator extends CoffeeDecorator {
public SugarDecorator(Coffee coffee) {
super(coffee);
}
@Override
public String getDescription() {
return coffee.getDescription() + ", Sugar";
}
@Override
public BigDecimal getCost() {
return coffee.getCost().add(new BigDecimal("0.20"));
}
}
public class WhippedCreamDecorator extends CoffeeDecorator {
public WhippedCreamDecorator(Coffee coffee) {
super(coffee);
}
@Override
public String getDescription() {
return coffee.getDescription() + ", Whipped Cream";
}
@Override
public BigDecimal getCost() {
return coffee.getCost().add(new BigDecimal("0.70"));
}
}
// Usage - compose decorators
Coffee coffee = new SimpleCoffee();
coffee = new MilkDecorator(coffee);
coffee = new SugarDecorator(coffee);
coffee = new WhippedCreamDecorator(coffee);
System.out.println(coffee.getDescription()); // Coffee, Milk, Sugar, Whipped Cream
System.out.println(coffee.getCost()); // 3.40Java I/O uses Decorator:
// Classic example from Java
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new FileInputStream("file.txt")
)
);Use when: Make incompatible interfaces work together.
// ✅ Adapter pattern
// Existing interface our code uses
public interface MediaPlayer {
void play(String filename);
}
// Legacy/third-party interface
public class LegacyAudioPlayer {
public void playMp3(String filename) {
System.out.println("Playing MP3: " + filename);
}
}
public class AdvancedVideoPlayer {
public void playMp4(String filename) {
System.out.println("Playing MP4: " + filename);
}
public void playAvi(String filename) {
System.out.println("Playing AVI: " + filename);
}
}
// Adapters
public class Mp3PlayerAdapter implements MediaPlayer {
private final LegacyAudioPlayer legacyPlayer = new LegacyAudioPlayer();
@Override
public void play(String filename) {
legacyPlayer.playMp3(filename);
}
}
public class VideoPlayerAdapter implements MediaPlayer {
private final AdvancedVideoPlayer videoPlayer = new AdvancedVideoPlayer();
@Override
public void play(String filename) {
if (filename.endsWith(".mp4")) {
videoPlayer.playMp4(filename);
} else if (filename.endsWith(".avi")) {
videoPlayer.playAvi(filename);
}
}
}
// Usage
MediaPlayer mp3Player = new Mp3PlayerAdapter();
mp3Player.play("song.mp3");
MediaPlayer videoPlayer = new VideoPlayerAdapter();
videoPlayer.play("movie.mp4");| Situation | Consider |
|---|---|
| Object creation is complex | Builder, Factory |
| Need to add features dynamically | Decorator |
| Multiple implementations of algorithm | Strategy |
| React to state changes | Observer |
| Integrate with legacy code | Adapter |
| Common algorithm, varying steps | Template Method |
| Need single instance | Singleton (use sparingly) |
| Anti-Pattern | Problem | Better Approach |
|---|---|---|
| Singleton abuse | Global state, hard to test | Dependency Injection |
| Factory everywhere | Over-engineering | Simple new if type is known |
| Deep decorator chains | Hard to debug | Keep chains short, consider composition |
| Observer with many events | Spaghetti notifications | Event bus, clear event hierarchy |
solid-principles - Design principles that patterns help implementclean-code - Code-level best practicesspring-boot-patterns - Spring-specific implementations© decebals, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/design-patterns of decebals/claude-code-java.
Open the folder on GitHubat commit 0d98fe9
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in decebals/claude-code-java, which our catalogue first saw on October 7, 2026.
Java Design Patterns Reference next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Java Design Patterns Reference this skilldecebals/claude-code-java | 750 | 1 repos | ~4.4k | Automated safety check: Pass | MIT | |
| Hexagonal Architecture Layers JavaGentleman-Programming/Gentleman-Skills | 657 | — | ~1k | Automated safety check: Pass | MIT | |
| Swiftui View RefactorDimillian/Skills | 4k | 5 repos | ~2k | Automated safety check: Pass | MIT | |
| RTK Rust Design Patternsrtk-ai/rtk | 83k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Architecture PatternsKartikLabhshetwar/better-shot | 2.4k | 2 repos | ~1.4k | Automated safety check: Pass | Custom licence | |
| AST Visitor Pattern for Unionsprisma/orm | 48k | — | ~830 | Automated safety check: Pass | Apache-2.0 |
Gentleman-Programming/Gentleman-Skills
Hexagonal architecture layering for Java services with strict boundaries.
Dimillian/Skills
Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage.
rtk-ai/rtk
Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.
KartikLabhshetwar/better-shot
Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.
prisma/orm
Replaces a plain TypeScript union plus switch statements with frozen subclasses and a visitor interface when several places dispatch on the same variants.
ramziddin/solid-skills
A skill your agent uses when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging.
decebals/claude-code-java
Reviews REST API design for correct HTTP verbs, versioning, DTO use, consistent responses and backward compatibility before an API change ships.
decebals/claude-code-java
Reviews a Java project's architecture at the macro level: package structure, module boundaries, dependency direction and layering.
decebals/claude-code-java
JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries).
decebals/claude-code-java
Java logging best practices with SLF4J, structured logging (JSON), and MDC for request tracing.
decebals/claude-code-java
Builds changelog entries from conventional commits in a Java project, after working out whether it uses SemVer, two-part versions or calendar versions.
decebals/claude-code-java
Covers Clean Code principles for Java: DRY, KISS and YAGNI with before-and-after examples, plus naming conventions for variables and booleans.
Works with
Categories
A practical Java reference for Builder, Factory, Singleton, Strategy, Observer and other patterns, with a table matching problems to patterns. Design patterns are presented for Java with modern examples, including Builder, Factory Method and Singleton among the creational patterns and Strategy and Observer among the behavioral ones, with Decorator, Adapter and Template Method in the quick lookup table. Each pattern gets a use-when line and annotated Java code, often contrasting an antipattern with the better version.
Java Design Patterns Reference fits situations like: implementing a specific pattern such as Builder, Factory or Strategy; designing extensible components in a Java codebase; refactoring rigid code with a suitable pattern; picking a pattern for a given design problem.
Run `npx skills add decebals/claude-code-java --skill design-patterns -a claude-code`. Or copy the skill folder (skills/design-patterns in decebals/claude-code-java) into .claude/skills/design-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add decebals/claude-code-java --skill design-patterns -a codex`. Or copy the skill folder (skills/design-patterns in decebals/claude-code-java) into .agents/skills/design-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add decebals/claude-code-java --skill design-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/design-patterns, .gemini/skills/design-patterns, .github/skills/design-patterns and .opencode/skills/design-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Java Design Patterns Reference is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Java Design Patterns Reference is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.4k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Java Design Patterns Reference: Hexagonal Architecture Layers Java (Gentleman-Programming/Gentleman-Skills, 657 stars), Swiftui View Refactor (Dimillian/Skills, 4k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars) and Architecture Patterns (KartikLabhshetwar/better-shot, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
decebals (a GitHub user) maintains it in decebals/claude-code-java, which has 750 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on September 6, 2026.
Source: decebals/claude-code-java on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.