reconcile
Skill1 starsChanged 11 days agoMITView on GitHub
Consolidate worktrees and clean up stale branches. Use when asked to reconcile, clean up worktrees, consolidate branches, or tidy up a project's git state.
- Deletes or force-pushes
24 other projects use a version of this.
Adopted by
Most recently taken up by
- Yesterday-AI/ytstacktheir own version, first seen Nov 8, 2026
- buildomator/buildomatortheir own version, first seen Nov 8, 2026
- eggs-gd/career-spacetheir own version, first seen Nov 8, 2026
- menot-you/n-soultheir own version, first seen Nov 1, 2026
- DataWithBaraa/claude-code-data-engineering-skillstheir own version, first seen Nov 1, 2026
- jbaruch/nanoclaw-hosttheir own version, first seen Oct 31, 2026
Used with
Projects with it also use close, brief and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
HermeticOrmusSkillclose
End-of-session ritual. Captures session state, updates auto-memory, writes a session summary, then exits the session cleanly.
Also in 3 projects that use this
AnthropicSkillbrief
Generate contextual briefings for legal work — daily summary, topic research, or incident response. Use when starting your day and need a scan of legal-relevant items across email, calendar, and contracts, when researching a specific legal question across internal sources, or when a developing situation (data breach, litigation threat, regulatory inquiry) needs rapid context.
Also in 3 projects that use this
renatorozasSkillgrill
Adversarial code review. Don't let me ship until the changes pass your scrutiny.
Also in 3 projects that use this
AnthropicSkillstart
Set up your bio-research environment and explore available tools. Use when first getting oriented with the plugin, checking which literature, drug-discovery, or visualization MCP servers are connected, or surveying available analysis skills before starting a new project.
Also in 3 projects that use this
nicolasestremSkillbrainstorm
Structured idea generation and solution exploration with systematic analysis.
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 3 projects that use this
- +1 more from anthropics
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- buildomator/buildomator★ 102same name
- DataWithBaraa/claude-code-data-engineering-skills★ 84same name
- Kanevry/session-orchestrator★ 53same name
- wrg32786/aigent-os★ 26same name
- howells/fiction★ 23same name
- evist0/okf-matt-skills★ 13same name
- jovesun-lab/arcgram★ 13same name
- conorbronsdon/agent-skills★ 10same name
- eggs-gd/career-space★ 4same name
- EvildoerXiaoyy/reasonix-skills★ 4same name
14 more not listed
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 repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analyze-codeSkill
- analyze-projectSkill
- analyze-testsSkill
- audit-mergesSkill
- babysit-prSkill
- backlogSkill
- branchSkill
- coderabbitSkill
- commitSkill
- greptileSkill
- implement-issuesSkill
- issueSkill
- jiraSkill
- lintro-addSkill
- lintro-reviewSkill
- lintro-verifySkill
- lintSkill
- properizeSkill
- pr-raycastSkill
- prSkill
- raycastSkill
- rebaseSkill
- scorecardSkill
- stand-ciSkill
- stand-generalSkill
- stand-odinSkill
- stand-pySkill
- stand-rustSkill
- stand-tsSkill
- sweep-prsSkill
- test-apiSkill
- test-shellSkill
- testSkill
- test-ui-qsfSkill
- test-uiSkill
- turbo-addSkill
- turbo-testSkill
- turbo-verifySkill
- which-prSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
10
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
- could be automatic: a setting could enforce it
- Very specific: line 22
If a project name is given, look for ~/Code/<project-name>
- Very specific: line 50
If tracking branch shows gone → remote branch was deleted (PR likely merged or closed)
- Distinctive: line 52
If tracking branch exists → check PR status
- Distinctive: line 106
Ask the user to confirm the plan (use a structured question tool if available):
- Distinctive: line 113
Do NOT proceed without explicit confirmation.
- Distinctive: line 117
After confirmation, perform the cleanup in this order:
- Very specific: line 121
Before any fallback delete, resolve <path> to a canonical path and verify all of the following:
- Very specific: line 127
Only with explicit user confirmation, if removal still fails (orphaned directory), run rm -rf <path> then git worktree prune
- Distinctive: line 180
NEVER delete branches or worktrees without asking the user first
- Distinctive: line 181
ALWAYS stash uncommitted changes before cleanup
- Distinctive: line 182
NEVER force-push or modify remote state
- Distinctive: line 183
NEVER delete main or master branches
- Distinctive: line 184
Always present the full picture before taking action
- Distinctive: line 185
If a directory can't be identified as a worktree or clone, flag it and ask — don't assume
- Very specific: line 187
If gh is not available, fall back to checking remote tracking status only
“Common” is measured: kept by at least 6 in 10 of the 19 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
Reconcile
Consolidate worktrees into the main worktree and clean up stale branches for a project.
Arguments
Accepts an optional project name as an argument:
/reconcile— reconcile the current working directory's project/reconcile py-lintro— reconcile the project at~/Code/py-lintro
Workflow
Phase 1 — Discovery
- Identify the project root:
- If a project name is given, look for
~/Code/<project-name> - Otherwise, use the current git repository root
- Confirm it's a git repository — if not, stop
- If a project name is given, look for
Find all worktrees:
git worktree list- Find sibling directories that may be related:
- List directories matching
<project-name>-*in the same parent directory - For each, check if it's:
- A worktree (
.gitis a file pointing to the main repo) - A separate clone (
.gitis a directory with same remote) - Unrelated (different remote or not a git repo) — ignore these
- A worktree (
- List directories matching
Collect all branches:
git branch -vv --no-color
Phase 2 — Analysis
For each branch (excluding main/master), determine its status:
- Check remote tracking:
- If tracking branch shows
gone→ remote branch was deleted (PR likely merged or closed) - If tracking branch exists → check PR status
- If tracking branch shows
Check GitHub PR status (if
ghis available):gh pr list --state all --json number,title,headRefName,state- Map each branch to its PR (if any)
- Categorize:
merged,open,closed(without merge), orno PR
Check for uncommitted changes in each worktree:
git -C <worktree-path> status --shortCheck for stashes:
git stash list- Check if main worktree is on
main— flag if it's on a feature branch
Phase 3 — Report
Present a summary to the user, grouped by action:
Project: turbo-themes
Main worktree: ~/Code/turbo-themes (on refactor/265 — should be main)
Worktrees to remove:
✅ turbo-themes-267-... → fix/267-text-contrast (PR #350 merged, clean)
✅ turbo-themes-build-.. → fix/build-ci-site (PR #359 merged, clean)
⚠️ turbo-themes-ci-... → fix/ci-missing-rose (PR #356 merged, 3 uncommitted files)
Branches to delete (PRs merged):
fix/267-text-contrast-state-buttons-light-themes
fix/build-ci-site-missing-core-dep
fix/ci-missing-rose-pine-synced
Branches to keep:
📌 feat/landing-page-redesign — no PR, unmerged work
Separate clones found:
🔶 ~/Code/turbo-themes-test — separate clone, not a worktree
Stashes: 5 (all on merged branches)Phase 4 — Confirm
Ask the user to confirm the plan (use a structured question tool if available):
- Which branches to keep vs delete
- Whether to remove separate clones
- Whether to clear stale stashes
- Confirm that uncommitted changes will be stashed
Do NOT proceed without explicit confirmation.
Phase 5 — Execute
After confirmation, perform the cleanup in this order:
- Remove worktree directories:
- Try
git worktree remove <path>first - Before any fallback delete, resolve
<path>to a canonical path and verify all of the following:- Path is non-empty and exists
- Path is NOT
/and NOT the home directory - Path is under an allowed prefix (repo sibling worktree/clone root)
- Path is not a symlink escaping the allowed prefix
- Only with explicit user confirmation, if removal still fails (orphaned directory),
run
rm -rf <path>thengit worktree prune
- Try
Stash uncommitted changes (if any, on branches being kept):
git -C <worktree-path> stash push -m "reconcile: WIP on <branch-name>"Switch main worktree to the default branch:
DEFAULT_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's#^origin/##') git checkout "$DEFAULT_BRANCH" git pullDelete merged branches:
git branch -d <branch1> <branch2> ...- Clear stale stashes (only if user confirmed):
- Drop stashes that reference deleted branches
Remove separate clones (only if user confirmed):
rm -rf <clone-path>- Apply the same canonical path-safety checks before deletion (non-empty, exists, not
/or home, within allowed prefix, no symlink escape)
- Apply the same canonical path-safety checks before deletion (non-empty, exists, not
Phase 6 — Verify
Print the final state:
=== worktrees ===
~/Code/turbo-themes abc1234 [main]
=== branches ===
feat/landing-page-redesign def5678 unmerged work
* main abc1234 [origin/main] latest commit message
=== stashes ===
(none)Important
- NEVER delete branches or worktrees without asking the user first
- ALWAYS stash uncommitted changes before cleanup
- NEVER force-push or modify remote state
- NEVER delete
mainormasterbranches - Always present the full picture before taking action
- If a directory can't be identified as a worktree or clone, flag it and ask — don't assume
- If
ghis not available, fall back to checking remote tracking status only - Branches with open PRs should default to "keep" in the recommendation
- Branches with no PR and no remote should be flagged for user decision
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.

