clean-code

Apply pragmatic coding standards like SRP, DRY, KISS, and YAGNI to AI-generated code.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/rieckt/create-loumi-app --skill clean-code-rieckt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/rieckt/create-loumi-app/tree/main/template/skills/base/clean-code
Command: npx skills add https://github.com/rieckt/create-loumi-app --skill clean-code-rieckt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pragmatic coding standards help AI-generated code be concise, readable, and maintainable, reducing defects and onboarding effort.

Core Features & Use Cases

  • SRP: Single Responsibility Principle ensures functions/classes do one thing.
  • DRY: Don't Repeat Yourself promotes reuse and reduces duplication.
  • KISS: Keep It Simple - prefer simple, clear solutions.
  • YAGNI: You Aren't Gonna Need It - avoid unnecessary features or complexity.
  • Anti-pattern awareness: avoid over-commenting, deep nesting, and God functions.
  • Code structure tips: guard clauses, flat nesting, and tight coupling.

Quick Start

Provide plain language prompts to apply pragmatic coding standards to a given code snippet, for example: "Refactor this function to be smaller, rename variables for clarity, and remove duplicated logic."

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I refactor AI-generated code to be more maintainable?

You can refactor code to be more maintainable by applying pragmatic coding standards like SRP, DRY, KISS, and YAGNI. This ensures functions do one thing, removes duplicated logic, and reduces deep nesting to minimize defects and onboarding effort.

What are the best practices for reducing code duplication and complexity?

Best practices for reducing code duplication and complexity include applying the DRY principle to promote reuse and KISS to prefer simple solutions. Additionally, following YAGNI avoids unnecessary features, keeping the codebase concise and maintainable.

How do I use guard clauses to flatten deeply nested functions?

You use guard clauses to flatten deeply nested functions by checking for edge cases early and returning immediately. This promotes a flat structure, limits function length, and eliminates the need for complex conditional nesting in your modules.

When should I remove comments during a code review?

You should remove comments during a code review when they are unnecessary and the code is self-documenting through clear naming conventions. Avoiding over-commenting is an anti-pattern awareness practice that keeps the logic concise and readable.

Can I enforce single responsibility principle on existing modules?

Yes, you can enforce the Single Responsibility Principle on existing modules through controlled refactoring. By breaking down God functions into smaller, dedicated components, you ensure each module does exactly one thing, improving overall maintainability.

What is the best way to apply coding standards to plain language prompts?

The best way to apply coding standards to plain language prompts is to explicitly request refactoring actions, such as making functions smaller, renaming variables for clarity, and removing duplicated logic to generate concise, AI-powered code.