Skip to content
thebushidocollective avatar

Solid Principles

Guide to the five SOLID design principles with Elixir and TypeScript code examples for each.

CCM score
46 of 100
skills.sh installs
618
GitHub stars
202
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion, each with a bad and good pattern
  • Includes an "Ask yourself" question per principle, plus before-coding, during-implementation, and code-review checklists
  • Provides Elixir behaviour-based and TypeScript composition-based examples for extending code without modifying existing modules
  • Designed for implementation-time design decisions when structuring modules, functions, and components for maintainability

Install

$ npx -y skills add thebushidocollective/han --skill solid-principles -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

SOLID Principles

Apply SOLID design principles for maintainable, flexible code architecture.

The Five Principles

1. Single Responsibility Principle (SRP)

A module should have one, and only one, reason to change

Elixir Pattern

# BAD - Multiple responsibilities
defmodule UserManager do
  def create_user(attrs) do
    # Creates user
    # Sends welcome email
    # Logs to analytics
    # Updates cache
  end
end

# GOOD - Single responsibility
defmodule User do
  def create(attrs), do: Repo.insert(changeset(attrs))
end

defmodule UserNotifier do
  def send_welcome_email(user), do: # email logic
end

defmodule UserAnalytics do
  def track_signup(user), do: # analytics logic
end

TypeScript Pattern

// BAD - Multiple responsibilities
class UserComponent {
  render() { /* UI */ }
  fetchData() { /* API */ }
  formatDate() { /* Formatting */ }
  validateInput() { /* Validation */ }
}

// GOOD - Single responsibility
function UserProfile({ user }: Props) {
  return <View>{/* UI only */}</View>;
}

function useUserData(id: string) {
  // Data fetching only
}

function formatUserDate(date: Date): string {
  // Formatting only
}

Details

Repository
github.com/thebushidocollective/han
Categories
Code Review & Quality, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the solid-principles skill do?

It applies the five SOLID design principles, covering single responsibility, open/closed, Liskov substitution, interface segregation and dependency inversion, to the modules, functions and components an agent designs during implementation. The skill includes Elixir and TypeScript patterns showing bad and good code for each principle.

How do I install the solid-principles skill?

Run npx -y skills add thebushidocollective/han --skill solid-principles -y in your project. The skill then lets the agent check its designs against SOLID principles while it writes code.

Which other skills are in the same category as solid-principles?

solid-principles sits in the Code Review & Quality category, alongside improve-codebase-architecture, codebase-design, code-review, setup-ts-deep-modules and caveman-review. It focuses on design-time principles rather than reviewing existing code.

More from thebushidocollective/han

All 14

Similar to Solid Principles

More Code Review & Quality