using-git-worktrees-extras

Validates scoped test baselines and edit readiness for linked Git worktrees.

1|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/ZK-Theory/TDL --skill using-git-worktrees-extras-zk-theory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees-extras
Source: https://github.com/ZK-Theory/TDL/tree/main/.agents/skills/using-git-worktrees-extras
Command: npx skills add https://github.com/ZK-Theory/TDL --skill using-git-worktrees-extras-zk-theory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working in linked Git worktrees often fails in subtle ways: full test baselines break for reasons outside your task, sandboxed runtimes silently block edits to a worktree root, and fresh worktree virtualenvs race or miss dependencies. This Skill provides the operational checks to confirm a worktree is actually editable, testable, and correctly isolated before you commit work to it. ## Core Features & Use Cases - Scoped Baseline Gate: Establishes a documented, user-approved partial test baseline when the full suite fails for pre-existing, out-of-scope reasons, while still reporting both results. - Declared-Root Routing & Edit Preflight: Inspects the runtime's writable-root policy on Windows or sandboxed environments, routes work to a correctly rooted task when the worktree is not writable, and verifies edit/index/test operations with a disposable preflight file. - Venv & File-Discovery Readiness: Documents uv sync concurrency races, source-only dependency build failures (e.g. petls), gitignore-blind Glob/Grep behavior inside worktrees, and workarounds for contract checks that are not worktree-venv-safe. - Use Case: You create a linked worktree on Windows to implement a feature, but edits fail and the full pytest baseline errors on an unrelated optional dependency. Use this Skill to verify the writable-root policy, run the edit-path preflight, scope the baseline with explicit approval, and deliver with evidence that all operations resolved inside one worktree. ## Quick Start Use the using-git-worktrees-extras skill to validate that my linked worktree is writable and establish a scoped test baseline before I start implementation.

Frequently Asked Questions about using-git-worktrees-extras

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

FAQPage Schema
How do I verify a Git worktree is writable before editing?

Run an edit-path preflight: confirm the worktree root, branch, and git directory, then create and modify a disposable file with the mandated editor, verify index readiness with an intent-to-add/reset cycle, and run the baseline test command from that worktree.

What is a scoped test baseline and when is it acceptable?

A scoped baseline runs only the tests relevant to your task when the full suite fails for pre-existing, out-of-scope reasons. It requires documented evidence that each failure predates the branch, explicit user approval, and never counts as converting the full baseline to green.

Why do Glob and Grep return no files inside a Git worktree?

Glob and Grep inherit the parent repository's gitignore rules, so paths under gitignored worktree mounts like .apm/worktrees appear empty even when files exist. Verify with a shell listing such as ls or Get-ChildItem instead of trusting the absence signal.

Can I run uv sync in two worktrees at the same time?

No. Concurrent uv run or uv sync against the same virtualenv races the editable install and leaves the environment missing dependencies while still auditing as clean. Recover with uv sync --all-extras --reinstall and prefer serial uv invocations per worktree.

Why does uv sync fail in a fresh worktree but not the main repo?

A fresh worktree may need to build a source-only dependency from sdist, which can fail on platforms without wheels, while the main venv already has a working build. Sync with --no-install-package for that dependency, then seed it from the main venv per its RECORD file.

When should work be routed to a separate task instead of editing a worktree directly?

Route to a task rooted at that worktree when the runtime's enforced writable-root policy does not declare the exact worktree writable. Do not bypass the denial with shell writes, git apply, or another editor; report the routing requirement once.