Agent skill · Code Review & Quality

clean-code

Principles and practices for writing readable, maintainable, and testable code

Cosmic Stack3,294★ · 2 repos on radarProfile →
claude-codeMIT
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill clean-code --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 8 KB
Bundled scripts: none
Version: 1.0.0
Declared author: cosmicstack-labs
Path: categories/development/clean-code/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 364
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Clean Code Write code that humans can read, understand, and change with confidence. ## Core Principles ### 1. Mean What You Say — Say What You Mean Code is communication. Every name, structure, and abstraction should reveal intent. If you need a comment to explain *what* the code does, the code is failing at communication. ### 2. Small Things, Done Well Small functions, small classes, small files. Each unit of code should have one clear responsibility and do it well. Composability beats complexity. ### 3. The Boy Scout Rule Leave the code cleaner than you found it. Every commit should improve the codebase incrementally — even if it's just renaming one variable or extracting one function. ### 4. Testability == Design Quality If code is hard to test, it has a design problem. Testable code is modular, decoupled, and honest about its dependencies. --- ## Clean Code Scoring Rubric Use this rubric to evaluate code quality on a scale of 1-5 for each dimension: | Dimension | 1 (Poor) | 3 (Adequate) | 5 (Excellent) | |-----------|----------|---------------|----------------| | **Naming** | Single-letter vars, ambiguous abbreviations | Descriptive but occasionally redundant | Reveals intent

What's inside
Steps it walks through
  1. Core Principles
  2. 1. Mean What You Say — Say What You Mean
  3. 2. Small Things, Done Well
  4. 3. The Boy Scout Rule
  5. 4. Testability == Design Quality
  6. Clean Code Scoring Rubric
  7. Actionable Guidance
  8. Naming
  9. Functions
  10. Comments
  11. Error Handling
  12. Testing
  13. Code Smells to Hunt
  14. Common Mistakes
More from mercury-agent-skills
All skills →
About this skill
What does the clean-code skill do?

Principles and practices for writing readable, maintainable, and testable code

How do I install it?

Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill clean-code --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going