What problem does it solve?
When a code patch corrupts a file (syntax errors, misplaced code blocks, silent missing imports), manual incremental fixes often compound the damage, leading to wasted debugging time and further broken state.
Core Features & Use Cases
- Git-based recovery workflow: Restore files to their last known clean state using version control, eliminating the risk of fixing broken code with more broken patches.
- Verification guardrails: Includes step-by-step checks using typecheck and runtime validation to confirm fixes work before committing.
- Prevention and detection guidance: Covers common patch pitfalls like adjacent-anchor false matches and silent import deletions, with recipes to catch and avoid them.
Use case example: If a patch accidentally inserts a PDF parsing function inside the wrong file scope, this skill walks you through restoring the original file and re-applying the change correctly without introducing new errors.
Quick Start
Use the patch-corruption-recovery skill to restore the corrupted backend/src/routes/chat.ts file to its last clean Git state and re-apply the pdf-parse patch with verification checks after each individual change.