git-worktree-ops

Create, list, and remove Git worktrees with branch bindings and guardrails.

3|1|Updated Feb 19, 2024
One-click install
npx skills add https://github.com/PrimordialCode/Mammoth.Extensions.DependencyInjection --skill git-worktree-ops
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree-ops
Source: https://github.com/PrimordialCode/Mammoth.Extensions.DependencyInjection/tree/main/.agents/skills/git-worktree-ops
Command: npx skills add https://github.com/PrimordialCode/Mammoth.Extensions.DependencyInjection --skill git-worktree-ops

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Coordinating multiple Git worktrees and guardrails in a multi-agent environment can be error-prone and hard to audit.

Core Features & Use Cases

  • Create, list, and remove worktrees safely across agents, with branch bindings and metadata persistence.
  • Enforce guardrails via metadata, pre/post hooks, and tooling to prevent misconfigurations.
  • Use in collaborative scenarios to maintain isolation, track task branches, and prune stale worktrees while preserving history.

Quick Start

Create a new worktree for an agent task and verify guardrails are active.

Frequently Asked Questions about git-worktree-ops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage Git worktrees safely when running multiple concurrent agents?

Git worktrees can be managed safely by applying automated metadata persistence, branch bindings, and guardrails to prevent misconfigurations across concurrent agents. This approach enforces safe defaults and tracks task branches to maintain isolation.

What are guardrails in a multi-agent Git worktree workflow?

Guardrails in a multi-agent Git worktree workflow are enforced metadata, pre/post hooks, and tooling configurations that prevent misconfigurations. They validate concurrent agent operations to maintain isolation and ensure safe branch bindings.

How do I clean up stale worktrees and prune metadata without losing commit history?

Stale worktrees and their associated metadata can be pruned using dedicated cleanup scripts that remove the worktree while preserving the underlying commit history. This automated cleanup process ensures metadata stays synchronized with active branches.

Can I bind specific task branches to individual agents using Git worktrees?

Yes, specific task branches can be bound to individual agents through Git worktrees with metadata persistence. This binding tracks which agent owns which branch, maintaining strict isolation and preventing cross-agent interference.

What is the best way to validate guardrails before starting a multi-agent worktree task?

Guardrails can be validated before starting a multi-agent worktree task by running verification scripts that check local Git configurations and metadata. This validation ensures safe defaults are active and branch bindings are correctly established.

Why do concurrent agents cause errors when sharing the same Git repository?

Concurrent agents cause errors in a shared Git repository because standard configurations lack isolation and metadata tracking for simultaneous branch operations. Implementing dedicated worktrees with enforced guardrails prevents these misconfigurations and conflicts.