create-worktree
Create and bootstrap a git worktree for isolated development work.
What this skill does
# Create Worktree
Creates and bootstraps a git worktree for isolated development work.
## Arguments
- `name` (required): Name for the worktree directory and branch
- `--spec=<path>`: Path to a spec file to copy into the worktree's specs directory
- `--base=<branch>`: Base branch to create worktree from (default: current branch or configured default)
- `--no-bootstrap`: Skip the onBootstrap hook
## Configuration
Check for `.claude/spec-workflow/config.yaml`:
```yaml
paths:
worktrees: "./worktrees" # Where worktrees are created
specs: "./specs" # Where specs live (for copying)
worktree:
branchNaming: "{name}" # Branch naming pattern
defaultBase: null # Default base branch (null = current)
onBootstrap: null # Hook script to run after creation
```
### Branch Naming
The `branchNaming` pattern supports these tokens:
- `{name}` - The worktree name
- `{date}` - Current date (YYYY-MM-DD)
Examples:
- `"{name}"` → `my-feature`
- `"feature/{name}"` → `feature/my-feature`
- `"{date}-{name}"` → `2024-01-15-my-feature`
### Bootstrap Hook
If `worktree.onBootstrap` is configured, it runs after worktree creation with these environment variables:
| Variable | Description |
|----------|-------------|
| `WORKTREE_PATH` | Absolute path to the new worktree |
| `WORKTREE_NAME` | Name of the worktree |
| `SPEC_FILE` | Path to spec file (if --spec was provided) |
| `BASE_BRANCH` | Branch the worktree was created from |
Example hook script:
```bash
#!/bin/bash
cd "$WORKTREE_PATH"
npm install
# ... any other setup
```
---
## Steps
1. **Check if worktree exists**
- Check if a worktree with the given name already exists at the configured path
- If it does, respond with "Worktree already exists at [path]" and exit
- If it does not exist, proceed
2. **Determine paths and branch name**
- Worktree path: `{config.paths.worktrees}/{name}` (default: `./worktrees/{name}`)
- Branch name: Apply `branchNaming` pattern (default: `{name}`)
- Base branch: `--base` argument, or `worktree.defaultBase`, or current branch
3. **Create the worktree**
```bash
git worktree add -b [branch-name] [worktree-path] [base-branch]
```
4. **Notify the user**
```
Worktree created at [path] on branch [branch-name].
```
5. **Handle spec file** (if --spec provided)
- Copy the spec file to the worktree's specs directory
- Update spec frontmatter with worktree and branch info
6. **Run bootstrap hook** (unless --no-bootstrap)
- If `worktree.onBootstrap` is configured, run it with environment variables
- If not configured, skip this step
- Report success or failure
7. **Final confirmation**
```
Worktree ready at [path].
To work in this worktree:
- Open a new terminal in [path]
- Or use: cd [path]
```
---
## Example Usage
```bash
# Basic worktree creation
/create-worktree feature-login
# Create worktree with a spec file
/create-worktree user-notifications --spec=specs/2024-01-15-notifications-spec.md
# Create worktree from a different base branch
/create-worktree hotfix-auth --base=release/v2.0
# Create worktree without running bootstrap
/create-worktree quick-fix --no-bootstrap
```
---
## Notes
- Worktrees are typically gitignored (add `worktrees/` to `.gitignore`)
- Each worktree has its own working directory but shares git history
- Worktrees allow parallel work on different features without stashing
- Use `/worktree-cleanup` (if available) to remove stale worktrees
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.