Agent skill

Post Merge

by swingerman in swingerman/engineer

Use immediately after a PR is merged to clean up the local feature branch and resync main.

MITAuto-check passedDevelopment

Install Post Merge

skills CLI
$ npx skills add swingerman/engineer --skill post-merge -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install swingerman/engineer post-merge --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/swingerman/engineer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineer/skills/post-merge .claude/skills/post-merge && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
post-merge
GitHub stars
154
Token cost
~1.4k tokens
SKILL.md length
662 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Use immediately after a PR is merged to clean up the local feature branch and resync main.

  • Works in 7 steps: Resolve + identify merged branch.… → Probe merge state. Run git fetch origin… → Run the cleanup. Run the three commands… → …
  • — /engineer.post-merge
  • SKILL.md covers When to use, Workflow, Autonomy dispatch and When NOT to use this skill, plus 1 more section
  • Calls git and gh

What it does

Post Merge is an agent skill from swingerman/engineer. Use immediately after a PR is merged to clean up the local feature branch and resync main. Triggers — "/engineer.post-merge", "did we merge", "did we push", "PR merged", "post-merge cleanup", or right after a gh pr merge succeeds in the same session.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Git. The repository describes itself as: Disciplined Agentic Engineering — a methodology kit for Claude Code: acceptance-test-first specs, explicit checkpoints, and autonomy you can actually leave running. The engineer… The licence is MIT.

When your agent uses it

  • — /engineer.post-merge
  • Post-merge cleanup
  • Right after a gh pr merge succeeds in the same session

