software-design-patterns-and-clean-code

Enforce SOLID and Clean Code practices across coding, refactoring, debugging, and reviewing.

Updated Dec 11, 2025
One-click install
npx skills add https://github.com/CareCard-ca/pkg-auth-util --skill software-design-patterns-and-clean-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: software-design-patterns-and-clean-code
Source: https://github.com/CareCard-ca/pkg-auth-util/tree/main/.agents/skills/software-design-patterns-and-clean-code
Command: npx skills add https://github.com/CareCard-ca/pkg-auth-util --skill software-design-patterns-and-clean-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces maintenance risk and engineering churn by ensuring every change follows pragmatic design patterns, SOLID principles, and Clean Code practices that keep logic readable, separated, and easy to test.

Core Features & Use Cases

  • Pragmatic patterns and SOLID: Apply design patterns only when they reduce real complexity and improve clarity or testability, with special focus on Single Responsibility and Dependency Inversion.
  • Separation of concerns: Maintain clear boundaries between orchestration, domain logic, validation, persistence, formatting, and side effects so behavior is predictable and reviewable.
  • Testable, minimal side effects: Prefer small composable functions and pure functions for transforms and validation, localize side effects, and add explicit error handling with actionable context.
  • Use Case: Refactoring authentication/authorization utilities or debugging token/password logic by restructuring code into testable units without broad unrelated rewrites.

Quick Start

Use this skill before coding, refactoring, debugging, or reviewing changes in this repository to align the implementation with pragmatic design patterns, SOLID, and Clean Code, while keeping changes focused and safely testable.

Frequently Asked Questions about software-design-patterns-and-clean-code

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

FAQPage Schema
How do I refactor code to follow SOLID principles and improve testability?

Refactoring for SOLID principles and testability involves restructuring logic into small composable functions, applying dependency inversion at boundaries, and localizing side effects. This ensures behavior remains predictable, readable, and safely testable without broad unrelated rewrites.

What is separation of concerns in clean code and when should I apply it?

Separation of concerns in clean code maintains clear boundaries between orchestration, domain logic, validation, persistence, and side effects. Apply it during coding or refactoring to keep behavior predictable, reviewable, and isolated for easier debugging.

When should I use software design patterns to reduce code complexity?

Use software design patterns only when they reduce real complexity and improve clarity or testability. Pragmatic application focuses on Single Responsibility and Dependency Inversion to prevent fragile implementations and minimize engineering churn.

How do I handle side effects and error handling in pure functions?

Handle side effects in pure functions by localizing them outside transforms and validation, preferring small composable functions. Add explicit error handling with actionable context to ensure logic remains readable, predictable, and easy to test.

Can I use clean code practices for debugging authentication utilities?

Yes, you can use clean code practices for debugging authentication utilities by restructuring token and password logic into testable units. Apply separation of concerns and minimal side effects to isolate issues without broad unrelated rewrites.

What is the best way to review code for minimal side effects and explicit error handling?

The best way to review code for minimal side effects is to verify logic is split into small composable functions with localized side effects. Check for explicit error handling with actionable context and function-level comments stating applied SOLID principles.