- Home
- Skills
- Workflow Automation
- Deterministic Git Worktree Squash & Teardown Pro
Deterministic Git Worktree Squash & Teardown Pro
by Julia
Safely squash linked worktree changes to main, exclude build artifacts, update SemVer, and teardown worktree cleanly.
$1.99
Deterministic Git Worktree Squash & Teardown Pro
Example session with this skill installed
/sgit-merge-worktree clean artifacts and squash feature-auth worktree into main
- Read your context and instructions
- Compiled the deterministic git worktree
Inspecting worktree repository state...
Source: D:/Workspace/project/.worktrees/feature-auth (branch: feature-auth)
Target Branch: main (HEAD: 8f9b2c1)
Artifact Cleanup: 14 temporary build files removed from .local/build (freed 42 MB)
Version Plan: 1.2.0 -> 1.2.1 (patch increment on main)
Proposed Squash Commit
feat(auth): complete OAuth2 implementation and token refresh
Features
- Add OAuth2 provider support
- Implement token refresh rotation
Bug Fixes
- Fix session expiration race condition
Confirmed by user -> Applying squash merge and committing to main...
Commit successful: 3d5e7f2 (HEAD -> main)
Removing source worktree safely...
Worktree removed cleanly. Task directory cleaned up.
Connects securely to your tools. The creator never sees your data.
About this skill
Overview
A deterministic, artifact-excluding Git worktree squash, SemVer synchronization, and teardown skill designed for modern AI coding agents (Claude Code, Cursor, Codex, Windsurf, Antigravity, OpenClaw, Roo Code).
Why sgit-merge-worktree?
Multi-agent and branch workflows frequently spin up separate Git worktrees. However, integrating a worktree back into the main branch often results in serious problems:
- Artifact Pollution: Worktrees accumulate local build outputs, compilation artifacts (
.local/,build/,dist/,tmp/), caches, and debug logs. Standardgit merge --squashpulls these dirty files directly into the main repository. - Worktree Leaks & Drift: Agents abandon unremoved worktree folders across disk, leaving locked repositories or stale tracking branches.
- Accidental Data Loss: Force-deleting worktrees without creating a safety snapshot of uncommitted experimentation.
- Version Drift: The version on the main branch is not incremented, or requires multiple corrective commits after the merge.
Key Capabilities
- Pre-Merge Artifact Cleanup (
merge_artifacts.py): Purges unneeded temporary build directories while protecting game saves, signing keys, and source assets. - Strict Artifact Exclusion: Guarantees temporary files and caches NEVER enter the Git index, safety stash, squash diff, or final commit.
- Safety Snapshot Stash: Captures an identifiable safety stash of uncommitted work before performing any mutations.
- Conventional Commits & Automated SemVer Bump: Calculates a 3-segment Semantic Versioning patch bump against the target main branch and bundles the update into the single squash commit.
- Clean Worktree Removal & Teardown: Performs pre-removal sanity checks (
check-cleanup), removes the linked worktree (git worktree remove) without dangerous force flags, and cleans up task state directories. - Zero External Dependencies: Pure Python 3.10+ standard library.
Supported Platforms
- Claude Code (
~/.claude/skills/sgit-merge-worktree/) - Cursor / Windsurf / Codex (
~/.agents/skills/sgit-merge-worktree/) - Antigravity (
~/.gemini/config/skills/sgit-merge-worktree/)
Requires target branch to be clean. Does not support automatic conflict resolution. Source must be a removable linked worktree. Limited to Python 3.10+ environments.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 12 days ago
- Software
Python
Git
Permissions
What's inside
Frequently Asked Questions
New in Workflow Automation
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.