clean-code

Enforce pragmatic coding standards like SRP, DRY, and KISS.

Updated Nov 2, 2025
One-click install
npx skills add https://github.com/cpmappstudio/cpca-sports --skill clean-code-cpmappstudio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/cpmappstudio/cpca-sports/tree/main/.agents/skills/clean-code
Command: npx skills add https://github.com/cpmappstudio/cpca-sports --skill clean-code-cpmappstudio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pragmatic coding standards help teams avoid over-engineering, eliminate unnecessary boilerplate, and produce concise, readable code that is easier to maintain and extend.

Core Features & Use Cases

  • Single Responsibility Principle (SRP): each function or class does one thing, reducing coupling and increasing testability.
  • DRY, KISS, and YAGNI: minimize duplication, keep solutions simple, and avoid building features you won't use yet.
  • Naming & Function Guidelines: clear, self-descriptive names; small, side-effect-free functions; guard clauses and flat control flow.
  • Code Structure & Refactor Mindset: prefer composition, colocation of related logic, and avoidance of deep nesting.
  • Anti-Patterns to Avoid: avoid unnecessary comments, over-engineering, and creeping complexity; embrace clarity and minimalism.
  • Use Case: a developer refactors a module to improve readability and maintainability without changing external behavior.

Quick Start

Apply SRP, DRY, and KISS in your next refactor, streamline a function to be small and self-contained, and run a quick lint and test pass.

Frequently Asked Questions about clean-code

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

FAQPage Schema
What is the best way to refactor code for readability and maintainability?

Code refactoring for maintainability involves enforcing pragmatic standards like SRP, DRY, and KISS to reduce complexity. This approach restructures modules into small, self-contained functions with clear naming and flat control flow without changing external behavior.

How do I apply clean code principles to avoid over-engineering?

Applying clean code principles to avoid over-engineering requires strict adherence to YAGNI and KISS guidelines. These standards eliminate unnecessary boilerplate and creeping complexity by preventing the creation of unused features and favoring simple, minimal solutions over deep nesting.

How do I structure functions to follow the Single Responsibility Principle?

Structuring functions to follow the Single Responsibility Principle requires ensuring each function does only one thing. This reduces coupling and increases testability by using guard clauses for flat control flow and minimizing side effects within the codebase.

Does this coding standard work with any programming language?

Yes, these coding standards work across codebases of any programming language. They focus on universal software engineering principles like naming rules, DRY, and flat structures rather than language-specific syntax, benefiting both individual developers and teams.

What anti-patterns should I avoid when writing maintainable code?

Anti-patterns to avoid when writing maintainable code include unnecessary comments, over-engineering, and creeping complexity. Replacing these with clarity and minimalism ensures concise solutions that are easier to extend without introducing bugs.

When do I need to refactor a module for clean code compliance?

You need to refactor a module for clean code compliance when functions grow too large, side effects increase, or control flow becomes deeply nested. Applying composition and colocation of related logic during these times streamlines daily coding tasks.