create-worktree
Creates a new git/jj worktree for development work with proper setup, dependencies, and optional thoughts initialization. Use when user needs to create a new worktree for feature development or bug fixes.
What this skill does
# Create Worktree
This skill creates a new worktree for development work with proper setup and verification.
## When to Activate
Activate this skill when:
- User needs to create a new worktree for a feature or bug fix
- Starting work on a Linear ticket (ENG-XXXX format)
- Need to work on multiple branches simultaneously
- Want an isolated workspace with its own dependencies
## Process
### 1. Gather Information
Ask the user for:
- Worktree name (or generate a unique one)
- Base branch (or use current branch)
- Whether to initialize thoughts directory (default: yes)
### 2. Create Worktree
**For git users:**
```bash
# Set up variables
WORKTREE_NAME="[name or generated]"
BASE_BRANCH="[base or current branch]"
WORKTREES_BASE="$HOME/wt/[repo-name]"
WORKTREE_PATH="${WORKTREES_BASE}/${WORKTREE_NAME}"
# Verify worktrees base directory exists
if [ ! -d "$WORKTREES_BASE" ]; then
echo "Creating worktrees directory: $WORKTREES_BASE"
mkdir -p "$WORKTREES_BASE"
fi
# Check if worktree already exists
if [ -d "$WORKTREE_PATH" ]; then
echo "Error: Worktree directory already exists: $WORKTREE_PATH"
exit 1
fi
# Create worktree (creates branch if it doesn't exist)
if git show-ref --verify --quiet "refs/heads/${WORKTREE_NAME}"; then
echo "Using existing branch: ${WORKTREE_NAME}"
git worktree add "$WORKTREE_PATH" "$WORKTREE_NAME"
else
echo "Creating new branch: ${WORKTREE_NAME}"
git worktree add -b "$WORKTREE_NAME" "$WORKTREE_PATH" "$BASE_BRANCH"
fi
# Copy .claude directory if it exists
if [ -d ".claude" ]; then
cp -r .claude "$WORKTREE_PATH/"
fi
# Change to worktree and run setup
cd "$WORKTREE_PATH"
make setup || {
echo "Setup failed. Cleaning up..."
cd - > /dev/null
git worktree remove --force "$WORKTREE_PATH"
git branch -D "$WORKTREE_NAME" 2>/dev/null || true
exit 1
}
```
**For jj users:**
```bash
# Set up variables
WORKTREE_NAME="[name or generated]"
BASE_BOOKMARK="[base bookmark]"
WORKTREES_BASE="$HOME/wt/[repo-name]"
WORKTREE_PATH="${WORKTREES_BASE}/${WORKTREE_NAME}"
# Verify worktrees base directory exists
if [ ! -d "$WORKTREES_BASE" ]; then
echo "Creating worktrees directory: $WORKTREES_BASE"
mkdir -p "$WORKTREES_BASE"
fi
# Check if worktree already exists
if [ -d "$WORKTREE_PATH" ]; then
echo "Error: Worktree directory already exists: $WORKTREE_PATH"
exit 1
fi
# Create new workspace
jj workspace add --name "$WORKTREE_NAME" "$WORKTREE_PATH"
# Set bookmark in new workspace
cd "$WORKTREE_PATH"
jj bookmark create "$WORKTREE_NAME"
# Copy .claude directory if it exists from original workspace
if [ -d "../.claude" ]; then
cp -r ../.claude .
fi
# Run setup
make setup || {
echo "Setup failed. Cleaning up..."
cd - > /dev/null
jj workspace forget "$WORKTREE_NAME"
rm -rf "$WORKTREE_PATH"
exit 1
}
```
### 3. Generate Unique Name (if needed)
If no name provided, generate one:
```bash
# Random adjectives and nouns for naming
adjectives=("swift" "bright" "clever" "smooth" "quick" "clean" "sharp" "neat" "cool" "fast")
nouns=("fix" "task" "work" "dev" "patch" "branch" "code" "build" "test" "run")
# Pick random values
adj=${adjectives[$RANDOM % ${#adjectives[@]}]}
noun=${nouns[$RANDOM % ${#nouns[@]}]}
timestamp=$(date +%H%M)
# Generate name
WORKTREE_NAME="${adj}_${noun}_${timestamp}"
```
### 4. Success Message
After successful creation:
```
โ
Worktree created successfully!
๐ Path: [WORKTREE_PATH]
๐ Branch/Bookmark: [WORKTREE_NAME]
To work in this worktree:
cd [WORKTREE_PATH]
To remove this worktree later (git):
git worktree remove [WORKTREE_PATH]
git branch -D [WORKTREE_NAME]
To remove this worktree later (jj):
jj workspace forget [WORKTREE_NAME]
rm -rf [WORKTREE_PATH]
```
## Important Notes
- The script runs `make setup` to install dependencies in the new worktree
- If setup fails, the worktree is automatically cleaned up
- The .claude directory is copied to the new worktree if it exists
- Worktrees are created in `$HOME/wt/[repo-name]/` by default
- For Linear tickets, use the ticket number as the worktree name (e.g., `ENG-2166`)
- Thoughts initialization is optional and can be skipped with `--no-thoughts` flag
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.