Sync main after merge
Use when a branch or worktree has been merged into `main` or `master`, or when Codex is asked to do that merge and then resynchronize the local default branch with the remote. Keep the default branch clean, current, and aligned with origin.From its SKILL.md
npx -y skills add gdebenedetti/skills --skill sync-main-after-mergeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.2 KB, 446 tokens by cl100k_base, as published. Nobody here has run it
Sync Main After Merge
Use this skill for merge-completion tasks on the default branch.
- Identify the repo's default branch.
- Prefer
origin/HEADwhen it exists. - Fall back to
main, thenmaster.
- Prefer
- Check the target checkout for a clean worktree.
- If uncommitted or untracked changes exist, stop before overwriting anything.
- Fetch and prune remote refs.
git fetch origin --prune
- If the request includes the merge itself, merge the topic branch or worktree branch into the default branch first.
- Switch to the default branch first, then merge the branch the user named or the branch currently associated with the worktree.
- Prefer fast-forward or the repo's documented merge policy.
- If the default branch is protected, do not push directly; route the merge through a pull request, then continue after the PR lands.
- Switch to the default branch locally.
git switch <default-branch>- If
git switchfails because the branch is already checked out in another worktree, stop and resolve that worktree instead of forcing a duplicate checkout.
- Sync the local default branch with remote.
- Use
git pull --ff-onlyfor the normal case. - If the user explicitly wants the local branch to match
origin/<default-branch>exactly, confirm that dropping any local commits is acceptable and the worktree is clean, then usegit reset --hard origin/<default-branch>after fetching. - After a protected-branch PR merges, fetch again before pulling so the local branch sees the new remote commit.
- Use
- Verify the result.
git status --short --branch- Confirm the local branch and
origin/<default-branch>point to the expected commit.
Guardrails
- Use
git switch, notgit checkout. - Never discard local changes unless the user explicitly asked for an exact remote match.
- Do not assume
main; usemasteronly when that is the actual default branch. - If the target branch is ambiguous, resolve that before changing history.
What ships with it: 1 file
330 B alongside SKILL.md
agents/
- openai.yaml330 B