clean-code-principles

Enforce clean code principles in TypeScript code generation and refactoring.

3|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill clean-code-principles-mauriciodelrio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code-principles
Source: https://github.com/mauriciodelrio/delriodev-skills/tree/main/es-skills/software/clean-code-principles
Command: npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill clean-code-principles-mauriciodelrio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a consistent set of clean code rules during code generation and refactoring so produced code is maintainable, testable, and easy to reason about. It prevents common anti-patterns like oversized functions, poor naming, improper layering, and premature abstractions that increase technical debt.

Core Features & Use Cases

  • SOLID enforcement: Guidance to structure modules and services with single responsibility, open/closed design, and dependency inversion.
  • Style and safety rules: DRY, KISS, YAGNI, atomic functions, guard clauses, immutability, encapsulation, and composition over inheritance.
  • Documentation and boundaries: Encourage JSDoc for business intent, strict boundary validation, separation of concerns, and error handling placement.
  • Practical use cases: Refactor an imperative handler into small pure functions, design repository interfaces with segregation, produce TypeScript-safe APIs, and create readable, testable components.

Quick Start

Apply clean-code-principles to the following code generation task and refactor the implementation to follow SOLID, DRY, guard clauses, immutability, expressive naming, and JSDoc for business intent.

Frequently Asked Questions about clean-code-principles

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

FAQPage Schema
How do I refactor TypeScript code to follow SOLID principles and clean code best practices?

Refactoring TypeScript to follow SOLID principles and clean code involves enforcing single responsibility, guard clauses, and atomic functions. This approach restructures imperative handlers into small pure functions, ensuring maintainability, testability, and clear separation of concerns.

What is the best way to enforce DRY and KISS principles during TypeScript code generation?

Enforcing DRY and KISS principles during code generation prevents common anti-patterns like premature abstractions and oversized functions. It applies strict immutability, encapsulation, and composition over inheritance to produce readable, maintainable, and well-documented TypeScript implementations.

Does this clean code approach work for both frontend and backend TypeScript development?

Yes, this clean code approach applies to TypeScript frontend and backend generation. It validates boundary inputs, ensures strict separation of concerns, and produces TypeScript-safe APIs and readable components across the entire developer workflow.

How do I add JSDoc for business intent when writing maintainable production code?

Adding JSDoc for business intent when writing maintainable production code requires documenting the purpose and rules of each module. This ensures generated implementations are well-documented, testable, and easy to reason about, reducing technical debt caused by poor naming and improper layering.

When should I use guard clauses and immutability to improve code quality in TypeScript?

You should use guard clauses and immutability to improve code quality whenever you need to handle boundary validation and prevent side effects. This practice ensures early error handling placement and predictable state changes, resulting in atomic functions and testable implementations.

Why does applying YAGNI and separation of concerns reduce technical debt in refactoring tasks?

Applying YAGNI and separation of concerns reduces technical debt by preventing premature abstractions and improper layering during refactoring tasks. It enforces strict boundary validation and single responsibility, ensuring the resulting codebase remains maintainable and easy to reason about.