What the user will say
- "I need a hotfix for the login bug"
- "Create an emergency worktree for ABC-1234"
- "Quick fix for production"
Non-negotiable rules
- The BASE_BRANCH MUST be the default branch (resolved from
.worktreeconfig→[worktrees].default-branch, fallback tomain). - You MUST fetch the latest changes from origin for the BASE_BRANCH before branching.
- Folder name should be descriptive (e.g.,
hotfix-login-bugorABC-1234-fix). - If a ticket ID is provided, use it in the branch name and folder name.
Step 1 — Identification
Identify the Issue:
- If the user provides a ticket ID (e.g., ABC-1234), fetch the ticket from the configured issue tracker (
.worktreeconfig→[defaults].issue-tracker) via MCP or API to get the title. - If no ticket is provided, ask for a short description if the user hasn't given one (e.g., "login-bug").
- If the user provides a ticket ID (e.g., ABC-1234), fetch the ticket from the configured issue tracker (
Resolve Names:
- DESCRIPTION = A kebab-case version of the ticket title or user description.
Step 2 — Create the hotfix worktree
Run the helper script from the repository root:
.skills/_shared/scripts/wt-hotfix.sh <DESCRIPTION> [--base <BRANCH>]
The script handles everything automatically:
- Resolves the default branch from
.worktreeconfig - Fetches latest from remote
- Creates folder
hotfix-<DESCRIPTION>with branchhotfix/<DESCRIPTION> - Delegates to
wt-create.shfor worktree creation, upstream tracking, file copying, hooks, and logging - Prints the
WORKTREE READYsummary
Required output
The script prints a WORKTREE READY block automatically. If it fails, report the error to the user.
Safety constraints
- Ensure the folder does not already exist.
- If the branch already exists locally, ask the user if they want to reuse it or use a different name.
- Always fetch latest to avoid stale base branches.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.