syncing-branch-with-base
Skill2 starsChanged 2 months agoBSD-3-ClauseView on GitHub
Syncs the current branch with its base. What this does is check the remote base branch, rebase the current one on the updated base and push it back to the remote. Use this when the base branch of the current branch may have diverged and you want to be sure that the current branch gets all latest changes of its base. This Skill is the canonical way to keep a branch up-to-date with its base. It must be used instead of merging the base branch, and always performs a rebase.
- Commits and pushes
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- addressing-pull-request-commentsSkill
- analyzing-github-issueSkill
- applying-ruby-conventionsSkill
- applying-test-conventionsSkill
- committing-changesSkill
- creating-pull-requestSkill
- editing-filesSkill
- enforcing-project-rulesSkill
- implementing-github-issueSkill
- improving-agent-reflectionSkill
- running-cli-in-wsl-portableSkill
- updating-docSkill
- validating-production-qualitySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 11 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When syncing the current branch with its base, follow those steps.
- Distinctive: line 14
Before executing anything, create a checklist named syncing-branch-with-base Execution Checklist with all steps of these instructions.
- Distinctive: line 16
After completing each step of these instructions, mark the item in the syncing-branch-with-base Execution Checklist as completed.
- Distinctive: line 17
Do not skip any item.
- Distinctive: line 18
If an item cannot be executed, explicitly explain why.
- Distinctive: line 19
Never mark the task as completed while any item from the syncing-branch-with-base Execution Checklist remains open.
- Distinctive: line 23
Always tell the user "SKILL: I am syncing the current branch with its base" to inform the user that you are running this skill.
- Very specific: line 32
Always use cli: git fetch --all to retrieve the GitHub remote's base branch.
- Very specific: line 41
Always use cli: git rebase github/{base_branch} to bring your branch on top of its base as on the GitHub remote.
- Very specific: line 43
Always fix any conflict you see during the rebase, and continue the rebase using cli: git rebase --continue until all your commits have …
- Very specific: line 44
If you don't know how to solve a conflict, then always use agent: ask_followup_question to ask the user to help you solve the git conflict.
- Very specific: line 57
Always push your rebased branch to GitHub using the --force-with-lease option: cli: git push github --force-with-lease.
- Very specific: line 58
If the push with --force-with-lease option failed, then always use agent: ask_followup_question to ask the user to help you solve the issue.
- Distinctive: line 67
Before declaring the task complete:
- Distinctive: line 71
If any step was not executed, execute it now.
- Very specific: line 75
Always use it every time another skill specifically mentions skill: syncing-branch-with-base.
- Distinctive: line 76
Always use it every time the user asks you to sync the branch with its base.
- Distinctive: line 77
Use it every time you realize the base branch has divereged and you want to get the current branch up-to-date with its base.
≈ “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
Syncing the current branch with its base
Sequential steps to be followed when using this skill
When syncing the current branch with its base, follow those steps.
Create the syncing-branch-with-base Execution Checklist (MANDATORY)
- Before executing anything, create a checklist named syncing-branch-with-base Execution Checklist with all steps of these instructions.
- The syncing-branch-with-base Execution Checklist must include all numbered steps explicitly.
- After completing each step of these instructions, mark the item in the syncing-branch-with-base Execution Checklist as completed.
- Do not skip any item.
- If an item cannot be executed, explicitly explain why.
- Never mark the task as completed while any item from the syncing-branch-with-base Execution Checklist remains open.
1. Inform the user
- Always tell the user "SKILL: I am syncing the current branch with its base" to inform the user that you are running this skill.
2. Find the base branch name
- By default the base branch name is
main. - The base branch name is later referenced as {base_branch}.
3. Fetch the base branch from the github remote
- Always use
cli: git fetch --allto retrieve the GitHub remote's base branch.
Example:
git fetch --all4. Rebase the branch
- Always use
cli: git rebase github/{base_branch}to bring your branch on top of its base as on the GitHub remote. - Never use
cli: git merge. - Always fix any conflict you see during the rebase, and continue the rebase using
cli: git rebase --continueuntil all your commits have been rebased properly. - If you don't know how to solve a conflict, then always use
agent: ask_followup_questionto ask the user to help you solve the git conflict.
Example:
git rebase github/main
# Fix potential conflicts in files
git rebase --continue
# Use agent tool ask_followup_question about new potential conflicts that you don't understand how to solve
git rebase --continue5. Push the rebased branch
- Always push your rebased branch to GitHub using the
--force-with-leaseoption:cli: git push github --force-with-lease. - If the push with
--force-with-leaseoption failed, then always useagent: ask_followup_questionto ask the user to help you solve the issue. It could be that another user contributed to the branch.
Example:
git push github --force-with-leaseFinal Verification (MANDATORY)
Before declaring the task complete:
- Re-list all numbered steps from the syncing-branch-with-base Execution Checklist.
- Confirm each one was executed.
- If any step was not executed, execute it now.
When to use it
- Always use it every time another skill specifically mentions
skill: syncing-branch-with-base. - Always use it every time the user asks you to sync the branch with its base.
- Use it every time you realize the base branch has divereged and you want to get the current branch up-to-date with its base.
Usage and code examples
Those examples are given for a Linux environment. Adapt them if you are running in a Windows environment.
Syncing the branch on main when there are not conflicts
git fetch --all
git rebase github/main
git push github --force-with-leaseSyncing the branch on main when there are some conflicts on *.rb files that you can solve by yourself
git fetch --all
git rebase github/main
# Solve conflicts on *.rb files
git rebase --continue
git push github --force-with-leaseSyncing the branch on main when there are some conflicts on *.rb files that you can't solve by yourself
git fetch --all
git rebase github/main
# Use agent tool ask_followup_question about new potential conflicts that you don't understand on *.rb
git rebase --continue
git push github --force-with-leaseDoes 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.

