Break a monolith function into modules
Decompose an oversized function into small, single-responsibility modules with clean interfaces. Every resulting unit is independently testable.
Preview
Copy prompt
This function is doing too many things and is difficult to test and maintain: [Paste code]. Decompose it into smaller, single-responsibility functions or modules with clearly defined inputs and outputs. Explain the reasoning behind each split, define the interfaces between the resulting units, ensure each part is independently testable, and confirm that the original external behaviour is fully preserved.
More
Refactoring
Prompts
