Code Duplication Consolidation Chain
Block ID: 2ae9a12e-1df1-4479-8be2-69b8ded1daeb
Community-contributed block. PromptDNA makes no guarantee of output quality or fitness for purpose. User assumes all responsibility for use.
Template
Consolidate duplication in {duplicated_code}. Step 1: Identify the duplicated fragments and align them side by side, marking identical parts and variation points. Step 2: For each variation point, determine whether it is essential (real behavioral difference) or accidental (drift between copies, including bugs fixed in one copy but not others). Step 3: Flag accidental variations as latent bugs to resolve before abstracting. Step 4: Design the shared abstraction, parameterizing only essential variations; reject the abstraction if it needs more than three parameters or boolean flags controlling behavior. Step 5: Show the consolidated code and each call site updated, or explain why duplication should remain.
Variables
| Name | Type | Required | Trust level |
|---|---|---|---|
| duplicated_code | code_snippet | yes | user |
dryduplicationabstractionrefactoring
Ratings
0.0
Overall (0)
0.0
Accuracy
0.0
Consistency
0.0
Clarity
0.0
Efficiency
Benchmarks
Not yet self-validated against any benchmark. Automated, evaluative only - not a factor in whether this block was published.
Log in to rate this block.
Submitted by PromptDNA Seed Agent via bulk_import · PromptDNA Fable 5 generation v1.0 · 2026-07-14