clean-code
Skill17 starsChanged 9 months agoMITView on GitHub
Clean Code principles and practices reference based on Robert Martin's work. Use this skill when reviewing code quality, naming conventions, refactoring, or applying SOLID principles. Auto-activates for code smell detection, style improvements, and maintainability concerns.
108 other projects use a version of this.
Adopted by
Most recently taken up by
- sbluemin/fleet-harnesstheir own version, first seen Nov 8, 2026
- nohemi20231/design-skillstheir own version, first seen Nov 8, 2026
- MammadovEshgin/clean-code-skilltheir own version, first seen Nov 8, 2026
- Mahesh-Bishnoi/skillstheir own version, first seen Nov 8, 2026
- Bruno-Cunha-Souza/ValarMindSkillstheir own version, first seen Nov 8, 2026
- kana-consultant/kana-best-practice-engineeringtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use intelligent-routing, nextjs-react-expert and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 5 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
xfstudioSkillbash-pro
Master of defensive Bash scripting for production automation, CI/CD
Also in 4 projects that use this
xfstudioSkillcode-refactoring-tech-debt
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti
Also in 4 projects that use this
flying-diceSkillclean-code-review
Multi-agent clean code audit — each principle gets its own agent
Also in 3 projects that use this
goca-seSkillbatch-operations
Apply a change safely across many files — refactors touching more than 5 files, library or API migrations, project-wide renames of symbols/imports/paths, or adding boilerplate to many files. Use when "do it all at once" risks context overflow or silent failures.
Also in 3 projects that use this
- +4 more from xfstudio
Other versions108 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 108
- superplanehq/superplane★ 9.1ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- Openpanel-dev/openpanel★ 7.3ksame name
- ciembor/agent-rules-books★ 2.8ksame name
- wondelai/skills★ 2.6ksame name
- decebals/claude-code-java★ 763same name
- operately/operately★ 618same name
- liza-mas/liza★ 418same name
- Mindrally/skills★ 275same name
98 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- clrs-algorithmsSkill
- dddSkill
- ddiaSkill
- gof-patternsSkill
- pragmatic-programmerSkill
- sicpSkill
- software-patternsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 101 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Write or review unit tests
- Distinctive: line 47
Every time you touch code, make it a little better.
- Distinctive: line 51
Before committing code, verify:
“Common” is measured: kept by at least 6 in 10 of the 101 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean Code Reference
A comprehensive reference for writing clean, maintainable code based on Robert Martin's "Clean Code" and related works. This skill provides language-agnostic principles with examples that apply to any programming language.
When This Skill Activates
This skill automatically activates when you:
- Review code for quality or maintainability
- Need guidance on naming conventions
- Discuss refactoring or code smells
- Apply SOLID principles
- Improve code readability or structure
- Write or review unit tests
Quick Reference
SOLID Principles
| Principle | Summary | Violation Sign |
| Single Responsibility (SRP) | One reason to change | Class does too many things |
| Open/Closed (OCP) | Open for extension, closed for modification | Modifying existing code for new features |
| Liskov Substitution (LSP) | Subtypes must be substitutable | Subclass breaks parent behavior |
| Interface Segregation (ISP) | No forced dependencies on unused methods | Fat interfaces |
| Dependency Inversion (DIP) | Depend on abstractions, not concretions | High-level modules import low-level |
Clean Code Practices
| Practice | Key Points |
| Meaningful Names | Intention-revealing, pronounceable, searchable |
| Functions | Small, do one thing, one level of abstraction |
| Comments | Code should be self-documenting; comments explain why, not what |
| Formatting | Consistent style, vertical density, horizontal alignment |
| Error Handling | Exceptions over error codes, fail fast, don't return null |
| Unit Testing | F.I.R.S.T. principles, one assert per test, test behavior |
| Code Smells | Recognition and refactoring of common problems |
| Boy Scout Rule | Leave code cleaner than you found it |
The Boy Scout Rule
"Leave the campground cleaner than you found it."
Every time you touch code, make it a little better. Small, incremental improvements compound over time.
Code Quality Checklist
Before committing code, verify:
- Names - Are all names intention-revealing?
- Functions - Is each function doing exactly one thing?
- Comments - Are comments explaining why, not what?
- DRY - Is there any duplicated logic?
- SOLID - Are principles being followed?
- Tests - Is the code tested and testable?
- Error Handling - Are errors handled gracefully?
Language Translation Notes
Examples use generic pseudocode. Adapt to your language:
- PHP:
class,function,->, type hints - JavaScript/TypeScript:
class, arrow functions,. - Python:
class,def,., type hints - Java/C#: Direct mapping with access modifiers
Based on concepts from "Clean Code: A Handbook of Agile Software Craftsmanship" by Robert C. Martin, 2008.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

