worktree-location

Create Git worktrees as sibling directories with branch-derived names.

23|4|Updated May 7, 2025
One-click install
npx skills add https://github.com/Stack-and-Flow/design-system --skill worktree-location
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-location
Source: https://github.com/Stack-and-Flow/design-system/tree/main/.atl/skills/worktree-location
Command: npx skills add https://github.com/Stack-and-Flow/design-system --skill worktree-location

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents CI, isolation, and path-mismatch problems caused by creating Git worktrees in inconsistent locations, especially when parallel agents or subagents are involved.

Core Features & Use Cases

  • Siblings-only worktree placement: Always create worktrees as siblings of the original repository directory to keep paths stable and predictable.
  • Subagent isolation guidance: Avoid using packaged subagent({ worktree: true }) when sibling placement is required; instead create the sibling worktree manually and run with cwd set correctly.
  • Consistent naming for branches and worktrees: Derive worktree paths from Conventional Commit types and issue-title slugs to make automation handoffs reliable.

Quick Start

Create a git worktree using the worktree-location rules so the new checkout is a sibling of the original design-system repo and never placed under /tmp.

Frequently Asked Questions about worktree-location

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

FAQPage Schema
How do I keep git worktree paths stable when running parallel agents?

Keep git worktree paths stable by placing worktrees as sibling directories next to the original repository, avoiding unstable locations like /tmp. This ensures predictable paths during parallel agent execution and PR creation.

Why does my subagent worktree end up in an unpredictable directory location?

Subagent worktrees end up in unpredictable locations when using packaged worktree isolation features. Avoid this by creating sibling worktrees manually and executing the agent with the current working directory set to the correct sibling path.

What is the best way to name git worktrees for automated CI handoffs?

The best way to name git worktrees for CI handoffs is deriving paths from Conventional Commit types and issue-title slugs. This branch-derived naming makes automation handoffs reliable and prevents directory collisions.

Can I create a git worktree under /tmp for isolated agent execution?

You cannot create a git worktree under /tmp by default, as guardrails prevent unstable paths unless explicitly requested. Worktrees are enforced as sibling directories next to the original repository to maintain checkout stability.

How do I prevent directory collisions when multiple agents create git worktrees?

Prevent directory collisions by applying deterministic placement rules that refuse conflicting paths. Sibling-directory computation and branch-derived naming ensure multiple agents create isolated worktrees without overwriting each other.

Does parallel agent workflow require deterministic worktree placement for PR creation?

Parallel agent workflows require deterministic worktree placement for PR creation to avoid path mismatches. Sibling-directory computation next to the original repo ensures isolated writer execution and stable checkout paths for automated PR handoffs.