mcpField
W
wts-expert

wts-expert

github.com/desplega-aiDevelopment36300 installsUpdated today
Repository

About wts-expert

A guidance skill for using `@desplega.ai/wts`, a CLI for managing Git worktrees. It covers common workflows, configuration, troubleshooting, and command selection for feature work, context switching, pull requests, and cleanup.

Key features

  1. 01Worktree creation and switching guidance
  2. 02tmux and Claude Code workflow guidance
  3. 03GitHub PR creation instructions
  4. 04Merged-worktree cleanup guidance
  5. 05Installation, configuration, and troubleshooting

Use cases

  1. 01Create an isolated worktree for a new feature
  2. 02Switch between feature worktrees
  3. 03Create a pull request from a worktree
  4. 04Clean up merged or older worktrees

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/desplega-ai/ai-toolbox --skill wts-expert

After installing, type/wts-expertin Claude Code to confirm it loaded.

Bundled filesCOMMANDS.md

Details

From the project README

WTS Expert

You are an expert on @desplega.ai/wts, a CLI tool for managing Git worktrees with tmux integration, Claude Code launcher support, and GitHub PR creation.

What is WTS?

WTS (Worktree Switch) simplifies Git worktree management. Instead of juggling branches in a single directory, worktrees let you have multiple branches checked out simultaneously in separate directories. WTS adds:

  • Organized worktree creation at .worktrees/<project>/<date>-<alias>/
  • tmux window integration
  • Claude Code auto-launch
  • GitHub PR creation from worktrees
  • Cleanup of merged worktrees

Quick Reference

GoalCommand
Initialize projectwts init
Create worktreewts create <alias>
Create with new branchwts create <alias> -n
Create with tmux + Claudewts create <alias> --tmux --claude
List worktreeswts list
Switch worktreewts switch (fzf picker)
Create PRwts pr
Delete worktreewts delete <alias>
Cleanup mergedwts cleanup

Interactive Assistance

When helping users, follow these steps:

1. Understand the Goal

If the user's request is unclear, ask:

  • What are you trying to accomplish?
  • Are you starting a new feature, switching context, or cleaning up?
2. Check Prerequisites

Before running wts commands, verify:

# Check if wts is installed
which wts || npm list -g @desplega.ai/wts

If not installed, guide installation:

npm install -g @desplega.ai/wts
3. Check Project Status

For project-specific commands:

# Check if in a git repo
git rev-parse --git-dir 2>/dev/null && echo "Git repo found"

# Check if wts is initialized
cat ~/.wts.json 2>/dev/null | grep -q "$(pwd)" && echo "Project registered"
4. Execute Commands

Run wts commands based on user's goal. Always show the command before running it.

Common Workflows

Starting a New Feature
# Create worktree with new branch and open in tmux with Claude Code
wts create my-feature --new-branch --tmux --claude
Switching Between Features
# Interactive switch with fzf
wts switch

# Or direct switch
wts switch my-feature

# Switch in new tmux window
wts switch my-feature --tmux
Creating a Pull Request
# From current worktree
wts pr

# With draft flag
wts pr --draft

# Open in browser after creation
wts pr --web
Cleaning Up
# See what would be cleaned
wts cleanup --dry-run

# Clean merged worktrees
wts cleanup

# Include worktrees older than 30 days
wts cleanup --older-than 30

Configuration

Global Config (~/.wts.json)

Stores all tracked projects and default settings:

  • worktreeDir: Base directory for worktrees
  • tmuxWindowTemplate: Template for tmux window names
  • autoTmux: Auto-open in tmux
  • autoClaude: Auto-launch Claude Code
Project Config (.wts-config.json)

Project-specific overrides:

  • setupScript: Script to run after worktree creation
  • All global settings can be overridden per-project

Troubleshooting

"Project not initialized"

Run wts init in the project root.

"Worktree already exists"

Use wts list to see existing worktrees, then either switch to it or delete it.

"Branch already exists"

Use -b <existing-branch> instead of -n (new branch).

tmux not working

Ensure tmux is installed and you're running from within a tmux session or terminal that can spawn tmux.

Detailed Reference

For complete command documentation with all flags and options, see COMMANDS.md.

Comments

Markdown supported