agentleFS
ptrandevptrandev/claude-skills/skills/merge-master/SKILL.md

merge-master

Skill1 starsChanged 15 days agoMITView on GitHub

Merges the repo's default branch into the current branch, resolves any conflicts, then commits and pushes. Use for "merge master", "sync with master", or "update my branch".

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the file. Understand both sides.

    line 26
  2. Distinctive:

    Stop and ask the user: when either choice changes behavior.

    line 29
  3. Distinctive:

    Commit the merge: Run git commit --no-edit once every conflicted file is staged (this keeps the default merge message).

    line 30
  4. Distinctive:

    Use git merge. Never rebase.

    line 42

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

merge-master

Steps

  1. Preflight. git status --porcelain. Stop and ask whether to stash or commit first when the tree is dirty. Never clobber uncommitted work. Stashing is the user's job before re-invoking this skill. Do not stash for them. Do not run git stash pop afterwards. Capture the current branch: git rev-parse --abbrev-ref HEAD. Stop and tell the user when the branch is the default branch resolved in step 2.
  2. Resolve the default branch. Read ../shared/default-branch.md and run its ladder. It owns the resolution. Stop and tell the user when it comes back empty: merging the wrong branch rewrites their work.
  3. Fetch and merge. git fetch origin "$DEFAULT", then git merge "origin/$DEFAULT". Skip to step 6 when it merges cleanly.
  4. Resolve conflicts. For each conflicted file (git diff --name-only --diff-filter=U):
    • Read the file. Understand both sides. Keep the intent of both changes.
    • Edit to remove all <<<<<<<, =======, >>>>>>> markers.
    • git add <file> once resolved.
    • Stop and ask the user when either choice changes behavior.
  5. Commit the merge. Run git commit --no-edit once every conflicted file is staged (this keeps the default merge message). Run it once per merge, not once per file.
  6. Verify. git status. Confirm no unmerged paths remain. Run the repo's typecheck, lint, or build when one is configured. Stop before step 7 when it fails. Report the failure and ask whether to push.
  7. Push. git push. Use git push -u origin <branch> with the branch captured in step 1 when push reports no upstream.
  8. Report. State what conflicted and how you resolved each one.

Notes

  • Use git merge. Never rebase.

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.