clean-code
Pragmatic coding standards for writing clean, maintainable code — naming, functions, structure, anti-patterns, and pre-edit safety checks. Use when writing new code, refactoring existing code, reviewing code quality, or establishing coding standards.
Why use this skill?
Enhance code quality with the clean-code skill for OpenClaw. Get expert guidance on naming, modular functions, architectural patterns, and refactoring.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/wpank/clean-code-reviewWhat This Skill Does
The clean-code skill is a comprehensive toolkit for OpenClaw AI agents designed to elevate code quality, enforce architectural standards, and reduce technical debt. It operates as an expert-level code reviewer and generator that focuses on readability, maintainability, and pragmatic software engineering principles. Rather than just offering syntax suggestions, it enforces core patterns like SRP (Single Responsibility Principle), DRY (Don't Repeat Yourself), and KISS (Keep It Simple). It provides concrete guidance on variable naming, function structure, and the elimination of anti-patterns, ensuring that every line of code produced by the agent is professional, predictable, and clean.
Installation
To integrate this skill into your environment, run the following command in your terminal:
npx clawhub@latest install clean-code
Use Cases
This skill is essential in several development scenarios. Use it when:
- Writing New Features: Ensure that new components are born with clean, scalable structures.
- Refactoring Legacy Code: Systematically break down "god functions" and reduce complexity in dense, unreadable codebases.
- Code Reviews: Act as a critical reviewer to catch naming issues, deep nesting, and logic flaws before they reach production.
- Standardizing Teams: Use the skill to generate coding standards for a project, ensuring consistent style across a team.
Example Prompts
- "Analyze this React component and apply guard clauses to flatten the logic and improve readability."
- "Review my current utility class. The function names are generic; suggest more descriptive names based on the domain logic and ensure SRP is followed."
- "I have a 100-line function that handles API calls, UI updates, and data formatting. Help me break this down into smaller, testable functions using the clean-code standards."
Tips & Limitations
- Tip: When using the skill, provide context about your framework (e.g., React, Node.js, Python/FastAPI) so the agent can suggest idiomatic improvements.
- Tip: Leverage the 'Boy Scout' principle—aim to improve just one module at a time rather than refactoring the entire repository in one go.
- Limitation: This skill focuses on logic and structure; it does not replace the need for unit testing or integration testing. Always run your test suite after applying suggested refactors to ensure behavioral parity.
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-wpank-clean-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
mermaid-diagrams
Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and other diagram types. Triggers include requests to diagram, visualize, model, map out, or show the flow of a system.
api-design-principles
Skill by wpank
auto-context
Automatically read relevant context before major actions. Loads TODO.md, roadmap.md, handoffs, task plans, and other project context files so the AI operates with full situational awareness. Use when starting a task, implementing a feature, refactoring, debugging, planning, or resuming a session.
clear-writing
Write clear, concise prose for humans — documentation, READMEs, API docs, commit messages, error messages, UI text, reports, and explanations. Combines Strunk's rules for clearer prose with technical documentation patterns, structure templates, and review checklists.
track-performance
Track the performance of Uniswap LP positions over time — check which positions need attention, are out of range, or have uncollected fees. Use when the user asks how their positions are doing.