clean-code
Skill9 starsChanged 3 months agoMITView on GitHub
Use when writing new code, reviewing PRs, refactoring legacy code, or reviewing code quality, readability, naming conventions, function size
63 other projects use a version of this, 7 of them edited.
Adopted by
Most recently taken up by
- superplanehq/superplanetheir own version, first seen Oct 5, 2026
- JeffreyFerreiras/ai-skillstheir own version, first seen Oct 5, 2026
- sbluemin/fleet-harnesstheir own version, first seen Oct 4, 2026
- jd-solanki/krutrimboxtheir own version, first seen Sep 27, 2026
- samirpatil2000/skillstheir own version, first seen Sep 26, 2026
- btseee/clean-code-skillstheir own version, first seen Sep 25, 2026
Used with
Projects with it also use 2d-games, 3d-games 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.
tiendatworkSkill2d-games
2D game development principles. Sprites, tilemaps, physics, camera.
Also in 3 projects that use this
tiendatworkSkill3d-games
3D game development principles. Rendering, shaders, physics, cameras.
Also in 3 projects that use this
MindrallySkillclean-architecture
Guidelines for implementing Clean Architecture patterns in Flutter and Go applications, with emphasis on separation of concerns, dependency rules, and testability.
Also in 7 projects that use this
ratacatSkilldesign-patterns
Use when designing software architecture, refactoring code structure, solving recurring design problems, or when code exhibits symptoms like tight coupling, rigid hierarchies, scattered responsibilities, or difficult-to-test components. Also use when choosing between architectural approaches or reviewing code for structural improvements.
Also in 5 projects that use this
kayamanSkillsolid-principles
Enforces SOLID principles (SRP, OCP, LSP, ISP, DIP) in object-oriented and multi-paradigm code. Use when designing classes and interfaces, evaluating responsibility assignment, reviewing code for coupling issues, applying dependency inversion, refactoring fat interfaces, or checking that subtypes are truly substitutable.
Also in 3 projects that use this
DIL8654Skilllogging-patterns
Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.
Also in 3 projects that use this
- +6 more from tiendatwork
Other versions63 projects use a version of this.
Word for word · 0
None found.
Edited · 7
- jackjin1997/ClawForge★ 1311% same
- PanPanFR/oh-my-kilo★ 1211% same
- AbdulSamad94/Legalyze-AI★ 211% same
- AbdulSamad94/Personal-Portfolio★ 211% same
- ronrefael/sonde★ 212% same
- muhammadrivaldy/agent-skills★ 012% same
- TheHiddenDeveloper/jarvis-skills★ 011% same
Wrote their own version · 56
- superplanehq/superplane★ 7.7ksame name
- ciembor/agent-rules-books★ 2.9ksame name
- wondelai/skills★ 2.3ksame name
- decebals/claude-code-java★ 747same name
- Mindrally/skills★ 266same name
- xenitV1/claude-code-maestro★ 229same name
- techygarg/lattice★ 197same name
- ratacat/claude-skills★ 56same name
- DGouron/review-flow★ 44same name
- kumaran-is/claude-code-onboarding★ 36same name
46 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 repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- agentmemory-agentsSkill
- agentmemory-architectureSkill
- agentmemory-configSkill
- agentmemory-hooksSkill
- agentmemory-mcp-toolsSkill
- agentmemory-rest-apiSkill
- agentmemorySkill
- antislopSkill
- caveman-compressSkill
- caveman-helpSkill
- cavemanSkill
- caveman-statsSkill
- cloudflareSkill
- codebase-designSkill
- code-reviewSkill
- commit-contextSkill
- commit-historySkill
- delegationSkill
- documentationSkill
- forgetSkill
- git-commitSkill
- graphifySkill
- grillingSkill
- handoff-compactSkill
- handoffSkill
- i-have-adhdSkill
- impeccableSkill
- jev-decisionSkill
- lessonSkill
- memory-disciplineSkill
- plansSkill
- playwright-cliSkill
- ponytail-reviewSkill
- pwa-developmentSkill
- recallSkill
- recapSkill
- rememberSkill
- resolving-merge-conflictsSkill
- session-historySkill
- shadcnSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- ui-designSkill
- ui-ux-pro-maxSkill
- vercel-reactSkill
- verification-before-completionSkill
- viteSkill
- vitestSkill
- web-design-guidelinesSkill
- web-perfSkill
- write-agentmemory-skillSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 59 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
No disinformation: don't call it accountList if it's a Map
- Distinctive: line 22
No side effects - no secretly changing global state
- Distinctive: line 25
Don't comment bad code - rewrite it:
- Distinctive: line 55
Don't return null; don't pass null
“Common” is measured: kept by at least 6 in 10 of the 59 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
Principles from Robert C. Martin's "Clean Code". Transform "code that works" into "code that is clean": readable and enhanceable by a developer other than its original author.
1. Meaningful Names
- Intention-revealing:
elapsedTimeInDaysnotd; pronounceable/searchable, nogenymdhms - No disinformation: don't call it
accountListif it's a Map - Meaningful distinctions: avoid
ProductDatavsProductInfo - Classes = nouns (
Customer), avoidManager/Data; methods = verbs (postPayment)
2. Functions
- Small. Do ONE thing. One level of abstraction per function (don't mix business logic with regex details)
- Arguments: 0 ideal, 1-2 fine, 3+ needs strong justification
- No side effects - no secretly changing global state
3. Comments
- Don't comment bad code - rewrite it:
# bad: comment explains what code should say if employee.flags & HOURLY and employee.age > 65: # good: code explains itself if employee.isEligibleForFullBenefits(): - Good comments: legal, intent/why, platform traps, non-obvious constraints, actionable TODOs. Keep concise (1-2 lines max).
- Bad: mumbling, redundant, misleading, mandated, noise, position markers.
- AI Comment Slop to eliminate:
- Decorative separators:
// ============,/* ---- ROUTES ---- */, box-drawing borders. - Restating the obvious / signature echo:
let count = 0; // Initialize count, repeating JSDoc params without added value. - Workflow narration:
// Step 1: Validate,// Step 2: Process,// Step 3: Return. - Empty labels:
// Main logic,// Helper function,// Business logic. - Vague TODOs:
// TODO: improve thiswithout actionable task and context. - Decorative emoji in code:
// 🚀 Performance,// ✅ Done. - End markers:
} // end if,# End of function. - Line-by-line narration: narrating each line instead of explaining block intent.
- Decorative separators:
4. Formatting
- Newspaper metaphor: high-level concepts top, details bottom
- Related lines close together; variables declared near usage
5. Objects & Data Structures
- Hide implementation behind interfaces
- Law of Demeter: avoid
a.getB().getC().doSomething() - DTOs: public variables, no functions
6. Error Handling
- Exceptions over return codes; write try-catch-finally first (defines scope)
- Don't return null; don't pass null
7. Unit Tests
- Three laws of TDD: no production code without failing test; no more test than sufficient to fail; no more production code than sufficient to pass
- F.I.R.S.T.: Fast, Independent, Repeatable, Self-Validating, Timely
8. Classes
- Small, single responsibility (SRP); stepdown rule - reads top-down
9. Smells
Rigidity (hard to change), fragility (breaks in many places), immobility (hard to reuse), viscosity (hard to do the right thing), needless complexity/repetition.
Checklist
- Function < 20 lines? Does exactly one thing?
- Names searchable and intention-revealing?
- Comments avoided by making code clearer?
- Too many arguments?
- Failing test exists for this change?
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.

