.agent/skills/gsd-reapply-patches/SKILL.md
Reapply local modifications after a GSD update
npx skillsauth add Ahmed-chouaya/algomath gsd-reapply-patchesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Check for local patches directory:
# Global install — detect runtime config directory
if [ -d "$HOME/.config/opencode/gsd-local-patches" ]; then
PATCHES_DIR="$HOME/.config/opencode/gsd-local-patches"
elif [ -d "$HOME/.opencode/gsd-local-patches" ]; then
PATCHES_DIR="$HOME/.opencode/gsd-local-patches"
elif [ -d "$HOME/.gemini/gsd-local-patches" ]; then
PATCHES_DIR="$HOME/.gemini/gsd-local-patches"
else
PATCHES_DIR=".agent/gsd-local-patches"
fi
# Local install fallback — check all runtime directories
if [ ! -d "$PATCHES_DIR" ]; then
for dir in .config/opencode .opencode .gemini .claude; do
if [ -d "./$dir/gsd-local-patches" ]; then
PATCHES_DIR="./$dir/gsd-local-patches"
break
fi
done
fi
Read backup-meta.json from the patches directory.
If no patches found:
No local patches found. Nothing to reapply.
Local patches are automatically saved when you run /gsd-update
after modifying any GSD workflow, command, or agent files.
Exit.
## Local Patches to Reapply
**Backed up from:** v{from_version}
**Current version:** {read VERSION file}
**Files modified:** {count}
| # | File | Status |
|---|------|--------|
| 1 | {file_path} | Pending |
| 2 | {file_path} | Pending |
For each file in backup-meta.json:
Read the backed-up version (user's modified copy from gsd-local-patches/)
Read the newly installed version (current file after update)
Compare and merge:
Merge strategy:
Write merged result to the installed location
Report status:
Merged — user modifications applied cleanlySkipped — modification already in upstreamConflict — user chose resolutionAfter reapplying, regenerate the file manifest so future updates correctly detect these as user modifications:
# The manifest will be regenerated on next /gsd-update
# For now, just note which files were modified
Ask user:
gsd-local-patches/gsd-local-patches/ directory## Patches Reapplied
| # | File | Status |
|---|------|--------|
| 1 | {file_path} | ✓ Merged |
| 2 | {file_path} | ○ Skipped (already upstream) |
| 3 | {file_path} | ⚠ Conflict resolved |
{count} file(s) updated. Your local modifications are active again.
</process>
<success_criteria>
tools
Manage parallel workstreams — list, create, switch, status, progress, complete, and resume
testing
Validate built features through conversational UAT
testing
Retroactively audit and fill Nyquist validation gaps for a completed phase
testing
Update GSD to latest version with changelog display