A skills.sh skill that applies Gang-of-Four design patterns and clean-code principles to write well-structured, maintainable, best-practice object-oriented code.
Distilled from Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, Helm, Johnson, Vlissides) into a decision-first guide: pick the pattern from what you want to vary, apply the principles that prevent the coupling in the first place, and resist over-engineering.
- 5 governing principles — program to an interface, favor composition over inheritance, encapsulate what varies, single responsibility, decouple the caller.
- The selection table — "what you want to vary → which pattern" (the fastest picker).
- Full catalog of all 23 GoF patterns — intent, when to apply, participants, and consequences/trade-offs.
- Clean-code rules and a
project-refactorsub-workflow for safely refactoring a whole project into design-pattern-rich code without breaking it.
Install into all your agents (Claude Code, Codex, Cursor, OpenCode, and 70+ more):
npx skills add MamounHisham1/design-patternsInstall into a specific agent only:
npx skills add MamounHisham1/design-patterns -a claude-codeInstall globally (available across all projects):
npx skills add MamounHisham1/design-patterns -gUse it once without installing:
npx skills use MamounHisham1/design-patternsOnce installed, the skill is auto-discovered. Ask your agent things like:
- "Design a notification system that decouples senders from handlers"
- "This module is tangled — refactor it cleanly"
- "Make this project design-pattern-rich / best practice" → triggers the
project-refactorworkflow
The project-refactor workflow runs a strict safety pipeline: scope → survey → inventory → plan → branch → (optionally parallelize) → execute → verify → summarize. It never breaks the project, always branches first (and asks before creating the branch), and asks before parallelizing with subagents.
MIT — see LICENSE.