agentleFS
rockdairockdai/agent-scripts/skills/merge-sync/SKILL.md

merge-sync

Skill0 starsChanged 7 months agoUnlicenseView on GitHub

Use when an agent workspace must synchronize after a pull request has merged, including project aliases like "merged" or "merged N", branch cleanup, main/default-branch updates, docs or agent-rule rereads, and peer notifications.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    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 project instructions to decide how merge-sync is triggered.

    line 16
  2. Distinctive:

    If the PR number is missing, recover it from the current branch, recent PRs, or the user before deleting any branch.

    line 21
  3. Distinctive:

    Delete the merged local feature branch only after confirming it is the PR head branch.

    line 27
  4. Distinctive:

    If the project has peer agents, notify them with the project-defined merge-sync message after local sync completes.

    line 29
  5. Distinctive:

    Do not notify the peer again.

    line 36
  6. Distinctive:

    Never delete the current branch unless it is confirmed to be the merged PR head branch.

    line 40
  7. Distinctive:

    Never treat tmux or chat output as proof of merge.

    line 41
  8. Distinctive:

    If docs or agent rules changed, reread them before accepting another task.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 Sync

Overview

After a PR merges, each agent workspace must update to the merged default branch and refresh any changed agent rules before doing more work. The workflow differs depending on whether the message came from a human on the merged branch owner side or from another agent.

Project-specific trigger aliases such as merged and merged N are compatibility shims. The reusable concept is "sync after PR merge".

Identify Source

Read the project instructions to decide how merge-sync is triggered. Common patterns:

  • Human-originated local sync: the agent that owned the PR is on or knows the PR's head branch.
  • Peer-originated sync: another agent sends the PR number so this workspace can update without deleting an unrelated current branch.

If the PR number is missing, recover it from the current branch, recent PRs, or the user before deleting any branch.

Human-Originated Sync

  1. Fetch remote state and identify the PR head branch and default branch.
  2. Switch to the default branch and pull the latest remote default branch.
  3. Delete the merged local feature branch only after confirming it is the PR head branch.
  4. Inspect merged file paths. If agent rules, docs, or skill pointers changed, reread the affected files before starting new work.
  5. If the project has peer agents, notify them with the project-defined merge-sync message after local sync completes.

Peer-Originated Sync

  1. Fetch remote state, switch to the default branch, and pull latest.
  2. Inspect the merged PR's changed files. Reread changed agent rules, docs, or skill pointers.
  3. Optionally delete stale local branches for that PR if they are clearly associated with the merged PR.
  4. Do not notify the peer again; merge-sync notifications must not bounce forever.

Safety Rules

  • Never delete the current branch unless it is confirmed to be the merged PR head branch.
  • Never treat tmux or chat output as proof of merge; verify through the VCS or hosting provider.
  • If docs or agent rules changed, reread them before accepting another task.

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.