- Home
- Skills
- DevOps & Cloud
- Git Worktree Agent
Works with the AI Agents you already use
Git Worktree Agent
Safely manage isolated Git worktrees for parallel development, branch integration, and risk-free repository cleanup.
$9
Git Worktree Agent
Example session with this skill installed
I need to start a new feature called 'api-refactor' based on the 'main' branch, but I want to keep my current work in this directory running. Set up a worktree for it.
- Read your context and instructions
- Compiled the git worktree agent
I have inspected the repository state. There are no existing worktrees at the proposed path, and the branch name is available. I have prepared a plan to isolate the api-refactor work.
Git Worktree Plan
| Action | Command | Target Path | Branch | Status |
|---|---|---|---|---|
| Inspect | git worktree list | N/A | N/A | COMPLETED |
| Create | git worktree add ../api-refactor main -b api-refactor | ../api-refactor | api-refactor | PENDING APPROVAL |
| Verify | cd ../api-refactor && git status | ../api-refactor | api-refactor | NOT RUN |
| Audit | git branch -vv | N/A | api-refactor | NOT RUN |
Safety Check:
- Path
../api-refactordoes not exist: Confirmed - Branch
api-refactordoes not exist: Confirmed - Current directory state: Dirty (stashed changes not required due to worktree)
Next steps
- Run the
git worktree addcommand listed above to initialize the new workspace. - Navigate to the new directory to begin the refactor without affecting your current process.
- Run
git worktree listto verify both environments are tracking correctly.
Connects securely to your tools. The creator never sees your data.
About this skill
Managing parallel features in a single repository often leads to messy stashes or risky branch switching that breaks build artifacts. This skill manages isolated Git worktrees, allowing for concurrent development without context switching overhead or directory collisions.
What it does
- Parallel workspace management isolates features or bug fixes into dedicated directories to avoid
git stashcycles. - Safety-first cleanup prevents the accidental deletion of unmerged branches or worktrees containing dirty files.
- Conflict detection analyzes merge-bases and compares branches to surface potential integration issues before they happen.
- Command planning generates step-by-step Git execution plans for approval to ensure no destructive operations occur.
- State auditing tracks worktree paths, branch associations, and pending changes across the entire local repository.
How it works
- Inspection of the current repository state including
git status, branch list, and existing worktree paths. - Conflict checking to ensure the target branch and directory name do not collide with existing assets.
- Plan generation where the agent proposes specific
git worktree addcommands for user verification. - Execution and validation of the worktree setup, checking that the environment is ready for isolated development.
- Integration and pruning to safely merge changes and remove directories only after verifying the work is committed.
Frameworks & tools
This skill works with any standard Git installation. It relies on git worktree subcommands and is compatible with terminal-based workflows, CI environments, and IDEs like VS Code or Cursor.
Why this beats prompting it yourself
Generic prompts often suggest risky flags like --force or forget to check for untracked files before pruning. This skill follows a strict safety protocol that verifies merge status and directory availability, preventing accidental data loss during complex parallel workflows.
Use cases
- Manage a hotfix in a separate directory while keeping a long-running feature build intact.
- Run multiple versions of an application side-by-side for manual comparison or testing.
- Isolate an automated AI agent's workspace to prevent it from overwriting your local staging area.
- Perform safe repository audits to find and prune abandoned feature branch directories.
Known limitations
Requires Git 2.5 or newer. It will not execute commands without explicit shell access and user approval. It does not manage submodules unless specifically instructed.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed 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 scanned
Verified clean 2 days ago
- Passed all security checks, Safe to install
Requires