update-branch
Skill1 starsChanged 2 months agoMITView on GitHub
Brings a branch up to date with its base branch, usually main. It rebases onto origin/<base>, or merges when the user agrees, then builds and runs the relevant tests. It pushes on its own when the risk is low, and asks first, with the reason, when it is not. It never uses a plain --force, and it never disturbs uncommitted work: a clone on another branch gets a separate git worktree. This skill is user-only: it runs only when the user invokes /update-branch [branch] [--base <branch>] [merge]. When the user wants to update a branch with main, rebase onto main, or fix "branch is behind main", suggest this command.
- Commits and pushes
4 other projects use a version of this.
Adopted by
Most recently taken up by
- henrilhos/skillstheir own version, first seen Oct 17, 2026
- rhesis-ai/rhesistheir own version, first seen Oct 8, 2026
- KonH/GlobalStrategytheir own version, first seen Sep 3, 2026
- tomimor/skillstheir own version, first seen Jun 26, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- rhesis-ai/rhesis★ 404same name
- KonH/GlobalStrategy★ 3same name
- tomimor/skills★ 2same name
- henrilhos/skills★ 1same 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 repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- plugin-versioningSkill
- skill-authoringSkill
- review-skillSkill
- tune-agent-docsSkill
- define-behaviorSkill
- implement-scenariosSkill
- review-feature-suiteSkill
- address-pr-commentsSkill
- code-review-pyramidSkill
- pr-reviewSkill
- review-changesSkill
- backfill-decisionsSkill
- decideSkill
- log-decisionSkill
- paretoSkill
- team-topologiesSkill
- standard-firstSkill
- triage-work-itemSkill
- work-itemSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Read the conflict conventions in the repository docs before you resolve a conflict.
- Distinctive: line 48
If the right answer to a conflict is not clear from the code, stop and ask.
- Very specific: line 60
After a rebase, git config user.email is the author of every commit in <BASE>..origin/<branch>.
- Distinctive: line 62
If one condition is false, do not push.
- Distinctive: line 64
After a rebase, push with the lease from Step 2:
- Very specific: line 70
If the lease fails, stop and report it.
- Very specific: line 76
Only MODE: worktree belongs to this run.
“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
Update Branch
A rebase rewrites published history, so every step that can lose work has a check in front of it. The branch defaults to the current branch, and the base defaults to origin/HEAD. The word merge asks for a merge.
Step 1: Pick the workspace
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(readlink -f "<skill_dir>/SKILL.md")")")}"
python3 "$PLUGIN_ROOT/scripts/prepare_update_workspace.py" [--branch <branch>] [--base <base>]The helper fetches, then prints MODE:, BASE:, and WORKSPACE_PATH:. Run every later command in that path, with git -C <workspace_path> for git. On STOP: <reason>, show the reason and stop. Never stash, reset, or discard work to get past a refusal.
Step 2: Protect the remote commits
Record origin/<branch> as the lease for Step 6. A branch with no remote ref was never pushed, so skip the rest of this step.
A rebase and a forced push delete the commits in <branch>..origin/<branch> from the remote. If the local branch has nothing of its own past origin/<branch>, fast-forward to it. Otherwise the two diverged, so show both sides and ask.
Step 3: Choose rebase or merge
Rebase by default. When one of these is true, propose a merge and wait for the answer:
<BASE>..origin/<branch>holds commits by another author thangit config user.email.- The repository docs ask for merge commits.
- The user asked for a merge.
Never switch strategy without consent.
Step 4: Update the branch
Read the conflict conventions in the repository docs before you resolve a conflict. Keep the intent of both sides, and read the base commit that touched the same lines. Record each resolution for the report, including any edit outside the conflict markers.
If the right answer to a conflict is not clear from the code, stop and ask. If the same lines conflict in commit after commit, abort the rebase and offer a merge.
Step 5: Build and test
Build the projects in git diff --name-only <BASE>...HEAD, and run their unit and integration tests. When a shared library changed, also test its dependents. Take the commands from the repository docs and build files. If you find none, ask.
Step 6: Push and report
The call to /update-branch gives permission to push when the risk is low. The risk is low when all of these are true:
- The build and every test from Step 5 passed, and Step 5 tested each changed project.
- Step 4 resolved no conflict.
- After a rebase,
git config user.emailis the author of every commit in<BASE>..origin/<branch>.
If one condition is false, do not push. Report the false conditions and the exact push command, then ask. If a build or a test failed, stop there.
After a rebase, push with the lease from Step 2:
git -C <workspace_path> push --force-with-lease=<branch>:<lease> origin <branch>If the lease fails, stop and report it. Do not retry with a new lease. After a merge, use a plain git push, with -u for a branch that was never pushed. Never use --force, -f, or a +<refspec>.
Then report the strategy, the new base commit, each conflict resolution, the build and test results, and the push result.
Step 7: Clean up
Only MODE: worktree belongs to this run. After a successful push, remove it with the helper, never with git worktree remove:
python3 "$PLUGIN_ROOT/scripts/prepare_update_workspace.py" --remove <workspace_path>Git removes a clean worktree with unpushed commits. The helper refuses it. If the helper prints STOP: or the branch was not pushed, keep the worktree and give the user its path.
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.

