Skip to content

decebals/claude-code-java / skills/design-patterns

design-patterns

Unverified

Common design patterns with Java examples (Factory, Builder, Strategy, Observer, Decorator, etc.). Use when user asks "implement pattern", "use factory", "strategy pattern", or when designing extensible components.

FileKindSize
README.mdmarkdown1.7 KB
SKILL.mdskill md17.2 KB
# Design Patterns

**Load**: `view .claude/skills/design-patterns/SKILL.md`

---

## Description

Common design patterns with practical Java examples. Covers creational, behavioral, and structural patterns with modern Java syntax and Spring integration.

---

## Use Cases

- "Implement factory pattern for notifications"
- "Use builder for this complex object"
- "How to add features without modifying class?" (Decorator)
- "Multiple payment methods, swap at runtime" (Strategy)
- "Notify multiple services when order placed" (Observer)

---

## Examples

```
> view .claude/skills/design-patterns/SKILL.md
> "I need to create different report types (PDF, Excel, CSV)"
→ Suggests Factory pattern with implementation example
```

---

## Patterns Covered

| Category | Patterns |
|----------|----------|
| **Creational** | Builder, Factory Method, Singleton |
| **Behavioral** | Strategy, Observer, Template Method |
| **Structural** | Decorator, Adapter |

---

## Quick Selection Guide

| Problem | Pattern |
|---------|---------|
| Many constructor parameters | Builder |
| Create without specifying class | Factory |
| Swap algorithms at runtime | Strategy |
| Add behavior dynamically | Decorator |
| Notify multiple objects | Observer |
| Integrate legacy code | Adapter |

---

## Related Skills

- `solid-principles` - Principles patterns implement
- `clean-code` - Code-level practices
- `spring-boot-patterns` - Spring implementations

---

## Resources

- [Refactoring Guru - Design Patterns](https://refactoring.guru/design-patterns)
- [Design Patterns by Gang of Four](https://www.oreilly.com/library/view/design-patterns-elements/0201633612/)
- [Java Design Patterns (java-design-patterns.com)](https://java-design-patterns.com/)
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 318kUpdated Claude CodeCodexUnverifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 196kUpdated Claude CodeCodexVerifiedInstall