Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering.
.claude/skills/athola-code-quality-principles/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 37% | 0% |
Guidance on KISS, YAGNI, and SOLID principles with language-specific examples.
Principle: Avoid unnecessary complexity. Prefer obvious solutions over clever ones.
| Prefer | Avoid | |--------|-------| | Simple conditionals | Complex regex for simple checks | | Explicit code | Magic numbers/strings | | Standard patterns | Clever shortcuts | | Direct solutions | Over-abstracted layers |
python# Bad: Overly clever one-liner users = [u for u in (db.get(id) for id in ids) if u and u.active and not u.banned] # Good: Clear and readable users = [] for user_id in ids: user = db.get(user_id) if user and user.active and not user.banned: users.append(user)
rust// Bad: Unnecessary complexity fn process(data: &[u8]) -> Result<Vec<u8>, Box<dyn std::error::Error>> { data.iter() .map(|&b| b.checked_add(1).ok_or("overflow")) .collect::<Result<Vec<_>, _>>() .map_err(|e| e.into()) } // Good: Simple and clear fn process(data: &[u8]) -> Result<Vec<u8>, &'static str> { let mut result = Vec::with_capacity(data.len()); for &byte in data { result.push(byte.checked_add(1).ok_or("overflow")?); } Ok(result) }
Principle: Don't implement features until they are actually needed.
| 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# Bad: Premature abstraction for one use case class AbstractDataProcessor: def process(self, data): ... def validate(self, data): ... def transform(self, data): ... class CSVProcessor(AbstractDataProcessor): def process(self, data): return self.transform(self.validate(data)) # Good: Simple function until more cases appear def process_csv(data: list[str]) -> list[dict]: return [parse_row(row) for row in data if row.strip()]
typescript// Bad: Over-engineered config system interface ConfigProvider<T> { get<K extends keyof T>(key: K): T[K]; set<K extends keyof T>(key: K, value: T[K]): void; watch<K extends keyof T>(key: K, callback: (v: T[K]) => void): void; } // Good: Simple config for current needs const config = { apiUrl: process.env.API_URL || 'http://localhost:3000', timeout: 5000, };
Each module/class should have one reason to change.
python# Bad: Multiple responsibilities class UserManager: def create_user(self, data): ... def send_welcome_email(self, user): ... # Email responsibility def generate_report(self, users): ... # Reporting responsibility # Good: Separated responsibilities class UserRepository: def create(self, data): ... class EmailService: def send_welcome(self, user): ... class UserReportGenerator: def generate(self, users): ...
Open for extension, closed for modification.
python# Bad: Requires modification for new types def calculate_area(shape): if shape.type == "circle": return 3.14 * shape.radius**2 elif shape.type == "rectangle": return shape.width * shape.height # Must modify to add new shapes # Good: Extensible without modification from abc import ABC, abstractmethod class Shape(ABC): @abstractmethod def area(self) -> float: ... class Circle(Shape): def __init__(self, radius: float): self.radius = radius def area(self) -> float: return 3.14 * self.radius**2
Subtypes must be substitutable for their base types.
python# Bad: Violates LSP - Square changes Rectangle behavior class Rectangle: def set_width(self, w): self.width = w def set_height(self, h): self.height = h class Square(Rectangle): # Breaks when used as Rectangle def set_width(self, w): self.width = self.height = w # Unexpected side effect # Good: Separate types with common interface class Shape(ABC): @abstractmethod def area(self) -> float: ... class Rectangle(Shape): def __init__(self, width: float, height: float): ... class Square(Shape): def __init__(self, side: float): ...
Clients shouldn't depend on interfaces they don't use.
typescript// Bad: Fat interface interface Worker { work(): void; eat(): void; sleep(): void; } // Good: Segregated interfaces interface Workable { work(): void; } interface Feedable { eat(): void; } // Clients only implement what they need class Robot implements Workable { work(): void { /* ... */ } }
Depend on abstractions, not concretions.
python# Bad: Direct dependency on concrete class class OrderService: def __init__(self): self.db = PostgresDatabase() # Tight coupling # Good: Depend on abstraction from abc import ABC, abstractmethod class Database(ABC): @abstractmethod def save(self, data): ... class OrderService: def __init__(self, db: Database): self.db = db # Injected abstraction
| 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 reviewing code, check:
Verification: Run wc -l <file> to check line counts and rg -c "class " <file> (or grep -c "class " <file>) to count classes per file.
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 pitfallsdocs/quality-gates.md#skill-level-quality-gate-composition for the full gate-skill federation graphreview 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)
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 ifthe file exceeds 500 lines (god-class threshold)
it serves as a mock boundary for testing
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 19,846 | 14,123 | -29% | 1 | 1 | 0% | 3,545 | 4,680 | +32% | 0 | 0 | — |
case-02 | fail→pass | 10,849 | 7,236 | -33% | 1 | 1 | 0% | 1,959 | 3,327 | +70% | 0 | 0 | — |
case-03 | pass→pass | 15,125 | 9,629 | -36% | 1 | 1 | 0% | 2,702 | 3,702 | +37% | 0 | 0 | — |
case-04 | pass→pass | 21,691 | 8,030 | -63% | 1 | 1 | 0% | 2,246 | 3,547 | +58% | 0 | 0 | — |
case-05 | pass→pass | 12,887 | 7,708 | -40% | 1 | 1 | 0% | 2,187 | 3,396 | +55% | 0 | 0 | — |
case-06 | pass→pass | 12,024 | 10,868 | -10% | 1 | 1 | 0% | 2,304 | 3,829 | +66% | 0 | 0 | — |
case-07 | pass→pass | 9,969 | 6,566 | -34% | 1 | 1 | 0% | 1,861 | 3,383 | +82% | 0 | 0 | — |
case-08 | pass→pass | 9,731 | 7,185 | -26% | 1 | 1 | 0% | 1,821 | 3,509 | +93% | 0 | 0 | — |
case-09 | pass→pass | 9,452 | 5,461 | -42% | 1 | 1 | 0% | 1,774 | 3,139 | +77% | 0 | 0 | — |
case-10 | pass→pass | 10,873 | 7,690 | -29% | 1 | 1 | 0% | 1,991 | 3,477 | +75% | 0 | 0 | — |
case-11 | pass→pass | 11,810 | 7,360 | -38% | 1 | 1 | 0% | 1,741 | 3,381 | +94% | 0 | 0 | — |
case-12 | pass→pass | 14,341 | 6,144 | -57% | 1 | 1 | 0% | 2,179 | 3,146 | +44% | 0 | 0 | — |
case-13 | pass→pass | 13,855 | 10,188 | -26% | 1 | 1 | 0% | 2,049 | 3,650 | +78% | 0 | 0 | — |
case-14 | fail→pass | 13,438 | 7,338 | -45% | 1 | 1 | 0% | 2,139 | 3,344 | +56% | 0 | 0 | — |
case-15 | fail→pass | 16,401 | 10,039 | -39% | 1 | 1 | 0% | 2,777 | 4,009 | +44% | 0 | 0 | — |
case-16 | pass→pass | 7,898 | 5,556 | -30% | 1 | 1 | 0% | 1,291 | 3,025 | +134% | 0 | 0 | — |
case-17 | pass→pass | 11,734 | 5,663 | -52% | 1 | 1 | 0% | 1,908 | 2,984 | +56% | 0 | 0 | — |
case-18 | pass→pass | 8,723 | 3,850 | -56% | 1 | 1 | 0% | 1,322 | 2,577 | +95% | 0 | 0 | — |
case-19 | pass→pass | 9,242 | 7,378 | -20% | 1 | 1 | 0% | 1,480 | 3,221 | +118% | 0 | 0 | — |
case-20 | pass→pass | 11,112 | 5,599 | -50% | 1 | 1 | 0% | 1,666 | 2,850 | +71% | 0 | 0 | — |
case-21 | pass→pass | 9,861 | 6,938 | -30% | 1 | 1 | 0% | 1,449 | 3,244 | +124% | 0 | 0 | — |
case-22 | pass→pass | 15,385 | 8,872 | -42% | 1 | 1 | 0% | 2,279 | 3,437 | +51% | 0 | 0 | — |
case-23 | pass→pass | 6,737 | 5,748 | -15% | 1 | 1 | 0% | 949 | 3,155 | +232% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.