mcaf-solid-maintainability

Refactor large files and classes to enforce SOLID principles and maintainability limits.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/managedcode/MCPGateway --skill mcaf-solid-maintainability
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mcaf-solid-maintainability
Source: https://github.com/managedcode/MCPGateway/tree/main/.codex/skills/mcaf-solid-maintainability
Command: npx skills add https://github.com/managedcode/MCPGateway --skill mcaf-solid-maintainability

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses code that has become too large, too complex, or too tightly coupled, making it difficult to understand, modify, and test. It enforces principles of good software design to improve long-term project health.

Core Features & Use Cases

  • SOLID & SRP Enforcement: Refactors code to adhere to the Single Responsibility Principle and other SOLID principles.
  • Maintainability Limits: Helps set and enforce limits on file size, type size, and function complexity.
  • Use Case: Refactor a 700-line service class into smaller, more cohesive units, ensuring each new part has a clear responsibility and is easily testable.

Quick Start

Refactor the attached file 'large_service.cs' to adhere to SOLID principles and reduce its line count.

Frequently Asked Questions about mcaf-solid-maintainability

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

FAQPage Schema
How do I refactor a large service class to follow SOLID principles and improve maintainability?▼

To refactor a large service class for SOLID maintainability, you apply the Single Responsibility Principle, increase cohesion, and use composition-over-inheritance to break it into smaller, easily testable units.

What is the Single Responsibility Principle and how does it help manage code complexity?▼

The Single Responsibility Principle (SRP) is a SOLID design pattern that ensures each class or module has only one reason to change, directly reducing code complexity and making large files easier to understand, modify, and test.

How do I set and enforce maintainability limits for file size and function complexity?▼

You can set and enforce maintainability limits by defining constraints for file size, type size, and function complexity within an AGENTS.md file at the root or local directory level, which the code review process then uses to enforce small-file discipline.

Does this refactoring approach require repository write access to apply design patterns?▼

Yes, applying SOLID design patterns and refactoring tightly coupled code requires repository write access to modify the source files, enforce maintainability limits in AGENTS.md, and document any justified exceptions to the design rules.

When should I use composition over inheritance to reduce tight coupling in my code?▼

You should use composition over inheritance to reduce tight coupling when refactoring large, complex classes into smaller, cohesive units, ensuring each new part has a clear responsibility and is easily testable without rigid class hierarchies.