clean-code

Enforce clean code principles across code writing, refactoring, and review workflows.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/tswr/engineering-mastery-plugin --skill clean-code-tswr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/tswr/engineering-mastery-plugin/tree/main/skills/clean-code
Command: npx skills add https://github.com/tswr/engineering-mastery-plugin --skill clean-code-tswr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Messy, inconsistent, and hard-to-read code slows down development, increases bug rates, and makes onboarding new team members and maintaining legacy systems far more difficult. This Skill eliminates those pain points by enforcing proven clean code principles that make codebases intuitive to work with for any developer.

Core Features & Use Cases

  • Intention-Revealing Naming: Enforce naming conventions that make variable, function, and class purposes immediately clear without needing extra comments.
  • Single-Responsibility Functions: Keep functions small and focused on one task, making them easier to test, debug, and modify.
  • Structured Error Handling & Class Design: Apply rules for error paths, class cohesion, and dependency inversion to reduce technical debt and improve long-term maintainability.
  • Code Smell Checklist: Use a quick reference checklist during code reviews and refactoring to identify and fix common anti-patterns.
  • Use Case: When refactoring a legacy codebase with 100-line functions and ambiguous variable names, use this Skill to break functions into small, single-purpose units and rename variables to reveal their intent, cutting down on review time and reducing bugs.

Quick Start

Use the clean-code skill to refactor the provided payment processing module to follow single-responsibility principles and use intention-revealing names for all variables and functions.

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 functions and ambiguous variable names?

Refactoring legacy code involves breaking 100-line functions into small, single-responsibility units and renaming ambiguous variables with intention-revealing names. This makes the purpose immediately clear, cuts down review time, and reduces avoidable bugs.

What are the most common code smells to check for during a code review?

Common code smells to check during a code review include ambiguous naming, functions handling multiple responsibilities, poor class cohesion, and high coupling. Use a quick reference checklist to identify and fix these anti-patterns for long-term maintainability.

Does clean code enforcement work with any programming language or project type?

Yes, clean code enforcement applies to all code writing, refactoring, and code review workflows across any programming language or project type. It enforces universal principles like single-responsibility functions and low coupling between components.

How does structured error handling reduce technical debt?

Structured error handling reduces technical debt by applying consistent rules for error paths and dependency inversion. This improves class cohesion and long-term code maintainability, preventing unmaintainable, hard-to-read code from increasing development costs.

What is the best way to enforce SOLID principles and naming conventions in an existing codebase?

The best way to enforce SOLID principles and naming conventions is to apply a code smell checklist during reviews and refactoring. This ensures intention-revealing naming, single-responsibility functions, and low coupling to eliminate technical debt.