| name | description | license | metadata | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
worktrunk |
Git worktree management via wt CLI. Create, switch, merge, and manage worktrees with hooks, LLM commits, and CI integration. |
MIT |
|
You are an expert at using Worktrunk (wt) for git worktree management. Worktrunk addresses worktrees by branch name, computes paths from templates, and automates workflow steps that normally require multiple git commands.
Worktrunk differs from raw git worktrees by:
- Addressing worktrees by branch name, not path
- Computing worktree paths from configurable templates
- Automating common workflows (create, merge, cleanup)
- Providing hooks at lifecycle points
- Integrating with Claude Code for AI-assisted development
worktree- Mentions of worktrees or worktree operationswt- Direct references to the wt commandworktrunk- Explicit Worktrunk mentionsswitch branches with separate directories- Need for parallel branch workmanage multiple branches- Multi-branch workflow needs
This skill activates when users:
- Need to work on multiple features simultaneously
- Want to automate git merge workflows
- Ask about managing multiple branches
- Mention parallel development or concurrent features
- Need CI status across branches
- Ask to configure git lifecycle hooks
Example invocations:
- "Create a new worktree for feature-X"
- "Switch to the feature-auth worktree"
- "Show me all my worktrees"
- "Merge this branch using wt"
- "Set up worktree hooks"
- "How do I use Worktrunk?"
- "Clean up old worktrees"
- "Configure LLM commit messages"
When this skill is invoked, follow this process:
- Identify the user's intent (create, switch, merge, configure, cleanup)
- Determine current git repository state
- Check if Worktrunk is installed (
wt --version) - Verify worktree configuration exists
For worktree creation:
- Use
wt switch --create <branch> - Specify base branch if needed (
--base) - Wait for post-create hooks to complete
- Verify new worktree directory exists
For switching:
- Use
wt listto show available worktrees - Use
wt switch <branch>orwt selectfor interactive - Confirm directory change
For merging:
- Review changes with
wt list --full - Check pre-merge hook configuration
- Execute
wt mergewith appropriate flags - Verify merge success and cleanup
For configuration:
- Show current config with
wt config show - Edit
.config/wt.tomlfor project settings - Configure hooks, path templates, or LLM integration
- Test configuration with dry runs
For cleanup:
- List worktrees with
wt list --branches - Identify safe-to-delete branches
- Use
wt removewith appropriate flags - Verify cleanup in background logs
- Confirm operation succeeded
- Check for error messages or warnings
- Verify expected state (worktree exists, branch merged, etc.)
- Provide next steps or recommendations
- Explain what was done and why
- Suggest related operations
- Point to relevant configuration options
- Recommend best practices for the use case
Change directory to a worktree, creating one if needed.
wt switch feature-auth # Switch to existing worktree
wt switch --create new-feature # Create branch + worktree
wt switch -c hotfix --base production # Branch from production
wt switch - # Return to previous worktree
wt switch ^ # Switch to default branchKey options:
-c, --create: Create new branch-b, --base <BASE>: Source branch (defaults to default branch)-x, --execute <CMD>: Run command after switching-y, --yes: Skip approval prompts--clobber: Remove stale paths at target--no-verify: Skip hooks
Shortcuts:
^: Default branch (main/master)@: Current branch-: Previous worktree
Creation process:
- Creates worktree at configured path
- Changes to new directory
- Runs post-create hooks (blocking)
- Spawns post-start hooks (background)
Display all worktrees with status, diffs, and CI results.
wt list # Basic table view
wt list --full # Include CI status + diff analysis
wt list --branches # Include branches without worktrees
wt list --format=json # JSON output for scripting
wt list statusline --claude-code # Status for Claude statuslineColumns:
- Branch: Branch name
- Status: Working tree symbols and branch state
- HEAD±: Uncommitted changes (lines added/deleted)
- main↕: Commits ahead/behind default
- main…±: Line diffs since merge-base (with --full)
- Remote⇅: Ahead/behind tracking branch
- CI: Pipeline status (with --full)
- Commit: Hash, age, message
Status symbols:
+: Staged changes!: Modified files?: Untracked files✘: Conflicts⤴: Rebase in progress⤵: Merge in progress^: Is default branch↕: Diverged from default/: No worktree exists
Progressive rendering: Branch names appear immediately; status fills in as background operations complete.
Merge current branch to default branch (like GitHub's "Merge pull request").
wt merge # Merge to default, remove worktree
wt merge develop # Merge to specific branch
wt merge --no-remove # Keep worktree after merge
wt merge --no-squash # Preserve commit historyOptions:
--no-remove: Retain worktree after merge--no-squash: Keep individual commits--no-commit: Skip commit/squash phases--no-rebase: Skip rebase (fails if not current)--no-verify: Skip hooks-y, --yes: Skip confirmations--stage <all|tracked|none>: Control staging
Execution pipeline:
- Squash: Combine commits since target into one
- Rebase: Update to target if behind
- Pre-merge hooks: Validate before merging
- Merge: Fast-forward merge only
- Pre-remove hooks: Final checks
- Cleanup: Remove worktree and branch
- Post-merge hooks: Final notifications (non-blocking)
Delete worktrees and their branches (when safely merged).
wt remove # Remove current worktree
wt remove feature-branch # Remove specific branch
wt remove old-1 old-2 # Remove multiple
wt remove -D experimental # Force-delete unmerged
wt remove --no-delete-branch feat # Remove worktree, keep branchBranch cleanup logic (ordered by processing cost):
- Same commit: Branch HEAD matches default
- Ancestor: Branch in target's history
- No added changes: Three-dot diff empty
- Trees match: Tree SHA values identical
- Merge simulation: Simulated merge produces matching tree
Options:
--foreground: Block until complete (default: background)--no-verify: Skip hooks-y, --yes: Skip approval prompts-f, --force: Remove despite untracked files-D: Force-delete unmerged branches
Logs: .git/wt-logs/{branch}-remove.log
Interactive worktree picker with live preview.
wt select # Open interactive pickerKeyboard controls:
- ↑/↓: Navigate worktree list
- Enter: Switch to selected worktree
- Escape: Cancel
- Type: Filter worktrees
- 1-4: Switch preview tabs
- Alt-p: Toggle preview panel
- Ctrl-u/Ctrl-d: Scroll preview
Preview tabs:
- HEAD±: Uncommitted changes
- log: Recent commits (dimmed if on default)
- main…±: Changes relative to merge-base
- remote⇅: Ahead/behind upstream
Manage configuration, shell integration, and runtime settings.
wt config shell install # Enable directory switching
wt config create # Generate user config
wt config create --project # Create project config
wt config show # Display current configState management:
wt config state marker set "🚧" # Set custom status marker
wt config state default-branch # View/set default branch
wt config state ci-status # View cached CI resultsConfiguration locations:
- User:
~/.config/worktrunk/config.toml - Project:
.config/wt.toml
Execute individual workflow operations.
wt step commit # Create LLM-generated commit
wt step squash # Combine all branch commits
wt step rebase # Rebase onto target
wt step push # Fast-forward target branch
wt step commit --stage=tracked # Stage only tracked files
wt step commit --show-prompt # View LLM promptStaging options:
all: Stage all changes including untracked (default)tracked: Stage only modified tracked filesnone: Commit without staging
Execute lifecycle hooks.
wt hook show # Display configured hooks
wt hook pre-merge # Run all pre-merge hooks
wt hook pre-merge test # Run hooks named "test"
wt hook post-create --var branch=feature # With variable overrides
wt hook approvals add # Pre-approve current project
wt hook approvals clear # Clear project approvalsHook types:
| Hook | Trigger | Blocking | Fail-fast |
|---|---|---|---|
| post-create | After worktree creation | Yes | No |
| post-start | After worktree creation | No (background) | No |
| post-switch | After every switch | No (background) | No |
| pre-commit | Before commit during merge | Yes | Yes |
| pre-merge | Before merging to target | Yes | Yes |
| post-merge | After successful merge | Yes | No |
| pre-remove | Before worktree removal | Yes | Yes |
Controls where new worktrees are created. Default: ../{{ repo }}.{{ branch | sanitize }}
Variables:
{{ repo }}: Repository name{{ branch }}: Branch name{{ branch | sanitize }}: Branch with path separators replaced{{ worktree_path }}: Full path to worktree{{ worktree_name }}: Worktree directory name{{ default_branch }}: Default branch (main/master){{ target }}: Target branch for merge operations{{ commit }},{{ short_commit }}: Commit hashes{{ remote }},{{ upstream }}: Remote information
Filters:
sanitize: Replace path separatorshash_port: Generate unique ports 10000-19999
.config/wt.toml:
# Path template
path-template = "../{{ repo }}.{{ branch | sanitize }}"
# Single command hooks
post-create = "npm install"
# Multiple command hooks
[pre-merge]
test = "cargo test"
lint = "cargo clippy"
build = "cargo build --release"
[post-start]
server = "npm run dev -- --port {{ branch | hash_port }}"[commit.generation]
command = "llm"
args = ["-s", "Commit message from diff"]
template = """
Generate a commit message for these changes.
Branch: {{ branch }}
Diff:
{{ git_diff }}
Recent commits:
{{ recent_commits }}
"""The Worktrunk plugin tracks Claude's activity state in wt list:
- 🤖: Claude is working
- 💬: Claude is waiting for input
Installation:
claude plugin marketplace add max-sixty/worktrunk
claude plugin install worktrunk@worktrunkAdd to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "wt list statusline --claude-code"
}
}Note: This may incur 1-2 second latency due to network requests for CI status.
wt config state marker set "🚧" # Current branch
wt config state marker set "✅" --branch feature # Specific branchwt switch --create feature/new-auth
# Worktree created, post-create hooks run
# Now in new worktree directorywt list # See all worktrees
wt switch feature/auth # Switch to existing
# or
wt select # Interactive picker# In feature branch worktree
wt merge
# Pipeline: squash → rebase → pre-merge hooks → merge → cleanupwt list --branches # See all branches
wt remove old-feature-1 old-feature-2
# Safe-to-delete branches removed automaticallywt select # Open picker
# Press 3 to view main…± (changes since merge-base)
# Press 1 to view HEAD± (uncommitted changes)Use blocking hooks (pre-merge, pre-commit) for:
- Tests that must pass
- Linting that must succeed
- Build verification
- Security scans
Use non-blocking hooks (post-start) for:
- Development servers
- File watchers
- Background processes
Example pre-merge workflow:
[pre-merge]
format = "cargo fmt --check"
test = "cargo test"
clippy = "cargo clippy -- -D warnings"Use --stage=all (default) when:
- All changes are intentional
- Working on isolated features
Use --stage=tracked when:
- Untracked files are experiments
- Generated files exist
- You want explicit control
Use --stage=none when:
- Changes already staged
- Running
wt step commitafter manual staging
Avoid hardcoding values. Use template variables:
# Bad
post-start = "npm run dev -- --port 3000"
# Good
post-start = "npm run dev -- --port {{ branch | hash_port }}"This generates unique ports per branch, preventing conflicts.
Use progressive rendering:
wt list --progressive # Fast info first, updates followCache CI status: CI results are cached 30-60 seconds per branch.
Background operations: wt remove runs in background by default. Use --foreground only when necessary.
All config options support WORKTRUNK_ prefixed variables using SCREAMING_SNAKE_CASE. Nested keys use double underscores:
export WORKTRUNK_COMMIT_GENERATION__COMMAND="llm"
export WORKTRUNK_PATH_TEMPLATE="../{{ repo }}.{{ branch | sanitize }}"Hook approvals: Project hooks require approval on first run. Approvals are saved to user config and invalidated if the command template changes.
Approval management:
wt hook approvals add # Pre-approve current project
wt hook approvals clear # Clear project approvals
wt hook approvals clear --global # Clear all approvalsSkip approvals: Use -y, --yes flag (use with caution).
If wt switch fails due to existing path:
wt switch --clobber feature-branch # Remove stale pathView hook output:
wt hook pre-merge # Run manually
wt hook show # Display configurationSkip hooks temporarily:
wt merge --no-verify # Skip all hooks
wt switch --no-verify new-branch # Skip post-create/post-startCheck logs for background operations:
cat .git/wt-logs/{branch}-remove.logIf default branch is incorrect:
wt config state default-branch set mainWorktrunk is built on git worktrees. All standard git commands work within worktrees:
git status # Works normally
git commit # Works normally
git push # Works normallyUse wt for worktree-level operations (create, switch, merge, remove).
Use git for standard version control operations within a worktree.
For scripting and automation:
wt list --format=json | jq '.[] | select(.uncommitted_changes > 0)'
wt list --format=json | jq '.[] | select(.ahead > 0)'Human-readable with progressive rendering:
wt list --full # All information
wt list --progressive # Fast info firstUse consistent path templates across repositories:
path-template = "~/work/{{ repo }}/{{ branch | sanitize }}"Generate unique ports for development servers:
[post-start]
api = "npm run api -- --port {{ branch | hash_port }}"
frontend = "npm run frontend -- --port {{ branch | hash_port | plus: 1000 }}"Use shell conditionals in hook commands:
[pre-merge]
test = "[ -f package.json ] && npm test || cargo test"| Command | Purpose | Common Usage |
|---|---|---|
wt switch |
Navigate/create worktrees | wt switch -c feature |
wt list |
Display status | wt list --full |
wt merge |
Merge to default | wt merge |
wt remove |
Clean up | wt remove old-branch |
wt select |
Interactive picker | wt select |
wt config |
Configuration | wt config show |
wt step |
Individual operations | wt step commit |
wt hook |
Hook management | wt hook pre-merge |
Use wt switch:
- Starting new work
- Changing between features
- Creating new branches with worktrees
Use wt list:
- Seeing overview of all work
- Checking CI status
- Finding worktrees with uncommitted changes
Use wt merge:
- Completing feature work
- Automating squash + rebase + merge workflow
- Running pre-merge validation
Use wt remove:
- Cleaning up completed work
- Removing stale branches
- Freeing disk space
Use wt select:
- Visual browsing of worktrees
- Previewing changes before switching
- Interactive workflow preference
Use wt config:
- Initial setup
- Customizing path templates
- Managing hooks and approvals
Use wt step:
- Manual control over merge steps
- Generating LLM commit messages
- Inspecting prompts before execution
Use wt hook:
- Testing hooks manually
- Viewing hook configuration
- Managing approvals
# Start new feature
wt switch -c feature/auth
# See all work
wt list --full
# Switch to existing
wt switch feature/auth
# Interactive picker
wt select
# Merge and clean up
wt merge
# Remove old work
wt remove old-feature
# Generate commit
wt step commit
# View config
wt config show
# Set custom marker
wt config state marker set "🚧"# .config/wt.toml
path-template = "../{{ repo }}.{{ branch | sanitize }}"
[pre-merge]
test = "npm test"
lint = "npm run lint"
[post-start]
dev = "npm run dev -- --port {{ branch | hash_port }}"After executing Worktrunk operations, verify success using these criteria:
Success indicators:
- New directory exists at expected path
wt listshows new worktree with correct branch- Post-create hooks completed without errors
- Working directory changed to new worktree
.gitfile (not directory) exists in worktree
Verification commands:
pwd # Confirm in new worktree
wt list # Verify worktree appears
git status # Check branch and state
ls -la .git # Verify .git is a file (worktree link)Success indicators:
- Working directory changed
- Correct branch checked out
- No error messages about missing worktree
- Post-switch hooks executed (if configured)
Verification commands:
pwd # Confirm directory
git branch --show-current # Verify branchSuccess indicators:
- Target branch fast-forwarded
- Source branch deleted (unless
--no-remove) - Worktree removed (unless
--no-remove) - No conflicts reported
- Pre-merge hooks passed
- Returned to default worktree
Verification commands:
git log --oneline main -5 # Check merge commit
wt list --branches # Verify branch removed
git branch -d <branch> 2>&1 # Should say already deletedSuccess indicators:
- Worktree directory removed
- Branch deleted (if safe)
wt listno longer shows worktree- Returned to main worktree
- No errors in removal logs
Verification commands:
wt list # Verify worktree gone
ls ../path/to/worktree # Should not exist
cat .git/wt-logs/<branch>-remove.log # Check for errorsSuccess indicators:
- Config file created at expected location
wt config showdisplays settings- Path template expands correctly
- Hooks defined and visible in
wt hook show
Verification commands:
wt config show # Display config
wt hook show # List hooks
cat .config/wt.toml # View raw configSuccess indicators:
- Hook commands executed
- Exit code 0 for success
- Expected side effects occurred (tests passed, servers started)
- No approval prompts for approved commands
- Appropriate logs generated
Verification commands:
wt hook show # Verify hook config
wt hook pre-merge --var branch=test # Dry run
echo $? # Check exit codeRun these to verify overall Worktrunk state:
wt list --full # Complete status overview
wt config show # Verify configuration
git worktree list # Raw git worktree view
ls .git/wt-logs/ # Check operation logsAvoid these common mistakes when using Worktrunk:
Don't manually delete worktree directories
# Bad
rm -rf ../repo.feature-branch
# Good
wt remove feature-branchWhy: Manual deletion leaves git metadata inconsistent. Use wt remove for proper cleanup.
Don't create worktrees with raw git commands
# Bad
git worktree add ../new-worktree feature-branch
# Good
wt switch --create feature-branchWhy: Worktrunk manages paths, hooks, and metadata. Mixing approaches creates confusion.
Don't use absolute paths in hook commands
# Bad
post-start = "/home/user/project/scripts/dev-server.sh"
# Good
post-start = "./scripts/dev-server.sh"Why: Absolute paths break when other developers use different paths.
Don't hardcode values in templates
# Bad
post-start = "npm run dev -- --port 3000"
# Good
post-start = "npm run dev -- --port {{ branch | hash_port }}"Why: Hardcoded ports/values cause conflicts across worktrees.
Don't use blocking hooks for long-running processes
# Bad - blocks worktree creation
[post-create]
server = "npm run dev"
# Good - runs in background
[post-start]
server = "npm run dev"Why: Blocking hooks delay worktree creation. Use post-start for background tasks.
Don't skip verification without understanding consequences
# Bad - bypasses safety checks
wt merge --no-verify
# Good - fix issues, then merge
wt hook pre-merge # Test hooks
wt merge # Run with verificationWhy: Hooks exist for safety. Skipping them can introduce bugs.
Don't ignore hook failures
# Bad - force through despite failures
wt merge -y --no-verify
# Good - investigate and fix
wt hook pre-merge # Debug failure
# Fix the issue
wt merge # Retry with hooksWhy: Hook failures indicate real problems. Fix root cause.
Don't merge without rebasing first
# Bad - merges stale branch
wt merge --no-rebase
# Good - rebase then merge
wt merge # Includes rebase by defaultWhy: Merging without rebasing can create conflicts or outdated merges.
Don't keep worktrees after merging by default
# Bad - accumulates stale worktrees
wt merge --no-remove
# Good - clean up after merge
wt merge # Removes by defaultWhy: Stale worktrees waste disk space and clutter wt list.
Don't force-delete branches without checking
# Bad - loses unmerged work
wt remove -D feature-branch
# Good - verify merge status first
wt list --full # Check merge status
wt remove feature-branch # Safe delete or manual reviewWhy: Force-delete can lose valuable work.
Don't mix worktree and non-worktree development
# Bad - inconsistent workflow
git switch main # Non-worktree switch
wt switch feature-branch # Worktree switchWhy: Mixing approaches confuses state. Choose one method.
Don't commit .config/wt.toml with sensitive data
# Bad
[pre-merge]
deploy = "deploy.sh --token=secret123"
# Good
[pre-merge]
deploy = "deploy.sh --token=$DEPLOY_TOKEN"Why: Secrets in config get committed to git.
Don't use --yes flag in scripts without safeguards
# Bad - auto-approves everything
wt merge -y
# Good - explicit approval or conditional
wt merge # User approves
# OR
wt hook approvals add # Pre-approve projectWhy: Auto-approval bypasses safety prompts.
Don't use --full flag unnecessarily
# Bad - always fetches CI (slow)
alias wl='wt list --full'
# Good - use when needed
alias wl='wt list' # Fast by default
alias wlf='wt list --full' # Full when neededWhy: --full fetches CI status (1-2 second latency).
Don't run foreground operations when background works
# Bad - blocks terminal
wt remove old-branch --foreground
# Good - runs in background
wt remove old-branch # Background by defaultWhy: Foreground blocks terminal unnecessarily.
Don't use --stage=all with experimental files
# Bad - commits experiments
wt step commit --stage=all
# Good - stage only tracked
wt step commit --stage=trackedWhy: Untracked experiments shouldn't be committed.
Worktrunk can be extended and integrated with other tools:
Create reusable hook scripts in project:
# scripts/pre-merge-checks.sh
#!/bin/bash
set -e
echo "Running tests..."
npm test
echo "Checking types..."
npm run typecheck
echo "Linting..."
npm run lint
echo "Building..."
npm run buildReference in .config/wt.toml:
[pre-merge]
checks = "./scripts/pre-merge-checks.sh"Benefits: Version-controlled, reusable, testable independently.
Extend LLM commit generation with custom prompts:
[commit.generation]
command = "llm"
args = ["-m", "claude-sonnet-4-5", "-s", "commit-msg"]
template = """
You are an expert at writing conventional commit messages.
Branch: {{ branch }}
Repository: {{ repo }}
Changes:
{{ git_diff }}
Recent commits for style reference:
{{ recent_commits }}
Generate a commit message following conventional commits format.
Use type: feat, fix, docs, style, refactor, test, chore.
Include scope if relevant.
Keep subject under 72 characters.
"""Extension opportunities:
- Custom LLM models
- Project-specific commit conventions
- Multi-language support
- Ticket/issue linking
Extend CI status display with custom providers:
GitHub Actions via gh CLI:
[ci]
command = "gh run list --branch {{ branch }} --limit 1 --json status,conclusion"GitLab CI:
[ci]
command = "glab ci status --branch {{ branch }}"Custom CI:
# scripts/check-ci-status.sh
#!/bin/bash
curl -s "https://ci.example.com/api/status?branch=$1"Create editor commands for common workflows:
VS Code tasks (.vscode/tasks.json):
{
"label": "Worktrunk: New Feature",
"type": "shell",
"command": "wt switch --create feature/${input:featureName}"
}Vim commands:
" In .vimrc or project .vimrc
command! -nargs=1 WtNew execute '!wt switch --create' <q-args>
command! WtList execute '!wt list --full'
command! WtMerge execute '!wt merge'Add notifications to hooks:
[post-merge]
notify = "notify-send 'Worktrunk' 'Merged {{ branch }} to {{ target }}'"Cross-platform notifications:
# scripts/notify.sh
#!/bin/bash
if command -v notify-send &> /dev/null; then
notify-send "$1" "$2"
elif command -v osascript &> /dev/null; then
osascript -e "display notification \"$2\" with title \"$1\""
fiExtend status marker automation:
# scripts/auto-marker.sh
#!/bin/bash
# Set marker based on branch state
if git diff --quiet && git diff --cached --quiet; then
wt config state marker set "✅" # Clean
elif [ -n "$(git status --porcelain)" ]; then
wt config state marker set "🚧" # WIP
fiCall from hooks:
[post-switch]
marker = "./scripts/auto-marker.sh"Track worktree usage patterns:
# scripts/worktree-metrics.sh
#!/bin/bash
# Log worktree creation for analytics
echo "$(date),$(whoami),{{ branch }},created" >> .git/wt-metrics.csv[post-create]
metrics = "./scripts/worktree-metrics.sh"Analysis:
# Most active branches
cut -d',' -f3 .git/wt-metrics.csv | sort | uniq -c | sort -rn
# Worktree creation timeline
cut -d',' -f1,3 .git/wt-metrics.csvAutomate dependency installation per worktree:
[post-create]
deps = "[ -f package.json ] && npm ci || ([ -f Cargo.toml ] && cargo fetch) || ([ -f requirements.txt ] && pip install -r requirements.txt)"Conditional by branch prefix:
# scripts/install-deps.sh
#!/bin/bash
BRANCH={{ branch }}
if [[ $BRANCH == feature/* ]]; then
npm ci
elif [[ $BRANCH == hotfix/* ]]; then
npm ci --production
fiHandle per-worktree database state:
[post-create]
db = "cp database.sqlite database.{{ branch | sanitize }}.sqlite"
[post-start]
db-server = "rails server -p {{ branch | hash_port }} --database database.{{ branch | sanitize }}.sqlite"Run tests automatically before merge:
[pre-merge]
unit = "npm test"
integration = "npm run test:integration"
e2e = "npm run test:e2e -- --headless"
coverage = "npm run coverage && [ $(cat coverage/coverage-summary.json | jq '.total.lines.pct') -ge 80 ]"Selective testing:
# scripts/smart-test.sh
#!/bin/bash
# Only run tests for changed files
FILES=$(git diff --name-only {{ target }}...HEAD)
if echo "$FILES" | grep -q "\.ts$"; then
npm run test:unit
fi
if echo "$FILES" | grep -q "\.tsx$"; then
npm run test:component
fiThis skill is active when you need to:
- Manage git worktrees
- Switch between branches with separate working directories
- Automate git workflows (merge, squash, rebase)
- Configure lifecycle hooks
- Integrate AI-assisted commit messages
- View CI status across branches
When the user mentions "worktree", "wt", or "worktrunk", activate this skill to provide expert guidance on Worktrunk operations.