Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Guidance on KISS, YAGNI, and SOLID principles with language-specific examples.
When To Use
Improving code readability and maintainability
Applying SOLID, KISS, YAGNI principles during refactoring
When NOT To Use
Throwaway scripts or one-time data migrations
Performance-critical code where readability trades are justified
KISS (Keep It Simple, Stupid)
Principle: Avoid unnecessary complexity. Prefer obvious solutions over clever ones.
Guidelines
Prefer
Avoid
Simple conditionals
Complex regex for simple checks
Explicit code
Magic numbers/strings
Standard patterns
Clever shortcuts
Direct solutions
Over-abstracted layers
Python Example
# Bad: Overly clever one-liner
users = [u for u in (db.get(id) foridin ids) if u and u.active andnot u.banned]
# Good: Clear and readable
users = []
for user_id in ids:
user = db.get(user_id)
if user and user.active andnot user.banned:
users.append(user)
Principle: Don't implement features until they are actually needed.
Guidelines
Do
Don't
Solve current problem
Build for hypothetical futures
Add when 3rd use case appears
Create abstractions for 1 use case
Delete dead code
Keep "just in case" code
Minimal viable solution
Premature optimization
Python Example
# Bad: Premature abstraction for one use caseclassAbstractDataProcessor:
defprocess(self, data): ...
defvalidate(self, data): ...
deftransform(self, data): ...
classCSVProcessor(AbstractDataProcessor):
defprocess(self, data):
returnself.transform(self.validate(data))
# Good: Simple function until more cases appeardefprocess_csv(data: list[str]) -> list[dict]:
return [parse_row(row) for row in data if row.strip()]
# Bad: Direct dependency on concrete classclassOrderService:
def__init__(self):
self.db = PostgresDatabase() # Tight coupling# Good: Depend on abstractionfrom abc import ABC, abstractmethod
classDatabase(ABC):
@abstractmethoddefsave(self, data): ...
classOrderService:
def__init__(self, db: Database):
self.db = db # Injected abstraction
Quick Reference
Principle
Question to Ask
Red Flag
KISS
"Is there a simpler way?"
Complex solution for simple problem
YAGNI
"Do I need this right now?"
Building for hypothetical use cases
SRP
"What's the one reason to change?"
Class doing multiple jobs
OCP
"Can I extend without modifying?"
Switch statements for types
LSP
"Can subtypes replace base types?"
Overridden methods with side effects
ISP
"Does client need all methods?"
Empty method implementations
DIP
"Am I depending on abstractions?"
new keyword in business logic
When Principles Conflict
KISS vs SOLID: For small projects, KISS wins. Add SOLID patterns as complexity grows.
YAGNI vs DIP: Don't add abstractions until you have 2+ implementations.
Readability vs DRY: Prefer slight duplication over wrong abstraction.
Integration with Code Review
When reviewing code, check:
No unnecessary complexity (KISS)
No speculative features (YAGNI)
Each class has single responsibility (SRP)
No god classes (> 500 lines)
Dependencies are injected, not created (DIP)
Verification: Run wc -l <file> to check line counts and rg -c "class " <file> (or grep -c "class " <file>) to count classes per file.
Related Skills
imbue:karpathy-principles - The "Simplicity First" principle wraps KISS, YAGNI, and SOLID into a four-principle synthesis derived from Karpathy's observations on LLM coding pitfalls
See docs/quality-gates.md#skill-level-quality-gate-composition for the full gate-skill federation graph
Exit Criteria
Every proposed code change checked against the integration
review checklist: no unnecessary complexity (KISS), no speculative
features (YAGNI), single responsibility per class (SRP), no god
classes over 500 lines, dependencies injected not created (DIP)
When KISS and SOLID conflict, the resolution is documented:
KISS wins for small projects, SOLID patterns applied as complexity
grows. The choice is explicit, not silent
wc -l <file> run on any modified file and result noted if
the file exceeds 500 lines (god-class threshold)
No new abstraction introduced with only one implementor unless
it serves as a mock boundary for testing