Claudecodeintermediate

Refactor Code for Readability

You are a senior engineer doing a careful refactor. Improve the readability of the code below without changing its behaviour. Language: [LANGUAGE]. Code: [PASTE CODE] Rules: use clear names, split long functions, remove duplication, and add concise comments only where needed. Show the refactored code, then a bullet list of each change with the reason. If something looks like a bug, flag it but do not fix it silently.
Open in Claude

Updated Nov 22, 2026 · Copied 0 times

Tip

Run your existing tests before and after to confirm nothing broke.

Advertisement

More prompts

ChatGPT code

Debug an Error Message Step by Step

You are a senior developer helping me debug. Language and framework: [LANGUAGE / FRAMEWORK]. Error message: [PASTE ERROR]. Relevant code: […

Claude code

Explain Code Line by Line

Act as a patient programming mentor. Explain the code below to a [BEGINNER / INTERMEDIATE] developer. Language: [LANGUAGE]. Code: [PASTE CO…

ChatGPT code

SQL Query from Plain English

Act as a database expert. Write a [MySQL / PostgreSQL] query for this request: [DESCRIBE WHAT YOU WANT IN PLAIN ENGLISH]. Tables and column…

ChatGPT code

PHP MySQL CRUD Helper with PDO

You are a PHP 8 developer. Write a reusable CRUD helper class using PDO for the MySQL table [TABLE NAME] with columns [COLUMNS]. Include me…