wt-new
SKILL.md
/wt:new - Create New Worktree and Branch
Description
Quick command to create a new git worktree with a new branch. Supports both interactive and automated modes.
Usage
/wt:new # fully interactive
/wt:new [BRANCH_NAME] # skip branch name prompt
/wt:new [BRANCH_NAME] [BASE_BRANCH] # fully non-interactive
Examples
/wt:new # prompts for both base branch and feature branch
/wt:new story/WINT-1012 # uses main as base, prompts skipped
/wt:new story/WINT-1012 main # fully automated, no prompts
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
BRANCH_NAME |
No | (prompted) | Feature branch name (e.g., story/WINT-1012) |
BASE_BRANCH |
No | (prompted) | Branch to base off (e.g., main, develop) |
When parameters are provided, the corresponding interactive prompts are skipped.
What It Does
This slash command:
- Verifies the git repository state
- Determines base branch (from parameter or interactive prompt)
- Determines feature branch name (from parameter or interactive prompt)
- Fetches latest from remote (
git fetch origin) to ensure base is up-to-date - Creates
tree/directory if it doesn't exist - Creates the worktree at
tree/{branch-name}based onorigin/{base-branch} - Reports the result: path to the new worktree, branch name
Workflow
Interactive mode (/wt:new)
- Verify git repository - Ensure you're in a valid git repo
- Ask for base branch - Which branch to start from (e.g.,
main,develop) - Ask for feature branch name - Name for your new branch (e.g.,
story/WISH-001) - Fetch latest from remote -
git fetch originto get latest commits without changing current checkout - Create worktree directory - Create
tree/if it doesn't exist - Create worktree -
git worktree add -b {branch-name} tree/{branch-name} origin/{base-branch} - Confirm success - Show you the path to your new worktree
Automated mode (/wt:new story/WINT-1012 main)
- Verify git repository - Ensure you're in a valid git repo
- Use provided base branch - Skip prompt, use
main - Use provided branch name - Skip prompt, use
story/WINT-1012 - Fetch latest from remote -
git fetch originto get latest commits without changing current checkout - Create worktree directory - Create
tree/if it doesn't exist - Create worktree -
git worktree add -b story/WINT-1012 tree/story/WINT-1012 origin/main - Report result - Output path and branch name for caller to use
Output
After completion, always report:
WORKTREE CREATED
branch: {branch-name}
path: tree/{branch-name}
This structured output allows the calling orchestrator (e.g., dev-implement-story) to capture
the branch name and path for worktree_register().
Benefits
✅ Quick Start - One command to create a new worktree
✅ Automated - Can be called non-interactively from workflow orchestrators
✅ Safe - Verifies git state before making changes
✅ Organized - Keeps all worktrees in tree/ directory
Weekly Installs
1
Repository
michael-menard/monorepoFirst Seen
Mar 1, 2026
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
continue1
kimi-cli1