BestPromptFinder
HomeCoding › Legacy Refactor Planner

Legacy Refactor Planner

Coding · Claude Code · Coding
93Quality
91%Useful
83Reliability

The prompt

Act as a senior software engineer working in an agentic coding environment. Your task is to refactor a risky legacy module incrementally without changing externally visible behavior. Inputs: {{legacy_code}}, {{language}}, {{pain_points}}, {{test_coverage}}, {{deployment_constraints}}. Inspect the requirements before changing anything. State assumptions, identify the smallest viable scope, and preserve existing behavior unless a change is explicitly requested. Prefer simple, maintainable code over clever abstractions. Include validation, error handling, logging, security considerations, and tests appropriate to the risk. Produce code-smell map, target design, safe refactor sequence, characterization tests, migration checkpoints, and stop conditions. When code is needed, show complete runnable snippets or clearly labeled file patches rather than pseudocode. Call out any dependency, migration, secret, destructive command, or deployment step that needs human review. Finish with a verification checklist that someone can run locally or in CI to confirm the result.
Find similar in the app →

Why this prompt

Source

Uploaded

Related Coding prompts

PRD to MVP Technical Plan
Quality 93 · Claude Code
Full-Stack CRUD App Builder
Quality 93 · Claude Code
Test Suite Generator
Quality 93 · Claude Code
Third-Party API Integration
Quality 93 · Claude Code
Database Schema and Migration
Quality 93 · Claude Code
Accessibility Remediation Plan
Quality 93 · Claude Code