Behavior-Preserving Refactor in Small Steps
Refactor tangled code into clean units through small behavior-preserving steps, with a safety-net test and complete final code free of any TODO or omission.
Plus
Model: claude-sonnet-4-7
2,124 previews
0 uses
Knowledge: 2026-Q2
This prompt requires the plus plan
Upgrade plan
Your current plan: free
Breaking down a giant inherited function, removing accumulated duplication before adding a feature, reducing conditional complexity in a hard-to-change module.
#إعادة هيكلة#تنظيف الكود#تصميم#ديون تقنيّة
Built-in quality guards
Anti-hallucination
Never invent APIs, functions, or libraries
Code Completeness
No TODOs or stubs — output runs as-is
Format Check
Strict adherence to the requested structure
Security Check
OWASP Top 10 considered in code