Category
Code & Dev

Understand and Refactor an Existing Codebase

Analyze an unfamiliar codebase, identify structural and maintenance issues, and propose improvements without changing functionality.

By Threads — Published on — Modified on

Prompt template

Format
Text Parameterized
Inputs
codebase (code, text) · Required
Outputs
analysis_and_refactored_code (text, code)

Replace the ${…} placeholders with your values before using this prompt. See parameters and defaults below.

Think like a senior engineer who has just joined an unfamiliar codebase. Understand its architecture and data flow, then identify structural problems, duplicated code, bottlenecks, and maintainability risks.

Provide:
- An architecture summary
- Problem areas
- A refactoring strategy
- Improved code

Keep functionality unchanged.

Codebase and relevant context:
${codebase}

Parameters

Replace each placeholder with your own value, or use its default when one is provided.

${codebase} codebase Required

Comments — 0