Create Worktree & Run Tests
Provides a script that creates a new git worktree from the current branch (HEAD) and runs tests inside the new worktree.
Usage
Run: <path-to-skill>/scripts/run.sh [worktree-path] [branch-name] [test-command]
- •If
worktree-pathis omitted the script creates a sibling directory named<repo-root>-test. - •If
branch-nameis omitted the script uses<current-branch>-test. - •If
test-commandis omitted, the script attempts to detect the project type and run a default test command (e.g.,npm test,pytest).
Requirements
- •
gitavailable in PATH
Behavior
- •If the target worktree directory already exists, the script will use it.
- •Otherwise, the script creates a new branch from
HEADand adds a worktree at the requested path. - •The script will then change into the worktree directory and execute the test command.