clean-code

Apply Clean Code principles to naming, functions, comments, and formatting.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/truongnat/emplus --skill clean-code-truongnat
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/truongnat/emplus/tree/main/.agents/skills/clean-code
Command: npx skills add https://github.com/truongnat/emplus --skill clean-code-truongnat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces long-term maintenance costs by transforming confusing, brittle code into clear, readable implementations that other developers can confidently extend.

Core Features & Use Cases

  • Meaningful naming: Uses intention-revealing identifiers, correct distinctions, and consistent conventions to make behavior obvious.
  • Function design: Encourages small, single-purpose functions, sensible abstractions, and minimal side effects.
  • Clean commenting and formatting: Recommends rewriting bad code instead of hiding it behind comments, and using formatting that improves scanability.
  • Data structure and error handling guidance: Promotes encapsulation, avoids “train wrecks” through better interfaces, and uses robust error-handling practices.
  • Testing and heuristics: Applies unit-testing principles (F.I.R.S.T.) and common smell detection to guide refactors safely.

Quick Start

Use the clean-code skill to review a recent pull request and rewrite the worst naming, function size, and error-handling issues for readability and maintainability.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I apply clean code principles to refactor legacy code?▼

To improve code readability during pull request reviews, you identify intention-revealing naming, enforce small single-purpose functions, and correct error-handling issues to ensure long-term maintainability.

What are the clean code best practices for function design and naming?▼

Clean code function design and naming require intention-revealing identifiers, correct distinctions, consistent conventions, and small single-purpose functions with minimal side effects to make behavior obvious.

When should I write comments instead of rewriting bad code?▼

You should rewrite bad code instead of hiding it behind comments, using clean commenting and formatting practices that improve scanability rather than masking confusing implementations.

How do I apply unit testing principles to maintainable code?▼

Unit testing principles for maintainable code apply the F.I.R.S.T. methodology and common smell detection to safely guide refactors, ensuring functions remain testable and single-purpose.

Can clean code guidelines fix error handling and data structure issues?▼

Clean code guidelines fix error handling and data structure issues by promoting encapsulation, avoiding train wrecks through better interfaces, and implementing robust error-handling practices.