God Class & Monolithic Method Decomposition (SOLID)
Decompose monolithic 1,000+ line classes into Single Responsibility components using SOLID design patterns.
Decompose monolithic classes into decoupled, Single Responsibility components adhering to SOLID principles with clean dependency injection.
Execution Workflow Procedure
Ordered steps the coding agent executes when performing this skill.
Map Domain Responsibilities
Group the methods and state of the God Class into distinct concerns (e.g. Auth, Billing, Notifications, Persistence).
Extract Interfaces & Services
Define clean interfaces for each extracted domain service and wire them via constructor dependency injection.
Preserve Facade Backward Compatibility
Retain the original class as a thin delegating Facade to ensure existing callers remain completely unaffected.
Agent Safety Guardrails & Anti-Hallucination Rules
- DO NOT break existing public method signatures; delegate to new services through the existing facade.
- DO NOT create circular dependencies between extracted services.
Expected Output Format
Extracted services, interface contracts, and the updated delegating facade.
Domain Verification Checks
Example Agent Invocations
Install / Configure This Skill
# Place in .cursorrules or create .cursor/rules/god-class-solid-decomposition.mdc # Trigger: Whenever you perform god class & monolithic method decomposition (solid) --- name: god-class-solid-decomposition description: Deconstruct 1,000+ line monolithic classes into decoupled SOLID services using Facade and Strategy patterns. version: 1.0.0 compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity] --- # God Class & Monolithic Method Decomposition (SOLID) ## Objective Split oversized classes into focused, single-responsibility components while preserving backward compatibility. ## Workflow 1. **Responsibility Grouping**: Cluster methods by domain concern (Auth, Billing, Storage, Email). 2. **Service Extraction**: Extract interfaces and implementations with dependency injection. 3. **Facade Delegation**: Retain the original class as a thin facade delegating to the new services.
Need a quick one-time prompt for chat?
Try the God Class & Long Method Decomposition with Design Patterns — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Safe Legacy Code Modernization with Golden Master Tests
Safely modernize fragile legacy codebases using Martin Fowler refactoring patterns and characterization tests.
Layered Monolith to Hexagonal / Clean Architecture Refactor
Refactor tangled MVC controllers and service layers into Clean Architecture (Ports & Adapters).
Spring Boot Service & JPA Code Review
Rigorous code review workflow for Spring Boot services examining transactions, JPA queries, concurrency, and validation.