# Repo Sync

> Keep the Create-Delight Remake checkout current and locally runnable after Git updates. Use when the user asks to pull latest changes, switch to main, rebase on main, merge upstream changes, update a branch, or otherwise run Git operations that may bring in packwiz metadata, packwiz-files payloads, or CDC submodule pointer changes.

- Skill: `jasons-impart/repo-sync` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add jasons-impart/repo-sync`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jasons-impart/repo-sync/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jasons-impart (https://skillmd.com/u/jasons-impart)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jasons-impart/repo-sync

---


# Repo Sync

## Workflow

Use this workflow for repository update tasks before reporting completion.

1. Ensure local Git hook shims are installed without rewriting existing shims, confirm status, and record the pre-update commit:

```powershell
./scripts/install-git-hooks.ps1 -IfUnset -Quiet
git status --short --branch
$oldHead = git rev-parse HEAD
```

When switching to `main` before pulling, record `main` before checkout:

```powershell
$oldHead = git rev-parse main
git checkout main
```

2. Perform the requested Git operation with non-interactive commands, then let the shared helper handle Packwiz runtime sync:

```powershell
git pull --ff-only origin main
git rebase origin/main
git diff --quiet $oldHead HEAD -- scripts/install-git-hooks.ps1 scripts/.githooks
if ($LASTEXITCODE -eq 1) {
    ./scripts/install-git-hooks.ps1 -Quiet
}
./scripts/sync-packwiz-assets.ps1 -IfGitChanged -OldRev $oldHead -NewRev HEAD -HookName repo-sync
```

`-IfGitChanged` checks `mods|resourcepacks|shaderpacks/**/*.pw.toml` and `packwiz-files/**`; it runs the full runtime sync only when needed. Git hooks perform the same check for regular local Git operations, but still run this command here so agent-managed updates have a visible result.

The sync script records the last successful revision in the ignored `.cache/packwiz-sync/sync-state.json`. This makes the hook and the explicit workflow call idempotent: the second call for the same revision, side, metadata roots, and sync-script version exits without downloading again. Use `-Force` when repairing a known local runtime mismatch. For slow overseas downloads, set `PACKWIZ_PROXY=http://127.0.0.1:7890`; the hooks inherit this environment variable.

The installer is idempotent: `-IfUnset` exits when all four shims already exist and are managed, while a full install only rewrites a shim when its generated content differs. The post-update hook installation only runs when the installer or tracked hooks changed. This makes newly added hooks available immediately, while ordinary repository updates do not rewrite local hook shims.

3. If `CDC-mod-src` changed or `git status` reports the submodule modified after update, run:

```powershell
git submodule update --init --recursive
```

4. Finish with:

```powershell
git status --short --branch
```

Report whether packwiz sync was required, whether it succeeded, and whether the final worktree is clean.

## Notes

- Runtime JARs are local development payloads and are normally not tracked.
- Do not commit local sync side effects unless they are intentional source changes.
- If sync leaves tracked config changes, inspect them before deciding whether to keep or restore them.

