Create and manage git worktrees with spec-workflow, Graphite, and Linear integration. Provides isolated development environments for parallel feature work.
Creates isolated git worktrees with automated setup, Graphite tracking, and Linear task integration.
/plugin marketplace add Uniswap/ai-toolkit/plugin install development-pr-workflow@uniswap-ai-toolkit<branch> [--graphite] [--trunk <branch>] [--setup <script>] [--linear <task-id>]Create and manage a git worktree based on the current directory and a branch name, with optional spec-workflow setup, Graphite integration, setup scripts, and Linear task automation.
Parse arguments from $ARGUMENTS:
Examples:
/git-worktree-orchestrator feature/new-auth/git-worktree-orchestrator feature/api-v2 --graphite --trunk main/git-worktree-orchestrator bugfix/login-timeout --setup "npm install && npm run build"/git-worktree-orchestrator feature/dark-mode --linear DEV-1234This command orchestrates the complete worktree setup process:
.claude/settings.local.json for consistent settings# Parse arguments
BRANCH_NAME=""
GRAPHITE_ENABLED=false
TRUNK_BRANCH=""
SETUP_SCRIPT=""
SKIP_SETUP=false
SKIP_GRAPHITE=false
LINEAR_TASK_ID=""
# Argument parsing logic
# (Claude will parse $ARGUMENTS and set these variables)
If no branch name is provided, prompt the user:
AskUserQuestion:
- "What branch name should be used for the worktree?"
If Graphite is enabled but no trunk branch is provided, prompt:
AskUserQuestion:
- "Which branch should be the trunk/parent for Graphite tracking?"
Options: main, master, develop, [custom]
Set configuration variables for the shared setup:
# Configuration for shared worktree setup
BRANCH_NAME="${BRANCH_NAME}"
SETUP_SCRIPT="${SETUP_SCRIPT:-}"
SKIP_SETUP="${SKIP_SETUP}"
SKIP_GRAPHITE_TRACK="${SKIP_GRAPHITE}"
TRUNK_BRANCH="${TRUNK_BRANCH}"
SKIP_INDEX_RESET=""
Follow all steps in the shared setup-worktree-core instructions:
The shared instructions will:
.claude/settings.local.jsonCreate symlink to .spec-workflow directory from root repository if it exists:
if [[ -d "$REPO_ROOT/.spec-workflow" ]]; then
echo "Creating symlink to .spec-workflow..."
ln -sfn "$REPO_ROOT/.spec-workflow" "$NEW_DIR/.spec-workflow"
echo "Symlinked .spec-workflow directory"
fi
Register spec-workflow MCP if available:
if command -v claude >/dev/null 2>&1 && [[ -d "$NEW_DIR/.spec-workflow" ]]; then
echo "Registering spec-workflow MCP..."
claude mcp add spec-workflow "npx @uniswap/spec-workflow-mcp@latest" "$NEW_DIR" || true
fi
If Linear task ID provided, offer to spawn autonomous Claude Code session:
AskUserQuestion:
- "Would you like to spawn a new Claude Code instance to autonomously complete the Linear task?"
Options:
- Yes, spawn autonomous session
- No, I'll work on it manually
If yes, the spawned session will:
mcp__linear__get_issueUpon completion, display a summary:
ā
Worktree Created Successfully!
š Location: /path/to/repo.worktrees/feature-branch
šæ Branch: feature-branch
Configuration:
ā Claude settings: copied
ā Graphite tracking: feature-branch ā main (parent)
ā Spec-workflow: linked
ā Setup script: executed (auto-detected: npm ci)
ā Index reset: completed
To start working:
cd "/path/to/repo.worktrees/feature-branch"
To merge work back:
1. Commit and push changes
2. Create PR using /pr-creator or gh pr create
3. After merge, clean up: git worktree remove "/path/to/repo.worktrees/feature-branch"
The command creates worktrees in a sibling directory pattern:
/path/to/repo/ # Main repository
/path/to/repo.worktrees/ # Worktrees directory
āāā feature-branch-1/ # Worktree for feature-branch-1
āāā feature-branch-2/ # Worktree for feature-branch-2
āāā bugfix-123/ # Worktree for bugfix-123
.spec-workflow for MCP functionalityArguments: $ARGUMENTS