using-git-worktrees

Creates isolated git worktrees with directory selection, gitignore verification, and baseline test validation.

1|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/JaimeHoracio/Ostacky --skill using-git-worktrees-jaimehoracio
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/JaimeHoracio/Ostacky/tree/main/assets/skills/using-git-worktrees
Command: npx skills add https://github.com/JaimeHoracio/Ostacky --skill using-git-worktrees-jaimehoracio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches simultaneously forces constant stashing, context switching, and risks polluting your main workspace. This Skill sets up isolated git worktrees so feature work happens in a separate directory sharing the same repository, without breaking your current state. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order—existing .worktrees/ or worktrees/ directories, then AGENTS.md or OpenCode config preferences, then asks the user—so worktrees land where the project expects them. - Safety Verification: Checks with git check-ignore that the worktree directory is gitignored before creation, and fixes it (adds to .gitignore and commits) if not, preventing accidental commits of worktree contents. - Automated Setup & Baseline Validation: Auto-detects the project type (Node.js, Rust, Python, Go), installs dependencies, and runs the test suite to confirm a clean baseline before implementation begins. - Use Case: Before executing an implementation plan for a new auth feature, the Skill creates .worktrees/auth on a new feature/auth branch, runs npm install and npm test, and reports a ready workspace with 47 passing tests. ## Quick Start Ask the agent to set up an isolated git worktree for your new feature branch before starting implementation.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I create a git worktree for a new feature branch?▼

Run git worktree add with a target path and the -b flag to create a new branch, for example git worktree add .worktrees/auth -b feature/auth. The Skill automates this plus dependency installation and baseline test verification.

Where should git worktrees be stored in a project?▼

The Skill checks in priority order: an existing .worktrees directory, then worktrees, then AGENTS.md or OpenCode config preferences, and finally asks the user. If both hidden and visible directories exist, .worktrees takes precedence.

Why must the worktree directory be in .gitignore?▼

If the worktree directory is not ignored, its contents appear in git status and risk being committed to the repository. The Skill verifies this with git check-ignore and automatically adds the entry to .gitignore and commits it if missing.

What happens if tests fail when setting up a worktree?▼

The Skill reports the test failures and asks whether to proceed or investigate rather than continuing silently. This ensures you can distinguish pre-existing issues from bugs introduced by new work.

Does git worktree setup work with Python or Rust projects?▼

Yes, the Skill auto-detects the project type from marker files: package.json triggers npm install, Cargo.toml triggers cargo build, requirements.txt or pyproject.toml trigger pip or poetry install, and go.mod triggers go mod download.