pr-merge-cleanup

pr-merge-cleanup is a skill for Claude Code, Codex from postmelee/hyper-waterfall. It costs 61 tokens per session (647 once invoked), scanned A, original, MIT.

A post-merge cleanup procedure for GitHub pull requests, issues, branches, and Git worktrees. A pull request is a proposed code change, and a worktree is a separate local checkout of the same repository.

In plain words
What is it for?
Use it after an approved pull request is merged to check its status, close the related issue when allowed, update the base branch, delete the remote and local task branches, and remove the separate worktree.
Why use it?
It prevents cleanup actions from happening before a pull request is truly merged. Once that condition is confirmed, it removes leftover tracking items and returns the repository to its main working branch.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex; $skill-name invocation.

Good fit Use it after an approved pull request is merged to check its status, close the related issue when allowed, update the base branch, delete the remote and local task branches, and remove the separate worktree.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/postmelee/hyper-waterfall/pr-merge-cleanup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add postmelee/hyper-waterfall --skill pr-merge-cleanup
Clone the repo
git clone --depth 1 https://github.com/postmelee/hyper-waterfall

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-merge-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/postmelee/hyper-waterfall/pr-merge-cleanup/github.svg)](https://agentmods.dev/skills/postmelee/hyper-waterfall/pr-merge-cleanup)
Your own site
<a href="https://agentmods.dev/skills/postmelee/hyper-waterfall/pr-merge-cleanup"><img src="https://agentmods.dev/badge/skills/postmelee/hyper-waterfall/pr-merge-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pr-merge-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/postmelee/hyper-waterfall/pr-merge-cleanup"><img src="https://agentmods.dev/badge/skills/postmelee/hyper-waterfall/pr-merge-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 647 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00061 $0.00647
Opus 5 $0.00030 $0.00324
Sonnet 5 $0.00012 $0.00129
Haiku 4.5 $0.00006 $0.00065

Measured 9d ago against content hash 6f3323e7b082, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

pr-merge-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/locales/en/mydocs/skills/pr-merge-cleanup/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR Post-merge Cleanup

Trigger

  • The task requester explicitly says "cleanup after merge" or "clean up the task."
  • This SKILL is invoked directly.

Preconditions

  • The target PR is actually merged on GitHub: gh pr view {number} --json state,mergeCommit.
  • The task requester approved Issue close, or the PR body included closes #N and the Issue was automatically closed.

Procedure

  1. Check PR and Issue state.
    gh pr view {number} --json state,mergedAt,mergeCommit,headRefName
    gh issue view {N} --json state
    
    • If PR state != MERGED, stop immediately and report to the task requester.
  2. Close the Issue only if it was not already closed.
    gh issue close {N}
    
  3. Update {BASE_BRANCH}.
    git fetch origin --prune
    git checkout {BASE_BRANCH}
    git pull --ff-only
    
  4. Delete the remote publish branch. Skip if the branch was already deleted by PR merge with --delete-branch.
    git push origin --delete publish/task{N} 2>&1 || echo "already deleted"
    
  5. Remove the separate worktree if one was used.
    git worktree remove ../{repo}-task{N}
    git worktree prune
    
  6. Delete the local work branch only when it is no longer needed.
    git branch -d local/task{N}
    # Forced deletion requires explicit task requester approval: git branch -D local/task{N}
    
  7. Final daily task board check: confirm the #{N} row in mydocs/orders/{yyyymmdd}.md is Done with a completion time.
  8. Report the cleaned items briefly to the task requester.

Verification

  • gh pr view {number} shows state == MERGED.
  • git branch -vv | grep local/task{N} has no output if the branch was deleted.
  • git ls-remote origin publish/task{N} has empty output.
  • git worktree list does not include the cleaned worktree.
  • git branch --show-current is {BASE_BRANCH}.

Never Do

  • Close an Issue when the PR is not merged.
  • Delete another task branch or the main worktree.
  • Run git branch -D without explicit approval; unmerged commits may be lost.
  • Delete another worker's stash.

Read the full file on GitHub · 76 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 76 lines · 61 tokens per session scan A 6f3323e7b082

Subscribe to this mod's changes

pr-merge-cleanup is a skill published in the GitHub repository postmelee/hyper-waterfall (79 stars, last pushed 1mo ago), licensed MIT. It adds 61 tokens to every session and 647 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

release

Release a new version of the mumei repository. Invoke when the user gives an explicit release instruction ("release it", "/release", "patch release", "ship 0.2.0"). Takes no argument or "patch" / "minor" / "major" for a SemVer bump, or a direct version such as "0.2.0". Wraps any uncommitted changes into a single…

iroha924/mumei · 144 tokens

storozh

Advisory semantic guard over a changeset manifest before it lands in shared state. Use after a multi-repo session produces a changeset-manifest (mirabilis C1) and before the co-sign push gate — classify each unit's routing against the darwin routing-policy (C3) and NLI-check each unit against the shield corpus (claims…

AlexShchuka/neuro-matrix · 104 tokens

deployment-automation

Use when planning, validating, or automating deployment workflows, release checks, rollback readiness, and post-deploy verification.

agenticdevops/aoh · 28 tokens

devops-release-automation

Use when planning and validating safe deployment automation — orchestrates deployment planning, terraform plan review, and post-release health verification.

agenticdevops/aoh · 30 tokens

review-before-commit

Run a behavioral self-check before persisting story results. Verifies diff simplicity, scope adherence, and verifiable completion against enso §10 behavioral principles. Use when a story's implementation is complete and ready to close.

usefulmove/enso · 49 tokens

generator-fix-integrator

Internal Auto-Harness generator skill for worktree-merge fix integration. Use only inside the parallel Generator integrator when it is addressing named defects from QA or retest.

redker56/auto-harness · 40 tokens