Understand and Refactor an Existing Codebase

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

Artificial Intelligence | AI Tools | AI Prompts Republished on Oct 20 0 Bookmarks 0 Copies
Bookmark 0

Prompt template

Format
Text Parameterized
Inputs
codebase (code, text) · Required
Outputs
analysis_and_refactored_code (text, code)
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}

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

Parameters

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

${codebase} codebase Required

What you'll create

An architecture and data-flow summary identifies duplication, structural problems and bottlenecks. A refactoring strategy and improved code address those risks while preserving functionality.

Frequently asked questions

Should the refactor change product behavior?

No, functionality is explicitly required to remain unchanged.

Comments

Tried this prompt? Share what you made, compare results, or ask a question

Up to 4 results. Images up to 2 MB; MP4, WebM, or MOV videos up to 4 MB each