Install any skill in seconds. Free to start, no credit card required.
Get Started Free →decebals/design-patterns
Common design patterns with Java examples (Factory, Builder, Strategy, Observer, Decorator, etc.).
Passed 8 of 23 test cases with the skill, and 15 of 23 without it.
1 fixed20 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I have data processors for CSV files and REST APIs that follow the exact same lifecycle: read data, process data, write data, and optionally notify completion. Right now, each class duplicates the process loop logic. How should I structure this in Java so subclasses only supply step details and can optionally override notification?
| Checked | Without skill | With skill |
|---|---|---|
| Defines a final template method in an abstract base class. | Passed | Passed |
| Declares abstract protected methods for mandatory steps like reading, processing, and writing. | Passed | Passed |
| Provides a protected hook method returning a boolean that subclasses can override. | Missed | Passed |
The instructions your model reads when the skill loads.
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) { }
test cases passed, vs 15 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.