Clean Code
Writing readable, maintainable code
Write code that reads like well-written prose using Robert C. Martin's Clean Code principles. This skill equips your AI agent with naming conventions, function design, error handling patterns, and refactoring techniques that make codebases maintainable.
What your agent learns
Meaningful Names
Use intention-revealing names for variables, functions, and classes — the name should tell you why it exists.
Small Functions
Functions should do one thing, do it well, and do it only. Keep them short, focused, and at one level of abstraction.
Comments Are a Failure
Good code is self-documenting. If you need a comment, first try to express the intent in code.
Error Handling
Use exceptions rather than return codes. Write try-catch-finally first, then fill in the body.
The Boy Scout Rule
Leave the codebase cleaner than you found it — always make small improvements as you go.
Try these with the skill installed
Review this module for Clean Code violations and suggest refactors using clean-code skill
Code reviewRename these functions and variables to be more intention-revealing using clean-code skill
NamingBreak this 200-line function into clean, single-responsibility functions using clean-code skill
RefactoringRefactor the error handling in this service to follow Clean Code patterns using clean-code skill
Error handlingInstall Clean Code
Free, open-source, and ready in 30 seconds.
npx skills add wondelai/skills/clean-code MIT Licensed · Works with Claude Code, Cursor, Claude Cowork & OpenClaw · No account needed