clean-code
Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
Author
Category
Development ToolsInstall
Hot:11
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-clean-code&locale=en&source=copy
Clean Code - AI Clean Code Standards Assistant
Skill Overview
Clean Code is a CRITICAL-level AI programming skill that, using practical principles like SRP, DRY, KISS, and YAGNI, helps you automatically check code quality, standardize naming, and simplify function design, making code easier to maintain.
Applicable Scenarios
1. Pull Request Code Review
Have the AI automatically check whether code complies with clean code standards before submitting a PR, including whether names are clear, functions are overly complex, duplicate code exists, and other common issues, reducing manual review workload.
2. Code Refactoring and Optimization
When existing code becomes hard to maintain, use the Clean Code skill to identify over-engineered parts, extract duplicate logic, apply guard clauses to simplify nesting, and bring the code back to being simple and clear.
3. New Feature Development Standards Checks
When writing new features, let the AI remind you in real time if you're violating the Single Responsibility Principle, if functions have too many parameters, or if unnecessary helper files are being created, maintaining code quality from the outset.
Core Features
1. Intelligent Code Standards Checking
Based on five core principles—SRP, DRY, KISS, YAGNI, and the Boy Scout Rule—automatically analyze whether code has mixed responsibilities, duplicated logic, over-design, and other issues, and provide concrete suggestions for changes.
2. Naming and Function Conventions
Check whether variable names, function names, booleans, and constants follow conventions (e.g.,
getUserById() instead of user(), hasPermission instead of permission), ensuring code is self-documenting and understandable without extra comments.3. Structural Optimization Suggestions
Identify anti-patterns like deep nesting, overly long functions, and redundant files; recommend using guard clauses, function composition, and proximity placement to simplify structure and keep code flat and readable.
Frequently Asked Questions
What is the Clean Code skill and what can it do?
Clean Code is an AI programming assistant skill focused on helping developers write cleaner, more maintainable code. It can check whether code adheres to principles like SRP (Single Responsibility), DRY (Don't Repeat Yourself), and KISS (Keep It Simple), identify poor naming, overly long functions, and over-engineering, and provide concrete improvement suggestions. Unlike other code-checking tools, Clean Code places greater emphasis on code readability and long-term maintainability.
How do I use the Clean Code skill for code reviews?
After enabling the Clean Code skill in your repository, the AI will automatically apply clean code principles as you write. When you submit code or request a review, the skill will check for issues such as functions longer than 20 lines, duplicated logic, unclear naming, and unnecessary helper files. The review results will present issue locations and suggested changes in a clear format; you can confirm and then let the AI automatically fix them.
What are Clean Code’s core principles?
Clean Code is based on five classic principles: SRP (Single Responsibility) requiring each function/class to do only one thing; DRY (Don't Repeat Yourself) requiring extraction of duplicate code for reuse; KISS (Keep It Simple) requiring the simplest solution to a problem; YAGNI (You Aren’t Gonna Need It) warning against writing code for features you may not need in the future; and the Boy Scout Rule, which requires making the code cleaner than before with each change.