code-quality-principles

Solid

KISS, YAGNI, and SOLID code quality principles for clean code, reducing complexity and preventing over-engineering.

Code & Development 294 stars 26 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
82
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Code Quality Principles 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 ```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 Example ```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.pus...

Details

Author
athola
Repository
athola/claude-night-market
Created
6 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category