using-git-worktrees

Automates isolated Git worktrees with priority-based directory selection and baseline test checks.

Updated Sep 25, 2024
One-click install
npx skills add https://github.com/kwam1na/athena --skill using-git-worktrees-kwam1na
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/kwam1na/athena/tree/main/.agents/skills/using-git-worktrees
Command: npx skills add https://github.com/kwam1na/athena --skill using-git-worktrees-kwam1na

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill streamlines creating isolated git worktrees for feature development, preventing cross-branch contamination and preserving a clean main workspace.

Core Features & Use Cases

  • Directory Selection Priority: prefers project-local .worktrees, then worktrees, then CLAUDE.md hints, then prompts.
  • Safety Verification: ensures the chosen directory is ignored by gitignore rules, and guides updates if needed.
  • Automatic Environment Setup: auto-detects project tooling (Node.js, Rust, Python, Go) and runs the appropriate setup steps.
  • Clean Baseline Verification: runs tests to ensure the worktree starts from a clean baseline.
  • Clear Operational Flow: logs and reports readiness as soon as the worktree is ready.

Quick Start

Start by selecting or creating a worktree directory, verify ignore rules, create the new feature worktree, and enter its directory.

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 an isolated Git worktree for feature development?

To create an isolated Git worktree, the skill automates directory selection, verifies gitignore rules, branches from origin/main, and runs environment setup. This process prevents cross-branch contamination while preserving a clean main workspace for your features.

How does Git worktree directory selection work safely?

Git worktree directory selection follows a priority sequence: it prefers project-local .worktrees, then a general worktrees folder, then CLAUDE.md hints, and finally prompts you. It verifies the chosen path is ignored by gitignore to ensure safety.

Can I auto-detect project tooling when setting up Git worktrees?

Yes, the worktree setup auto-detects project tooling for Node.js, Rust, Python, and Go environments. It automatically runs the appropriate setup steps for your detected stack, ensuring the new worktree is ready for development immediately.

What is the best way to prevent cross-branch contamination in Git?

Using isolated Git worktrees is the best way to prevent cross-branch contamination. By creating separate directories for features and verifying a clean baseline with tests, the workflow ensures your main repository remains unpolluted during development.

Do I need to update gitignore before creating a worktree?

You need to ensure your chosen worktree directory is ignored by gitignore rules. The skill verifies this safety requirement and guides you through necessary gitignore updates if the directory is not currently ignored.

Why run tests after creating a Git worktree?

Running tests after creating a Git worktree performs a clean baseline verification. This ensures the new worktree starts from a stable state, confirming the automatic environment setup completed successfully before you begin feature development.