Source profileQuality 91/100

athola/claude-night-market/plugins/conserve/skills/code-quality-principles/SKILL.md

code-quality-principles

Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering.

Source repository stars
330
Declared platforms
0
Static risk flags
1
Last source update
2026-08-24
Source checked
2026-08-25

Decision brief

What it does: where it fits

Guidance on KISS, YAGNI, and SOLID principles with language-specific examples.

Best for

  • Improving code readability and maintainability
  • Applying SOLID, KISS, YAGNI principles during refactoring

Not for

  • Throwaway scripts or one-time data migrations
  • Performance-critical code where readability trades are justified

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/athola/claude-night-market --skill "plugins/conserve/skills/code-quality-principles"
Safe inspection promptEditorial

Inspect the Agent Skill "code-quality-principles" from https://github.com/athola/claude-night-market/blob/90037391d2db6536f67a7ccc8dee7c6819f170b7/plugins/conserve/skills/code-quality-principles/SKILL.md at commit 90037391d2db6536f67a7ccc8dee7c6819f170b7. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    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)

    [ ] No unnecessary complexity (KISS)[ ] No speculative features (YAGNI)[ ] Each class has single responsibility (SRP)
  2. 02

    When To Use

    Improving code readability and maintainability

    Improving code readability and maintainabilityApplying SOLID, KISS, YAGNI principles during refactoring- Improving code readability and maintainability - Applying SOLID, KISS, YAGNI principles during refactoring
  3. 03

    When NOT To Use

    Throwaway scripts or one-time data migrations

    Throwaway scripts or one-time data migrationsPerformance-critical code where readability trades are justified- Throwaway scripts or one-time data migrations - Performance-critical code where readability trades are justified
  4. 04

    KISS (Keep It Simple, Stupid)

    Principle: Avoid unnecessary complexity. Prefer obvious solutions over clever ones.

    Principle: Avoid unnecessary complexity. Prefer obvious solutions over clever ones.
  5. 05

    Guidelines

    Review the “Guidelines” section in the pinned source before continuing.

    Review and apply the “Guidelines” source section.

Permission review

Static risk signals and limitations

Network access

medium · line 110

The documentation includes network, browsing, or remote request actions.

apiUrl: process.env.API_URL || 'http://localhost:3000',

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars330SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
athola/claude-night-market
Skill path
plugins/conserve/skills/code-quality-principles/SKILL.md
Commit
90037391d2db6536f67a7ccc8dee7c6819f170b7
License
MIT
Collected
2026-08-25
Default branch
master
View the original SKILL.md

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

PreferAvoid
Simple conditionalsComplex regex for simple checks
Explicit codeMagic numbers/strings
Standard patternsClever shortcuts
Direct solutionsOver-abstracted layers

Python Example

# 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

// 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)
}

YAGNI (You Aren't Gonna Need It)

Principle: Don't implement features until they are actually needed.

Guidelines

DoDon't
Solve current problemBuild for hypothetical futures
Add when 3rd use case appearsCreate abstractions for 1 use case
Delete dead codeKeep "just in case" code
Minimal viable solutionPremature optimization

Python Example

# 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 Example

// 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,
};

SOLID Principles

Single Responsibility Principle

Each module/class should have one reason to change.

# 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/Closed Principle

Open for extension, closed for modification.

# 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

Liskov Substitution Principle

Subtypes must be substitutable for their base types.

# 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): ...

Interface Segregation Principle

Clients shouldn't depend on interfaces they don't use.

// 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 { /* ... */ }
}

Dependency Inversion Principle

Depend on abstractions, not concretions.

# 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

Quick Reference

PrincipleQuestion to AskRed 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

  1. KISS vs SOLID: For small projects, KISS wins. Add SOLID patterns as complexity grows.
  2. YAGNI vs DIP: Don't add abstractions until you have 2+ implementations.
  3. 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

Frequently asked questions

What to verify before installation and use

What does the code-quality-principles source document cover?

Guidance on KISS, YAGNI, and SOLID principles with language-specific examples.

How do I install code-quality-principles?

The source record exposes this install command: npx skills add https://github.com/athola/claude-night-market --skill "plugins/conserve/skills/code-quality-principles". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged network in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 9764

Jamie-BitFlight/claude_skills

python3-development

Use when building Python 3.11+ CLI apps (Typer/Rich), writing pytest test suites, fixing ruff linting or ty/mypy type errors, configuring pyproject.toml, creating portable scripts, or reviewing Python code. Activates on all Python implementation tasks — routes to specialist agents for CLI architecture, test design, packaging, and code review. Authoritative reference for modern Python 3.11-3.14 patterns and TDD workflows.

Computed 9764

Jamie-BitFlight/claude_skills

standards-for-python-development

Shared Python 3.11+ development standards covering type safety (ty, native generics, Protocol, TypeIs), layered architecture, error handling, performance, identifier naming, UI/CLI patterns (Rich/Typer), testing requirements (pytest, 80% coverage, TDD), and quality gates. Activates when any Python skill or agent needs to apply shared standards for implementation, code review, refactoring, or test authoring.

Computed 955,241

dotnet/skills

grade-tests

Grades a specified set of test methods individually and produces a concise table mapping each test (fully-qualified name) to a letter grade (A–F), a score band, and a one-line note — designed to be posted as a PR comment. Use when the caller wants per-test feedback on a curated list of methods (for example, the new or modified tests in a pull request), not a suite-wide audit. Polyglot: .NET, Python, TS/JS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. Input is a list of test methods (or

Computed 9425

Borda/AI-Rig

review

Multi-agent code review of local Python files, directories, or the current git diff covering architecture, tests, performance, docs, lint, security, and API design. Scope: Python source files in local working tree. Python-file-free targets (pure JS/TS/Go/Rust projects) are out of scope. TRIGGER when: user asks to review local Python files, a directory, or the current git diff/working-tree changes, with no GitHub PR number involved; phrases: "review this", "review my changes", "code review this d