Code Quality

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.

Clean Code by Robert C. Martin

Clean Code

by Robert C. Martin

npx skills add wondelai/skills/clean-code

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.

Robert C. Martin

Co-author of the Agile Manifesto, 50+ years in software

Robert C. Martin (Uncle Bob) is a software engineer, author, and co-author of the Agile Manifesto. He has been a programmer since 1970 and is one of the most influential voices in software craftsmanship.

View Book →

Try these with the skill installed

Review this module for Clean Code violations and suggest refactors using clean-code skill

Code review

Rename these functions and variables to be more intention-revealing using clean-code skill

Naming

Break this 200-line function into clean, single-responsibility functions using clean-code skill

Refactoring

Refactor the error handling in this service to follow Clean Code patterns using clean-code skill

Error handling

Install 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