agentleFS
Muriel-SalvanMuriel-Salvan/x_aeon_agents/skills/syncing-branch-with-base/SKILL.md

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

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
  1. Distinctive:

    When syncing the current branch with its base, follow those steps.

    line 10
  2. Distinctive:

    Before executing anything, create a checklist named syncing-branch-with-base Execution Checklist with all steps of these instructions.

    line 14
  3. Distinctive:

    After completing each step of these instructions, mark the item in the syncing-branch-with-base Execution Checklist as completed.

    line 16
  4. Distinctive:

    Do not skip any item.

    line 17
  5. Distinctive:

    If an item cannot be executed, explicitly explain why.

    line 18
  6. Distinctive:

    Never mark the task as completed while any item from the syncing-branch-with-base Execution Checklist remains open.

    line 19
  7. Distinctive:

    Always tell the user "SKILL: I am syncing the current branch with its base" to inform the user that you are running this skill.

    line 23
  8. Very specific:

    Always use cli: git fetch --all to retrieve the GitHub remote's base branch.

    line 32
  9. Very specific:

    Always use cli: git rebase github/{base_branch} to bring your branch on top of its base as on the GitHub remote.

    line 41
  10. Very specific:

    Always fix any conflict you see during the rebase, and continue the rebase using cli: git rebase --continue until all your commits have …

    line 43
  11. Very specific:

    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.

    line 44
  12. Very specific:

    Always push your rebased branch to GitHub using the --force-with-lease option: cli: git push github --force-with-lease.

    line 57
  13. Very specific:

    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.

    line 58
  14. Distinctive:

    Before declaring the task complete:

    line 67
  15. Distinctive:

    If any step was not executed, execute it now.

    line 71
  16. Very specific:

    Always use it every time another skill specifically mentions skill: syncing-branch-with-base.

    line 75
  17. Distinctive:

    Always use it every time the user asks you to sync the branch with its base.

    line 76
  18. Distinctive:

    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.

    line 77

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 --all to retrieve the GitHub remote's base branch.

Example:

git fetch --all

4. 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 --continue until all your commits have been rebased properly.
  • 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.

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 --continue

5. Push the rebased branch

  • Always push your rebased branch to GitHub using the --force-with-lease option: cli: git push github --force-with-lease.
  • 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. It could be that another user contributed to the branch.

Example:

git push github --force-with-lease

Final 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-lease

Syncing 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-lease

Syncing 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-lease

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.