Clean Code

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

492 stars 68 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add cosmicstack-labs/mercury-agent-skills --skill clean-code
Manual install
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/development/clean-code ~/.claude/skills/clean-code

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

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, consistent, searchable |
| **Function Size** | Monolithic 500+ line functions | 50-100 line functions with mixed concerns | <20 lines, one clear level of abstraction |
Read the full skill on GitHub

Details

Skill name
clean-code
Path
categories/development/clean-code/SKILL.md
License
MIT
Repo updated
25 August 2026

FAQ

What does the Clean Code skill do?

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

How do I install the Clean Code skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill clean-code. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Clean Code popular?

It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.