Example prompts

  • “/engineer.post-merge”
  • “did we merge”
  • “did we push”
  • “/post-merge”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Resolve + identify merged branch. Resolve the methodology root via ${CLAUDE_PLUGIN_ROOT}/scripts/dae_resolve.py. Get the current branch…
  2. Probe merge state. Run git fetch origin --quiet, then check whether the current branch has been merged
  3. Run the cleanup. Run the three commands in order, stopping on any non-zero exit
  4. Prune stale remote refs. git fetch origin --prune. Removes pointers to remote branches that no longer exist (e.g. when the GitHub "delete…
  5. Reconcile local state, then the tracker. Flip the local feature.md status FIRST — otherwise progress-log (which derives the tracker record…
  6. Close the session log. A merged feature is the clearest session boundary there is — the work shipped and the next session starts somewhere…
  7. Handoff. Emit a summary per ${CLAUDE_PLUGIN_ROOT}/references/handoff-summary.md. checkpoint: null; artifacts: []; human_action_needed: no…

What it can do on your machine

Read from SKILL.md and the folder at commit 32947eb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Post Merge loads about 1.4k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 662 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from swingerman/engineer at commit 32947eb, republished under its MIT licence (© swingerman). 662 words, ~1,350 tokens.

Download SKILL.mdSave it as .claude/skills/post-merge/SKILL.md (or your agent's skills folder).
name
post-merge
description
Use immediately after a PR is merged to clean up the local feature branch and resync main. Triggers — "/engineer.post-merge", "did we merge", "did we push", "PR merged", "post-merge cleanup", or right after a `gh pr merge` succeeds in the same session.

post-merge

The branch-hygiene skill that runs immediately after a PR merges — not deferred to the next session. next and session-summary already catch a stale branch at session boundaries (v1.7.1); post-merge closes the gap in between, where users were still asking "are we still on the feature branch?" mid-session.

When to use

  • Auto — invoke right after observing a successful gh pr merge, gh pr merge --auto, or a "Merged" PR state in gh pr view --json state. The agent that ran the merge calls this skill before doing anything else.
  • Manual — /engineer.post-merge or the trigger phrases above.

Not for: cleanup when the PR isn't merged yet (the work isn't done); session-end teardown (session-summary handles that); session-start survey (next already probes for stale branches as a backstop).

Workflow

  1. Resolve + identify merged branch. Resolve the methodology root via ${CLAUDE_PLUGIN_ROOT}/scripts/dae_resolve.py. Get the current branch (git branch --show-current). If it's main/master/the repo's default branch, there's nothing to clean — stop and report.

  2. Probe merge state. Run git fetch origin --quiet, then check whether the current branch has been merged:

    • GitHub-side check (preferred when gh is available): gh pr view --json state,mergedAt,headRefName --jq '.state' for the PR linked to this branch. State of MERGED is the strongest signal.
    • Git-side check (fallback): git merge-base --is-ancestor HEAD origin/HEAD (or origin/main). True means every commit on this branch is reachable from main.

    If neither check confirms a merge, stop — the work isn't shipped yet. Report what was checked.

  3. Run the cleanup. Run the three commands in order, stopping on any non-zero exit:

    git checkout <default-branch>
    git pull --ff-only
    git branch -d <merged-branch>

    git branch -d (not -D) refuses unmerged work — non-destructive by construction. If it refuses, surface what's unmerged and stop; don't escalate to -D without explicit user confirmation.

  4. Prune stale remote refs. git fetch origin --prune. Removes pointers to remote branches that no longer exist (e.g. when the GitHub "delete branch on merge" setting removed the remote).

  5. Reconcile local state, then the tracker. Flip the local feature.md status FIRST — otherwise progress-log (which derives the tracker record from local truth) and next/reorient (which read feature.md status) keep seeing in-progress. Run:

    ${CLAUDE_PLUGIN_ROOT}/scripts/dae_reconcile.py <merged-feature-dir> --apply

    It sets feature.md status: done when the PR is merged (detected via gh, so squash-merge and git.manual are covered — the git-ancestry check in Step 2 is not) and returns flag: merged-unverified when no CP7 verify handoff exists. If flagged, surface it prominently — the feature shipped with its ACs unverified; that is a discipline gap, not a clean close. Then dispatch /engineer.progress-log to propagate the done state to progress.md + the tracker (records merged_at). Per ${CLAUDE_PLUGIN_ROOT}/references/handoff-dispatch.md — auto at medium/high, surface-and-ask at low.

  6. Close the session log. A merged feature is the clearest session boundary there is — the work shipped and the next session starts somewhere else. Auto-invoke /engineer.session-summary at autonomy medium/high; confirm-then-invoke at low. This is the human-readable "how do I pick this up" record; without it the only trace of the session is machine handoffs. Skip if a session-summary entry for today already exists on this feature.

  7. Handoff. Emit a summary per ${CLAUDE_PLUGIN_ROOT}/references/handoff-summary.md. checkpoint: null; artifacts: []; human_action_needed: no. The handoff records: the merged branch name, the PR URL (if known), and the new HEAD commit. recommended_next points at /engineer.next if the feature is shipped, or the relevant fix/session continuation otherwise.

Show full SKILL.md (126 more words)Show less

Autonomy dispatch

LevelBehavior
highRun all seven steps. Report a one-line summary.
mediumRun all seven steps. Report what changed (one short paragraph).
lowSurface the planned commands and the merge-state evidence; wait for confirmation before running.

When NOT to use this skill

  • The PR is open or in review → wait until it's actually merged.
  • The merge happened on a different branch than the one currently checked out → switch to that branch first (or just git fetch --prune and skip the rest).
  • You squashed and force-pushed → git branch -d will refuse; that's expected. Either confirm -D manually or rebase onto main and try again.

References

  • ${CLAUDE_PLUGIN_ROOT}/references/handoff-summary.md — handoff schema
  • ${CLAUDE_PLUGIN_ROOT}/references/handoff-dispatch.md — autonomy-driven dispatch rule
  • Sister skills: next (session-start stale-branch backstop), session-summary (session-end stale-branch backstop), progress-log (tracker propagation)

© swingerman, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in engineer/skills/post-merge of swingerman/engineer.

Open the folder on GitHubat commit 32947eb

Compare with similar skills

Post Merge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Post Merge compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Post Merge this skillswingerman/engineer154—~1.4kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Codebase Knowledge Graph Q&AEgonex-AI/Understand-Anything86k1 repos~1.2kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Understand Diff AnalysisEgonex-AI/Understand-Anything86k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    86k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    86k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    86k GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed

More from swingerman/engineer

All 27 skills in this repo
  • Crap Analyzer

    swingerman/engineer

    A skill your agent uses to produce a risk-based refactor + test plan for recently-changed code on a diff/branch/PR by computing CRAP (complexity × untested) on changed methods.

    154 GitHub stars~1.2k tokensUpdated 15 days ago
    Auto-check passed
  • Atdd Mutate

    swingerman/engineer

    A skill your agent uses to add a third validation layer to the ATDD workflow — after acceptance tests verify WHAT and unit tests verify HOW, mutation testing verifies the tests actually catch bugs.

    154 GitHub stars~2.7k tokensUpdated 15 days ago
    Auto-check passed
  • Fix

    swingerman/engineer

    A skill your agent uses to drive a bug fix from first report through close, with a "why didn't we catch it?" loop at the end.

    154 GitHub stars~3k tokensUpdated 15 days ago
    Auto-check passed
  • Atdd

    swingerman/engineer

    A skill your agent uses to drive feature work through the Acceptance Test Driven Development workflow — Given/When/Then specs before code, a project-specific test pipeline, and two parallel test…

    154 GitHub stars~2.8k tokensUpdated 15 days ago
    Auto-check passed
  • Harden

    swingerman/engineer

    Use after a feature passes Light Verify (CP7), to prove the tests actually catch bugs and, where the code warrants it, to formally check its invariants — Checkpoint 8.

    154 GitHub stars~1.8k tokensUpdated 15 days ago
    Auto-check passed
  • Next

    swingerman/engineer

    Use at the start of a work session, or any time the question is "what should I pick up now" across the whole project.

    154 GitHub stars~3k tokensUpdated 15 days ago
    Auto-check passed

Works with

Categories

Questions about Post Merge

What does Post Merge do?

Use immediately after a PR is merged to clean up the local feature branch and resync main. Post Merge is an agent skill from swingerman/engineer. Use immediately after a PR is merged to clean up the local feature branch and resync main.

When should I use Post Merge?

Post Merge fits situations like: — /engineer.post-merge; post-merge cleanup; right after a gh pr merge succeeds in the same session.

How do I install Post Merge in Claude Code?

Run `npx skills add swingerman/engineer --skill post-merge -a claude-code`. Or copy the skill folder (engineer/skills/post-merge in swingerman/engineer) into .claude/skills/post-merge in your project. Claude Code loads it when a task matches its description.

How do I install Post Merge in Codex?

Run `npx skills add swingerman/engineer --skill post-merge -a codex`. Or copy the skill folder (engineer/skills/post-merge in swingerman/engineer) into .agents/skills/post-merge in your project. Codex loads it when a task matches its description.

Can I use Post Merge in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add swingerman/engineer --skill post-merge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/post-merge, .gemini/skills/post-merge, .github/skills/post-merge and .opencode/skills/post-merge in your project.

What does Post Merge need to run?

Going by SKILL.md and its folder, Post Merge needs the command-line tools its instructions call (git and gh).

Does Post Merge access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Post Merge safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Post Merge use?

Post Merge is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Post Merge use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Post Merge?

Skills that share tags, products or a category with Post Merge: Finishing a Development Branch (obra/superpowers, 296k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Codebase Knowledge Graph Q&A (Egonex-AI/Understand-Anything, 86k stars) and Code Design Rationale Investigator (cursor/plugins, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Post Merge?

swingerman (a GitHub user) maintains it in swingerman/engineer, which has 154 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on September 23, 2026.

Source: swingerman/engineer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.