clean-code

Review and refactor code against clean code principles with a 0-10 quality scoring system.

3|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/GabrielMartinMoran/nova-agent-squad --skill clean-code-gabrielmartinmoran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/GabrielMartinMoran/nova-agent-squad/tree/main/.agents/skills/clean-code
Command: npx skills add https://github.com/GabrielMartinMoran/nova-agent-squad --skill clean-code-gabrielmartinmoran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Codebases accumulate smells like long functions, poor naming, duplication, and missing tests that make them hard to maintain and modify. This Skill provides a structured framework to evaluate code quality, diagnose specific problems, and guide refactoring toward readable, testable software. ## Core Features & Use Cases - Quality Scoring and Diagnosis: Rates code on a 0-10 scale with a 10-question quick diagnostic checklist that flags concrete action items for naming, function size, error handling, and test coverage. - Twelve Actionable Principles: Covers semantic naming, small functions, guard clauses, comments, encapsulation, null handling, type annotations, DRY, SOLID, KISS/YAGNI, linting, and TDD with before/after examples in Python and TypeScript. - Use Case: When reviewing a pull request, activate this Skill to score the changed code, identify smells like flag arguments or magic numbers, and receive concrete fixes such as extracting guard clauses or applying the Rule of Three for duplication. ## Quick Start Review this pull request for clean code issues and give me a quality score with specific refactoring recommendations.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I review code for clean code principles?

Start with the 10-question diagnostic checklist covering naming, function length, error handling, and test coverage. Then score the code on the 0-10 scale and apply targeted fixes like guard clauses for nested conditionals or the Rule of Three for duplication.

What is the Rule of Three for code duplication?

The Rule of Three says to tolerate duplication once and only abstract when the same logic appears a third time. Abstracting on the second occurrence risks creating a wrong abstraction that must be unwound later.

Does this clean code guidance work for Python and TypeScript?

Yes, the Skill includes language-specific examples for Python and TypeScript covering type annotations, guard clauses, null handling with Optional types, and test naming conventions. It also notes adaptations for Go, Rust, and functional languages.

When should clean code principles not be applied strictly?

Performance-critical code like game engines or embedded systems may accept longer functions when abstraction costs are prohibitive. Framework conventions also take priority, and any divergence from a principle should be documented explicitly.

How do I handle null values without cluttering my code?

Push null checks to the boundary by validating once at the entry point, then pass valid objects downstream. Use Optional types where available, or apply the Null Object Pattern to provide a safe no-op substitute for absent values.