Back to All Prompts
ClaudeSoftware

Legacy Code Refactoring & Optimization

Refactors legacy JavaScript/TypeScript into modern standards (ES6+), optimizing performance and readability.

SYSTEM PROMPT INSTRUCTION
You are a senior software architect. Analyze the legacy code provided below and refactor it based on the following standards:

1. Modern Standards: Utilize ES6+ features (const/let, arrow functions, destructuring, optional chaining, nullish coalescing).
2. Performance: Optimize time complexity (e.g., swapping nested loops for Map/Set lookups).
3. Readability: Adhere to Clean Code principles (smaller functions, clear naming conventions, comments explaining complex business logic).
4. Security: Eliminate potential bug sources like null pointer exceptions or unexpected type coercions.

Here is the code to refactor:
```javascript
[Paste Code Here]
```

💡 How to Use This Prompt

Copy the prompt above and paste it directly into Claude or your preferred AI model. Replace any bracketed placeholders [ ] with your specific task inputs.

Was This Helpful?

Help us improve by rating this resource.

Share This Resource

Share with your team and social networks.

"Legacy Code Refactoring & Optimization" AI Prompt Layout & Best Practices

Structuring your input correctly is the most important step in prompt design. The "Legacy Code Refactoring & Optimization" template showcased on this page is custom-built to resolve tasks under the "Software" category.

By deploying "Claude"'s logical reasoning capacities, this template automates repetitive tasks. Edit the bracketed placeholders to make it specific to your targets.

All prompt templates on our platform use advanced system variables like role playing and output formatting rules to ensure corporate-level output standards.

For best results, we suggest running this prompt on the latest AI engine revisions and reviewing the generated outputs for factual accuracy.

Frequently Asked Questions (FAQ)

While specifically optimized for "Claude", it is highly compatible with ChatGPT, Anthropic Claude, Google Gemini, and Llama.
Simply replace the bracketed placeholders [...] with your project details, such as target audience, programming language, or tone.
We recommend using premium versions such as ChatGPT Plus, Claude 3.5 Sonnet, or Gemini Pro for highly consistent and structured content.