clean-code

Apply Clean Code principles to improve code readability and maintainability.

3|Updated Apr 5, 2023
One-click install
npx skills add https://github.com/mrp4sten/.dotfiles --skill clean-code-mrp4sten
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/mrp4sten/.dotfiles/tree/main/development/IA/opencode/skill/clean-code
Command: npx skills add https://github.com/mrp4sten/.dotfiles --skill clean-code-mrp4sten

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Improve code readability and maintainability by applying Clean Code principles.

Core Features & Use Cases

  • Descriptive naming conventions and expressive identifiers.
  • Small, focused functions with clear responsibilities.
  • Consistent error handling, formatting, and DRY principles.
  • Guidance for refactoring and code reviews to reduce technical debt.

Quick Start

Apply the guidelines to your codebase immediately to improve readability and reduce defects.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I write clean code and improve readability in my codebase?

To write clean code and improve readability, use descriptive naming conventions, small focused functions with single responsibilities, and consistent formatting. These practices reduce bugs and technical debt across your codebase.

What's the best way to refactor existing code to reduce technical debt?

Refactoring to reduce technical debt involves applying DRY principles, enforcing consistent error handling, and breaking large functions into small, single-responsibility units. This process eliminates duplication and clarifies code responsibilities.

How do I apply clean code principles during code reviews?

Apply clean code principles during code reviews by checking for descriptive identifiers, minimal argument counts in functions, and comments explaining the WHY rather than the WHAT. Consistent formatting and proper error handling should also be verified.

Can I use clean code guidelines across different programming languages and teams?

Yes, clean code guidelines are applicable across languages and teams. Core principles like descriptive naming, small focused functions, limited arguments, and DRY are language-agnostic and enforce consistent, maintainable codebases.

Why does my code have so many bugs and how can clean code help?

Code has many bugs often due to poor naming, large unfocused functions, and inconsistent error handling. Clean code principles reduce these defects by enforcing single-responsibility functions, descriptive identifiers, and minimal, purposeful comments.

When should I write comments in clean code?

In clean code, you should write minimal comments focused on explaining the WHY behind a decision, not the WHAT the code does. Descriptive naming and clear function responsibilities should make the code self-documenting.