antoniolg

worktree-helper

8
0
# Install this skill:
npx skills add antoniolg/agent-kit --skill "worktree-helper"

Install specific skill from multi-skill repository

# Description

Guide for creating and working in Git worktrees with a consistent workflow. Use when a user wants to run a task in a separate worktree, create or clean up worktrees, migrate a repo into a main/worktrees layout, or implement work based on an issue ID using GitHub/GitLab tooling.

# SKILL.md


name: worktree-helper
description: Guide for creating and working in Git worktrees with a consistent workflow. Use when a user wants to run a task in a separate worktree, create or clean up worktrees, migrate a repo into a main/worktrees layout, or implement work based on an issue ID using GitHub/GitLab tooling.


Worktree Helper

Overview

Use this skill to set up a clean worktree workflow, create new worktrees, and guide issue-based or task-based work. Keep the user in control for any destructive or structural change.

Workflow Decision Tree

1) Is the request issue-based?

  • Yes β†’ Use references/hosting.md to fetch issue details (MCP β†’ gh β†’ glab β†’ manual).
  • No β†’ Continue with the task description.

2) Is the repo layout already main/ + worktrees/?

  • Yes β†’ Work from main/.
  • No β†’ Recommend migration and offer to run scripts/migrate_to_main_layout.sh.

3) Create a worktree using the naming rules in references/workflow.md.

4) Implement the task in the worktree, then review with the user.

5) Finish: merge or open a PR/MR, then clean up worktrees and branches.

Required Checks

  • Confirm the user wants to migrate before running any migration command.
  • Confirm before deleting branches or removing worktrees.
  • If tooling is missing for issue intake, ask the user to paste issue details.

Core References

  • references/workflow.md β€” step-by-step commands, naming, create/remove worktrees.
  • references/hosting.md β€” MCP/CLI/manual issue intake and tooling detection.
  • references/troubleshooting.md β€” common worktree errors and fixes.

Bundled Scripts

  • scripts/migrate_to_main_layout.sh β€” migrate a repo root into a main/ + worktrees/ layout. Use only with explicit user confirmation.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.