clean-code

Refactors Java methods to enforce DRY, KISS, and YAGNI principles.

23|7|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/hzy970907/fish-claude-code --skill clean-code-hzy970907
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/hzy970907/fish-claude-code/tree/main/skills/clean-code
Command: npx skills add https://github.com/hzy970907/fish-claude-code --skill clean-code-hzy970907

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write cleaner, more understandable, and maintainable code by adhering to established principles and best practices, reducing technical debt and improving collaboration.

Core Features & Use Cases

  • Code Quality Improvement: Refactors existing code to be more readable and efficient.
  • Principle Enforcement: Guides developers on applying DRY, KISS, and YAGNI principles.
  • Naming Conventions: Establishes clear and consistent naming for variables, methods, and classes.
  • Function Design: Promotes small, focused functions with single levels of abstraction.
  • Comment Best Practices: Encourages comments that explain the "why" rather than the "what".
  • Use Case: When faced with a complex, hard-to-understand method, use this Skill to refactor it into smaller, more manageable functions with clear names and single responsibilities.

Quick Start

Use the clean-code skill to refactor the provided Java method for improved readability and adherence to KISS principles.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I refactor a long Java method to improve readability and maintainability?

To refactor a long Java method for readability, break it into smaller, focused functions with single responsibilities and clear naming conventions. This reduces complexity and makes the code easier to manage and understand.

What are the best practices for writing clean code and reducing technical debt?

Best practices for clean code involve enforcing DRY, KISS, and YAGNI principles to reduce technical debt. Establish consistent naming, design small functions, and write comments that explain the why rather than the what.

How do I eliminate magic numbers and primitive obsession in my code?

Eliminate magic numbers and primitive obsession by applying targeted refactoring techniques. Replace magic numbers with named constants and encapsulate primitive data into meaningful objects to improve code clarity and robustness.

Does the clean-code approach work for legacy Java codebases with complex methods?

Yes, the clean-code approach effectively refactors complex legacy Java codebases. It addresses common code smells like long methods and primitive obsession by enforcing DRY and KISS principles to produce robust software.

What is the difference between good and bad commenting practices in software engineering?

Good commenting practices explain the why behind code decisions, while bad comments merely describe the what. Effective comments provide context for maintainability without restating obvious implementation details.