Clean Code Principles

Enforces KISS, DRY, and YAGNI principles when writing Java code.

Updated May 12, 2026
One-click install
npx skills add https://github.com/ZzZueszZ/claude-kit --skill clean-code-principles-zzzueszz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Clean Code Principles
Source: https://github.com/ZzZueszZ/claude-kit/tree/main/.claude/skills/clean-code
Command: npx skills add https://github.com/ZzZueszZ/claude-kit --skill clean-code-principles-zzzueszz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Java codebases often accumulate over-engineered abstractions, duplicated logic, and premature features that make maintenance difficult. This Skill provides mandatory coding rules that keep Java code simple, readable, and maintainable. ## Core Features & Use Cases - KISS, DRY, YAGNI Enforcement: Concrete rules with correct and incorrect Java examples showing when to avoid over-engineering, duplication, and premature abstraction. - Naming & Structure Standards: Conventions for classes, methods, variables, constants, and packages, plus limits on method length (20 lines), parameters (3), class size (200 lines), and dependencies (5). - Comment Discipline & Pre-commit Checklist: Rules for writing WHY-focused comments and a checklist to verify before every commit. - Use Case: When implementing a new Spring Boot service, apply these rules to decide whether an interface is actually needed, extract shared validation logic, and keep methods small and well-named. ## Quick Start Review my Java service class and refactor it to follow KISS, DRY, and YAGNI principles with proper naming conventions.

Frequently Asked Questions about Clean Code Principles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply KISS, DRY, and YAGNI principles in Java code?▼

Apply KISS by avoiding design patterns when simple conditionals suffice, DRY by extracting duplicated logic into shared methods or constants, and YAGNI by only writing code for current requirements. Each principle includes concrete Java examples of correct and incorrect usage.

When should I create an interface in Java versus a concrete class?▼

Create an interface only when multiple implementations exist or when Spring dependency injection requires mocking in tests. With a single implementation, a concrete class is sufficient and avoids premature abstraction.

What are the naming conventions for Java classes, methods, and variables?▼

Classes use PascalCase nouns, methods use camelCase verbs, variables use meaningful camelCase names, and constants use UPPER_SNAKE_CASE. Avoid abbreviations, generic names like data or temp, and type-based names like userList.

When should I not apply the DRY principle?▼

Do not apply DRY when two similar code blocks belong to different domains or when extracting them creates unnecessary coupling. If changing one occurrence would not affect the other, keep them separate.

What are the limits for method and class size in clean Java code?▼

Methods should be at most 20 lines with no more than 3 parameters, using parameter objects when more are needed. Classes should stay under 200 lines with at most 5 injected dependencies.