design-patterns-implementation
Apply appropriate design patterns (Singleton, Factory, Observer, Strategy, etc.) to solve architectural problems. Use when refactoring code architecture, implementing extensible systems, or following SOLID principles.
How do I install this agent skill?
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill design-patterns-implementationIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides reference guides and code templates for common software design patterns like Singleton, Factory, and Observer. It includes documentation and a placeholder shell script for test scaffolding. No malicious code, data exfiltration patterns, or obfuscation techniques were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
10 files scanned · No issues
- ZeroLeakspass
Score: 93/100 · 2 sections analyzed
What does this agent skill do?
Design Patterns Implementation
Table of Contents
Overview
Apply proven design patterns to create maintainable, extensible, and testable code architectures.
When to Use
- Solving common architectural problems
- Making code more maintainable and testable
- Implementing extensible plugin systems
- Decoupling components
- Following SOLID principles
- Code reviews identifying architectural issues
Quick Start
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)
Reference Guides
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 |
Best Practices
✅ DO
- Choose patterns that solve actual problems
- Keep patterns simple and understandable
- Document why patterns were chosen
- Consider testability
- Follow SOLID principles
- Use dependency injection
- Prefer composition over inheritance
❌ DON'T
- Apply patterns without understanding them
- Over-engineer simple solutions
- Force patterns where they don't fit
- Create unnecessary abstraction layers
- Ignore team familiarity with patterns
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/aj-geddes/useful-ai-prompts/design-patterns-implementation">View design-patterns-implementation on skillZs</a>