worktree-per-pr

Create and manage isolated git worktrees for each agent dispatch.

3|2|Updated May 12, 2026
One-click install
npx skills add https://github.com/kriscendobot/garden --skill worktree-per-pr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-per-pr
Source: https://github.com/kriscendobot/garden/tree/main/skills/worktree-per-pr
Command: npx skills add https://github.com/kriscendobot/garden --skill worktree-per-pr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill prevents cross-contamination of code and state by ensuring that every agentic task operates within a strictly isolated, ephemeral worktree, eliminating the risk of edits bleeding across concurrent jobs.

Core Features & Use Cases

  • Isolated Workspaces: Automatically creates and manages distinct project checkouts for every subagent dispatch.
  • Lifecycle Orchestration: Handles the setup and teardown of worktree triples, ensuring no stale artifacts remain after a task completes.
  • Use Case: When running multiple concurrent agents to review different pull requests, this skill ensures each agent has its own clean environment, preventing git-push conflicts and file corruption.

Quick Start

Use the worktree-per-pr skill to prepare a fresh isolated project worktree for the current agent dispatch.

Frequently Asked Questions about worktree-per-pr

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

FAQPage Schema
How do I isolate git state for concurrent agentic tasks to prevent cross-contamination?

Git state isolation for concurrent agentic tasks is achieved by managing isolated, ephemeral worktree lifecycles for every sub-agent dispatch. This ensures strictly separated project checkouts, eliminating the risk of edits bleeding across concurrent jobs.

What is the best way to run multiple agents reviewing different pull requests without git-push conflicts?

Running multiple agents reviewing different pull requests without conflicts requires creating distinct, per-dispatch worktree checkouts. This provides each agent with a clean environment, preventing file corruption and git-push conflicts during concurrent operations.

How do I set up a fresh isolated worktree for an agent dispatch?

Setting up a fresh isolated worktree for an agent dispatch involves using the worktree-per-pr skill within the garden's dispatch architecture. It handles the setup and teardown of worktree triples to prepare clean, ephemeral environments.

Does git worktree lifecycle management automatically clean up stale artifacts after a task completes?

Git worktree lifecycle management does automatically clean up stale artifacts after a task completes. It orchestrates the strict setup and teardown of ephemeral workspaces to ensure no residual files remain and workspace integrity is maintained.

When do I need ephemeral worktrees for mutating and read-only subagents?

Ephemeral worktrees are needed when executing mutating and read-only subagents concurrently within a dispatch architecture. They provide the strict isolation required to prevent cross-job interference and state corruption during parallel task execution.