clean-code

Assess code quality against a Clean Code scoring rubric.

364|53|Updated May 9, 2026
One-click install
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill clean-code-cosmicstack-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/categories/development/clean-code
Command: npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill clean-code-cosmicstack-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers reduce maintenance cost by enforcing principles for writing code that is clear, modular, and reliably testable.

Core Features & Use Cases

  • Readable communication: Guides naming, structure, and abstraction choices so intent is obvious without excessive comments.
  • Small, well-scoped units: Promotes small functions and single responsibilities to improve composability.
  • Testability and refactoring discipline: Connects design quality to test strategy and encourages incremental improvement using the Boy Scout Rule.

Quick Start

Ask your agent to refactor a messy function by renaming unclear variables, splitting it into small single-purpose functions, and proposing behavior-focused tests using the Clean Code scoring rubric.

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 messy function to improve readability and maintainability?

Refactor messy functions by renaming unclear variables, splitting large code blocks into small single-purpose units, and proposing behavior-focused tests to ensure maintainability without altering external behavior.

What is the best way to perform a code review focused on clean code principles?

Perform clean code reviews using a scoring rubric to assess naming conventions, function sizing, comments, error handling, and testing discipline, providing concrete actionable guidance for incremental improvement.

How do I design new modules for production systems with evolving requirements?

Design new modules for evolving requirements by applying clean code principles: promoting small well-scoped functions, ensuring reliable testability, and making intent obvious through clear naming and structure.

Can I use a scoring rubric to assess code quality across error handling and testability?

Yes, you can assess code quality using a clean code scoring rubric that explicitly evaluates naming, function size, comments, error handling, and testing discipline to produce concrete actionable refactor guidance.

When do I need to apply the Boy Scout Rule during day-to-day refactoring?

Apply the Boy Scout Rule during day-to-day refactoring to encourage incremental improvement, leaving code you touch cleaner than you found it by enhancing structure, abstraction choices, and testability.