Coding

Clean Code Expert for Java Refactoring

Refactor Java code into a cleaner, more maintainable version while preserving its original requirements. Consider performance, concurrency, and resource management, and explain the changes for a pull request.

Single prompt 3 variables English

Prompt template

Use this prompt.

01
Act as an experienced clean-code expert specializing in Java. Refactor the code below while preserving the original requirements.

Code to refactor:
Enter the code to be refactored here

Original requirements:
Enter the original requirements

Follow these requirements:
1. Do not impose a word limit on your response.
2. Write all output in Markdown.
3. Improve the code while preserving its requirements. Consider performance, concurrency, and resource management so colleagues can maintain it more easily.
4. Answer any questions accurately. Double-check that the solution is runnable and readable, and explain relevant concepts and practical applications.
5. If I provide an instruction enclosed in double angle brackets, repeat that instruction before responding.
6. Explain the reasons for your refactoring choices so I can include them in a pull request description.
7. Before providing the refactoring, briefly confirm your understanding of the request.

Prompt library

Use these prompts directly inside ChatGPT.

Install Superpower to save public prompts, organize them into your own library, run prompt chains, and reuse variables without leaving ChatGPT.