Understand and Refactor an Existing Codebase
Analyze an unfamiliar codebase, identify structural and maintenance issues, and propose improvements without changing functionality.
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