merged
Skill11 starsChanged 4 months agoMITView on GitHub
Use right after the user merged a PR — "merged", "I merged it", "merged, clean up", "shipped, clean up the branch" — to run the post-merge routine for the repo the PR belongs to.
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 42
Update the default branch in its existing worktree with git pull --ff-only, or check it out in the primary worktree when free, then git …
- Very specific: line 59
If orca exists but the list call fails, ownership is unknown: skip the removal and report it (for example, "open Orca and rerun, or remove …
- Distinctive: line 67
Run git worktree prune to clear stale administrative records.
- Very specific: line 70
Release (only if requested): Prefer a repo-local release skill or command (for example .claude/skills/release/ or …
- Distinctive: line 74
NOT VERIFIED — flag loudly), what auto-deploys, branches/worktrees removed (and whether through Orca or git) or kept, release link if cut.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Merged — post-merge cleanup, checks, and (optional) release
The human just merged a PR. Run the tail of the pipeline they otherwise type by hand.
Arguments
- Optional PR URL/number (else detect:
gh pr list --state mergedor the current branch's PR). release— also cut a release after cleanup. Never release unless this word (or an explicit ask) is present — in some repos publishing a release deploys to production.keep— keep the PR's worktree and local branch. Without this word (or an explicit "keep the worktree"), removing them is the default.
Steps
- Verify repo and merge. Resolve local
nameWithOwner, then rungh pr view <pr> --json state,mergedAt,mergeCommit,headRefName,headRefOid,url. Require the PR URL repository to match the local repo andstateto beMERGED. Otherwise stop before migration, deploy, release, or local actions. - Migration check (do not skip). Did the merged diff add DB migration files
(
gh pr diff <pr> --name-onlyagainst the repo's migrations dir)? If yes: verify the migration actually ran where the code deploys (deploy workflow run / migrator job logs) and say so explicitly. A shipped PR whose migration silently didn't run is a production incident — this check exists because it happened. - Answer the deploy question preemptively. From
.github/workflows, state what this merge triggers on its own (e.g. "staging auto-deploys on merge to the default branch; prod only on a published release") and link the running workflow if one started. - Local cleanup, limited to this PR.
- Resolve the default branch and locate its worktree plus the PR branch worktree with
git worktree list --porcelain. Before switching or removing anything, rungit status --porcelainin every involved worktree and stop if any is dirty. - Require the local PR branch tip to equal the recorded
headRefOid; otherwise skip deletion and report unpublished or post-merge commits. - Update the default branch in its existing worktree with
git pull --ff-only, or check it out in the primary worktree when free, thengit fetch --prune. Never remove the primary worktree. If the PR branch occupies the primary worktree while the default branch is checked out elsewhere, leave the branch/worktree and report why cleanup was skipped. - Unless
keepwas given, remove the PR's linked worktree without asking: a clean tree at the verified head is all the permission needed. If this session's working directory is inside that worktree, run every other step first (release included) and do the removal, branch deletion, and prune last. Run the removal and every git command after it from the primary worktree (git -C '<primary-worktree>' …, orcd '<primary-worktree>' &&in the same Bash call), because git cannot run from a deleted directory. - Pick the removal command by whether Orca manages the worktree, not by which
terminal is running. If
command -v orcasucceeds andorca worktree list --jsoncontains a"path"equal to the worktree path, runorca worktree rm --worktree "path:<worktree-path>". If that command fails, stop and report the exact cleanup the user still needs to do; do not fall back to git. Iforcaexists but the list call fails, ownership is unknown: skip the removal and report it (for example, "open Orca and rerun, or remove it yourself"). Only with noorca, or a successful list that does not contain the path, rungit worktree remove <worktree-path>. - Then delete the local branch if it still exists (Orca may already have deleted it).
Try
git branch -dfirst. After a squash/rebase merge, allowgit branch -Donly because the PR is verified merged and the local tip exactly matches its recorded head. Never remove unrelated branches or worktrees. - Run
git worktree pruneto clear stale administrative records. Do not delete untracked files or vaguely named "planning artifacts"; each workflow owns and removes its own temporary files.
- Resolve the default branch and locate its worktree plus the PR branch worktree with
- Release (only if requested). Prefer a repo-local release skill or command (for
example
.claude/skills/release/or.claude/commands/release.md); otherwise use the repo's documented release process. - Report. One compact block: merged PR, migration verdict (none / ran / NOT VERIFIED — flag loudly), what auto-deploys, branches/worktrees removed (and whether through Orca or git) or kept, release link if cut.
Red flags
- Any temptation to
gh pr merge→ never; this is a verify-only skill. - Migration present but you can't confirm it ran → make it the FIRST line of the report and suggest how to verify; never bury it.
- The default branch is checked out in another worktree → run the update there; do not remove or force it.
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- luainkernel/lunatik★ 610same name
- DanaResearchGroup/agent-skills★ 1same name
- zahidakhyar/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- checkpointSkill
- cmux-orchestrateSkill
- explain-prSkill
- herdr-orchestrateSkill
- orchestrate-listSkill
- orchestrate-planSkill
- orchestrateSkill
- polishSkill
- review-fixSkill
- review-loopSkill
- reviewSkill
- shipSkill
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
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.

