agentleFS
insapption-projectsinsapption-projects/claude-agent-team-starter/.claude/skills/merge-main/SKILL.md

merge-main

Skill1 starsChanged 8 months agoMITView on GitHub

Merges the current feature branch into main/master after all quality gates pass. Performs a squash merge, verifies PR checks, and confirms the remote branch is cleaned up. Step 12 of the dev-workflow.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No unresolved PR review comments

    line 21
  2. Distinctive:

    If working tree is dirty:

    line 40
  3. Distinctive:

    Check that the PR has no requested changes pending:

    line 45
  4. Distinctive:

    If checks are not green or reviews are pending:

    line 50
  5. Distinctive:

    If there are conflicts:

    line 66
  6. Very specific:

    If gh is not available, provide manual instructions:

    line 87

“Common” is measured: kept by at least 6 in 10 of the 5 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.

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

Skill: /merge-main

Usage

/merge-main

Prerequisites

  • /test-lint must have returned PASS in the most recent run
  • PR must be open and all checks green
  • No unresolved PR review comments

Steps

1. Pre-merge Verification

# Confirm we are on the feature branch
git branch --show-current

# Confirm working tree is clean
git status

# Show commit log for this PR
git log main..HEAD --oneline

If working tree is dirty:

🚧 STOP: Uncommitted changes found. Run /git-commit first.

Check that the PR has no requested changes pending:

gh pr view --json reviewDecision,statusCheckRollup

If checks are not green or reviews are pending:

⚠️  BLOCKED: PR checks or reviews not complete.
    Status : {check_name} — {status}
    Action : Resolve before merging.

2. Sync with Main

git fetch origin main
git rebase origin/main

If there are conflicts:

🚧 CONFLICT: Rebase conflicts in {files}.
   Resolve conflicts manually and run /merge-main again.

3. Merge via GitHub CLI (squash)

gh pr merge --squash --delete-branch

The squash commit message format:

{type}({domain}): {imperative description} (#PR_NUMBER)

{Body summarizing the full PR — what and why}

If gh is not available, provide manual instructions:

Manual merge steps:
1. Go to {pr_url}
2. Click "Squash and merge"
3. Edit commit title to: {type}({domain}): {description} (#N)
4. Confirm merge
5. Delete branch via GitHub UI

4. Verify Merge

git fetch origin main
git log origin/main --oneline -5

Confirm the squash commit appears in main's log.


5. Clean up Local Branch

git checkout main
git pull origin main

(Local branch deletion happens in Step 14 — /delete-branch)


6. Confirm

──────────────────────────────────────────────────────────────
  MERGED SUCCESSFULLY
──────────────────────────────────────────────────────────────
PR      : {pr_url}
Merged  : {branch} → main
Commit  : {squash_commit_hash}
Remote  : branch deleted ✅

Now on : main ({commit_hash})

Next step: /update-references auto
──────────────────────────────────────────────────────────────

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.