worktree-detection

Resolve Git worktree paths dynamically from Git's internal registry.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/yaresimeonthomas/-kate-crm --skill worktree-detection-yaresimeonthomas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-detection
Source: https://github.com/yaresimeonthomas/-kate-crm/tree/main/.claude/skills/worktree-detection
Command: npx skills add https://github.com/yaresimeonthomas/-kate-crm --skill worktree-detection-yaresimeonthomas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hardcoding Git worktree paths in scripts and hooks causes failures when worktrees are created in different locations or on different machines, breaking automation that relies on locating task-specific worktrees.

Core Features & Use Cases

  • Dynamic Worktree Lookup: Resolves worktree paths by querying Git's internal registry instead of relying on fixed directory structures.
  • Task Number Extraction: Automatically pulls task identifiers from agent variables like task owner or subject lines.
  • Use Case: For example, a CI/CD hook that needs to run linting on a specific task's worktree can use this skill to reliably find the correct directory regardless of where the worktree was created on the system.

Quick Start

Use the worktree-detection skill to locate the Git worktree associated with task number TASK-005 from your current repository.

Frequently Asked Questions about worktree-detection

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

FAQPage Schema
How do I locate a Git worktree by task ID without hardcoding paths?

To locate a Git worktree by task ID without hardcoded paths, this skill queries Git's internal worktree registry to dynamically resolve valid worktree directories using task identifiers.

Why do my Git hook scripts fail when worktrees are created in different locations?

Git hook scripts fail across different machines because hardcoded worktree paths break when directories move. Querying Git's internal worktree registry dynamically resolves paths based on task identifiers instead of fixed locations.

How do I map agent task identifiers to their local worktree directories in automation workflows?

Mapping agent task identifiers to local worktree directories involves extracting task numbers from agent variables and querying Git's worktree registry to resolve the associated directory paths for automation workflows.

What happens if a script tries to locate a missing Git worktree?

When locating a missing Git worktree, the script handles the absence gracefully to prevent crashes, ensuring automation workflows continue executing without failing due to unresolvable task paths.

Can I use this worktree path resolution for CI/CD linting hooks?

Yes, you can use this worktree path resolution for CI/CD linting hooks. It reliably finds the correct task-specific worktree directory regardless of where it was created on the system.

What is the best way to resolve task-specific Git worktree paths in agent tools?

The best way to resolve task-specific Git worktree paths in agent tools is querying Git's internal registry rather than relying on fixed directory structures, preventing cross-machine automation failures.