clean-code
Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
Why use this skill?
Enforce high-level coding standards with the clean-code skill for OpenClaw. Automate refactoring, maintainability, and best practices.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/gabrielsubtil/clean-codeWhat This Skill Does
The clean-code skill is a specialized instruction set for the OpenClaw AI agent that enforces high-level software engineering best practices. It transforms the AI from a general code generator into a disciplined, senior-level engineer. The core philosophy centers on maintainability, readability, and the avoidance of technical debt. By applying principles like SRP (Single Responsibility Principle), DRY (Don't Repeat Yourself), and KISS (Keep It Simple), the skill ensures that the generated codebase is modular, testable, and intuitive to navigate. It actively discourages common anti-patterns such as over-engineering, "God functions," and excessive comment blocks, favoring self-documenting code over verbose documentation.
Installation
To integrate this standard into your development workflow, execute the following command in your terminal within the OpenClaw environment:
clawhub install openclaw/skills/skills/gabrielsubtil/clean-code
Ensure that you have sufficient permissions to update your local agent skill directory. Once installed, the agent will automatically apply these heuristics to all subsequent code generation tasks.
Use Cases
- Refactoring legacy codebases that have become brittle or hard to read.
- Rapid feature development where maintaining a clean architecture is required from day one.
- Onboarding AI-generated code into production environments where quality standards are high.
- Reducing the cognitive load for team members by enforcing consistent naming conventions and structure.
- Automating the removal of redundant code and "magic numbers" that plague enterprise systems.
Example Prompts
- "Refactor the UserAuthentication module using the clean-code standards, ensuring we use guard clauses instead of nested conditionals and strictly following the SRP."
- "Review the current order processing function. It currently exceeds 50 lines; please split it into smaller, composable functions while ensuring no side effects."
- "Create a new data service for our API integration. Remember to keep the logic flat, use intentional naming for all variables, and remove any unnecessary helper functions that only exist in one place."
Tips & Limitations
To get the most out of this skill, always consider the system impact before asking the agent to modify shared files. Because this skill prioritizes guard clauses and flat structure, it may significantly alter the indentation and flow of your existing code. While it excels at writing clean, production-ready logic, it relies on the user to provide clear context regarding existing file dependencies. It is recommended to perform a git diff after the agent executes changes to ensure that imports and interface signatures remain intact across the dependency tree. Avoid using this skill for highly obscure, experimental algorithms where the overhead of modularization might temporarily impede performance testing.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-gabrielsubtil-clean-code": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution