clean-coder
/clean-coder
Enforces Clean Code standards, identifies code smells, and ensures SOLID principles. Use when: clean code, code smell, SOLID, refactor, quality check.
- Author
- andreibesleaga ↗
- Repository
- gabbe ↗
- Licence
- CC-BY-4.0
- Last repository change
- 24.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.
CC-BY-4.0, otwarta.
What it does and when to use it
Enforces Clean Code standards, identifies code smells, and ensures SOLID principles. Use when: clean code, code smell, SOLID, refactor, quality check.
Original author description
Enforces Clean Code standards, identifies code smells, and ensures SOLID principles. Use when: clean code, code smell, SOLID, refactor, quality check.
How it works
- Goal
- Core Principles (2025 Standards)
- Common Code Smells
- Steps
- Checklist
- Security & Guardrails
SKILL.md preview
---
name: clean-coder
description: "Enforces Clean Code standards, identifies code smells, and ensures SOLID principles. Use when: clean code, code smell, SOLID, refactor, quality check."
license: CC-BY-SA-4.0
metadata:
source: "agents/skills/coding/clean-coder.skill.md"
tags: "coding"
core: "true"
context_cost: "medium"
---
# Clean Coder Skill
## Goal
To ensure code is readable, maintainable, and free of technical debt "smells" before it merges.
## Core Principles (2025 Standards)
1. **SOLID**:
- **S**ingle Responsibility: One reason to change.
- **O**pen/Closed: Open for extension, closed for modification.
- **L**iskov Substitution: Subtypes must be substitutable.
- **I**nterface Segregation: Tiny, focused interfaces.
- **D**ependency Inversion: Depend on abstractions, not concretions.
2. **DRY (Don't Repeat Yourself)**: Abstract logic, not just code.
3. **KISS (Keep It Simple, Stupid)**: Simplest solution that works.
4. **YAGNI (You Ain't Gonna Need It)**: Don't implement future features now.
## Common Code Smells
- **Long Method**: > 20 lines (heuristic). Extract Method.
- **Large Class**: Too many responsibilities. Extract Class.
- **Primitive Obsession**: Using strings/ints instead of Value Objects.
- **Feature Envy**: Using data from another object more than its own.
- **Shotgun Surgery**: One change requires edits in many classes.
## Steps
When reviewing or writing code:
1. **Scan for Smells**: Check against the `clean-code-principles.md` guide.
2. **Suggest Refactoring**: "Split this huge function into 3 smaller ones: `validateInput`, `processData`, `saveResult`."
3. **Verify Naming**: Variables should be descriptive (`userAssumingRole` vs `u`).
4. **Check Comments**: Code should be self-documenting. Comments explain *why*, not *what*.
## Checklist
- [ ] Descriptive naming?
- [ ] Functions do one thing?
- [ ] No duplicated logic?
- [ ] No magic numbers/strings?
- [ ] Dependencies injected?
## Security & Guardrails
### 1. Skill Security (Clean Coder)
- **Security-Blind Refactoring**: The agent might "clean up" authentication or encryption logic by simplifying it, inadvertently removing critical, non-obvious security mitigations (like constant-time string comparisons to prevent timing attacks, or explicit memory zeroing). The agent must flag any refactoring of cryptographic, authentication, or authorization modules as requiring immediate, mandatory human security review.
- **Over-Abstraction Vulnerabilities**: In pursuit of DRY and SOLID principles, the agent might extract logic into generic, highly abstract base classes or dynamic factory methods. This can obscure the control flow, making it exceptionally difficult for static analysis tools (SAST) to track tainted data from source to sink. "Clean" code must not sacrifice security auditability; the agent must prioritize explicit data flows over extreme abstraction.
### 2. System Integration Security
- **Log Forgetting via KISS**: While applying the KISS (Keep It Simple, Stupid) principle, the agent might identify verbose security logging or audit trailing as "unnecessary complication" and remove it to simplify the function. The agent must treat explicit Audit Logging and Security Telemetry components as mathematically untouchable by standard "Clean Code" heuristics.
- **Dependency Inversion Payload Injection**: When enforcing Dependency Inversion (Step 1.5), the agent might advocate for dynamic dependency injection config (e.g., loading concrete classes by string name at runtime). If an attacker can control those configuration strings, they achieve arbitrary code execution. The agent must verify that all Dependency Injection implementations rely on explicit, type-safe bindings, not untrusted runtime variables.
### 3. LLM & Agent Guardrails
- **Aesthetic Over Optimization**: The LLM might become obsessed with the *appearance* of clean code (e.g., converting all `if/else` chains into complex functional `reduce` operations) without considering the performance or readability impact for human maintainers. The checklist (Step 4) must enforce a "Readability First" constraint—if a refactored function requires more cognitive load to understand than the original, the refactor is rejected.
- **Hallucinated "Smells"**: Due to pattern misrecognition, the LLM might hallucinate a "Shotgun Surgery" smell where none exists, proposing massive, deeply invasive architectural changes for a minor feature PR. The agent must quantifiably prove the existence of a smell (e.g., citing exactly which 5 files will need changing) before suggesting sweeping architectural refactoring.
Versions
The database has no other skills named clean-coder.
Database snapshot: 13.11.2026 · package version 23a708192bea (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100clean-code
This skill should be used when the user asks to "refactor code", "review code quality", "apply clean code principles", "check for code smells", "improve code design", "do a clean code review", "apply SOLID principles", "fix naming", "reduce complexity", or when performing the… - 90clean-code
Clean Code 规范总览与路由,覆盖命名、函数、注释、格式、对象与数据结构、错误处理、边界、测试、类、系统、并发、简单设计、渐进式重构及各类代码坏味道。当用户进行代码审查、重构、写新代码或询问 Clean Code / 整洁代码 / 代码坏味道相关规范时使用,并按主题加载 references 中的对应规则文件。Use for code review, refactor, writing new code, or any clean code / code smell / readability question; routes to the… - 100clean-code
Clean code principles. Covers naming, functions, and readability. Use when writing or reviewing code for quality. USE WHEN: user mentions "code quality", "readability", "refactor", "clean up code", "naming", "magic numbers", asks about "how to write better code", "code smells",… - 100clean-code-principles
SOLID principles, design patterns, DRY, KISS, and clean code fundamentals. Use when reviewing architecture, checking code quality, refactoring, or discussing design decisions. Triggers on "review architecture", "check code quality", "SOLID principles", "design patterns", or "clean code". - 100code-refactoring-refactor-clean
Refactor code with clean code principles, SOLID design patterns, and modern software engineering practices to improve quality, maintainability, and performance. Use when cleaning up or restructuring existing code. - 100codebase-cleanup-refactor-clean
Refactor code with clean code principles, SOLID design patterns, and modern software engineering practices to improve quality, maintainability, and performance. Use when cleaning up or restructuring existing code.