design-patterns

Recommend design patterns and SOLID refactors to reduce coupling and improve modularity.

7|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/camilooscargbaptista/cto-toolkit --skill design-patterns-camilooscargbaptista
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-patterns
Source: https://github.com/camilooscargbaptista/cto-toolkit/tree/main/design-patterns
Command: npx skills add https://github.com/camilooscargbaptista/cto-toolkit --skill design-patterns-camilooscargbaptista

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps engineers and architects choose and apply appropriate design patterns, SOLID principles, and Clean Architecture to reduce coupling, increase cohesion, and make codebases easier to maintain and evolve.

Core Features & Use Cases

  • Pattern Selection & Rationale: Maps common code smells to candidate patterns (Factory, Strategy, Adapter, Repository, etc.) and explains why each fits the context.
  • SOLID & Architecture Guidance: Prescribes SRP, OCP, LSP, ISP, and DIP applications and demonstrates layered Clean Architecture organization for safer boundaries.
  • Refactoring Plans & Examples: Provides step-by-step refactor sequences with before/after explanations and trade-offs for adoption in refactors, code reviews, and migration to DDD or modular architectures.
  • Anti-pattern Detection: Identifies god classes, shotgun surgery, feature envy, and spaghetti code and recommends corrective patterns or architectural changes.
  • Use Case: During a design review, receive concrete recommendations to restructure a monolith into bounded contexts, create repositories and ports, and implement dependency inversion with adapters.

Quick Start

Analyze my codebase and recommend appropriate design patterns, SOLID refactors, and an actionable refactoring plan to improve modularity, reduce coupling, and increase cohesion.

Frequently Asked Questions about design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right design pattern to fix code smells like god classes and shotgun surgery?

To fix code smells like god classes and shotgun surgery, choose the right design pattern by mapping the specific code smell to candidate patterns such as Factory, Strategy, or Adapter. The Skill analyzes your codebase to recommend patterns that reduce coupling and increase cohesion.

How do I refactor a monolith into bounded contexts using Clean Architecture?

Refactoring a monolith into bounded contexts using Clean Architecture involves creating repositories and ports, implementing dependency inversion with adapters, and establishing safer layered boundaries. The Skill provides concrete step-by-step refactor sequences with before/after explanations and trade-offs.

What is the best way to apply SOLID principles during a code review?

The best way to apply SOLID principles during a code review is to check for SRP, OCP, LSP, ISP, and DIP applications. The Skill prescribes specific SOLID applications and demonstrates layered Clean Architecture organization to ensure safer boundaries and improved modularity.

Can I get a refactoring plan for migrating to Domain-Driven Design across my services?

Yes, you can get a refactoring plan for migrating to Domain-Driven Design across services and modules. The Skill produces actionable refactoring steps, trade-off analysis, and example code snippets that respect SOLID principles and layered dependency rules.

When should I not use the Repository pattern in my architecture?

You should not use the Repository pattern when applying it would introduce unnecessary abstraction layers without reducing coupling or improving maintainability. The Skill provides trade-off analysis for pattern adoption, ensuring you only implement architectural changes when they provide clear modularity benefits.