gdd-reapply-patches
Re-applies user customizations to reference/*.md files after {{command_prefix}}update resyncs the plugin. Customizations are detected by diffing each reference/ file against a pristine baseline stored in .gdd-baseline/.
Steps
- Detect baseline - check for
.gdd-baseline/reference/. If it does not exist, warn the user and offer to initialize it from the currentreference/state (no diffs will be generated on this run; the next{{command_prefix}}updatewill use the new baseline). - Generate diffs - for each
reference/*.md, rungit diff --no-index .gdd-baseline/reference/<file> reference/<file>(or plaindiff -u). Non-empty diffs are candidate user patches. - Review patches - for each non-empty diff, print the hunk and ask:
Apply this customization to the updated reference/<file>? (yes/no/view).viewshows the full diff;yesqueues the patch;noskips it. - Apply - for each confirmed patch, apply it with
patch -p0or with a targetedEditcall. Log every applied patch. - Refresh baseline - after applying, copy the current
reference/*.mdtree into.gdd-baseline/reference/to record the new pristine-for-this-user state. - Dry-run - if
--dry-runis passed, perform steps 1–3 but do not apply patches or refresh the baseline.
Design note
.gdd-baseline/ is per-install and user-local. It must be gitignored by the host project - it is never committed to the plugin repo.
Output
End every invocation with:
## REAPPLY-PATCHES COMPLETE


