Agent skill

Code Quality Principles

by athola in athola/claude-night-market

Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity.

MITAuto-check passedDevelopment

Install Code Quality Principles

skills CLI
$ npx skills add athola/claude-night-market --skill code-quality-principles -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install athola/claude-night-market code-quality-principles --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/athola/claude-night-market.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/conserve/skills/code-quality-principles .claude/skills/code-quality-principles && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-quality-principles
GitHub stars
342
Token cost
~2.1k tokens
SKILL.md length
501 words
Files
1
Skills in repo
160
Repo updated
First seen
Licence
MIT

At a glance

Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity.

  • Works in 3 steps: KISS vs SOLID: For small projects, KISS… → YAGNI vs DIP: Don't add abstractions… → Readability vs DRY: Prefer slight…
  • Reviewing code for over-engineering
  • SKILL.md covers When To Use, When NOT To Use, KISS (Keep It Simple, Stupid) and YAGNI (You Aren't Gonna Need It), plus 6 more sections
  • Calls rg

What it does

Code Quality Principles is an agent skill from athola/claude-night-market. Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Code quality, Design patterns and Code simplification. The repository describes itself as: 23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context… The licence is MIT.

When your agent uses it

  • Reviewing code for over-engineering
  • Tasks that involve Code quality
  • Tasks that involve Design patterns

Example prompts

  • “Use the code-quality-principles skill to apply KISS, YAGNI, and SOLID principles for clean code with reduced complexity”
  • “/code-quality-principles”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  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.

What it can do on your machine

Read from SKILL.md and the folder at commit 9f3eb00. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • rg

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Quality Principles loads about 2.1k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 501 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from athola/claude-night-market at commit 9f3eb00, republished under its MIT licence (© athola). 501 words, ~2,097 tokens.

Download SKILL.mdSave it as .claude/skills/code-quality-principles/SKILL.md (or your agent's skills folder).
name
code-quality-principles
description
Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering.
alwaysApply
false
category
development
tags
design, principles, clean-code, architecture
complexity
low
model_hint
fast
estimated_tokens
600

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
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.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
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 Example
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,
};

SOLID Principles

Single Responsibility Principle

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

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
Liskov Substitution Principle

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): ...
Interface Segregation Principle

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

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

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.
Show full SKILL.md (187 more words)Show less

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.

  • 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

© athola, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

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

Open the folder on GitHubat commit 9f3eb00

Compare with similar skills

Code Quality Principles next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Quality Principles compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Quality Principles this skillathola/claude-night-market342—~2.1kAutomated safety check: PassMIT
Solidramziddin/solid-skills606—~2.7kAutomated safety check: PassNone
Codebase Health Refactoringkucherenko/jscpd6.3k—~2.5kAutomated safety check: PassMIT
DRY Refactoring With jscpdkucherenko/jscpd6.3k—~2.1kAutomated safety check: PassMIT
Omni DevGulajavaMinistudio/Mayukai-Theme139—~736Automated safety check: PassMIT
Brooks Reviewhyhmrright/brooks-lint1.5k1 repos~430Automated safety check: PassMIT

Similar skills

  • Solid

    ramziddin/solid-skills

    A skill your agent uses when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging.

    606 GitHub stars~2.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • A three-part cleanup guided by jscpd: measure health, then fix duplicated code, remove dead code and simplify the most complex files, finishing by re-measuring the score.

    6.3k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Removes copy-paste duplication found by jscpd, starting with exact clones and hotspots, then renamed and near-miss copies, using proven refactoring strategies.

    6.3k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Omni Dev

    GulajavaMinistudio/Mayukai-Theme

    Omni-expert principal software architect. An agent skill from GulajavaMinistudio/Mayukai-Theme.

    139 GitHub stars~736 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Brooks Review

    hyhmrright/brooks-lint

    PR code review that surfaces decay risks, design smells, and maintainability issues with concrete Symptom → Source → Consequence → Remedy findings, drawing on twelve classic engineering books.

    1.5k GitHub starsUsed in 1 repo~430 tokens
    DevelopmentAuto-check passed
  • Clean Code

    jd-solanki/slidev-theme-dracula

    Write readable, maintainable code through disciplined naming, small functions, and clean error handling.

    161 GitHub starsUsed in 1 repo~3.8k tokens
    DevelopmentAuto-check passed

More from athola/claude-night-market

All 160 skills in this repo
  • Night Market Diagnostics Toolkit

    athola/claude-night-market

    Run and interpret repo diagnostic scripts (ratchets, validators, token stats).

    342 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Skills Eval

    athola/claude-night-market

    Evaluate Claude skill quality through auditing. An agent skill from athola/claude-night-market.

    342 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Agent Teams

    athola/claude-night-market

    Coordinates Claude agent teams via filesystem protocol. An agent skill from athola/claude-night-market.

    342 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Delegation Core

    athola/claude-night-market

    Delegates execution to eight CLIs (Gemini, Qwen, MiniMax, GLM, Muse, Codex, OpenCode, Glimmer).

    342 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Elegant Code

    athola/claude-night-market

    Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

    342 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Skill Library Mission

    athola/claude-night-market

    Build a project skill library in .claude/skills/ via discovery, parallel authoring, and review.

    342 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Code Quality Principles

What does Code Quality Principles do?

Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Code Quality Principles is an agent skill from athola/claude-night-market. Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity.

When should I use Code Quality Principles?

Code Quality Principles fits situations like: reviewing code for over-engineering; tasks that involve Code quality; tasks that involve Design patterns.

How do I install Code Quality Principles in Claude Code?

Run `npx skills add athola/claude-night-market --skill code-quality-principles -a claude-code`. Or copy the skill folder (plugins/conserve/skills/code-quality-principles in athola/claude-night-market) into .claude/skills/code-quality-principles in your project. Claude Code loads it when a task matches its description.

How do I install Code Quality Principles in Codex?

Run `npx skills add athola/claude-night-market --skill code-quality-principles -a codex`. Or copy the skill folder (plugins/conserve/skills/code-quality-principles in athola/claude-night-market) into .agents/skills/code-quality-principles in your project. Codex loads it when a task matches its description.

Can I use Code Quality Principles in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add athola/claude-night-market --skill code-quality-principles -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-quality-principles, .gemini/skills/code-quality-principles, .github/skills/code-quality-principles and .opencode/skills/code-quality-principles in your project.

What does Code Quality Principles need to run?

Going by SKILL.md and its folder, Code Quality Principles needs the command-line tools its instructions call (rg). Our summary lists: Python 3.

Does Code Quality Principles access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Quality Principles safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Quality Principles use?

Code Quality Principles is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Quality Principles use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Quality Principles?

Skills that share tags, products or a category with Code Quality Principles: Solid (ramziddin/solid-skills, 606 stars), Codebase Health Refactoring (kucherenko/jscpd, 6.3k stars), DRY Refactoring With jscpd (kucherenko/jscpd, 6.3k stars) and Omni Dev (GulajavaMinistudio/Mayukai-Theme, 139 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Quality Principles?

athola (a GitHub user) maintains it in athola/claude-night-market, which has 342 GitHub stars. The repository holds 160 skills in this directory. The repository was last updated on October 6, 2026.

Source: athola/claude-night-market on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.