clean-code-guard

Review generated or changed code against Clean Code, SOLID, DRY, KISS, YAGNI, and LLM failure-mode rules.

1|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill clean-code-guard-hamzaoui-louai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code-guard
Source: https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend/tree/main/.opencode/skills/clean%20code%20skills/clean-code-guard
Command: npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill clean-code-guard-hamzaoui-louai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI-generated and hastily written code often ships with systematic defects: swallowed errors, hallucinated API calls, premature abstractions, duplicated logic, and hardcoded fake success values. This Skill adds a structured guard pass that catches these issues before code is presented, committed, or merged. ## Core Features & Use Cases - Three operating modes: guard-pass mode checks diffs after code is written, live mode applies rules while writing, and review mode produces a structured findings report with severity levels. - 24 always-applied imperatives: covers naming, function size, parameter limits, comment discipline, SOLID, DRY/KISS/YAGNI, and 15 documented LLM failure modes backed by published research. - Self-check before delivery: an 8-point checklist verifies every diff, and a summary line reports fixes made or flags raised. - Use Case: After an agent implements an API endpoint, run the guard pass on the diff to catch a broad catch-all handler swallowing database errors and a hardcoded success return before the code is committed. ## Quick Start Review the code you just wrote using clean-code-guard and fix any violations before showing me the result.

Frequently Asked Questions about clean-code-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review AI-generated code for quality issues?

Run a guard pass on the diff checking for swallowed errors, hallucinated API calls, premature abstractions, duplicated logic, and hardcoded success returns. The skill provides 24 imperatives plus a structured review checklist that produces severity-ranked findings with concrete fixes.

What are the most common LLM code generation mistakes?

Documented failure modes include catch-all error handling that swallows failures, defensive guards for impossible cases, premature abstraction, comment pollution, code duplication, hallucinated packages, and mock fallbacks returned as real implementations. Research shows code duplication grew 8x and package hallucination averages 19.6% across models.

Does this code review skill require any tools or dependencies?

No. It is a portable instruction skill requiring no MCP server, network access, API key, shell command, or bundled script. It works in any runtime that supports SKILL.md files with linked references, and it complements rather than replaces project linters and test runners.

When should I not apply clean code review rules?

Skip the guard pass for conceptual questions, CI configuration, git workflow tasks, prose writing, and data analysis. The skill targets production code changes only, and project conventions override its rules when they conflict.

How do I handle disagreements with a code review finding?

Each rule cites a primary source such as Uncle Bob, Fowler, Hunt and Thomas, McCabe, or Metz, plus published 2024-2026 research. For context-specific overrides, document an exception comment naming the principle, the reason, and a revisit trigger.