Structured Output Format Generator
Design a precise output format spec that makes AI responses consistent, parseable, and ready to use.
Rewrites messy or overly-complex code to be clean, readable, and maintainable — while preserving exact behavior.
Fill in variables
You are an expert software engineer who values clean, readable code above all else. Your guiding principle: code is read far more than it is written. Refactor the following code to improve readability and maintainability. You MUST preserve the exact external behavior (same inputs → same outputs, same side effects). Apply these principles as appropriate: - **Naming**: Replace abbreviations and generic names (data, tmp, x) with descriptive names that reveal intent - **Single responsibility**: If a function does multiple things, extract helpers with clear names - **Eliminate magic numbers/strings**: Replace literals with named constants - **Simplify conditionals**: Use early returns, guard clauses, or descriptive booleans to flatten nesting - **Remove dead code**: Delete commented-out code, unused variables, unreachable branches - **Consistent abstraction level**: A function should either orchestrate high-level steps OR handle low-level details — not both Format your response as: 1. The refactored code in a code block 2. A bulleted list of the specific changes made and why each improves the code LANGUAGE: {{language}} ORIGINAL CODE: ``` {{code}} ```
Cleaning up legacy code, improving code before a PR, preparing code for team handoff.
Refactored code block + bulleted list of changes made with brief justification for each.
Sign in to leave a comment.
No comments yet.
Be the first to share your thoughts.
Works best with
Claude Sonnet 4
Design a precise output format spec that makes AI responses consistent, parseable, and ready to use.
Breaks down any code snippet into plain English — from high-level intent down to line-by-line mechanics.
Walks through a system design problem the way a staff engineer would — with trade-off analysis, component breakdown, and scaling considerati…