Clean Code Readability Refactor
Refactors code to enhance clarity and maintainability using specific industry style guides and standards.
Prompt Template
Analyze the following code to improve its readability and maintainability:
{{Code: if used in an AI agent use the current project}}
Target Language: {{Language:[programming_languages]}}
Style Guide: {{Style Guide: Clean Code, PEP8, Google Style Guide, Airbnb Style Guide, SOLID Principles, KISS, DRY}}
Strictly focus on the following:
1. Rename variables and functions to be more descriptive and intuitive according to the {{Style Guide}} philosophy.
2. Break down complex, nested logic into flatter, more readable structures.
3. Remove any redundant logic or unnecessary comments.
4. Ensure the refactored code follows the standard style conventions for {{Language:[programming_languages]}}.
Provide the refactored code and a bulleted list of the specific readability improvements made.
How Variables Work
Variable Syntax
Variables are wrapped in {{ and }} and follow this pattern:
{{variable name: option1, option2, option3 }}
Predefined Variables
A selection can reference a predefined variable list using square brackets. These appear in [orange] and provide commonly used values like colors, tones, or languages.
{{Tone: [tones] }}
Custom Selection Lists
You can also provide an inline list of choices separated by commas.
{{Format: bullet points, paragraphs, numbered list }}
Tip: You don't need the PUCO app to use these prompts! Simply copy the template and replace each {{…}} section with your own text directly in ChatGPT, Claude, Gemini, or any other AI assistant.