harness:using-git-worktrees

Create an isolated Git worktree for feature work and run baseline tests.

3|1|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/huangbaixun/harness-engineering --skill harness-using-git-worktrees
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: harness:using-git-worktrees
Source: https://github.com/huangbaixun/harness-engineering/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/huangbaixun/harness-engineering --skill harness-using-git-worktrees

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents risky cross-contamination between your current workspace and new feature work by ensuring changes happen in an isolated Git environment.

Core Features & Use Cases

  • Isolated workspace detection: Detects whether you are already inside a linked worktree or a submodule and avoids creating nested worktrees unnecessarily.
  • Preference-aware setup: Asks for consent when you have not declared a worktree preference, then honors existing guidance if already provided.
  • Robust creation and safety checks: Prefers native worktree tools when available, otherwise falls back to git worktree add with ignored-directory verification for project-local paths, then runs setup and a clean baseline test pass.
  • Use case: Starting a feature that touches many files (e.g., implementing F002) without risking your main branch or your ongoing edits.

Quick Start

Ask the AI: "Set up an isolated worktree for feature F002 and verify the baseline tests pass before I start implementing."

Frequently Asked Questions about harness:using-git-worktrees

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

FAQPage Schema
How do I isolate feature branch work without disrupting my current git checkout?

Git worktrees isolate feature work by creating a separate workspace, preventing cross-contamination between ongoing edits and new implementation plans. This ensures changes happen safely without disrupting your current checkout.

How do I set up a git worktree and verify the test baseline before starting implementation?

To set up a git worktree, request an isolated workspace for your feature branch. The system detects existing worktree context, creates the worktree, auto-runs dependency setup, and executes a clean baseline test pass.

Does git worktree work safely inside submodules or existing linked worktrees?

Git worktree detects whether you are already inside a linked worktree or submodule and avoids creating nested worktrees unnecessarily, ensuring safe operation within existing complex repository structures.

What is the best way to manage worktree creation when native platform tools are unavailable?

The best approach is a git worktree add fallback with project-local ignore verification. This safely performs worktree creation in ignored directories when native platform worktree tools are not available.

When do I need to use a git worktree for my development cycle?

You need a git worktree when starting isolated implementation plans, especially before running a development cycle on a specific feature branch or when a harness-driven merge workflow is needed.