Code and module-level design judgment — complexity management, interface design, naming, abstraction depth, error handling philosophy, information hiding. Use when: writing new modules, reviewing code quality, refactoring decisions, API design, naming discussions. Triggers: design judgment, code quality, module design, complexity, naming, abstraction, error handling, code smell
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Code and module-level design judgment — complexity management, interface design, naming, abstraction depth, error handling philosophy, information hiding. Use when: writing new modules, reviewing code quality, refactoring decisions, API design, naming discussions. Triggers: design judgment, code quality, module design, complexity, naming, abstraction, error handling, code smell
Design Philosophy
Design judgment framework for code and module-level decisions. Not architecture (→ architect-thinking), not testing (→ testing-strategy), not refactoring mechanics (→ refactoring-judgment).
Complexity — The Root Enemy
Three forms (Ousterhout):
Form
Signal
Mitigation
Change Amplification
Simple change requires edits in many places
Consolidate knowledge behind single interface
Cognitive Load
Reader must hold too much context to understand
Reduce state, narrow interfaces, isolate concerns
Unknown Unknowns
Not obvious what to change or what breaks
Make dependencies explicit, document non-obvious behavior
Strategic programming: invest 10-20% extra to reduce future complexity. Tactical programming (just make it work) compounds tech debt.
Deep Modules vs Shallow Modules
Deep module: simple interface, complex implementation → maximizes information hiding
Shallow module: interface nearly as complex as implementation → adds ceremony, not value
Prefer fewer, deeper modules over many thin wrappers
Classitis (too many tiny classes/functions) increases cognitive load through indirection
Information Hiding & Leakage
Each module should encapsulate design decisions that are likely to change
Information leakage: when the same knowledge appears in multiple modules — even across interface boundaries
Temporal decomposition (structuring by execution order) often causes leakage — group by knowledge instead
If two modules always change together, they share a hidden design decision → merge or re-abstract
Define Errors Out of Existence
Best error handling is no error handling — design APIs so invalid states are unrepresentable