post-merge-sync
Skill10 starsChanged 28 days agoApache-2.0View on GitHub
Use only when the owner explicitly asks to clean up after a merged AIP pull request - verify the merge live, sync the actual main worktree safely, remove the merged feature worktree if clean, delete only the local feature branch, and report exact merge/main SHAs. Never delete a remote branch.
- Commits and pushes
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- address-reviewSkill
- release-publicationSkill
- specification-driven-implementationSkill
- address-reviewSkill
- post-merge-syncSkill
- release-publicationSkill
- specification-driven-implementationSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Verify the merge live: Read the PR with GitHub and require state=MERGED.
- Very specific: line 19
If a worktree has refs/heads/main, require it to be clean, then fast-forward it with git -C <main-worktree> pull --ff-only origin main.
- Very specific: line 21
If no main worktree exists, do not repurpose or switch another worktree.
- Very specific: line 23
Remove the merged feature worktree only if safe: If a worktree is attached to the captured head branch, require it to be clean, then remove …
- Very specific: line 26
Delete only the local feature branch: After the feature worktree is gone and the branch is confirmed merged into origin/main, delete it …
- Distinctive: line 28
Never run git push --delete, git branch -D, or otherwise delete the remote branch unless the owner separately asks.
- Distinctive: line 33
No test suite is required: this skill changes no repository content.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Post-merge sync
This skill is deliberately conservative because the repository may have several worktrees and the shared checkout may be on an unrelated branch.
Procedure
- Verify the merge live. Read the PR with GitHub and require
state=MERGED. CaptureheadRefNameandmergeCommit.oiddirectly from that response. If the PR is not merged, stop. - Fetch main without switching the current checkout:
git fetch origin main. - Verify ancestry. Require the captured merge commit to be an ancestor of
origin/main. Report and stop if it is not. - Find worktrees explicitly with
git worktree list --porcelain.- If a worktree has
refs/heads/main, require it to be clean, then fast-forward it withgit -C <main-worktree> pull --ff-only origin main. - If no main worktree exists, do not repurpose or switch another worktree.
origin/mainis the synchronized reference; report that no local main worktree was present.
- If a worktree has
- Remove the merged feature worktree only if safe. If a worktree is attached to the captured
head branch, require it to be clean, then remove it with
git worktree remove <path>. A dirty worktree is a stop condition; never discard its changes. - Delete only the local feature branch. After the feature worktree is gone and the branch is
confirmed merged into
origin/main, delete it withgit branch -d <headRefName>if it exists. Never rungit push --delete,git branch -D, or otherwise delete the remote branch unless the owner separately asks. - Report exact state: PR number, merge SHA,
origin/mainSHA, local main-worktree SHA if one exists, removed worktree path, and whether the local feature branch was deleted.
No test suite is required: this skill changes no repository content.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

