
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-codeInstalls 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- Docker Compose Production485
- Angular Rxjs Patterns289
- Django Rest Framework263
- Cpp Modern Features245
- Tailwind Responsive Design235
- Bdd Patterns208
- Storybook Component Documentation165
- Reactflow Fundamentals138
- PHP Security Patterns
- Android Jetpack Compose2.2K
- Fastapi Async Patterns958
- Atomic Design Fundamentals780
- Storybook Story Writing678