clean-code

Enforce pragmatic clean-code standards for naming, function structure, and maintainability.

Updated Dec 20, 2023
One-click install
npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill clean-code-thiago-cruz-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/Thiago-Cruz-eng/Hibrygame/tree/main/.claude/skills/clean-code
Command: npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill clean-code-thiago-cruz-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The clean-code skill reduces maintainability problems by enforcing pragmatic coding standards, helping you write clearer code with fewer bugs and less rework.

Core Features & Use Cases

  • Pragmatic conventions: Promotes SRP, DRY, KISS, YAGNI, and the Boy Scout rule to keep code readable and evolving safely.
  • Naming & function rules: Enforces intent-revealing names, small functions, limited arguments, and minimal side effects.
  • AI coding behavior guidelines: Directs the AI to implement features or fixes immediately without over-explaining and to ask when requirements are unclear.
  • Edit-safety checklist: Requires thinking about imports, dependencies, and test impact before changing any file.

Quick Start

Use the clean-code skill to revise a proposed implementation and return a refactored version that follows naming, small-function, guard-clause, and no-unnecessary-comments rules.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I refactor code to follow clean code standards?

Clean code refactoring enforces pragmatic standards like SRP, DRY, KISS, and YAGNI to improve naming, function structure, and maintainability. It focuses on intent-revealing names, small functions, guard clauses, and minimal comments to reduce bugs and rework.

What are guard clauses and how do they improve function design?

Guard clauses are early returns in function design that prevent deep nesting and minimize side effects. Clean code standards enforce using guard clauses alongside limited arguments and small functions to keep code readable and reduce unintended side effects.

Can I use clean code conventions for feature implementation and bug fixes?

Clean code conventions apply directly to feature implementations and bug fixes across typical app codebases. They direct the AI to implement changes immediately, avoid over-engineering, and follow an edit-safety checklist to update dependent files and tests consistently.

What's the best way to enforce coding standards like DRY and KISS in my codebase?

Enforcing coding standards like DRY and KISS requires applying the Boy Scout rule to keep code evolving safely. It involves checking imports, dependencies, and test impact before changing any file, ensuring low coupling and clarity across the codebase.

Why does clean code minimize comments and avoid over-explaining?

Clean code minimizes comments to prioritize intent-revealing names and self-documenting function structure over explanatory text. It directs the AI to implement features concisely without over-explaining, asking for clarification only when requirements are unclear.