From plugin-frontend
Applies design patterns (Singleton, Factory, Observer, Strategy, etc.) to refactor code architecture, implement extensible systems, and follow SOLID principles.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plugin-frontend:design-patterns-implementationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Apply proven design patterns to create maintainable, extensible, and testable code architectures.
Minimal working example:
class DatabaseConnection {
private static instance: DatabaseConnection;
private connection: any;
private constructor() {
this.connection = this.createConnection();
}
public static getInstance(): DatabaseConnection {
if (!DatabaseConnection.instance) {
DatabaseConnection.instance = new DatabaseConnection();
}
return DatabaseConnection.instance;
}
private createConnection() {
return {
/* connection logic */
};
}
}
// Usage
const db1 = DatabaseConnection.getInstance();
const db2 = DatabaseConnection.getInstance();
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Singleton Pattern | Singleton Pattern |
| Factory Pattern | Factory Pattern |
| Observer Pattern | Observer Pattern |
| Strategy Pattern | Strategy Pattern |
| Decorator Pattern | Decorator Pattern |
| Repository Pattern | Repository Pattern |
| Dependency Injection | Dependency Injection |
npx claudepluginhub denissanthiago/plugin-frontend-claude-codeConsults design pattern catalog before implementing or refactoring code to check for matching patterns and follow established implementations.
Gang of Four patterns (Creational, Structural, Behavioral) and when to apply them.
Covers 26 Gang of Four design patterns with PHP 8.3+ implementations, UML diagrams, and practical use cases.