landing
Skill4 starsChanged 7 months agoMITView on GitHub
Post-merge cleanup workflow. Discusses uncommitted worktree changes per-worktree before deleting; handles local + remote merged branches, stale refs, dist/ build artifacts, and surfaces today's memory entries for review. Use when the user wants to wrap up after merging a PR, clean up worktrees, tidy branches, do post-merge cleanup, "land the plane", "land", remove stale feature branches, or close out a development session.
- Deletes or force-pushes
- Commits and pushes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- creedants/pstack-t3their own version, first seen Oct 3, 2026
- marcus-at-localhost/market-context-kittheir own version, first seen Aug 21, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
- mahiunfiltered/claude-code-skillstheir own version, first seen Jul 8, 2026
- Hussain-Elfalah/Agentic-Skillstheir own version, first seen Jun 4, 2026
- lightpointventures/claude-code-startertheir own version, first seen Mar 27, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- lightpointventures/claude-code-starter★ 36same name
- Hassaan146/claude-skills★ 18same name
- creedants/pstack-t3★ 3same name
- Hussain-Elfalah/Agentic-Skills★ 2same name
- mahiunfiltered/claude-code-skills★ 1same name
- marcus-at-localhost/market-context-kit★ 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 repository124 other files it gives its agents.
- apple-contactsSkill
- atlassian-cli-jiraSkill
- bellardSkill
- brainstormingSkill
- career-interviewSkill
- carmackSkill
- cavecrewSkill
- caveman-commitSkill
- caveman-compressSkill
- caveman-helpSkill
- caveman-reviewSkill
- cavemanSkill
- caveman-statsSkill
- ci-watchSkill
- clone-configSkill
- cloudflare-emailSkill
- course-correctSkill
- datastar-patternsSkill
- datastarSkill
- datastar-taoSkill
- defuddleSkill
- description-linterSkill
- deterministic-simulation-testingSkill
- dispatching-parallel-agentsSkill
- dopplerSkill
- dx-auditSkill
- evolution-changelogSkill
- evolution-engineSkill
- executing-plansSkill
- farleySkill
- finishing-a-bones-leafSkill
- frontend-component-decision-treesSkill
- gh-project-charterSkill
- gh-project-operationsSkill
- gh-project-setupSkill
- gh-project-sharedSkill
- goal-completeSkill
- golang-patternsSkill
- hellandSkill
- hickeySkill
- hippSkill
- investigating-agent-sessionsSkill
- linear-cliSkill
- linear-methodSkill
- memorizeSkill
- midscene-testingSkill
- monitoring-the-operatorSkill
- normanSkill
- obsidian-basesSkill
- obsidian-canvasSkill
- obsidian-markdownSkill
- orchestrator-modeSkill
- orchestrator-suitSkill
- ousterhoutSkill
- pikchr-generatorSkill
- pocock-cavemanSkill
- pocock-diagnoseSkill
- pocock-git-guardrailsSkill
- pocock-handoffSkill
- pocock-setup-pre-commitSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 14 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
After a PR is merged and you want to delete the local + remote feature branch
- Very specific: line 18
When .worktrees/ has accumulated multiple stale checkouts
- Distinctive: line 20
When the user says "land the plane", "clean up", "tidy worktrees", "wrap up after merge", or similar
- Distinctive: line 28
Run these in one batch and present the results to the user as a single inventory block before doing anything destructive.
- Distinctive: line 57
After the inventory runs, present a concise summary:
- Distinctive: line 69
If user says no/abort → stop.
- Very specific: line 94
c: ask for a commit message.
- Distinctive: line 97
q: stop the whole flow, jump to step 6
- Distinctive: line 101
After worktrees are handled:
- Distinctive: line 105
After remote deletions: git remote prune origin (no prompt — implicit in the user's confirmation).
- Distinctive: line 107
If either list is empty, skip its prompt.
- Very specific: line 111
If dist/ exists from the inventory, ask: "Remove dist/ (size: X)?
- Distinctive: line 115
If the inventory found memory entries authored today: list them with paths.
- Distinctive: line 119
Do NOT delete or modify any memory file.
- Distinctive: line 123
Run git status and git worktree list.
- Distinctive: line 137
If anything was kept (dirty worktrees user opted to keep, etc.), list it explicitly so the user knows what's left.
- Very specific: line 146
Never: delete a worktree with uncommitted changes without the user picking option (s/c/d) for that specific worktree.
- Very specific: line 148
Never: delete a remote branch that doesn't match feat/* (or is main/master).
- Distinctive: line 150
If any step errors out, surface the error verbatim and ask the user before retrying or skipping.
“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.
Files
Landing
Post-merge cleanup. Methodical taxi-in: inventory first, decide section-by-section, never destroy uncommitted work without an explicit per-worktree decision.
When to use
- After a PR is merged and you want to delete the local + remote feature branch
- When
.worktrees/has accumulated multiple stale checkouts - At the end of a development session to clean up the working environment
- When the user says "land the plane", "clean up", "tidy worktrees", "wrap up after merge", or similar
Workflow
Walk the user through cleanup in this order. Run the inventory first, then handle items section-by-section. Be terse — say what you're doing and ask only the questions that need an answer.
1. Inventory
Run these in one batch and present the results to the user as a single inventory block before doing anything destructive. Use absolute paths and don't assume cwd:
git worktree list
echo '---per-worktree status---'
for wt in $(git worktree list --porcelain | awk '/^worktree/ {print $2}' | grep -v "^$(git rev-parse --show-toplevel)$"); do
echo "=== $wt ==="
(cd "$wt" 2>/dev/null && git status --porcelain) || echo "(unable to enter)"
done
echo '---local merged branches (excluding main)---'
git branch --merged main 2>/dev/null | grep -vE '^\*|main$|master$'
echo '---remote merged feat/* branches---'
gh pr list --state merged --limit 50 --json headRefName,number --search "head:feat/" 2>/dev/null \
| jq -r '.[] | select(.headRefName | startswith("feat/")) | "\(.headRefName) (#\(.number))"' \
| head -20
echo '---remote refs to prune (dry-run)---'
git remote prune origin --dry-run 2>&1 | grep -E 'would prune|^ ' | head -20
echo '---dist/ size---'
[ -d dist ] && du -sh dist 2>/dev/null || echo "(no dist/)"
echo '---memory entries authored today---'
MEMDIR=$(find ~/.claude/projects -maxdepth 2 -name "memory" -type d -path "*$(basename "$(pwd)")*" 2>/dev/null | head -1)
if [ -n "$MEMDIR" ]; then
find "$MEMDIR" -name '*.md' -mtime -1 -type f 2>/dev/null | grep -v MEMORY.md | head -10 \
|| echo "(no recent entries)"
else
echo "(no project-specific memory dir found)"
fiAfter the inventory runs, present a concise summary:
Inventory (cleanup candidates):
- Worktrees to consider: N (M dirty)
- Local merged branches: N
- Remote merged feat/* branches: N
- Stale remote refs: N
- dist/:
<size>or absent- Today's memory entries: N (informational only)
Proceed? (y/N)
If user says no/abort → stop. Otherwise continue to step 2.
2. Worktrees (per-worktree decisions)
For each non-main worktree from the inventory:
- Clean (per-worktree status was empty): announce "removing clean worktree at
<path>" and rungit worktree remove <path>. No prompt. Dirty (per-worktree status had output): STOP. Show the user:
Worktree at
<path>has uncommitted changes:<paste the porcelain output>Options:
- (s) stash to a named stash (e.g.
pre-cleanup-<branch>), then remove worktree - (c) commit on the current branch, then remove worktree
- (d) delete losing changes (
git worktree remove --force) - (k) keep this worktree, skip cleanup
- (q) abort cleanup entirely
Choice for
<path>?Honor the user's per-worktree choice:
- s:
(cd <path> && git stash push -m "pre-cleanup-$(git branch --show-current)")thengit worktree remove <path> - c: ask for a commit message;
(cd <path> && git add -A && git commit -m "<msg>")thengit worktree remove <path> - d:
git worktree remove --force <path>(after confirming once more — destructive) - k: skip; note in final report
- q: stop the whole flow, jump to step 6
- (s) stash to a named stash (e.g.
3. Local + remote branches (batch confirm)
After worktrees are handled:
- List the local merged branches (excluding
main/master). Ask: "Delete these N local branches? (y/N)" — single confirm, thengit branch -d <each>. Ifgit branch -drefuses any branch (unmerged commits), pause and ask user before-D. - List the remote merged feat/* branches. Ask: "Delete these N remote branches? (y/N)" — single confirm, then
git push origin --delete <branch1> <branch2> ...in one batch. - After remote deletions:
git remote prune origin(no prompt — implicit in the user's confirmation).
If either list is empty, skip its prompt.
4. dist/ directory
If dist/ exists from the inventory, ask: "Remove dist/ (size: X)? (y/N)". If yes, rm -rf dist.
5. Memory entries (informational only)
If the inventory found memory entries authored today: list them with paths. Tell the user:
These memory entries were authored today. Review them at
<dir>and prune any that are too narrow or session-specific. I won't touch memory automatically.
Do NOT delete or modify any memory file. Move on.
6. Final report
Run git status and git worktree list. Show the user:
Cleanup complete.
- Worktrees removed: N (kept: M)
- Local branches deleted: N
- Remote branches deleted: N
- Stale refs pruned: N
- dist/: removed / kept / absent
<output of git status>
If anything was kept (dirty worktrees user opted to keep, etc.), list it explicitly so the user knows what's left.
Composition with other skills
bones-powers:finishing-a-bones-leaf— after fan-in + git push + PR merge, hand off toland-the-planeto clean up the feature branch and worktree.superpowers:finishing-a-development-branch— same handoff pattern for non-bones workflows.
Safety rules
- Never delete a worktree with uncommitted changes without the user picking option (s/c/d) for that specific worktree.
- Never force-delete (
-D) a local branch that isn't merged without explicit user confirmation for that branch. - Never delete a remote branch that doesn't match
feat/*(or ismain/master). - Never modify memory files. List only.
- If any step errors out, surface the error verbatim and ask the user before retrying or skipping.
Tone
Terse. Don't narrate intent — just say what you're doing and ask the targeted question. Match the "land the plane" framing: end of flight, methodical taxi-in.
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.

