solid-principles

Apply SOLID design principles to Elixir and TypeScript modules.

187|20|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/TheBushidoCollective/han --skill solid-principles-thebushidocollective
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solid-principles
Source: https://github.com/TheBushidoCollective/han/tree/main/core/skills/solid-principles
Command: npx skills add https://github.com/TheBushidoCollective/han --skill solid-principles-thebushidocollective

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides applying SOLID design principles to modules, functions, and components for better maintainability and extensibility.

Core Features & Use Cases

  • SRP & OCP: Separate concerns and open/closed design patterns.
  • LSP & ISP: Subtyping contracts and focused interfaces.
  • Concrete Examples: Real-world patterns in Elixir and TypeScript to illustrate principles.

Quick Start

Review a module and identify a single responsibility, then refactor to split responsibilities and add a small, focused test.

Frequently Asked Questions about solid-principles

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

FAQPage Schema
How do I apply SOLID principles to make my code more maintainable?

SOLID principles guide separating concerns, defining clear responsibilities, and structuring dependencies to reduce coupling and improve maintainability. Start by identifying single responsibilities in your modules, then refactor to split concerns and add focused tests.

What's the difference between single responsibility and interface segregation?

Single responsibility means each module handles one reason to change. Interface segregation means clients depend only on methods they use, not bloated interfaces. Together they eliminate unnecessary coupling and make refactoring safer.

Can I apply SOLID principles in TypeScript and Elixir?

Yes. SOLID applies across languages through language-appropriate patterns: TypeScript uses interfaces and class hierarchies; Elixir uses behaviours and protocol-based composition. Both satisfy the five principles with idiomatic implementations.

How do I know if my modules violate the open/closed principle?

The open/closed principle means modules should be open for extension but closed for modification. If adding new features requires changing existing code rather than adding new implementations, your design is too tightly coupled to specifics.

What does Liskov substitution mean for my interfaces?

Liskov substitution ensures subtypes can replace their parent types without breaking behavior. Violating it causes unexpected errors when code relies on inherited contracts. Enforce it by ensuring derived types honor parent contracts exactly.

When should I refactor code to follow SOLID instead of leaving it alone?

Refactor when adding features requires modifying existing modules, tests become fragile, or responsibilities blur across functions. SOLID prevents these pain points; apply it during implementation and when refactoring reaches natural boundaries.