clean-code

Guide code reviews and refactoring with naming, structure, and error handling principles.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/markky21/claude-skills --skill clean-code-markky21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/markky21/claude-skills/tree/main/plugins/my-personal-tools/skills/clean-code
Command: npx skills add https://github.com/markky21/claude-skills --skill clean-code-markky21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean code reduces cognitive load for readers, making software easier to reason about, extend, and maintain over time.

Core Features & Use Cases

  • Naming conventions: Guidelines to create intention-revealing, consistent identifiers.
  • Structure and SRP: Emphasis on single responsibility, modular design, and manageable methods.
  • Error handling & comments: Clear error propagation and comments that explain why decisions were made, not what the code does.
  • Use Case: When reviewing legacy modules with long methods or unclear responsibilities, apply these principles to refactor for readability and maintainability.

Quick Start

  • Review active code with long methods or vague names.
  • Rename identifiers for clarity, extract focused helpers, and improve error handling.
  • Apply SRP and SOLID guidelines during refactor and document decisions in comments.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I refactor legacy code with long methods and unclear responsibilities?

To refactor legacy code, rename vague identifiers for clarity, extract focused helper methods to enforce the single responsibility principle, and improve error handling to make modules easier to maintain and reason about.

What is the single responsibility principle and how does it improve code structure?

The single responsibility principle (SRP) ensures each module or method handles one focused task. Applying SRP during refactoring creates a modular design that reduces cognitive load and makes software easier to extend and maintain.

How should I write effective comments when reviewing code?

Effective comments should explain why specific decisions were made rather than what the code does. Documenting the reasoning behind refactoring choices and structural changes helps future developers understand the maintainable code's context.

What are code smells and how do I fix them during a code review?

Code smells are indicators of poor design, such as long methods or vague naming. Fix them by renaming identifiers to be intention-revealing, extracting focused helpers, and applying SOLID guidelines to improve overall readability.

What is the best way to improve error handling and naming conventions in existing modules?

The best way to improve error handling and naming conventions is to ensure clear error propagation and rename identifiers to be intention-revealing and consistent, which reduces cognitive load for readers maintaining the software.

Can I apply clean code principles during onboarding to help new developers?

Yes, applying clean code principles during onboarding helps new developers by emphasizing modular design, manageable methods, and clear error propagation, making the existing software architecture easier to reason about and extend.