thebushidocollective avatar

Solid Principles

A practical reference for applying SOLID principles in Elixir and TypeScript codebases. Pulls in automatically when you're designing modules, functions, or components that need solid architectural patterns. Each principle gets concrete before/after examples showing what violates it and how to fix it, plus a quick mental checklist question like "Can I add new functionality without changing existing code?" The checklists are genuinely useful during implementation and code review. It won't refactor your code for you, but having these patterns on hand when you're about to tightly couple something or create a god module is better than remembering them three commits later.

skills.sh installs
590
GitHub stars
200
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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
}

Sponsors

Details

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

More from thebushidocollective/han

All 14
1alirezarezvani avatarhelm-chart-builderalirezarezvani/claude-skillsHelm chart development agent skill and plugin for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw — chart scaffolding, values design, template patterns, depend585skills.sh installs
2solatis avatarcodebase-analysissolatis/claude-configInvoke IMMEDIATELY via python script when user requests codebase understanding, architecture comprehension, or repository orientation. Do NOT explore first - th584skills.sh installs
3googleworkspace avatarrecipe-triage-security-alertsgoogleworkspace/cliList and review Google Workspace security alerts from Alert Center.583skills.sh installs
4parcadei avatarexploreparcadei/continuous-claude-v3Meta-skill for internal codebase exploration at varying depths (quick/deep/architecture)580skills.sh installs
5qodex-ai avatarcreative-generation-agentqodex-ai/ai-agent-skillsBuild agents that generate creative content including music, memes, podcasts, and multimedia. Covers generative models, content synthesis, style transfer, and c572skills.sh installs
6wanshuiyin avatarauto-paper-improvement-loopwanshuiyin/auto-claude-code-research-in-sleepAutonomously improve a generated paper via GPT-5.6-Sol xhigh review → implement fixes → recompile, for 2 rounds. Use when user says "改论文", "improve paper", "论文润572skills.sh installs