orthogonality-principle
БесплатноБез исполняемых скриптовНе проверенUse when designing modules, APIs, and system architecture requiring independent, non-overlapping components where changes in one don't affect others.
от TheBushidoCollective★ 202 звезды на GitHubОб этом скилле
Orthogonality Principle
Build systems where components are independent and changes don't ripple unexpectedly.
What is Orthogonality?
Orthogonal (from mathematics): Two lines are orthogonal if they're at right angles - changing one doesn't affect the other.
In software: Components are orthogonal when changing one doesn't require changing others. They are independent and non-overlapping.
Benefits
- Changes are localized (less debugging)
- Easy to test in isolation
- Components are reusable
- Less coupling = less complexity
- Easier to understand and maintain
Signs of Non-Orthogonality
Red flags indicating components are NOT orthogonal
- Change amplification: Changing one thing requires changing many others
- Shotgun surgery: One feature scattered across many files
- Tight coupling: Components know too much about each other
- Duplicate logic: Same concept implemented multiple ways
- Cascading changes: Change in A breaks B, C, D unexpectedly
Achieving Orthogonality
1. Separation of Concerns
Keep unrelated responsibilities separate
Elixir Example
# NON-ORTHOGONAL - Mixed concerns
defmodule UserController do
def create(conn, params) do
# Validation
if valid_email?(params["email"]) do
# Database
user = Repo.insert!(%User{email: params["email"]})
# External API
Stripe.create_customer(user.email)
# Notification
Email.send_welcome(user.email)
# Logging
Logger.info("Created user #{user.id}")
# Response
json(conn, %{user: user})
end
end
end
# Changing email format affects validation, database, Stripe, email!
# ORTHOGONAL - Separated concerns
defmodule UserController do
def create(conn, params) do
with {:ok, command} <- build_command(params),
{:ok, user} <- UserService.create(command) do
json(conn, %{user: user})
end
end
end
defmodule UserService do
def create(command) do
with {:ok, user} <- Repo.insert(User.changeset(command)),
:ok <- BillingService.setup_customer(user),
:ok <- NotificationService.welcome(user) do
{:ok, user}
end
end
end
# Now can change billing without touching notifications
# Can change notifications without touching database
# Each service is orthogonal
TypeScript Example
// NON-ORTHOGONAL - Everything in one component
function TaskList() {
const [tasks, setTasks] = useState<Task[]>([]);
const [filters, setFilters] = useState<Filters>({});
const [sorting, setSorting] = useState<Sort>({ field: 'date', dir: 'asc' });
// Data fetching
useEffect(() => {
fetch('/api/tasks').then(res => res.json()).then(setTasks);
}, []);
// Filtering logic
const filtered = tasks.filter(gig => {
if (filters.status && gig.status !== filters.status) return false;
if (filters.location && !gig.location.includes(filters.location)) return false;
return true;
});
// Sorting logic
const sorted = [...filtered].sort((a, b) => {
const aVal = a[sorting.field];
const bVal = b[sorting.field];
return sorting.dir === 'asc' ? aVal - bVal : bVal - aVal;
});
// Rendering
return (
<View>
{/* Filters UI */}
{/* Sorting UI */}
{/* List UI */}
</View>
);
}
// Changing filtering affects fetching, sorting, rendering!
// ORTHOGONAL - Separated concerns
function useTaskData() {
const [tasks, setTasks] = useState<Task[]>([]);
useEffect(() => {
fetch('/api/tasks').then(res => res.json()).then(setTasks);
}, []);
return tasks;
}
function useTaskFiltering(tasks: Task[], filters: Filters) {
return useMemo(() => {
return tasks.filter(gig => {
if (filters.status && gig.status !== filters.status) return false;
if (filters.location && !gig.location.includes(filters.location)) return false;
return true;
});
}, [tasks, filters]);
}
function useTaskSorting(tasks: Task[], sort: Sort) {
return useMemo(() => {
return [...tasks].sort((a, b) => {
const aVal = a[sort.field];
const bVal = b[sort.field];
return sort.dir === 'asc' ? aVal - bVal : bVal - aVal;
});
}, [tasks, sort]);
}
function TaskList() {
const allTasks = useTaskData();
const [filters, setFilters] = useState<Filters>({});
const [sort, setSort] = useState<Sort>({ field: 'date', dir: 'asc' });
const filtered = useTaskFiltering(allTasks, filters);
const sorted = useTaskSorting(filtered, sort);
return (
<View>
<TaskFilters filters={filters} onChange={setFilters} />
<TaskSorting sort={sort} onChange={setSort} />
<TaskCards tasks={sorted} />
</View>
);
}
// Now can change filtering without touching sorting
// Can change data fetching without touching UI
// Each concern is orthogonal
2. Interface Segregation
Create focused, minimal interfaces
Elixir Example (Interface Segregation)
# NON-ORTHOGONAL - Fat interface
defmodule Da
Установить orthogonality-principle в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadEditGrepGlobFAQ
Что делает скилл orthogonality-principle?
Use when designing modules, APIs, and system architecture requiring independent, non-overlapping components where changes in one don't affect others.
Как установить скилл orthogonality-principle?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл orthogonality-principle запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic