git-workflow

Create Git worktrees with isolated uv-based Python virtual environments.

Updated Nov 19, 2025
One-click install
npx skills add https://github.com/nikblanchet/claude-code-production-patterns --skill git-workflow-nikblanchet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow
Source: https://github.com/nikblanchet/claude-code-production-patterns/tree/main/actual-code/skills/project/git-workflow
Command: npx skills add https://github.com/nikblanchet/claude-code-production-patterns --skill git-workflow-nikblanchet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires uv, and includes scripts (resource) components.

What problem does it solve?

Traditional Git workflows can hinder parallel development, lead to merge conflicts, and make context switching cumbersome. This Skill introduces a robust worktree-based workflow that enables seamless parallel feature development, isolated environments, and clean commit histories, saving you time and reducing complexity.

Core Features & Use Cases

  • Worktree Orchestration: Automates the creation of isolated Git worktrees for parallel feature development, allowing you to work on multiple tasks simultaneously without interference.
  • Per-Worktree Environments: Ensures each worktree has its own Python virtual environment, preventing dependency conflicts and lock contention.
  • Branch Protection: Implements Git hooks to safeguard the main branch from accidental commits, enforcing quality gates and preventing errors.
  • Use Case: A developer needs to work on two independent features simultaneously. This skill allows them to create separate worktrees for each, complete with isolated environments, without stashing changes or managing complex branch switching, maximizing productivity.

Quick Start

To create a new worktree for a feature, ask me to "Create a new worktree named 'feature-x' for branch 'feature-x-implementation' from main." I will use the create_worktree.py script to set it up.

Frequently Asked Questions about git-workflow

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

FAQPage Schema
How do I set up parallel development with Git worktrees?

Git worktrees enable parallel development by creating isolated working directories from a single repository. This Skill automates worktree creation with per-worktree Python environments, allowing you to work on multiple branches simultaneously without stashing changes or context switching overhead.

What's the best way to manage multiple feature branches without merge conflicts?

Worktree-based workflows reduce merge conflicts by isolating each feature in a separate working directory with its own environment. This Skill orchestrates that isolation, handling branch validation, environment provisioning, and preventing accidental commits to protected branches.

Can I develop multiple features at once in the same Git repository?

Yes. This Skill creates separate worktrees for each feature, each with isolated Python virtual environments managed by uv. You work on independent tasks simultaneously without dependency conflicts or lock contention between worktrees.

How do worktrees prevent dependency conflicts when switching between features?

Each worktree gets its own uv-managed Python virtual environment with project dependencies installed independently. This isolation eliminates lock file conflicts and ensures each feature branch has consistent, separate dependencies without affecting others.

Do I need to stash uncommitted changes when working on multiple branches?

No. Worktrees eliminate stashing by creating separate working directories for each branch. This Skill automates detection of uncommitted changes and lets you decide interactively whether to include them, enabling seamless context switching without losing work.

What happens if I try to commit to the main branch from a worktree?

This Skill implements Git hooks that safeguard the main branch from accidental commits. These quality gates prevent errors and enforce your branching strategy, ensuring only validated changes reach protected branches.