Reapply local modifications after a GSD update
<codex_skill_adapter>
$gsd-reapply-patches.$gsd-reapply-patches as {{GSD_ARGS}}.{{GSD_ARGS}} as empty.GSD workflows use AskUserQuestion (Claude Code syntax). Translate to Codex request_user_input:
Parameter mapping:
header → headerquestion → question"Label" — description → {label: "Label", description: "description"}id from header: lowercase, replace spaces with underscoresBatched calls:
AskUserQuestion([q1, q2]) → single with multiple entries in request_user_inputquestions[]Multi-select workaround:
multiSelect. Use sequential single-selects, or present a numbered freeform list asking the user to enter comma-separated numbers.Execute mode fallback:
request_user_input is rejected (Execute mode), present a plain-text numbered list and pick a reasonable default.GSD workflows use Task(...) (Claude Code syntax). Translate to Codex collaboration tools:
Direct mapping:
Task(subagent_type="X", prompt="Y") → spawn_agent(agent_type="X", message="Y")Task(model="...") → omit (Codex uses per-role config, not inline model selection)fork_context: false by default — GSD agents load their own context via <files_to_read> blocksParallel fan-out:
wait(ids) for all to completeResult parsing:
CHECKPOINT, PLAN COMPLETE, SUMMARY, etc.close_agent(id) after collecting results from each agent
</codex_skill_adapter>Check for local patches directory:
# Global install (path templated at install time)
PATCHES_DIR=./.codex/gsd-local-patches
# Local install fallback
if [ ! -d "$PATCHES_DIR" ]; then
PATCHES_DIR=./.codex/gsd-local-patches
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.
<success_criteria>