sync-branch
Skill0 starsChanged 15 days agoMITView on GitHub
Bring your task branch up to date with the team branch (main or dev): fetch, predict the conflicts, rebase, resolve the clear conflicts or stop, run the checks and update the pushed branch with --force-with-lease. Use at the start of a task, before each push, before a handoff, and when the playbook says that the branch is behind.
- Deletes or force-pushes
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- antick/skillstheir own version, first seen Nov 16, 2026
- dmzoneill/skillstheir own version, first seen Oct 24, 2026
- longmajs/claude-skillstheir own version, first seen Oct 15, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- dmzoneill/skills★ 2same name
- antick/skills★ 0same name
- longmajs/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- a11y-auditSkill
- architecture-reviewSkill
- bootstrap-projectSkill
- capture-screenshotsSkill
- customizeSkill
- deliver-featureSkill
- design-reviewSkill
- docs-upkeepSkill
- fix-bugSkill
- handoffSkill
- implementSkill
- leadSkill
- log-decisionSkill
- refine-requirementsSkill
- release-readinessSkill
- reproduce-in-worktreeSkill
- security-auditSkill
- ship-prSkill
- start-taskSkill
- threat-modelSkill
- verify-featureSkill
- vet-dependencySkill
- write-adrSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 15 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Do not push to the team branch.
- Distinctive: line 20
Do not discard work. Before you rebase, write down the commit of your branch, so that you can go back to it.
- Distinctive: line 25
Read it from the git configuration: git config playbook.integrationBranch.
- Very specific: line 26
If it is empty, use the branch in the request ($ARGUMENTS).
- Very specific: line 27
If you did not get the branch from the configuration, ask the owner one time: "The team branch is <name>.
- Distinctive: line 29
If the base is the branch of an earlier task, and that task is now merged into the team branch, go to section 7.
- Distinctive: line 46
If you have changes that are not committed, continue your step until the checks pass, and commit.
- Distinctive: line 47
Write down the commit of your branch: git rev-parse HEAD.
- Distinctive: line 55
If the rebase completes without conflicts, go to section 5.
- Distinctive: line 56
If a conflict occurs, examine each file with a conflict:
- Very specific: line 57
Read your change and the change from the team.
- Distinctive: line 59
Resolve the conflict: only if all of these are true:
- Distinctive: line 64
Stop: if a resolution needs a decision about the change of another person, or if the file is not in the scope of your task:
- Distinctive: line 70
Run the full check suite from AGENTS.md ("Before calling a task done"): lint, typecheck and tests.
- Distinctive: line 71
If a check fails because of a team change, fix it in a new commit.
- Very specific: line 72
If the checks fail and you cannot fix them, go back to the commit that you wrote down: git reset --keep <commit>.
- Very specific: line 74
Do not push a new branch here.
- Distinctive: line 79
If your checkout is on the team branch, do not rebase it, and do not commit on it.
- Distinctive: line 81
If git status --short shows no changes, update it: git pull --ff-only.
- Distinctive: line 82
If it shows changes, tell the owner.
- Very specific: line 89
Do sections 2 to 5 with the team branch as the base.
- Very specific: line 90
Remove the saved base: git config --unset branch.<your branch>.playbookBase.
- Very specific: line 96
Before each push, before a handoff and before a PR (ship-pr).
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sync the branch with the team branch
Playbook files named here: when the project has its own copy at
.playbook/local/<same path>, use that copy instead.
Team branch: $ARGUMENTS
The team branch is the branch that the team keeps up to date, for example main or dev. Other people push to it many times each day. If your branch stays old, the conflicts become larger. Thus, rebase your branch often, while the conflicts are small.
Rules:
- Rebase only your own task branch. Do not rebase the team branch. Do not rebase a branch that another person or session works on. Do not use
--update-refs: it can move the branch of an earlier task. - Do not push to the team branch.
- Push a rebased branch only with
--force-with-lease --force-if-includes. Never use--forcealone. The owner agreed to this force push for your own task branch only (working agreement, rule 21). - Sync only at a clean point: all your changes are committed and the checks pass. Do not use
--autostashorgit stash: all the worktrees of a clone share one stash, so another session can take your changes. - Do not discard work. Before you rebase, write down the commit of your branch, so that you can go back to it.
1. Find the base
- Find the team branch:
- Read it from the git configuration:
git config playbook.integrationBranch. - If it is empty, use the branch in the request (
$ARGUMENTS). If the request does not give one, use the default branch of the remote:git symbolic-ref --short refs/remotes/origin/HEAD. If that fails, usemainormaster, the one that is on the remote. - If you did not get the branch from the configuration, ask the owner one time: "The team branch is
<name>. Is this correct?" Then save it:git config playbook.integrationBranch <name>. All the worktrees of this clone use this value. The playbook hook also uses it.
- Read it from the git configuration:
- Find the base of your branch. Usually it is the team branch. If your brief or ticket says that your branch starts from the branch of an earlier task that is not merged, the base is that branch. Save it, so that the playbook hook compares with it:
git config branch.<your branch>.playbookBase <earlier branch>. - If the base is the branch of an earlier task, and that task is now merged into the team branch, go to section 7.
2. Find the state
- Get the new commits:
git fetch origin <team branch>. - Find the state of your branch:
- The branch:
git branch --show-current. If it is the team branch, go to section 6. - The new commits:
git rev-list --count HEAD..<base>. Useorigin/<team branch>as<base>when the base is the team branch. If the number is 0, your branch is up to date. Stop. - Your changes that are not committed:
git status --short. - Whether the branch is on the remote:
git ls-remote --exit-code --heads origin <your branch>. Exit code 0 means that it is on the remote. Write down the result. You use it in section 5.
- The branch:
- Predict the conflicts. This command does not change your files:
git merge-tree --write-tree --name-only --no-messages HEAD <base>.- Exit code 0: no conflicts.
- Exit code 1: the lines after the first line are the files with conflicts.
- A different exit code: the prediction failed (for example, git is older than 2.38). Continue without a prediction.
3. Prepare
- If you have changes that are not committed, continue your step until the checks pass, and commit. Then sync. If a conflict is predicted, do not change the files with the conflict before you sync.
- Write down the commit of your branch:
git rev-parse HEAD. You go back to it if the rebase fails. - Turn on the memory of conflict resolutions one time for each clone:
git config rerere.enabled true. Then git repeats a resolution when the same conflict occurs again in a later rebase.
4. Rebase
- Rebase:
- The base is the team branch:
git rebase origin/<team branch>. - The base is the branch of an earlier task:
git rebase --fork-point <earlier branch>. The earlier task can rebase its branch too. Then your branch contains old copies of its commits.--fork-pointreplays only your own commits. If git cannot find the fork point, do the steps of section 7 step 1 to find the old end of the earlier task, and usegit rebase --onto <earlier branch> <old end>.
- The base is the team branch:
- If the rebase completes without conflicts, go to section 5.
- If a conflict occurs, examine each file with a conflict:
- Read your change and the change from the team. Find the commits from the team that changed the file:
git log --oneline HEAD..<base> -- <file>. Read their messages. - If git says "Resolved '
<file>' using previous resolution", git used a resolution from an earlier rebase. The file has no conflict markers. Read it and compare it with the two changes, as for a new conflict. If the resolution is wrong, rungit rerere forget <file>, and resolve the conflict again. - Resolve the conflict only if all of these are true:
- You understand the change from the team, and its purpose.
- The resolution keeps the purpose of both changes.
- The file is in the scope of your task.
- To resolve: edit the file, remove the conflict markers,
git add <file>, thengit rebase --continue. Do not take one side of a full file (--oursor--theirs) without reading both sides. - Stop if a resolution needs a decision about the change of another person, or if the file is not in the scope of your task:
git rebase --abort. Your branch is then as it was before.- Report to the owner (in a workspace, to the lead): the files, the team commits (id, author and message), the two changes, and your recommendation. Then wait.
- Read your change and the change from the team. Find the commits from the team that changed the file:
5. Check and push
- Run the full check suite from
AGENTS.md("Before calling a task done"): lint, typecheck and tests. A rebase without conflicts can still break the code, because the team changed code that your change uses. - If a check fails because of a team change, fix it in a new commit. If the fix is not in the scope of your task, report it as in section 4 step 3.
- If the checks fail and you cannot fix them, go back to the commit that you wrote down:
git reset --keep <commit>. Then report. If a resolution was wrong, tell the next sync to check it: git can use it again (section 4 step 3). - Push only if the branch was on the remote before the sync (section 2). Then the remote branch (and its PR) stays the same as your branch:
git push --force-with-lease --force-if-includes origin <your branch>. If git refuses, another person pushed to your branch. Do not push again. Report it.- Do not push a new branch here.
handoffandship-prpush a new branch when the owner says so.
- Do not push a new branch here.
- Report in one line: "Rebased
<branch>onto<base>at<commit>:<n>new commits, conflicts<none / resolved in <files>>, checks<result>, pushed<yes/no>." In a workspace, put this line in your next handoff.
6. The team branch in a checkout
If your checkout is on the team branch, do not rebase it, and do not commit on it.
- If
git status --shortshows no changes, update it:git pull --ff-only. - If it shows changes, tell the owner. The owner decides.
7. The earlier task is merged
Your branch contains the commits of the earlier task. The team branch contains them as different commits (for example, after a squash merge). A normal rebase then gives conflicts in files of the earlier task. Do this instead:
- Find the old end of the earlier task in your branch:
git merge-base --fork-point <earlier branch> HEAD. If the output is empty (for example, the local branch of the earlier task does not exist), ask the owner or the lead for the last commit of the earlier task in your branch. Do not guess. - Do sections 2 to 5 with the team branch as the base. In section 4, rebase only your own commits:
git rebase --onto origin/<team branch> <old end of the earlier task>. - Remove the saved base:
git config --unset branch.<your branch>.playbookBase.
When to sync
- At the start of a task, after you make or continue its branch.
- When the playbook says that your branch is behind its base, or that a rebase will conflict. Sync at the next point where your checks pass. If a conflict is predicted, go to that point first, and do not change the files with the conflict before you sync.
- Before each push, before a handoff and before a PR (
ship-pr).
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.

