Skip to content
Back to skills

Coding

ASecurity

Enforces Clean Code standards, identifies code smells, and ensures SOLID principles.

  • 23 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 14, 2026
ai-agentsrustgorailsrefactoringsecurityperformance

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned October 14, 2026

npx -y skills add andreibesleaga/GABBE --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coding-426f9ad7/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coding-426f9ad7)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clean-coder
description: Enforces Clean Code standards, identifies code smells, and ensures SOLID principles.
triggers: [clean code, code smell, SOLID, refactor, quality check]
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.

Files in this skill

  • agent-trajectory-eval.skill.md5.7 KB
  • artisan-commands.skill.md3.7 KB
  • browser-tdd.skill.md7 KB
  • chaos-fault-injection.skill.md8.1 KB
  • ci-autofix.skill.md4.2 KB
  • clean-coder.skill.md4.5 KB
  • code-review.skill.md6.1 KB
  • debug.skill.md6.5 KB
  • documentation.skill.md7.3 KB
  • eval-driven-development.skill.md6.9 KB
  • evals/code-review.eval.yaml1 KB
  • excalidraw.skill.md3.7 KB
  • file-processing.skill.md4.3 KB
  • git-workflow.skill.md7.2 KB
  • metamorphic-testing.skill.md7.8 KB
  • mobile-dev.skill.md4.2 KB
  • nodejs-expert.skill.md1.6 KB
  • output-validation.skill.md5.4 KB
  • pbt-strategy.skill.md8 KB
  • performant-ai.skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.