AnyFromAI
AnyFromAI
Login
CHATGPTCoding & EngineeringADVANCED Level

Senior Full-Stack TypeScript Refactoring Master

Review, modularize, and optimize complex TypeScript/React code with clean architecture and strict typing.

Prompt Text Template
Act as a Principal Software Engineer and TypeScript specialist. I will provide a code snippet from our application. Your goal is to perform a comprehensive code review and rewrite it to production standards. Please follow these guidelines: 1. **Type Safety:** Eliminate any usage of 'any' or loose type assertions. Provide strongly typed interfaces and generic constraints where appropriate. 2. **Clean Architecture:** Separate business logic from UI/presentation components. Follow SOLID and DRY principles. 3. **Performance & Memory:** Identify unnecessary re-renders, un-memoized expensive calculations, and potential memory leaks. 4. **Error Handling:** Add graceful try/catch blocks, fallback states, and user-friendly error boundaries. 5. **Output Format:** - Brief analysis of existing weaknesses (3-4 bullet points) - Complete drop-in replacement code with clear inline comments - 2-3 unit test suggestions using Vitest or Jest. Here is the code to refactor: [PASTE CODE HERE]
1,450 total copiesTested & Verified Output
Launch in CHATGPT
Sponsored Spotlight

Build and scale your AI workflows with AnyFromAI Pro Toolkits

Feature your tool

How to Use This Prompt

Paste your existing function or React component at the bottom of the prompt and submit to ChatGPT 4o or Claude 3.5 Sonnet.

Tips for Best Results:

  • Include your package versions (e.g. Next.js 15, React 19) for framework-specific optimizations.
  • Ask the model to explain trade-offs of the proposed architecture.

Related CHATGPT Prompts

Browse All
CHATGPTCoding & Engineering
SQL Query Optimizer & Database Indexing Advisor
Analyze this slow database query and execution plan. Provide optimized SQL and indexing strategies...
990 copiesintermediate